docs(agents): scale the local gate to the diff - #696
Conversation
The gate demanded full-workspace clippy + tests before every push, even for a one-crate change — 20+ minutes in a cold worktree — while CI runs the same full matrix on every push anyway. That tax was slowing every iteration. Keep the full gate as a hard stop only where local reds have actually come from: after rebases/conflict resolution, for workspace-level changes (root manifest, lockfile, toolchain, CI), and for diffs spanning three or more crates. Scoped diffs run fmt plus crate-scoped clippy and tests, and lean on CI for dependents and the other platforms. The hid-crate rustdoc step now attaches to diffs that touch those crates instead of every push.
Greptile SummaryThe PR replaces the mandatory full-workspace pre-push gate with scoped and full tiers based on a diff’s blast radius.
Confidence Score: 4/5The documentation change is safe to merge after correcting the non-blocking inconsistency in the push checklist. The main gate definition includes multi-crate diffs in the full tier, while the condensed checklist directs such diffs to scoped checks unless they also involve a rebase or workspace-level file. Files Needing Attention: AGENTS.md
|
| Filename | Overview |
|---|---|
| AGENTS.md | Documents the tiered local gate, but the push checklist omits the full-gate requirement for diffs spanning three or more crates. |
Reviews (1): Last reviewed commit: "docs(agents): scale the local gate to th..." | Re-trigger Greptile
| 2. Local gate green on the **final** tree, at the tier the diff calls for — | ||
| full gate after any rebase or for workspace-level changes; scoped | ||
| fmt + clippy + test otherwise. |
There was a problem hiding this comment.
Checklist omits multi-crate gate
The condensed checklist classifies every non-workspace, non-rebase diff as scoped, omitting the full-gate requirement for changes spanning three or more crates. An agent following this checklist can therefore run only scoped checks for a multi-crate change, weakening the intended local validation.
| 2. Local gate green on the **final** tree, at the tier the diff calls for — | |
| full gate after any rebase or for workspace-level changes; scoped | |
| fmt + clippy + test otherwise. | |
| 2. Local gate green on the **final** tree, at the tier the diff calls for — | |
| full gate after any rebase, for workspace-level changes, or for diffs | |
| spanning three or more crates; scoped fmt + clippy + test otherwise. |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
The local gate required full-workspace clippy + tests before every push —
20+ minutes in a cold worktree — while CI already runs the full matrix on
every push. For a one-crate change that duplicated CI instead of protecting
it, and it was slowing every iteration.
This makes the gate two-tier. Scoped diffs (one or two crates, nothing
workspace-level) run fmt plus crate-scoped clippy and tests, then push and
let CI sweep dependents and the other platforms. The full four-step gate
stays a hard stop exactly where historical CI reds have come from:
Cargo.toml,Cargo.lock,rust-toolchain.toml, CI workflows);The hid-crate rustdoc step attaches to diffs touching those three crates
rather than to every push. Pushing a known-red tree is still out, and the
prek push hook keeps full-workspace clippy as the backstop.
Changes
AGENTS.md(andCLAUDE.mdvia its symlink): rewrite the "Local gate"section as the two tiers above; align push-checklist item 2 with the
tiered wording.
Testing
Docs-only; no code built. Verified
CLAUDE.mdis a symlink toAGENTS.md,so one edit covers both entry points.