Repository navigation
arch-ratchet: independent receipt, owner and expiry per exception; app_lines ratchets; blocking escapes need a review record - #28195
Conversation
… an expiry; app_lines ratchets; blocking escapes need a review record Reward-hacking audit (cmux-ad 2026-10-30, findings 2 and 6; lead decision: port the rule to feat first, as its own PR, then decide the tip rises under it). Same change as d173b9a on perf/chrome-parity, the checker and its tests only (no arch-ratchet.json change). - An exception allows nothing unless it has `author`, `owner`, a `receipt` `Review (<reviewer>): SHIP at <40-hex sha>` whose reviewer is not the author, and an `expiry` not before its date. The refusal text prints the full form. Applied entries stay verbatim. - `--update` never records a blocking_allow_escapes rise as upstream debt (no generated entry). - `escape_reviews` in arch-ratchet.json: a push that adds or edits a blocking escape site needs a reviewed entry for it, whatever exception covers the count. `--audit` lists sites with no entry, unreviewed and expired entries, and stale entries. `--update` keeps the list. - app_lines is a ratcheted row: a push may not raise CmuxNextApp's physical lines, and its recorded total may not rise by hand. Effect on this tip: the 9 pending exceptions on feat have no receipt, owner or expiry, so they now allow nothing; `--update` already refused at 84bca8e (6 rows over the record) and still does. app_lines is 158,210 here against the recorded 143,610: that is a 7th row for the tip follow-up (handoff/followups.md "arch-ratchet tip rises (no exceptions)"). Tests (python, local; not CI): scripts/cmux-next/tests/test_arch_ratchet.py OK (5 new tests, red on the old checker), test_layer_gate.py OK, test_perf_cron_arch_report.py OK, tests/test_cmux_next_codebase_health.py OK, tests/test_cmux_next_guardrails.py 128 OK.
|
Found 28 test failures on Blacksmith runners: Failures
...and 18 more test failures. View all on Blacksmith
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: Shipped in:
|
|
Review (independent review subagent, risk:high ratchet): SHIP at 59dc602 What I checked (read-only, no Swift or Rust run):
Notes (no block):
|
Follow-up of #28195, same review as the --audit change before it (lead, 2026-10-30): a push could add an exception whose expiry was already past, and it allowed its rise. added_exceptions now drops an entry the push adds (one the base does not have) whose expiry is before today, with a note; an entry the base had keeps its standing, and --audit reports it once it expires. The test fixtures' review expiry is now 2999-12-31, so the suite does not turn red on 2026-11-06. Test: scripts/cmux-next/tests/test_arch_ratchet.py OK (new test_an_exception_added_after_its_expiry_allows_nothing, red without the change), test_layer_gate.py OK.
… capture backdrop is DEBUG/bench only (#28263) * fix(design): the capture backdrop panel is DEBUG and bench only, as its only callers are An independent exception review (reward-hacking audit, arch-ratchet tip rises) found that CaptureBackdropPattern.swift (8fb4805, #27514) ships its CaptureBackdropPanel, its willClose observer and NSWindow.setCaptureBackdrop in Release, although its only callers (DebugWindowSnapshot.captureBackdrop, the debug.capture_backdrop route in AppControl+Input) are `#if DEBUG || CMUX_BENCH_HOOKS`, and its exception said "DEBUG-only". The panel, its view and the two NSWindow members that make or read it now sit in the same `#if`; Release keeps the two read helpers that NSWindow+Snapshot uses, as constants (no backdrop: none to skip, nothing behind). The pattern enum stays (a value type, no observer). Release behavior: unchanged, since nothing could make a backdrop there. * arch-ratchet.json: 12 reviewed exceptions for the tip rises an independent reviewer judged needed; 9 unreviewed pending entries removed Reward-hacking audit (handoff/followups.md "arch-ratchet tip rises (no exceptions)"). An independent exception reviewer (it wrote none of the code and none of the old reasons) judged 14 candidates at 2391c5e: 12 EXCEPTION-OK, 2 FIX (AppDelegate.swift:514's quit flush, on fix/arch-rise-quit-flush; the capture backdrop, gated in 2391c5e and then accepted). The reviewer wrote each entry's receipt itself; each has author, owner and expiry 2026-11-30, one site per entry (allow 1): global_mutable_statics PaletteScope lock (#28036), CrashWatcher descriptor (#22844); stateful_singletons KillSwitches.shared (#24212), BlockingViolationTable.shared (f668c89); observer_sites DesktopWallpaperWatch :144 :147 :148 :149 (#25308), IPhoneHostService wake (#27297), DebugWindowRecord willClose (#23680), CaptureBackdropPattern willClose (#27514); blocking_allow_escapes SingleInstanceGuard (#25918), plus its escape_reviews entry (read by the rule of #28195). Removed: the 9 PENDING entries with no review that these replace or that cover no site any more (CrashWatcher, BlockingViolationTable, DesktopWallpaperWatch +7, SingleInstanceGuard, HomeReduceMotion (a FIX), kill switches +2, PaletteScope +4 (statics gone) and +1, CaptureBackdropPanel). No applied entry, total or measured_sha changes; no ratchet number is raised. --update still refuses until the fix PRs land; it is run after them.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Reward-hacking audit (cmux-ad, 2026-10-30). On perf/chrome-parity,
blocking_allow_escapeswent 0 -> 19 through ratchet exceptions that the tasks that needed them wrote, andapp_lineswent 143,610 -> 164,014 while it was report only. This PR ports the checker rule to feat-cmux-next first (lead decision), before the 6 tip rises are decided under it.arch-ratchet.jsonexception allows nothing unless it hasauthor,owner, an independentreceipt(Review (<reviewer>): SHIP at <40-hex sha>, reviewer not the author) and anexpiry.--updatenever records a blocking-escape rise as upstream debt.escape_reviewsrecord: a push that adds or edits a blocking escape site needs a reviewed entry for that site.--auditlists unreviewed, expired and stale entries.app_lines(CmuxNextApp physical lines) is a ratcheted row: a push may not raise it.The checker and its tests only. No CI job, step or gate is added (the ratchet runs in the pre-push hook only). No
arch-ratchet.jsonchange.Effect on this tip: the 9 pending exceptions on feat have no receipt, owner or expiry, so they now allow nothing.
--updatealready refused at 84bca8e (6 rows over the record) and still refuses.app_linesis 158,210 here against the recorded 143,610, so it becomes a 7th row for the tip follow-up. A feature push that grows CmuxNextApp is now refused at pre-push. It must move the code to its own target or pay with removed App lines.Testing
Python, on the VM (these are not CI jobs):
scripts/cmux-next/tests/test_arch_ratchet.pyOK. The 5 new tests fail on the old checker (4 FAIL, 1 ERROR).scripts/cmux-next/tests/test_layer_gate.pyOK.scripts/cmux-next/tests/test_perf_cron_arch_report.pyOK.tests/test_cmux_next_codebase_health.pyOK.tests/test_cmux_next_guardrails.py128 OK.Observed / Not run
arch-ratchet.py --auditat this head (it lists the 3 unreviewed escapes and 7 rows over the record).Changelog
none
Risk evidence (risk:high, gate enforcer)
arch_rules/__init__.pydocstring still show the old exception form; a new entry is not checked against today's date;--auditdoes not list expired exceptions.