Skip to content

[finding] No symbol-anchor corpus covers scripts/**, so the 27 cross-file line citations in gate headers rot unchecked — #15599's moved twice in one day #15765

Description

@baozhoutao

Filed by the os-dev on #15599, session session_012zGPuVVX3deAx9LdjK8jCk, from PR #15770. Filed bare — domain:*, type and priority are triage's. ⛔ Not fixed here: that card's ruling is header-only on one gate.

⚠️ Attribution is written as prose above rather than as the usual footer: GitHub's body sanitizer dropped the rule line and the footer block from this card on create (measured — the rest of the body stored byte-for-byte). Not re-posted, per AGENTS.md.

What was measured

On origin/main 66e68adc6:

  • scripts/**/*.mjs comment lines carrying a cross-file path:NNN citation: 27 citations across 14 files.
  • Nothing in this repo resolves any of them. check-adr-symbol-anchors.mjs registers exactly one corpus — defineCorpus({ id: 'adr', docRoots: [ADR_DIR], docPattern: /\.md$/ }) with ADR_DIR = 'docs/adr' — and git grep -n defineCorpus scripts/ finds no second registration. So scripts/** is outside every symbol-anchor corpus, in both directions: a line citation there is neither resolved nor refused.

Why that matters, demonstrated rather than argued

#15599 is the worked example, and its rot rate is the finding:

the citation as written packages/client/src/index.ts:310
the #15094 census found the declaration at :392
triage read, the same day :390

One cross-file line citation in a gate header moved twice inside a single day, unnoticed, because nothing checks it. A second one three lines below it (content/docs/api/client-sdk.mdx:659) had drifted off its line too, and was found only because a human read the paragraph.

The repo already ruled on the general shape. scripts/symbol-anchors.mjs#ANCHOR_GRAMMAR's last line reads, verbatim:

⛔ `DIR/FILE.ts:4901`     A LINE NUMBER IS NOT AN ANCHOR FORM.

(angle-bracket placeholders spelled as words here — GitHub's body sanitizer eats them.)

That grammar is authoritative for docs/adr/** and enforced there; gate headers in scripts/** are simply outside its reach, and gate headers are exactly where the next fixer starts reading.

What a fix might owe

symbol-anchors.mjs's whole design is that a second corpus is a defineCorpus call and no new mechanism — #13788 already added one that way for the platform checklist. A scripts/** corpus over .mjs comment blocks looks like the same call, plus a migration of the 27 citations to symbol or file-level anchors.

⚠️ Unpriced here, and the reason this is filed rather than done: the extractor was written for prose in .md, and whether it reads a // or /* */ comment block cleanly is not established by this card. That is the measurement a fix owes first.

Refs

#15599 (the two repaired instances), #13788 (the second-corpus precedent), #13556 (the ADR migration and its 72.1% one-way lower bound).


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions