Repository navigation
fix(devtools): keep the layering gate read-only; prune on request - #5710
Merged
Merged
Conversation
… on request The layering gate rewrote docs/plans/layering-surface-baseline.json and sqlite-degradation-baseline.json whenever an entry no longer reproduced. verify then saw the Git-visible content change mid-run and voided the result as checkout_moved_during_run, which failed the hosted quick gate on every branch carrying a stale entry. Stale entries are now blocking findings naming the fix command (devtools gate layering --prune-baselines), which is the only route that writes. The ratchet still cannot keep a fixed violation's exemption alive. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Sinity
enabled auto-merge (squash)
September 28, 2026 01:26
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sinity
added a commit
that referenced
this pull request
Oct 2, 2026
## Summary Add a regression control that runs the quick verifier's real plan, receipt and Git-content checks with a real layering subprocess against tracked synthetic stale baselines. ## Problem PR #5710 already shipped read-only default layering and SQLite baseline gates. The remaining task acceptance required evidence through whole `verify --quick`: stale entries must retain their exact cause and prune command while candidate content remains unchanged. Direct gate tests did not establish that integration contract. ## Solution The new control builds a neutral tracked Git fixture with stale layering and SQLite entries, runs the real quick entry point and layering subprocess, and checks the failed receipt, both named stale subjects, exact prune command, unchanged tracked bytes/fingerprint and clean status. It explicitly stubs unrelated gate process outcomes and host/toolchain observations. It does not claim those stubs prove all twelve actual gates. Product gates and default baseline content are unchanged. ## Verification `devtools test tests/unit/devtools/test_layering_gates.py tests/unit/devtools/test_verify.py`: managed job 6283 exited 0; 140 selected, 140 terminal, 140 passed on clean `ac454ec0327fd037ad7fbcfd773ba057e41166ec`, same clean head at finish. For literal acceptance, a declared `devtools verify --quick` run (6286) executed all twelve actual gates on the owned candidate with two explicitly prepared synthetic stale entries. Eleven gates passed. Only layering failed, with diagnosis `gate_semantic_violation`, exactly two stale violations, their individual subjects, and `devtools gate layering --prune-baselines`. There was no `checkout_moved_during_run` verdict. Expected initial dirtiness was exactly the two fixture baseline files. Their exact bytes/hashes, head/tree/status and complete Git-visible fingerprint were equal before and after. Restoring only the two captured original byte snapshots recovered the original clean candidate identity and fingerprint. Receipt: `20261002T060417Z-quick-3025813-5b415c3d`. The first focused run passed 140 tests. The first whole quick supplement (6278) showed unchanged tracked content and both stale causes, but also exposed a test-only mypy error from reading an unexported imported `gate.venv_bin`. Its receipt was retained and not accepted as the final proof. The two-line correction imports the function from its declaring `devtools.toolchain`; the complete owning selection and necessary whole quick proof were then rerun. Normal precommit hooks, changed-file ruff and `git diff --check` passed. The normal pre-push hook ran clean `devtools verify --quick` on the exact head and passed all twelve gates, exit 0; receipt `20261002T060726Z-quick-3029893-86ef3d95`. Hosted checks remain the publication gates. ## Self-review Final pass 2 reread the entire one-file diff against current master and applied the project and generic checklists. The coordinator independently reviewed the source, correction and controlled proof packet. 1. ✓ Siblings/owners: shipped layering and SQLite default/prune branches inspected; shared actual quick caller, output, receipt and content fingerprint are exercised together. 2. ✓ Fix itself: no product fix introduced; test calls actual quick entry and real layering subprocess. Unrelated gate process outcomes and host/toolchain observations explicitly stubbed. 3. ✓ Memory/limits: tiny neutral fixture tracked bytes only, no corpus/cap/whole archive copy. 4. ✓ Cost/unit: one layering child, quick plan and one tiny Git tree; no new recurring product work. 5. ✓ Interruption: production interruption route unchanged; child runs through real registered gate process owner, with subprocess joined before receipt. 6. ✓ Ordering/races: initial tracked bytes/status/fingerprint compared after actual quick; successful hash required, only baseline stale failure accepted. Real supplement6286 preserved fullGitvisible fingerprint4cbf4b, twoSHA/status/head/tree; exacttwo-byte-snapshot restore returned cleaninitial05da. 7. ✓ Failure classification: require exact stale rule tokens, both individual stale subjects and explicit prune command; no checkout-moved diagnosis permitted. 8. ✓ Silent outcomes: real quick plan membership asserted; only layering can fail; no all12-real-gate claim from stubs. Declared supplement owns literal acceptance. 9. ✓ Cleanup: tmp_path owns neutral Git/cache artifacts; no host archive or production baseline writes. Supplement snapshots preserved before mutation and exact restoration verified. 10. ✓ Identity/keys: actual Git content hash/checkout identity/receipt head are exercised; no production cache or identity changes. 11. ✓ Lossless: every tracked fixture byte retained, original source mechanisms unchanged; no default baseline edit committed. 12. ✓ Degenerate: two stale classes in one input, alongside existing live exemption; existing direct empty/live/prune controls remain. 13. ✓ Consumers: test-only addition; no public interface/config/schema or product consumer change. 14. ✓ Tests/stubs: restoring unconditional prune changes bytes/fingerprint and receipt diagnosis, breaking control. Stub scope explicit; actual layering producer executes in subprocess against synthetic tracked Git checkout. 15. ✓ Trust: public fixture neutral, author [email protected], no private receipts/corpus; scratch proof remains outside Git. Devtools area ✓ explicit focused modules only, actual --quick runs static gate plan without pytest/corpus fallback. Generic1 ✓ remaining acceptance preserved, literal all12 proof6286 established; Generic2 ✓ both baseline families/quick owner inspected; Generic3 ✓ no predecessor/product replacement; Generic4 ✓ exact visible stale cause/prune command; Generic5 ✓ concrete unconditional-prune mutation makes test red; Generic6 ✓ public data neutral, private evidence excluded. ## Honest residuals The regression control stubs unrelated gate outcomes; the separate declared all-gate run supplies the literal whole-quick proof. This test-only change preserves the already shipped #5710 mechanism. No default baseline edits, verifier framework, exclusions, whole-checkout copy, corpus, private archive or activation are included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The layering gate no longer rewrites tracked baselines during a run. Stale layering and SQLite-degradation baseline entries become blocking findings that name the fix command,
devtools gate layering --prune-baselines, the only route that writes.Problem
When a baseline entry no longer reproduced, the gate pruned
docs/plans/layering-surface-baseline.jsonanddocs/plans/sqlite-degradation-baseline.jsonin place.devtools verifycompares the Git-visible content before and after the run, saw the change, and voided the result ascheckout_moved_during_run. Every branch carrying a stale entry therefore failed the hosted quick gate with no code fault (bead polylogue-hzyyv). Reproduced locally on #5704's head:verify --quickendedcheckout_moved_during_run, with only those two baselines modified.Solution
devtools/verify_layering.py: new--prune-baselinesflag. Without it, stale entries arelayering_baseline_stale/sqlite_degradation_baseline_staleviolations and nothing is written. The ratchet property is kept: a fixed violation's exemption cannot survive, because the gate fails until the shrink is committed.Verification
devtools gate layeringon master: passed, working tree unchanged.devtools test tests/unit/devtools/test_layering_gates.py: one failure in the new test (an over-strict set assertion), fixed; rerun of that test: PASSED.Residuals
Branches whose base predates #5698 now fail visibly with
layering_baseline_staleinstead of a voided run; rebasing onto master clears it.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4