Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(scripts): judge spec citations at member granularity, and stop the header teaching a retired filter (objectui#7513) - #7617

Merged
os-sam merged 1 commit into
mainfrom
claude/issue-7513-spec-symbol-member-granularity
Sep 4, 2026
Merged

os-sam merged 1 commit into
mainfrom
claude/issue-7513-spec-symbol-member-granularity

Conversation

@claude

@claude claude Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #7513

Implements the maintainer ruling of 2026-09-04 (decision batch #29, A′ + b, verbatim 「同意」),
recorded in comment 5536189897.

1. Precision rule 4, tightened from symbol to member granularity

A comment citing SpecSymbol.key where the spec's own shape has no key is now a dangling
reference. Three measured specimens took exactly that shape, and every one of them named a symbol
the spec really exports — which is why rule 4 passed them:

citation what the spec actually says
SelectOptionSchema.description (×2) the option schema is .strict() and spells five keys, none of them description — so it 422s the WHOLE field
FieldSchema.rows rows is not a field key at all
DashboardSchema.title the dashboard display name is label

This is rule 4 tightened, not a second instrument — the ruling is explicit on that point. Same
question (is there anything behind what this comment points at), same answer shape, and
no allowlist and no ledger of its own: the measured population is 0 on this branch's base, so a
hit is always fresh and fails on the PR that writes it. There is nothing here to accrue.

Where it looks, and why that is not B

It walks every comment in the scanned files, not the block attached to a top-level declaration.
Two of the three specimens sat on interface MEMBERS and one sat inside a function body, so a
declaration-scoped scan sees none of them. It needs no claim phrase either — one of them read
"Per @objectstack/spec, DashboardSchema.title is …", which no phrase table matches and which is
wrong all the same.

That is not issue #7513's deferred B, because it asks a different question. Rule 2 asks whether
a DECLARATION has a compile-time tie behind its claim, which needs a declaration and a tie test.
This asks only whether a NAME the prose spells exists in the spec, which needs neither. B stays
deferred and its counts are posted on the card.

Four precision rules, each measured against the tree

  • Proximity and same sentence — rule 2's own discipline (CLAIM_WINDOW), reused rather than
    reinvented. Without it, ListView.resolveTimelineDateBinding (a method on this repo's own
    component, 755 characters from an unrelated spec mention) reads as a spec citation. 136 raw
    citations tree-wide collapse to 73 real ones.
  • A slash on either side makes it a PATH. @objectstack/spec ui/TimelineConfig.json is a
    file the comment points at; json is an extension, not a member. Four sites read this way.
  • The member set is the union over the spec's symbol FAMILY — N, NSchema, NInput, NParsed —
    taken on the AUTHORING side (a schema's .shape, hopping through a ZodPipe's .in) rather than
    the parsed output. ⭐ Load-bearing, not tidiness: FormField.visibleOn is a real authorable key
    that the spec's OUTPUT type deliberately drops (its declaration is an Omit of the inferred type
    over the string 'visibleOn'), so reading the output type alone reports a correct comment as
    dangling. That was a live false positive in an earlier draft of this change.
  • Zod's own API is excluded BY RULE, not by allowlist entries — see below.

2. The Zod exclusion is a predicate, and it has a specific shape for a specific reason

The ruling required a documented predicate rather than allowlist entries, and ratchet 3 would refuse
an entry that excuses nothing in any case. Two predicates:

  1. Call form — NavigationModeSchema.default('page'). A citation written with its parentheses
    is an invocation. This carries the names Zod SHARES with the authoring vocabulary, which is why
    they need no list: default, options, type, required, readonly and optional are all
    real spec keys AND real Zod methods.
    ⚠️ A backtick or space before the paren is prose, not a call — "FieldSchema.rows (a positive
    integer)" is a citation with a parenthetical after it, and one of the three specimens is written
    exactly that way. There is a pin for that distinction.
  2. A five-name introspection vocabulary for the bare spellings that actually occur
    (parse, safeParse, parseAsync, safeParseAsync, shape).

⛔ Deliberately NOT "any property of the Zod type". Zod puts .description, .default,
.optional, .readonly, .type and .shape on every schema, so a structural read waves through
SelectOptionSchema.description — the citation this entire rule was built for. I measured that
directly: it read green under the structural predicate. The ordering in the scanner is the second
half of the safety — the family's AUTHORED set answers first, so a symbol that really declares
shape as a key is green on the strength of its shape, never on the vocabulary. Both halves have
their own pin.

3. The two stale docblock paragraphs, plus one bounded in-place fix

The header's hasExportModifier prose contradicted the // No export filter (objectui#6291)
comments at both scanners. Corrected to unambiguous past tense, with the reason recorded: a card was
filed on the strength of that prose, and its author did not invent the mechanism — they read it in
this file's own header.

⭐ Declared bounded in-place fix: hasExportModifier itself is deleted. It had zero call
sites
anywhere in the repo (measured: git grep finds only the declaration and the two prose
mentions being corrected). Correcting the prose while leaving a live-looking helper for the next
reader to grep would leave the trap half-set — the identifier IS the artifact the prose pointed at.
Same defect class as the card, mechanically pinned by the measurement, same gate family, no new
verification surface, and no other claim holds this file (all 6 open PRs enumerated to completion:
0 touch scripts/).

What does NOT land here

B (widening rule 2 to member-attached doc comments) and b (bare aligns / aligned in
CLAIM_PATTERNS) are deferred by the ruling. Both owed measurements were run in a throwaway and are
posted as their own comment on #7513. Headline: B would produce 45 new rule-2 failures, 37 of
them in packages/types; b's added false-positive surface is 0, and so is its yield — it is a
no-op on this tree today, because PR #7510 repaired the only site that had the shape.

Verification

Union re-run at 3ce032c0 (the final commit):

check result
check:spec-symbols ✅ exit 0 — its own verdict line: ✅ spec member citations: no comment cites a key its spec symbol does not declare.
pnpm exec vitest run scripts/__tests__/ (repo root) ✅ 100 files, 2958 tests passed
pnpm run type-check:scripts ✅ exit 0
check:control-bytes ✅ scanned 6228 tracked text file(s)
check:entry-guard ✅ 56 export bindings, 56 of them inert on import (this PR adds two exports)
check-changeset-presence ✅ no changeset is owed — 0 files are published source of a released package

tsc --listFiles confirms both edited files are in the tsconfig.scripts.json program, so
"typecheck clean" genuinely covers them rather than silently excluding the test file.

⭐ The red/green pair, and the ablation that makes it mean something

A ratchet asserted only green on today's tree proves nothing about the tightening — the tree is
green either way, including with the rule deleted, which I verified rather than assumed. So the
bite leg is pinned on the VERBATIM pre-repair comments, copied out of the removed lines of PR #7510
and PR #7520:

  • RED on the pre-repair text: all three specimens produce findings, at the right lines.
  • GREEN on main: the gate exits 0, 0 dangling, 0 allowlist entries.
  • Ablation (implementation committed first, then neutered): mutation proven on disk by anchored
    before/after counts of the exact text plus a changed blob hash — removed-text count 0, injected
    marker 1. Under the ablation all three RED fixtures return the empty list, so those three
    assertions genuinely fail without the rule. Restore proven by an empty git diff HEAD and a
    worktree blob hash identical to the HEAD blob.

Measured population, on 1bae75bb against @objectstack/spec@17.2.0

raw Symbol.member citations in spec-mentioning comments   136
within CLAIM_WINDOW and the same sentence                  73
  resolve against the family's authored shape              64
  excluded as Zod API (5 call-form, 4 vocabulary)            9
  member set unknowable, rule stays out                      0
  DANGLING                                                   0

Lint

Not narrowed — I ran eslint . over the whole repo, 4244 files (count read from eslint's own
--format json output, not estimated).

  • Both changed files: 0 errors, 0 warnings. check-spec-symbol-derivation.mjs is in the linted
    population, not skipped.
  • ⚠️ The run's overall exit is 1, and that is honest to report rather than round off: there are
    93 pre-existing errors in 79 files this diff does not touch (mostly
    react-hooks/static-components, plus no-console, preserve-caught-error,
    no-restricted-imports). That is a property of a raw eslint . invocation — it is not this
    repo's lint script, which is turbo run lint, a per-package fan-out with per-package scoping,
    and which CI runs in full regardless. ⛔ I am not claiming those 93 are new, and I am not claiming
    the repo's own lint is red.
  • Why this diff cannot have caused any of them: the flat config enables no type-aware linting
    (no projectService, no project parser option anywhere in eslint.config.js), so a change in
    these two files cannot move the verdict on a file it does not touch.

Notes for the reviewer

  • Clause-② re-judged from the diff: no. Two files, both under scripts/; no published surface,
    no skills/**, no released package source.
  • skip-changeset is not applied — this repo declares with an empty-frontmatter changeset when
    one is owed, and check-changeset-presence says none is owed here.
  • ⛔ Left as-is deliberately: check:spec-symbols still reports 19 unbacked rule-2 claims and 14
    untriaged rule-1 collisions. Those are the existing ledgers; this change neither grows nor shrinks
    them.

Generated by Claude Code

…e header teaching a retired filter (objectui#7513)

Tightens precision rule 4 of `check:spec-symbols` from symbol to member
granularity, per the maintainer ruling of 2026-09-04 (batch #29, A′ + b).

A comment citing `SpecSymbol.key` where the spec's own shape has no `key`
is now a dangling reference. Three measured specimens took that shape and
all three were inviting a 422: `SelectOptionSchema.description` (twice,
into a `.strict()` option schema, which sinks the whole field),
`FieldSchema.rows`, and `DashboardSchema.title`. Every one of them named a
symbol the spec really exports, so rule 4 passed them.

This is rule 4 tightened, not a second instrument: no allowlist and no
ledger of its own — the measured population is 0 on this commit, so a hit
is always fresh and fails on the PR that writes it. Zod's own API is
excluded by two documented predicates (call form, plus a five-name
introspection vocabulary), never by allowlist entries.

Also corrects the two header paragraphs that still described the
`export`-modifier filter in the present tense, beside a `hasExportModifier`
helper that had lost its last call site. A card was filed on the strength
of that prose; the helper is removed so nothing is left to grep into the
same false conclusion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

决策:check-spec-symbol-derivation 要不要从符号粒度收紧到成员粒度?(实测全树 3 条悬空引用,零 allowlist)

1 participant