Skip to content

feat(scripts): census cross-file line-address citations tree-wide (report-only, objectui#8875) - #8881

Merged
baozhoutao merged 1 commit into
mainfrom
claude/8875-cross-file-line-citation-census
Sep 9, 2026
Merged

baozhoutao merged 1 commit into
mainfrom
claude/8875-cross-file-line-citation-census

Conversation

@baozhoutao

@baozhoutao baozhoutao commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Refs #8875 (the census)

⛔ Deliberately not Fixes. #8875's subject is that objectui#8047's cite-by-content rule
covers test names only and its comment carve-out does not hold across files. This pull request
delivers the measurement that card said any choice needs — 1267 citations, 540 false today —
and ⛔ deliberately repairs nothing and rules on nothing. The gap itself is still open, and the
three directions the card named are still unchosen. Closing it here would retire a measured
population of 540 false citations from every open-issue sweep. On merge the card returns to
pm:queue carrying the number, with the direction question routed to triage.

What this is, and what it deliberately is not

objectui#8875 rules on nothing. It names three candidate directions and says the choice "needs the tree-wide population that has not been measured". This PR is that measurement, and nothing else.

  • ⛔ eslint-rules/no-line-address-in-test-name.js is untouched — not extended to comments, not to message strings.
  • ⛔ No blocking gate, and nothing wired into CI.
  • ⛔ Not one citation is repaired, including the off-by-one this PR's own control fires on. Per the card: shifting an already-false address by a hunk delta moves a wrong pointer to a differently wrong place while making the diff look diligent.

The number

Measured on 5a47dcdb6 by pnpm census:cross-file-line-citations:

Cross-file line-address citations in the population 1267
of which false against today's tree 540
of which resolve to their cited content 295
of which the census refuses to judge 432

Excluded and counted, never silently dropped: 61 hits under released CHANGELOG.md version headings, 2 same-file citations, 57 fixture addresses inside the census and its own test. Citations reaching a test name: 0 — objectui#8047's rule is holding that sub-population, and that zero is a reading only because the classifier controls below fire in the same run.

The false 540 splits three ways: drifted 411 (the cited content is elsewhere in the cited file, and the census says where), non-substantive 112 (the cited line is blank or delimiters only), out-of-range 17 (past the end of the file). The 432 unjudged are no-such-file 144 — dominated by citations into build artifacts such as packages/types/dist/overlay.d.ts, which are untracked and regenerated, so nothing can ever check them — ambiguous-basename 131 (a bare basename naming several tracked files at once), anchor-absent 123 and no-anchor 34.

By directory, top of the table:

directory total false resolves unjudged
packages/types 218 84 94 40
scripts 168 58 55 55
docs 157 92 13 52
.changeset 155 82 26 47
scripts/__tests__ 106 26 25 55
packages/app-shell 56 14 28 14
packages/layout 37 12 2 23
packages/plugin-detail 37 27 5 5
apps/console 36 14 5 17
eslint-rules 35 6 1 28

35 buckets in all; the script prints the rest. ⛔ This PR takes no position on which of the card's three directions the number favours — that decision is reserved to objectui#8875.

Why a census:* script and not a check:* gate

Measured, not assumed: census:body-dialect appears in no file under .github/workflows/, while the control check:entry-guard resolves to lint.yml. So census:* is already this repo's spelling for "runnable, reported, not blocking", and choosing it is how this stays report-only without a reader taking it on trust. It also keeps objectui#3653's obligation out of the way — that card pins content/docs/guide/ci-cd-pipeline.md's table by command, so a CI step here would owe a documentation row for a gate nobody has decided to have.

The two controls the card asked for, both in the output, both fatal

PASS  firing (want false): scripts/check-doc-component-types.mjs -> packages/core/src/actions/ActionRunner.ts
      scripts/check-doc-component-types.mjs:597 -> packages/core/src/actions/ActionRunner.ts:112 [non-substantive]
PASS  non-firing (want not-false): packages/types/src/crud.ts -> packages/plugin-detail/src/index.tsx
      packages/types/src/crud.ts:53 -> packages/plugin-detail/src/index.tsx:387 [resolves]

Both are addressed by content — the citing file and the file it cites — never by their own line numbers; a control pinned by a line address would be an instance of the defect being measured, and a test asserts they carry no line number.

Five syntaxes, because a one-syntax probe under-reads by construction

path:line; the #L permalink; line NNN of NAME; NAME line NNN; and the bare continuation address, which carries no filename at all. Ablation, measured: making syntax 5 unreachable drops the population from 1267 to 1115 and the false count from 540 to 460 — so 12% of the population, and 80 of the false readings, are invisible to any basename-anchored probe. A second ablation removing non-substantive from the false verdicts flips the firing control to FAIL and exits non-zero, which is what shows the control can fail. Both ablations mutate on disk, prove the mutation landed by counting the changed text, and restore under a trap; the restored blob hash equals the HEAD blob and git diff HEAD is empty.

Two defects found in the instrument itself, both fixed

  1. A naive ts|tsx alternation matched .ts inside ListView.tsx, so the single line NNN of NAME instance in the repo was scored against a ListView.ts that does not exist. The path:line syntaxes hid it — their required colon forces a backtrack into tsx — so only the syntax with nothing after the name was wrong. That is this card's own subject one level up.
  2. The first test-name classifier merely asked whether a line contained something shaped like a test call. It reported 27 hits on this tree, every one of them prose — including eslint-rules/no-line-address-in-test-name.js's own header quoting the false positive it was written to avoid. Replaced by a title-extent walk anchored at the statement start, with four fixture controls that run on every census.

Checks

  • pnpm exec vitest run scripts/ — 133 files, 3864 tests passed, 2 skipped, 0 failed (31 of them new).
  • pnpm type-check:scripts — exit 0.
  • eslint over the root partition that covers this whole diff (packages/*, apps/*, examples/*, docs/** ignored; nothing here lives in a package, so turbo run lint reaches none of it) — 307 files linted, 0 errors, and the JSON report names both new files, so the narrowing is a measurement rather than a gap.
  • check-changeset-presence, check-changeset-no-major, check-entry-guard, check-control-bytes, check-unreferenced-sources, check-governed-queue-guard --test — all exit 0. The guard reports NOT GOVERNED: 4 paths, none matched.
  • Changeset with empty frontmatter: internal tooling only, no package publishes anything from this diff.

⛔ Left in draft; not enqueued, no auto-merge armed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr


Generated by Claude Code


Generated by Claude Code

…jectui#8875)

objectui#7853 ruled the class -- cite the assertion by CONTENT, not by line
address. objectui#8047 mechanized it for TEST NAMES only, carving out comments
and failure messages because "a human reads them beside the code they
annotate". objectui#8875 observes that the justification holds for a same-file
citation and not for a cross-file one, rules on nothing, and says the choice
between its three candidate remedies needs the tree-wide population that has
not been measured.

This is that measurement, and nothing else. Report-only, named `census:*`
rather than `check:*` because the two existing `census:*` scripts appear in no
workflow -- so the name is what keeps this out of CI without a reader having to
take it on trust. It repairs no citation: shifting an already-false address by
a hunk delta moves a wrong pointer to a differently wrong place while making
the diff look diligent, which is the trap the card exists to name.

Five syntaxes, because a one-syntax probe under-reads this class by
construction: `path:line`, the `#L` permalink, the address written before or
after the name, and the bare continuation address that carries no filename at
all. Released changelog sections are carved out and counted -- a changelog
entry is a dated record of what was true at that release. Every citation is
judged against what is at the cited line TODAY, never against whether a diff
moved it. Two tree controls and four classifier controls run on every
invocation and are fatal, as is an empty population.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
@baozhoutao
baozhoutao marked this pull request as ready for review September 9, 2026 19:03
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 4e3a4f0 Sep 9, 2026
34 checks passed
@baozhoutao
baozhoutao deleted the claude/8875-cross-file-line-citation-census branch September 9, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants