Add repository rules review bot - #222
Conversation
Port tenferro-rs's delta-scoped REPOSITORY_RULES review to strided-rs. The workflow runs from the trusted base revision and treats PR contents as data: the PR head is fetched for `git diff` only, never checked out or executed. Findings post as a single updating PR comment; only block-severity findings fail CI. Adapted for this workspace and for the #199 retirement: - The deterministic boundary check enforces the Phase 0 freeze instead of tenferro's AD boundary. Added implementation lines in strided-einsum2, strided-opteinsum, mdarray-opteinsum, ndarray-opteinsum, or deprecated/ block; deprecation notices (doc comments, attributes, README, Cargo.toml) are exempt so Phase 0 can land. The `rules-review:waive` label is the escape hatch for a fix that protects the current tenferro pin. - Section routing is rebuilt for the retained crates and for crates living at the repository root. A coverage test fails if a REPOSITORY_RULES section is neither routed, always-on, nor explicitly human-only, so the sections added by #216 cannot go silently unreviewed. - The prompt carries strided-rs cautions: column-major default, expected unsafe in kernel hot paths, and upstream naming from Strided.jl / HPTT. Clarify the benchmark rule while porting it. A live run had the reviewer correctly apply "keep benchmark programs in the benchmark suite" to a new harness under strided-kernel/benches/, which would block every in-tree regression bench. The rule now separates in-tree benches from cross-repository comparisons and published results, says the location rule is not a harness mandate, and scopes the performance-table ban to READMEs and rustdoc so dated worklogs may still quote measurements as evidence. AGENTS.md matches. The three duplicated github-script blocks in the tenferro workflow become two composite actions. Verified: 47 script tests, actionlint clean, dry-run over the waived, no-LLM, retired-crate, and retained-crate paths, plus live DeepSeek runs before and after the rule change. Refs #199 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Setup status — the two prerequisites in the PR description are now done:
Branch protection is deliberately unchanged for now. Note that |
Ports tenferro-rs's delta-scoped
REPOSITORY_RULES.mdreview bot to strided-rs. Part of the environment work tracked inshinaoka/task-management-terasaki#26; scoped to the #199 retirement.What lands
.github/workflows/review_bot.ymlscripts/repository-rules-review.pyscripts/test-repository-rules-review.pyai/prompts/repository-rules-review.md.github/actions/{post-review-comment,verify-review-label}/scripts/requirements-dev.txtpython-dotenvREPOSITORY_RULES.mdgains a## Retired Crate Freezesection,AGENTS.mddocuments the bot and local usage, andci.ymlgains a job that runs the script's tests.Security model
Unchanged from tenferro.
pull_request_targetchecks out the trusted base revision; the PR head is fetched forgit diffonly and never checked out or executed. External-fork PRs are rejected at the gate. Both label escape hatches require themaintain/adminrole and reapplication after the latest push. Secret-shaped text in added lines blocks the upload before anything reaches the API.Adapted for #199
The deterministic boundary check enforces the Phase 0 freeze instead of tenferro's AD boundary. Added implementation lines in
strided-einsum2,strided-opteinsum,mdarray-opteinsum,ndarray-opteinsum, ordeprecated/produce ablock. Deprecation notices are exempt — doc comments,#[deprecated]and other attributes, README,Cargo.toml— so Phase 0 can land without a waiver. The regex requires a trailing space, slash, or line end on block-comment continuations so*dst = value;is not mistaken for a comment.Against
9da9b9f(the einsum2 GEMM fix on main), it behaves as intended:```
Verdict: fail
strided-einsum2/src/contiguous.rs:12: use strided_kernel::MaybeSendSync;
```
A carry-list fix that has to protect the current tenferro pin uses
rules-review:waive.Section routing is rebuilt for the retained crates, with paths matching this repo's root-level crate layout.
test_every_rule_section_is_reachablefails if a##section is neither routed, always-on, nor explicitly human-only — so the sections #216 will add cannot go silently unreviewed.The prompt carries strided-rs cautions: column-major is the default and is not a bug,
unsafein kernel hot paths is expected, and upstream naming and constants from Strided.jl / HPTT are deliberate.Benchmark rule clarified
A live run surfaced that the reviewer correctly applied "Keep benchmark programs and published benchmark results in
strided-rs-benchmark-suite" to a new harness understrided-kernel/benches/. Read literally the rule contradicts the repo's own layout, and it would have blocked every PR adding a regression bench. The rule now:<crate>/benches/and says the rule is about location, not harness choice (a first draft made the reviewer flag a hand-rolled timing loop for not being criterion);docs/to quote measurements as evidence (a first draft banned those too, and the reviewer flagged an existing worklog).AGENTS.mdmatches. This overlaps #214, which can now focus on actually movingstrided-kernel/README.md:186.Verification
actionlintclean on both workflowsfail; retained-crate commit →pass; waived →pass; no-LLM → onewarnfb6794e1 chunk / 26s / pass;fe9f2cc(3750 lines) 7 chunks / ~460sAfter the rule fix, the
fe9f2ccrun returns one finding, and it is a fair one against a rule this PR did not touch:Notes for review
timeout-minutes: 20covers the largest observed run with margin, but a 3750-line PR costs ~8 minutes of wall clock and seven API calls. Worth watching against the DeepSeek off-peak budget already being managed for the BugHunt bots.DEEPSEEK_API_KEYsecret and, optionally, aDEEPSEEK_MODELvariable.rules-review:waiveandrules-review:no-llmlabels need creating before the escape hatches work.Refs #199
🤖 Generated with Claude Code