docs(examples): cite the #6318 assertion by content, not by line address (objectui#7853) - #7893
Merged
Merged
Conversation
…ess (objectui#7853) The citing docblock addressed `safe-validate-corpus-6318.test.ts` by line number. A comment-only edit to that file -- every diff line a comment, both revisions transpiling byte-identically -- moved the cited assertion from line 98 to line 117, making the address false. Nothing in the repository went red. Cite the assertion's content and name the enclosing `it(...)` title instead, and drop the line number. A quoted assertion rots too if someone rewrites the assertion, but it rots LOUDLY: the quote stops matching anything, and one `git grep -F` says so. The quote is the shortest span that is unique tree-wide (1 occurrence); the shorter `'type' in o` matches 2 sites, and the longer form only adds an `expect(...).toBe(false)` wrapper that can be restyled without changing the claim. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
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 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 #7853
Ruling on the card's A/B/C fork was A — cite by content. This implements A on the one
citation the card names, and reports the one measurement that makes B decidable. No gate is
built here, no script is committed, nothing is added to
ci.yml.The sentence this card is really about
⭐ The citation was already stale on
mainbefore this PR — and it was made stale by achange proven to be comment-only. An edit that changed no behaviour whatsoever falsified a
statement in a different file, and nothing in the repository raised a hand.
That is the whole defect. Not "a number is wrong" — the number was right when it was written.
The defect is that the number became wrong silently, and no instrument in this repo is
capable of noticing.
Fact-check on current
main(re-confirmed here, not taken on trust)Measured at
659235cb6:safe-validate-corpus-6318.test.ts3faaa7d0f)component-fixture-declared-keys.test.tsThe drift-causing commit is
7e6de4b05(squash of #7860, landed 2026-09-06T01:12:55Z), and itreally is comment-only: it touches exactly one file,
+24 / -5, and 0 of its 29 diff linesare non-comment lines. Net
+19;98 + 19 = 117. Its check-runs: 24 success, 2 skipped,zero failures.
not a near-miss. It is a comment line inside a different
it(...), in a differentdescribe(...)block, about a different subject. A reader who followed the old addresslanded somewhere that reads plausibly and says nothing about the claim.
What changed
One docblock passage in
examples/schema-catalog/test/component-fixture-declared-keys.test.ts.The citation now names the assertion's content and the enclosing
it(...)title, andcarries no line number. The file name is kept — that part is a stable pointer, and dropping it
(option C) was rejected.
The argument the passage makes, and the pin below it, are untouched; the card says that block
reads soundly and this PR does not reopen it. The cited file itself is not touched.
I also left a short note in the docblock saying the missing line number is deliberate, with the
reason. Without it the next reader "helpfully" restores an address, and we file this card again.
The quote-length trade-off, decided by measurement
The quote has to be long enough to be unique and short enough to be stable. I picked the
boundary by counting rather than by taste — occurrences across
packages/**andexamples/**:'type' in ooptions.some((o) => 'type' in o)expect(options.some((o) => 'type' in o)).toBe(false);So the chosen quote is the shortest unique span. Everything longer is pure cost: the
expect(...)/.toBe(false)wrapper is assertion style, and restyling it to.toBeFalsy()would break the quote without changing the claim the passage leans on — a false alarm, which is
the one failure mode that would make people distrust loud rot. Everything shorter is ambiguous.
Naming the enclosing
it(...)title is the second, independent handle: titles are prose ahuman rewrites deliberately, so it survives mechanical edits that would move any line number.
This change is itself comment-only, proven the same two ways the card used
esbuild@0.28.2transform of both revisions is byte-identical:e95598747f099988e3c69b32b33269ae6498f08fe4a183991b2f03dbd08a20bc, 21710 bytes eachEffect on the citation class: the population goes 491 to 490 — exactly one address retired,
and I verified my own added prose introduces no new
path.ext:linetoken.The measurement that makes B decidable
⛔ A reading only. No gate, no committed script, no
ci.ymlchange. Throwaway script, run onceon
659235cb6.Population: 491, reproducing the card's grep verbatim
(
[A-Za-z0-9_.-]+\.(ts|tsx):[0-9]+overpackages/**examples/**) — the card's numberstill holds exactly on current
main.1. In comments vs in code
.md: CHANGELOGs and READMEs)Containing files: 224
.ts, 198.tsx, 69.md. Comment-vs-code is decided by this repo's ownscripts/js-comment-mask.mjs— the single answer to that question, whose self-test I ran green(35 cases) — not by a hand-rolled regex.
The 69 in-code ones are the "probably a different thing" the card predicted: they are source
locations as test data (flow fixtures asserted by
ConditionBuilder/FlowNodeConfigFieldtests), not prose pointers. 0 citations sit in bare code.
2. Does the cited path resolve?
Resolution runs against
git ls-files, sonode_modulesand build output are excluded byconstruction, not by a filter I wrote. This matters for the PM's reliability warning: the
false-positive sources named there do not silently mis-resolve, they land in the
unresolvablebucket where I can see them — citations intodist/, into.d.tsbuild output,and cross-repo citations into the
service-aibackend are all there. The 52 ambiguous ones arehonestly ambiguous (e.g.
index.tsx:271, 21 candidate files) and are excluded from item 3rather than guessed at.
3. Cited line beyond the file's line count — a LOWER BOUND on "definitely stale"
Among the 381 resolvable citations: 0.
citations whose line number exceeds the file's length. It says nothing about whether a cited
line still contains what the citing text claims — that would mean opening 491 addresses, which
the card did not do and neither did I.
A zero needs a control before it can be reported, so I ran one. The detector fires correctly on
a known out-of-range citation and stays quiet on in-range ones, including at the exact
off-by-one boundary (
:149on a 148-line file flags;:148does not). Headroom on the realpopulation: max
citedLine / fileLengthis0.978, median0.436, and only 5 of 381 sitwithin 10 lines of EOF. So the zero is a property, not a near-miss.
⭐ What that zero actually tells you about B
The cheap criterion does not catch this card's own defect. The citation this PR is fixing —
known stale, demonstrably stale — cites line 98 of a 148-line file. In range. The control
confirms it: the out-of-range test returns
falsefor it.So the honest read for the B decision is:
to the one defect that caused this card to be filed;
the cited line still contains the quoted text — which is a much larger build, needs the
citation to carry a quote in the first place, and still faces the 52 ambiguous and 58
unresolvable paths measured above;
not 491.
I am not recommending for or against B — that is the PM's or the director's call. This is the
number they asked for.
Checks
All run on the final commit
814c1a9d0, withgit diff HEADempty.pnpm lint(full repo,eslint . --no-inline-config)examples/schema-catalogtype-checkcomponent-fixture-declared-keys.test.tscheck:control-bytes✅ check-control-bytes: OK (scanned 6386 tracked text file(s); skipped 85 binary).check:vi-mock-specifierscheck:vi-mock-inheritcheck:shell-escape-residuecheck:unreferenced-sourcesOK Every shipped source file in every covered package is reachable.The type-check genuinely reads the edited file —
tsc -p tsconfig.test.json --listFileslistsit, so "type-check clean" is a measurement about this file rather than a vacuous pass.
mainis not broken. Running thewhole package suite locally, 93 tests fail in
catalog-gallery-render.test.tsx(92) andplugin-dashboard-gallery-render.test.tsx(1). Three readings place them:origin/mainblob, hash-verifiedidentical — those same two files fail with 93, the identical count;
659235cb6CI's fourTest (shard N/4)runs are all green.So this is a local build-state artifact of my container (I built only this package's dependency
closure, and those two suites reach for docs-gallery host artifacts that a full build produces),
not a defect on
main. Recording it because it cost a measurement, not as a finding againstthe tree. Session:
https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3Changeset — the checker's verdict, quoted verbatim, not guessed:
So no changeset is owed at all — not even the empty-frontmatter form.
examples/**is not areleased package. The dispatch's guess was the empty-frontmatter form; the checker overrides it,
and I obeyed the checker.
Governed surface — verdict quoted verbatim:
Left as draft regardless: the PM seat runs the pre-landing checks and drives the queue.
🤖 Generated with Claude Code
Generated by Claude Code