Skip to content

test(scripts): re-derive the ValidationRule absence claim, not just the sentence - #6195

Merged
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-6186-validation-rule-truth-pin
Aug 25, 2026
Merged

test(scripts): re-derive the ValidationRule absence claim, not just the sentence#6195
yinlianghui-tw merged 1 commit into
mainfrom
claude/issue-6186-validation-rule-truth-pin

Conversation

@yinlianghui-tw

Copy link
Copy Markdown
Collaborator

Part of #6186 — claim 1 only. The card stays open: claims 2 and 3 are the escalated needs-user-decision policy question and are untouched here.

What was one-sided

scripts/__tests__/check-doc-component-types.test.ts pinned that content/docs/plugins/plugin-form.mdxcontains the sentence:

There is no ValidationRule type in this repository

Presence is not truth. Land a bare declaration of that name tomorrow and the page turns false while the pin stays green — worse than no pin, because a green test reads as coverage of the claim it quotes.

The existing pin is untouched. Its own comment says why it exists — to stop the fiction being authored back into a snippet a reader copies — and that is a different, legitimate job. This adds the other half so that presence and truth are two assertions, neither pretending to do the other's work.

The trap, and why the assertion is written the long way

A substring match on ValidationRule matches 106 lines on today's tree, every one of them a real and different type:

SpellingDeclared at
AdvancedValidationRulepackages/types/src/data-protocol.ts:708
ValidationRuleTypepackages/types/src/data-protocol.ts:748
ObjectValidationRulepackages/types/src/data-protocol.ts:1129
DesignerValidationRulepackages/types/src/designer.ts:762
FieldValidationRulespackages/types/src/form.ts:744

Plus four the card had not listed: ValidationRuleSchema, ValidationRuleDraft, BaseValidationRuleShape, buildValidationRules.

A naive assertion reds on a true claim, and the next person to hit that deletes it — putting the claim back where it started. So bareValidationRuleSites() matches a declaration of the exact name (interface / class / enum / type) or a re-export that publishes it, and every spelling above is fixtured as a negative control beside the positives, rather than remembered in a comment.

Comments and string/template/regex literal content are blanked with the repo's own scripts/js-comment-mask.mjs before matching. That is load-bearing twice over: it keeps prose from fabricating a finding, and it is what lets the scan read its own fixture table without reding on it.

Scanned population, stated

git ls-files filtered to the .ts family (.ts, .tsx, .mts, .cts, .d.ts included) — 3,603 files on this tree. Derived, not listed: node_modules, dist and every other build output are untracked and so are out by construction, and a TypeScript type cannot be declared outside that family. scripts/check-control-bytes.mjs reads this repository the same way. The scan refuses to collapse quietly: a population under 1,000 files fails rather than passing vacuously.

Fidelity of the mask was measured rather than assumed: over those 3,603 files, blanking literal content loses 16 of 2,324 top-level exported declarations, in exactly two files — packages/sdui-parser/src/codegen.ts, which emits a declaration from a template, and check-spec-symbol-derivation.test.ts, whose fixtures are template literals. Both are the direction to lose them in.

The prose overclaimed, so it was narrowed

The sentence carried a rider — "under any spelling" — which the assertion cannot check and which is measurably false: five near-spellings do exist. Leaving it would reproduce this card's own defect, a gate asserting less than the prose while looking like it covers it. The page now names the near-spellings and says none of them types the key; the pinned clause itself is unchanged, so the presence pin needed no edit.

(The card cited the sentence at plugin-form.mdx:99; PR #6185 moved it to line 102. Branched from b04646b63 and re-read.)

Verification

Reverse verification, each direction predicted before running, mutation proven on disk by anchored counts (not an editor exit code), restored with git checkout HEAD -- path and proven with an empty git diff HEAD. No build leg: the subject is read off disk with fs.readFileSync, never resolved through a package exports into dist/.

  1. Positive control — appended export interface ValidationRule to packages/types/src/form.ts (anchored count 0 to 1). Predicted red, naming it. Observed: 1 failed | 35 passed, message packages/types/src/form.ts:1403: declares interface ValidationRule.
  2. Negative controls — the five near-spellings confirmed present by anchored count, plus three more injected (SuperValidationRule, ValidationRuleName, ValidationRuleRunner, and an aliasing re-export). Predicted green. Observed: 36 passed, exit 0.
  3. The existing pin was not traded away — removed the sentence from the page (anchored count 1 to 0). Predicted: the presence pin reds, the new tree scan stays green. Observed exactly that: 1 failed | 35 passed, the failure being no longer authors ValidationRule, and says outright that it does not exist.

Gate union re-run at 4188af3f9 on a clean tree, gate list derived from package.json and .github/workflows/ rather than from the dispatch:

GateExitIts own verdict line
root vitest run scripts/__tests__/0Test Files 71 passed (71) / Tests 1935 passed (1935)
pnpm check:doc-types0Every documented component type is registered.
pnpm check:doc-fences0every TypeScript block in 223 document(s) is fenced ts/tsx/typescript…
pnpm check:control-bytes0OK (scanned 5110 tracked text file(s); skipped 85 binary).
pnpm docs:check-links0Links are valid across 15 scan roots.
node scripts/check-changeset-presence.mjs0No source of a released package changed in this range, so no changeset is owed.
pnpm type-check:scripts0clean tsc -p tsconfig.scripts.json
pnpm lint:root028 problems (0 errors, 28 warnings) — all pre-existing, none in the changed files

Every exit code captured by redirect before any pipe.

No changeset, per the presence gate's own verdict quoted above — objectui has no skip-changeset label mechanism, so that verdict is the declaration form.

Declared narrowing:pnpm check:doc-snippets exits 1 in this worktree with The snippet program was NOT run: the packages it resolves against are not built — an unbuilt-dist/ precondition listing 20 packages, independent of this diff, which changes no fenced snippet (prose only). CI builds and runs it.


Generated by Claude Code

… the sentence
`check-doc-component-types.test.ts` pinned that `plugin-form.mdx` CONTAINS the
sentence "There is no `ValidationRule` type in this repository". Presence is not
truth: land a bare declaration of that name and the page turns false while the
pin stays green, which reads as coverage of a claim nothing checks.
Adds the other half. `bareValidationRuleSites()` reports every site that puts the
BARE name into this repository's types — a declaration of the exact name, or a
re-export that publishes it — over every TypeScript file `git ls-files` tracks
(3,603 on this tree; build output is untracked and so out by construction).
Comments and string/template/regex literal content are blanked with
`scripts/js-comment-mask.mjs` first, which is what lets the scan read its own
fixtures without reding on them.
The near-spellings are the whole difficulty: a substring match on
`ValidationRule` hits 106 lines of real, different types
(`AdvancedValidationRule`, `ValidationRuleType`, `ObjectValidationRule`,
`DesignerValidationRule`, `FieldValidationRules`, and four more), so a naive
assertion reds on a true claim and gets deleted. All of them are fixtured as
negative controls next to the positives.
The existing presence pin is untouched — it stops the fiction being authored back
into a snippet, which is a different job.
`plugin-form.mdx` loses the "under any spelling" rider, which overclaimed: the
near-spellings do exist, and the new assertion checks the bare name only. The
page now names them and says none of them types the key.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
@yinlianghui-tw
yinlianghui-tw marked this pull request as ready for review August 25, 2026 00:09
@yinlianghui-tw
yinlianghui-tw added this pull request to the merge queueAug 25, 2026
Merged via the queue into main with commit e4de2adAug 25, 2026
23 checks passed
@yinlianghui-tw
yinlianghui-tw deleted the claude/issue-6186-validation-rule-truth-pin branch August 25, 2026 00:29
os-warren pushed a commit that referenced this pull request Aug 25, 2026
…e block-family one
Applies the 2026-08-25 "bounded or derivable" ruling to the two closure claims
left open on objectui#6186 after claim 1 landed as PR #6195.
Claim 2 (`thresholds`) was written twice — in the plugin-dashboard page and in
the sdui-parser census header — and two copies of one closure claim drift apart
independently. The census header is now the canonical statement and the page
points at it. Single-sourcing makes the surviving copy load-bearing, so it is
also DERIVED: a new gate re-scans every JS/TS file git tracks for an access to a
key of that name, with positive and negative controls, and a population that
refuses to collapse on an empty walk.
Claim 3 (block-schema) was a whole-tree negative that measurement showed to be
false as written: `PageSchema.slots` and `PageNodeSchema.template` both have
live runtime readers under a different vocabulary. Bounded to the block family's
own keys, which is what the page's actual point survives.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CZgmFFzqA9cX8tBMhvpFe
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yinlianghui-tw@claude