Uh oh!
There was an error while loading. Please reload this page.
Declare the packages/examples census subtree check-system-context-census actually reads - #14323
Merged
Merged
Conversation
…ually reads The gate spelled 29 path literals -- the page it maintains and the spec seeds it cites -- and none of them is its population. `isystem-census.mjs` builds the census from `git ls-files packages examples`, so a diff that merely SHIFTS a cited line reds the gate in CI while the dispatch derivation places it in the `silent` bucket, which reads as a clearance and is not. Declares `ROOT_DIR_WATCH_HINTS = ['packages/**', 'examples/**']` using the idiom `check-tenant-audit-census.mjs` already carries and `check-watch-hint-literal` already gates, derives the corpus roots from a new `CORPUS_ROOTS` constant in `isystem-census.mjs`, and pins both directions in the gate's own self-test so a corpus root added or dropped cannot outrun the declaration. Measured cost of the wide form: one extra derived family on cards under `packages/**` / `examples/**` only, against a gate that runs in ~3s and that CI runs on every PR regardless. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV
baozhoutao
marked this pull request as ready for review
September 2, 2026 03:10
Uh oh!
There was an error while loading. Please reload this page.
baozhoutao
deleted the
claude/issue-14131-census-population-declaration
branch
September 2, 2026 03:36
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#14131
check-system-context-census.mjsspelled 29 path literals — the page it maintains, thefour colliding
isSystemdeclarations, theNON_READ_ANCHORScitations — and not one ofthem is its population.
isystem-census.mjsbuilds the census fromgit ls-files packages examples, so a diff that merely SHIFTS a cited line reds the gatein
Lint & Repo Gateswhile the dispatch derivation places it in thesilentbucket,which reads as a clearance and is not.
Measured cost, from this card and its comments: three CI laps plus three repair dispatches
in one night, on three unrelated PRs, each after a dev had honestly run its derived
families and honestly reported green.
Premise re-check on fresh
origin/main(a39b02a6b, clean tree) — HOLDSEvery number in the card re-derived unchanged (109 / 20 / 45 / 145). The Silent bucket is
139 today, not the 127 the card recorded — re-derived, not quoted.
Deliverable 1 — the Silent-bucket census, MEASURED
The engine seat's first-deliverable fence: classify the Silent families by "declared
population vs actually-read population". Static classification was tried first and was not
good enough (a recursive
walk(dir)hides its seed root), so the population wasmeasured instead: every one of the 139 Silent families was run under an fs-tracing
preload that records the repo-relative path of every
readFileSync/readdirSync/git ls-filesthe gate makes, and the trace was compared against the literalsextractWatchHintsreads out of that family's own sources.Definition used, stated so the number is checkable: content reads only
(
readFileSync/readFile/openSync/createReadStream) —statSync/existsSyncprobesare excluded — of tracked files, minus the 5-path footprint
pnpmitself reads.packages/orexamples/that no declared literal covers⭐ So this card is one member of a class, not a one-gate defect. The top of the list,
undeclared readsafterdeclared literals:pnpm check:nul-bytesnode scripts/check-closing-keyword-parity.mjsnode scripts/check-self-test-workflow-commands.mjsnode scripts/check-position-name-fold-loaders.mjspnpm check:refd-timer-probenode scripts/check-comment-mask-corpus.mjspnpm check:vendor-version-stampspnpm check:skill-identifier-livenesspnpm check:parse-guardpnpm check:engine-double-contractnode scripts/check-system-context-census.mjspnpm check:error-code-casingnode scripts/check-tenant-audit-census.mjsA gate that opens every
package.jsonto build a workspace list reads far more than canred it. Four were verified by reading the source —
check:engine-double-contract(
SCAN_ROOTS = ['packages', 'examples'], one declared literal),check:error-code-casing(SCAN_ROOTS = ['packages']),check:route-envelope(
walk(join(ROOT, 'packages'))),check:error-status-conformance(walk(SCAN_ROOT)) —and all four are the same shape as this card. ⛔ The remaining members are NOT asserted to
each want this repair; three of the largest provably cannot take it (see below).
Already-worked subsets, so nothing here is re-filed:#13519 / PR #14188 repaired four
gates by declaring what they read; #14189 carries the three whole-tree gates
(
check:nul-bytes,check-comment-mask-corpus,check:refd-timer-probe) for which atruthful declaration is "every file" and is therefore refused by the derivation's own
"22 leads is the same as none" rule. The residue between those seven and the 49 measured
here is filed as a new finding (linked from this PR's card comment) — ⛔ not fixed here,
and its derivation-layer half queues behind #14013, which holds
scripts/pm/dispatch-gates.mjsright now.Deliverable 2 — the family-bloat cost of the wide declaration, MEASURED FIRST
The services seat's fence: ⛔ do not adopt the wide declaration before measuring what it
costs an ordinary diff. Families derived per probe path, before -> after, at
a39b02a6b:packages/lint/src/authoring-rules.tspackages/plugins/plugin-auth/src/auth-plugin.tspackages/metadata-protocol/src/protocol.tspackages/spec/src/data/object.zod.tsexamples/app-crm/package.jsoncontent/docs/permissions/access-matrix.mdxscripts/check-nul-bytes.mjs.github/workflows/lint.yml⇒ +1 family, and only on cards under the two declared subtrees. Nothing outside them
moves. The gate it adds runs in ~3s and CI runs it on every PR regardless, so the local
cost is one command against the CI lap it replaces. That is the measurement the services
seat asked for, and it is what carries the decision below.
The declaration shipped: WIDE
ROOT_DIR_WATCH_HINTS = ['packages/**', 'examples/**'], the idiomcheck-tenant-audit-census.mjs:146already carries andcheck-watch-hint-literalalreadygates. ⛔ No second pattern invented.
Narrow (the 20 packages / 45 files that carry a read site today) was considered and
refused on the gate's own terms: a roster of the files that carry a read site TODAY can
never name the file that grows one TOMORROW, and a NEW read site is exactly what check B
— the mandatory POPULATION half — exists to catch. A narrow declaration derives green for
the one case that most needs the lead, so it re-introduces this defect wearing the shape
of a fix. The services seat leaned the same way; the measurement above is what made it a
decision rather than a preference.
What holds the declaration honest
isystem-census.mjsnow names its corpus roots once (CORPUS_ROOTS),collectCorpuswalks that constant, and the gate's
--self-testderives both directions from it:every walked root is declared, and no declared root is unwalked. A corpus root added or
dropped reds here instead of silently outrunning the declaration.
Reverse verification (both mutations on the committed tree, both legs restored)
Predicted direction: RED, plus the derivation dropping the gate.
Mutation A is the load-bearing one: identical runtime value, every runtime assertion still
green, and zero hints extracted — the measured proof that the literal spelling is what
carries this fix.
Checks run — union at
03edd9ce5(the final commit of this branch)Derived for the real changeset with
node scripts/pm/dispatch-gates.mjs(no paths — thescript takes the change set off the merge base itself): 16 families, 14 by path + 2 by
change kind.
check:pm-dispatch-gatesneeded ~690s on this shared box (it builds temp git repos andspawns child CLIs), which is past the container's ~10-minute foreground ceiling: two
foreground attempts were killed at 500s and at 520s under the shared verify lock, both with
no output at all. It was then run to completion and its exit code collected inside the same
turn. Recording that, because "killed at the ceiling" and "red" are not the same reading and
the first two attempts would have looked identical to a hang.
Exit codes were captured before any pipe (
cmd > file 2>&1; EXIT=$?), and each line abovequotes the gate's own verdict line rather than a bare
$?.Changeset
skip-changeset: the diff is two CI-internal scripts underscripts/, publishes nothingfrom any package, and releases nothing — the textbook case
lint.ymlnames in its ownchangeset-family comment. The label is applied on this PR.
Generated by Claude Code
Generated by Claude Code