This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
test(gates): share attachedDocs and pin the lazy-views ledger to its own prose - #7982
Merged
baozhoutao merged 1 commit intoSep 6, 2026
Conversation
…own prose `attachedDocs` — the structural locator for the documentation attached to an exported constant — was written inside `scripts/__tests__/check-eager-closure-budget.test.ts` and has nothing in it that is specific to that checker. It moves to `scripts/__tests__/helpers/attached-docs.ts`, the directory's existing shared test-plumbing location, which the `unit` project's `*.test.ts` include never collects as a suite. Its body is token-identical to the lifted one; the only textual change is the "not found" throw, which said "in the checker" and now says "in the source" because it has two customers. Its second customer is `scripts/__tests__/vite-declared-lazy-views.test.ts`, which now pins the VALUE half only: every path `DECLARED_LAZY_VIEWS_STILL_EAGER` carries, plus `APP_CONTENT_PATH` and `EAGER_WALK_CONTROL`, must appear in the prose attached to that same constant. All three failed that pin as written, so three sentences in `scripts/vite-declared-lazy-views.ts` now name the path their constant carries; that is the only edit to the checker's own source. The commit half of the pin is deliberately absent: the file cites five commits in prose and exports no constant carrying a commit as data, so there is nothing live to check them against and copying the pin over would ship a vacuously green test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013uAaxiwgYDybsTNV9xwa1M
baozhoutao
marked this pull request as ready for review
September 6, 2026 05:40
baozhoutao
deleted the
claude/issue-7289-attached-docs-shared-helper-lazy-views-pin
branch
September 6, 2026 06:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7289
Lifts
attachedDocs— the structural locator for the documentation attached toan exported constant, written for objectui#7046 — into a shared test helper, and
applies its value half to
scripts/vite-declared-lazy-views.ts.Where the helper went, and why there
scripts/__tests__/helpers/attached-docs.ts.That directory is the repo's existing shared test-plumbing location, not a new
convention:
helpers/turbo-inputs.ts,helpers/tsc-program.ts,helpers/build-program.ts,helpers/config-program.ts,helpers/eslint-config-program.tsandhelpers/vitest-config-program.tsalready live there and are imported as
./helpers/NAMEby six sibling suites.Measured, because a helper collected as a suite would be an empty test file: the
unitproject invitest.config.mtsincludes only names ending in.test.tsunder
scripts/, so this module is importable and never collected. The wholescripts/surface runs 107 files after the change, the same 107 as before.The body is token-identical to the one it replaces (verified by comparing
the whitespace-normalised token streams of the HEAD block and the new file). Two
things differ and nothing else: the signature is reflowed onto three lines by
the added
export, and the not-found throw saidin the checkerand now saysin the source, because it has two customers. No test asserts that string.The commit half does not transfer — re-measured on this branch
scripts/vite-declared-lazy-views.tscarries five 9-hex citations inprose, at lines 100, 227, 282, 340 and 547. They are two distinct commits
(
b98352a15four times,fab4802e3once) — the card said "five commits",and the precise reading is five citations of two.
APP_CONTENT_PATH,EAGER_WALK_CONTROLandDECLARED_LAZY_VIEWS_STILL_EAGER. All three carry path strings. No exportedconstant carries a commit string as data.
So there is nothing live for a commit pin to check those citations against, and
copying objectui#7046's commit pin here would ship a vacuously green test — the
same wall objectui#7046 hit on
PER_CHUNK_BASELINE. It is deliberately notshipped, and the reasoning is written beside the pin rather than left in a card.
The blanket negative pin ("no OTHER hash in this block") is not shipped either,
for the reason objectui#7046 already measured: it is red on honest history.
The value pin, and the finding it produced
Every path a constant carries must appear in the prose attached to that same
constant.
attachedDocsstrips the code, so the declaration cannot satisfy thepin by restating itself.
All three constants FAILED the pin as written. Not one of the three
paragraphs named the path its constant carries: the ledger's bullet said
RecordDetailView, and the two control constants' blocks named no path at all.Three sentences now do — one per constant — and that is the only edit this
PR makes to
scripts/vite-declared-lazy-views.ts.scripts/check-eager-closure-budget.mjsis untouched.
A companion case records what each constant carries as data, so the pin cannot
go vacuous in silence if the ledger empties. Emptying the ledger is a win
here, not a regression — the file's own header calls deleting a line a
MEASUREMENT — so that number moving down is where the win gets recorded.
Probes
Every mutation was proven on disk before its run was read, and every restore is
proven by blob hash equal to the HEAD blob plus an empty
git diff HEAD. Eachscript carries an
EXIT INT TERMtrap restoring through absolute paths.5a772eaa(local function present, import absent)101 passed— identical to the101 passedthe lifted version producesgzipBytesprose retyped (injected count 0 to 1; the carried hash still 4 elsewhere), run twice — once against the pre-lift test file, once against the lifted onepins every commit BASELINE carries into its own attached prose,expected [ '3d257c85a' ] to deeply equal [],1 failed/100 passedAPP_CONTENT_PATH's value taken out of its paragraph (anchor 1 to 0, replacement 0 to 1)pins every path APP_CONTENT_PATH carries into its own attached prose—1 failed/30 passedEAGER_WALK_CONTROL's value taken out of its paragraphpins every path EAGER_WALK_CONTROL carries into its own attached prose—1 failed/30 passedpins every path DECLARED_LAZY_VIEWS_STILL_EAGER carries into its own attached prose—1 failed/30 passedObjectDataPage.tsx, a real fileAppContentreally declares lazy, so the sorted / exists / declared-lazy cases stay green and only the new pin speaks2 failed/29 passed: the prose pin, and the vacuity recordquietly re-run: a
\Q...\E-quoted\nin the perl expression matched nothing,the file's blob hash did not move and the injected-text count went 0 to 0. The
on-disk check caught it; the reading above is from the re-run with a working
anchor.
Gates
Run at
5ae65749b, exit code captured before any pipe, each gate's own verdictline quoted:
pnpm exec vitest run scripts/—Test Files 107 passed (107),Tests 3239 passed (3239)scripts/__tests__/check-eager-closure-budget.test.ts—Tests 101 passed (101)(unchanged count)scripts/__tests__/vite-declared-lazy-views.test.ts—Tests 31 passed (31)(26 before, plus the five new cases)pnpm type-check:scripts— exit 0, no diagnosticspnpm lint:root—32 problems (0 errors, 32 warnings), none of them on the four changed filespnpm check:control-bytes—check-control-bytes: OK (scanned 6422 tracked text file(s); skipped 85 binary).pnpm check:unreferenced-sources—OK Every shipped source file in every covered package is reachable.node scripts/check-changeset-presence.mjs—No source or published contract of a released package changed in this range, so no changeset is owed.(scripts/is not released source; no changeset, and no label)node scripts/check-governed-queue-guard.mjs --teston all four paths —NOT GOVERNED — 4 path(s) checked against 5 governed surface(s); none matched.pnpm exec turbo ls --affectedagainst the branch point —0 no packages; the diff is entirely underscripts/, which no workspace package owns, and the one code reader ofscripts/vite-declared-lazy-views.tsoutsidescripts/(apps/console/vite.config.ts) sees a comment-only change.Overlap with draft PR #7685
Draft PR #7685 (objectui#7122, spec seat) also touches
scripts/__tests__/check-eager-closure-budget.test.ts— two hunks, whose headersread
@@ -611,10 +611,11 @@and@@ -795,7 +796,7 @@— and rewritesscripts/check-eager-closure-budget.mjs. This PR's edits to that test file arean import near the top and a deletion at old lines 1400 to 1477; the regions are
disjoint. Whichever of the two lands second should merge
mainfirst. This PRdoes not touch
scripts/check-eager-closure-budget.mjsat all, so PR #7685'srewrite of it lands against the pins rather than through them — which is what
the pins are for.
Out of scope and untouched here: objectui#6785 and objectui#6631. Whether the
file's five prose citations should get any guard at all is the separate question
objectui#7289 recorded, and this PR does not answer it.
Generated by Claude Code