Repository navigation
fix(quality): ratchet-bank verifier rejects object-valued notes — nightly banking has been aborting since 2026-08-11 - #11702
Conversation
CI red here is base-red, not this branchSame failing checks appear on unrelated open PRs against
The unit failures on this branch are Directly affected suites, run locally against this branch: Happy to rebase once the base goes green. |
…ting every nightly bank `verifyFrozenMap` compared `_rebaseline_*` note values with `after[key] !== prev`. That is a referential comparison: correct for the string notes it was written against, wrong for the object-valued one that landed on 2026-08-11, where the merge-storm rebaseline folded four file->LOC pairs under a single note key. Two structurally identical objects off two `JSON.parse` calls are never `===`, so the verifier reported that note "rewritten" on a tree nobody had touched. Effect: `node scripts/quality/verify-ratchet-bank.mjs` exited 1 on pristine release/v3.8.51, and the `bank-ratchet-shrinks` job in nightly-release-green.yml (cheaper-inference#8612) aborts on any non-zero exit. The automation added precisely to stop caps outliving their shrinks (cheaper-inference#8584) has therefore banked nothing since 2026-08-11. Fix uses the module's own `jsonEqual()` helper, so notes are still compared verbatim -- a genuinely edited note, string or object, is still rejected. Both new tests fail without the one-line change and pass with it. Claude-Session: https://claude.ai/code/session_01WXi3P7fMBXdVyZdnEeDYwq
Output of `node scripts/check/check-file-size.mjs --update` with the verifier fix in place -- data only, no source or gate behavior changes. frozen 90 -> 86 entries 26,907 lines reclaimed 4 entries dropped (now under cap) testFrozen 37 -> 37 entries 14,657 lines reclaimed `verify-ratchet-bank.mjs --ref <this commit's parent>` confirms the direction: 110 lowered, 4 removed, nothing raised, no note touched. These are shrinks the codebase already earned; the ceilings simply outlived them because the nightly banking lane has been aborting since 2026-08-11 (see the preceding commit). Until they are banked the "shrink-only" gate is not binding -- `adobeFireflyClient.ts` was frozen at 3,899 against an actual 2,953, i.e. 946 lines of headroom to grow inside a ratchet that is supposed to only descend. Four other files carried 900+ each. Recomputed against release/v3.8.51 @ 2e8326d. A banked baseline is tied to the tip it was measured on: on the previous tip nine files had since grown past the tightened ceilings, so this must be regenerated if the base moves again before merge. That is precisely the job the nightly lane is supposed to do unattended. Claude-Session: https://claude.ai/code/session_01WXi3P7fMBXdVyZdnEeDYwq
6dcaf10 to
e170edd
Compare
|
Rebased onto The reclaimed total moved slightly, 41,672 → 41,564 lines (frozen 26,907 + testFrozen 14,657), because the tip advanced 24 commits. That shift is worth flagging, because it is a property of the change rather than noise: a banked baseline is tied to the tip it was measured on. Rebasing the original commit unchanged produced 9 violations — files that had grown past the newly tightened ceilings while the old, loose ones still permitted it: So this baseline has to be regenerated if the base moves again before merge — which is exactly the unattended job the nightly lane is meant to do, and cannot while the verifier exits 1. Re-verified on the new tip: Note the verifier must be pointed at the commit's parent ( |
Recreated from #11702 (MumuTW) onto the current release/v3.8.51 — fixes the object-note comparator bug that has silently blocked the automated ratchet-bank lane since 2026-08-11; 24/24 focused tests + file-size gate green on this tip. Thanks for tracking this down!
|
Thanks for finding this! The release tip moved (further file-size-baseline.json rebaselines |
…per-inference#11892) Recreated from cheaper-inference#11702 (MumuTW) onto the current release/v3.8.51 — fixes the object-note comparator bug that has silently blocked the automated ratchet-bank lane since 2026-08-11; 24/24 focused tests + file-size gate green on this tip. Thanks for tracking this down!
What this fixes
scripts/quality/verify-ratchet-bank.mjs— the safety gate that lets the automatedbanking lane write to the quality baselines — exits 1 on a pristine
release/v3.8.51working tree, with no local changes at all:Root cause
verifyFrozenMapcompares note values referentially:That is correct for the string notes the function and its tests were written
against. It is wrong for the object-valued note added on 2026-08-11, where the
merge-storm rebaseline folded four
file → LOCpairs into the value of a singlenote key. Two structurally identical objects parsed from two
JSON.parsecalls arenever
===, so the note is reported "rewritten" unconditionally.Why it matters
bank-ratchet-shrinksin.github/workflows/nightly-release-green.yml:398runs thisverifier and aborts on any non-zero exit. So the automation added in #8612 —
specifically to stop caps outliving the shrinks that earned them (#8584) — has
banked nothing since 2026-08-11.
The measured consequence, against
release/v3.8.51:frozentestFrozenThat slack is not academic. A "shrink-only" ceiling set above the file's real size is
a growth allowance:
dashboard/combos/page.tsxopen-sse/executors/chatgpt-web.tsopen-sse/services/adobeFireflyClient.tsdashboard/api-manager/ApiManagerPageClient.tsxopen-sse/handlers/chatCore.tsThe change
1 —
scripts/quality/verify-ratchet-bank.mjs(one line + comment): compare noteswith the module's own
jsonEqual()instead of!==. Notes are still requiredverbatim; a genuinely edited note, string or object, is still rejected.
2 —
tests/unit/verify-ratchet-bank.test.ts: two regression tests. Theobject-valued-note case fails without the fix (
not ok 8) and passes with it; thecompanion test asserts a changed object note is still rejected, so the fix cannot
silently weaken the gate.
3 —
config/quality/file-size-baseline.json: the output ofnode scripts/check/check-file-size.mjs --update, now that the verifier permits it.Data only.
Verification
Adversarial checks run before opening this PR:
actually covers the change rather than passing either way.
(
JSON.stringifybyte-equal on the object-valued note), 0 entries added, 4 removedand each verified to now sit under the 1000 cap.
--updateafter banking — idempotent, no further movement.release/v3.8.51@2e8326d531; carrying the originalnumbers across the rebase produced 9 violations, so the baseline is regenerated against
the current tip (see the comment below).
untouched checkout of
release/v3.8.51: exit 1 there too.The malformed 2026-08-11 entry itself is left exactly as the owner annotated it. This
PR makes the verifier tolerate it rather than rewriting an audit-trail note.