Uh oh!
There was an error while loading. Please reload this page.
test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286
Merged
Merged
Conversation
…to the values it explains `VERDICT_CEILING_CONSTANTS` deliberately excludes `BASELINE` and `PER_CHUNK_BASELINE`, so the freshness check that guards every other constant in `check-eager-closure-budget.mjs` structurally cannot see them and the only thing describing them is a comment. objectui#6778 is what that costs: a paragraph attached to `PER_CHUNK_BASELINE` named a commit three re-baselines out of date as what `BASELINE` carried and drew the reverse of the verdict the same script printed in the same run. Adds positive pins only, located structurally (the JSDoc ending immediately before the declaration plus the comments lexically inside it, code stripped): every commit a baseline carries as data must appear in its own attached prose; every "BASELINE's `<hash>`" claim in either attached block must name `BASELINE.commit`; every chunk name `PER_CHUNK_BASELINE` carries must appear in its per-key provenance list. No constant, ceiling, verdict path or export changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
This was referenced Sep 2, 2026
yinlianghui
marked this pull request as ready for review
September 2, 2026 03:33
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#7046
VERDICT_CEILING_CONSTANTSinscripts/check-eager-closure-budget.mjsdeliberately excludesBASELINEandPER_CHUNK_BASELINE— no verdict is computed from them, soevaluateCeilingFreshness, the check that keeps every other constant in that file honest, structurally cannot see them, and the only thing describing them is a comment. #6778 measured what that costs. This adds the cheap backstop the card asked for, inscripts/__tests__/check-eager-closure-budget.test.ts. No constant value, ceiling, verdict path or export of the gate script changes — the diff is one test file, and the.mjsblob is byte-identical tomain(proven below).What the pins assert
Six new cases in one
describe, all positive pins: a live value the prose claims must equal the value the module actually exports. The constants are read by importing the module; the prose is read out of the real file text.commit:line excluded from the prose sideBASELINEcarries exactly one commit;PER_CHUNK_BASELINEcarries none — recorded so the pin above cannot go vacuous in silenceBASELINE's `HASH`claim in either attached block namesBASELINE.commit, and at least one such claim still existsPER_CHUNK_BASELINEcarries appears in its per-key provenance list"Attached block" is located structurally
attachedDocs(source, exportName)finds the JSDoc block ending immediately before theexport const NAMEdeclaration, then walks the initializer — skipping comments and string literals — until the brackets it opened close again, collecting the comments met on the way. No line numbers anywhere; the card's warning that citations in this area rot within days applies to the test as much as to the prose.Both halves are load-bearing, and this is a measurement, not a preference:
mainat64d624ded:BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on thegzipBytesfield, inside the object literal. A pin scoped to the leading block alone would be red on an honest file. This is the one place the shipped shape departs from the letter of the dispatch ruling ("the JSDoc comment that ends immediately before the declaration"); it is declared here rather than worked around, and the ruling's intent — structural, never a line number — is kept.commit: '3d257c85a'would satisfy the pin by restating the constant: the prose about the value passing because it contains the value, which is this card's own defect one layer up. The locator case asserts thecommit:line is on thecodeside and not theproseside.The (a) / (b) decision, and the measurement behind it
Shipped: (a) alone. (b) is not shipped.
Measured on
mainat64d624ded, 9-hex tokens per attached block (prose side only, code excluded):BASELINE3d257c85a(current),bd2a7ec50(history — "the previous baseline")3d257c85aPER_CHUNK_BASELINE2c8474c04,a64e96ca8,3d257c85a,350509b53,e33b44796Two things follow, and both are the reason (b) stays on the shelf:
BASELINEit fires onbd2a7ec50, exactly as the dispatch's own reading predicted. UnderPER_CHUNK_BASELINEit is worse: that constant carries no commit at all, so every one of its five hashes is an "other" hash and (b) fires five times on text that is correct.bd2a7ec50, but2c8474c04anda64e96ca8are present-tense per-key provenance — marking them as history would be false, and leaving them unmarked keeps (b) red. Legalising them instead would mean pinning them against something, and there is nothing to pin them against: no export carries them. Making (b) green would take rewriting the narrative comments, which the ruling rules out as not worth it.PER_CHUNK_BASELINE's block naming a retired hash as whatBASELINEcarried — andPER_CHUNK_BASELINEcarries no commit string, so the per-constant positive pin says nothing about its block. The dispatch ruling anticipated the per-chunk constant carrying more than one commit string; read off the module, it carries zero. That is why this PR ships the claim pin as well: it is still a positive pin (a cited value must equal a live value, so it has no false-positive surface on history — nobody writesBASELINE's `x`about a hash it used to carry), and it is the leg that actually guards the shape #6778 found. The claim pin matches exactly one site in all 1,450 lines of the file today, at the sentence PR #7045 repaired.Values are not pinned into prose: measured, neither attached block cites any of the four numeric readings the two constants carry, so a value pin would also be red on an honest file.
Ablation
Every leg mutates the real
scripts/check-eager-closure-budget.mjsin the worktree, under anEXIT INT TERMtrap with absolute paths. The mutation is proven on disk bygrep -cbefore/after and by the blob hash differing from HEAD's; the restore is proven bygit hash-objectequalling the HEAD blob and by an emptygit diff HEADfor that path — never by an exit code. HEAD blob for that path throughout:e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.BASELINE's block to the retired4c1623c0c`3d257c85a` is the commit1 to 0; injected 0 to 1; blob6cad9fa96pins every commit BASELINE carries into its own attached prosee830ac3a6, diff emptyBASELINE's `3d257c85a`toBASELINE's `4c1623c0c`— the #6778 defect restored verbatimf31caf4afholds every "BASELINE carries X" claim in the attached prose to the live valuee830ac3a6, diff emptyui-componentstoui-widgetson the 2 prose lines ofPER_CHUNK_BASELINE's block (declaration untouched)1876de838pins every chunk name PER_CHUNK_BASELINE carries into its own attached prosee830ac3a6, diff emptyProvenance is per KEYtoper LOCALE60134b328locates the block attached to each baseline, and only that blocke830ac3a6, diff emptyBASELINE.commitre-baselined toe33b44796, every word of prose left untouchede238500005e830ac3a6, diff emptyA5 is what proves the pin reads the module and not two halves of the same text — the re-baseline shape the card is about: the constant moves, the paragraph is left behind, and the test reds the same minute instead of three re-baselines later.
A4 is the "prove the assertion sees the real block" fence. The control terms are
the previous baseline(inBASELINE's block) andProvenance is per KEY(inPER_CHUNK_BASELINE's), both verified present before being asserted; A4 shows the assertion actually depends on the block's real text. The same case also asserts the neighbouring ceilings' blocks are not swept in.Gates
Run from the worktree at
2a3144b6e, exit codes captured by redirect-then-$?, never through a pipe:pnpm exec vitest run scripts/__tests__/check-eager-closure-budget.test.ts --maxWorkers=2— exit 0,Test Files 1 passed (1) / Tests 87 passed (87)(81 before, 6 added).scripts/__tests__/that names this gate — exit 0,Test Files 5 passed (5) / Tests 197 passed (197)on2a3144b6ewith a clean tree.pnpm type-check:scripts— exit 0.pnpm check:control-bytes— exit 0,✅ check-control-bytes: OK (scanned 6004 tracked text file(s); skipped 85 binary).pnpm check:entry-guard— exit 0,✓ check:entry-guard: 58 scripts/ file(s) — no entry guard outside the baseline; ...node scripts/check-changeset-presence.mjs— exit 0,✅ No source or published contract of a released package changed in this range, so no changeset is owed.Scripts-only change, so no changeset ships.pnpm exec eslint scripts/__tests__/check-eager-closure-budget.test.ts --no-inline-config --format json— exit 0, 1 file linted, 0 errors, 0 warnings, 0 suppressed.grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'— no match.Declared narrowing
The full
scripts/__tests__/directory was not run locally; the shared heavy-verify lock had a holder and two waiters, and this diff touches one file with no test in that directory enumerating the directory or reading this file (checked:grep -rln "readdirSync.*__tests__"returns nothing). CI runs the directory. Repo-wide lint is not narrowed but out of reach by construction: rootlintisturbo run lint, which is driven by package.json scripts and so cannot reachscripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (noprojectService, noproject,tseslint.configs.recommendedrather thanrecommendedTypeChecked), so no untouched file's verdict can move from this diff.Scope
scripts/vite-declared-lazy-views.ts(#6785, closed) was not touched. The mechanism does generalise to it —attachedDocsis not specific to this file — and that is recorded as a finding for the PM rather than ridden along here.#6785 and #6631 are not addressed by this PR; #6631 in particular stays open, and its "which side moved the headroom" question is untouched.
https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
Generated by Claude Code