test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains - #7286

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin
Sep 2, 2026
Merged

test(scripts): pin the prose attached to the eager-closure baselines to the values it explains#7286
yinlianghui merged 1 commit into
mainfrom
claude/issue-7046-baseline-prose-pin

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#7046

VERDICT_CEILING_CONSTANTS in scripts/check-eager-closure-budget.mjs deliberately excludes BASELINE and PER_CHUNK_BASELINE — no verdict is computed from them, so evaluateCeilingFreshness, 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, in scripts/__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 .mjs blob is byte-identical to main (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.

PinAsserts
locator controlThe attached block really is the attached block: control phrases that must hit and do, neighbour phrases that must not, and the commit: line excluded from the prose side
(a) positive pinEvery commit string a baseline carries as data appears in its own attached prose
carried-data shapeBASELINE carries exactly one commit; PER_CHUNK_BASELINE carries none — recorded so the pin above cannot go vacuous in silence
claim pinEvery BASELINE's `HASH` claim in either attached block names BASELINE.commit, and at least one such claim still exists
chunk-name pinEvery chunk name PER_CHUNK_BASELINE carries appears in its per-key provenance list

"Attached block" is located structurally

attachedDocs(source, exportName) finds the JSDoc block ending immediately before the export const NAME declaration, 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:

  • The leading block alone is not enough. Measured on main at 64d624ded: BASELINE's leading JSDoc carries zero commit hashes. The sentence naming the commit the measurement was taken on is the JSDoc on the gzipBytesfield, 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.
  • The whole declaration text is too much.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 the commit: line is on the code side and not the prose side.

The (a) / (b) decision, and the measurement behind it

Shipped: (a) alone. (b) is not shipped.

Measured on main at 64d624ded, 9-hex tokens per attached block (prose side only, code excluded):

Attached blockCommit tokens in its proseCarried as data
BASELINE3d257c85a (current), bd2a7ec50 (history — "the previous baseline")3d257c85a
PER_CHUNK_BASELINE2c8474c04, a64e96ca8, 3d257c85a, 350509b53, e33b44796none

Two things follow, and both are the reason (b) stays on the shelf:

  1. (b) is red on the honest file before any mutation. Under BASELINE it fires on bd2a7ec50, exactly as the dispatch's own reading predicted. Under PER_CHUNK_BASELINE it 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.
  2. No marker rescues it. A past-tense marker could legalise bd2a7ec50, but 2c8474c04 and a64e96ca8 are 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.

⚠️ The sharper finding: (a) as literally specified would not have caught #6778. That defect was a sentence in PER_CHUNK_BASELINE's block naming a retired hash as what BASELINE carried — and PER_CHUNK_BASELINE carries 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 writes BASELINE'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 realscripts/check-eager-closure-budget.mjs in the worktree, under an EXIT INT TERM trap with absolute paths. The mutation is proven on disk by grep -c before/after and by the blob hash differing from HEAD's; the restore is proven by git hash-object equalling the HEAD blob and by an empty git diff HEAD for that path — never by an exit code. HEAD blob for that path throughout: e830ac3a67b4e6c2a91db82e36dc6ee8415bbe8b.

LegMutationOn-disk proofResultRestore
A1prose hash in BASELINE's block to the retired 4c1623c0c`3d257c85a` is the commit 1 to 0; injected 0 to 1; blob 6cad9fa96exit 1 — 1 failed / 86 passed, pins every commit BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A2BASELINE's `3d257c85a` to BASELINE's `4c1623c0c` — the #6778 defect restored verbatimanchor 1 to 0; injected 0 to 1; blob f31caf4afexit 1 — 1 failed / 86 passed, holds every "BASELINE carries X" claim in the attached prose to the live valueblob back to e830ac3a6, diff empty
A3ui-components to ui-widgets on the 2 prose lines of PER_CHUNK_BASELINE's block (declaration untouched)4 to 2 file-wide; injected 0 to 2; blob 1876de838exit 1 — 1 failed / 86 passed, pins every chunk name PER_CHUNK_BASELINE carries into its own attached proseblob back to e830ac3a6, diff empty
A4control term Provenance is per KEY to per LOCALE1 to 0; injected 0 to 1; blob 60134b328exit 1 — 1 failed / 86 passed, locates the block attached to each baseline, and only that blockblob back to e830ac3a6, diff empty
A5BASELINE.commit re-baselined to e33b44796, every word of prose left untouched1 to 0; injected 0 to 1; blob e238500005exit 1 — 2 failed / 85 passed (A1's and A2's cases)blob back to e830ac3a6, diff empty

A5 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 (in BASELINE's block) and Provenance is per KEY (in PER_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.

⚠️ One process note worth recording: A3's first attempt asserted it would rewrite 2 lines and hit 3 — the structural block walk had run past the declaration and would have mutated the constant's own key, which would have moved both sides of the pin and proven nothing. The mutation script refused instead of writing, the trap restored, and the leg was re-scoped to prose only. A mutation script's exit code is not evidence that the right bytes moved.

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).
  • Widened to every test file in scripts/__tests__/ that names this gate — exit 0, Test Files 5 passed (5) / Tests 197 passed (197) on 2a3144b6e with 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.
  • Control-byte self-scan on the edited file beyond the gate: 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: root lint is turbo run lint, which is driven by package.json scripts and so cannot reach scripts/, a non-package directory — the direct eslint invocation above is the whole of what applies, and eslint here is not type-aware (no projectService, no project, tseslint.configs.recommended rather than recommendedTypeChecked), 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 — attachedDocs is 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

…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
@yinlianghui
yinlianghui marked this pull request as ready for review September 2, 2026 03:33
@yinlianghui
yinlianghui added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit 5dbbde6Sep 2, 2026
29 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-7046-baseline-prose-pin branch September 2, 2026 04:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants

@yinlianghui@claude