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

Commit dac022c

Browse files
test(scripts): cite the bare-ValidationRule negatives by file, not by line; mark the two retired names synthetic (objectui#10781) (#10791)
Fixes #10781 Clause-②: no. It is a test-fixture citation, and nothing published moves. ## What changed One file, `scripts/__tests__/check-doc-component-types.test.ts`, comments only. With comments masked, the test's code is byte-identical to `origin/main` (measured below). - The negative fixtures of the bare-`ValidationRule` matcher (test "the bare-`ValidationRule` match discriminates every near-spelling that really exists") no longer carry line addresses. - `AdvancedValidationRule` and `ValidationRuleType`: objectui#10719 (PR objectui#10759) retired both names. No live spelling puts a suffixed name on the `type … =` branch, so there is nothing truthful to re-cite `ValidationRuleType` to, and route 1 of the card has no live pair. Both stay as **SYNTHETIC** negatives (route 2). The comment above them says so, gives the reason each shape is kept, and points at the retirement pin `phase35-validation-types-retired-10719.test.ts` in `packages/types`. - `ObjectValidationRule`, `DesignerValidationRule`, `FieldValidationRules`, `ValidationRuleDraft` and `BaseValidationRuleShape` are re-cited by the file they live in, with no line. AGENTS.md #11 and the citation gate's own header both say an address is repaired by turning it into a content anchor, not by moving the number. - The block comment no longer says every negative is a spelling this repository writes. That is only true of the negatives with a file beside them; the rest are shapes. It also states that nothing re-derives either kind of citation (AGENTS.md #9). - The same file has one other stale cross-file address, in the objectui#5106 key-table block: the `plugin-grid.mdx` specimen of a "none — `skipFallback: true`" row. It now points at the `view:grid` row by content. Acceptance notes say why it is in this PR. ## Why this is wider than the card's Finding The card's Finding names two addresses. Its Acceptance reads: "No fixture in that file cites a `packages/types/src/**` address that does not hold the cited spelling at head." Measured at `origin/main` `bf14b6460`, **none** of the six addresses into `packages/types/src` held its spelling: - objectui#10759 removed the two lines the Finding names. - The other four were wrong before that. They cite `data-protocol.ts` (twice, including the `BaseValidationRuleShape` quote), `designer.ts` and `form.ts`, and each already pointed at an unrelated line on `97b6c21^`, the tree before objectui#10759. Changing only two would leave the Acceptance false. The seventh fixture address, app-shell `ObjectValidationsPanel.tsx`, still held; it is converted anyway so the list uses one citation form. ## Evidence (head `a90af71878`) | Check | Reading | |---|---| | `pnpm exec vitest run scripts/__tests__/check-doc-component-types.test.ts` (under `os-verify-lock`) | `Tests 125 passed (125)`, `VERDICT command-exit 0` | | Masked-code equality against `bf14b6460`: `stripComments` from `scripts/js-comment-mask.mjs`, with blank lines and trailing spaces dropped | equal. Positive control: dropping one negative fixture from the base reads unequal | | `pnpm check:new-line-citations` | `VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0` | | `node scripts/cross-file-line-citation-census.mjs --json`, rows whose citing file is this test | 7 before, 0 after. ⚠️ This is **not** a census reading: the census exits 1 on `bf14b6460` as well, because one of its own controls fails there (see Acceptance notes) | | `pnpm check:control-bytes` | OK, exit 0 | | `node scripts/check-changeset-presence.mjs` | "no changeset is owed", exit 0 | | `node scripts/check-changeset-no-major.mjs` | exit 0 | | `pnpm check:spec-symbols`, `pnpm check:test-path-roots`, `pnpm check:doc-types`, `pnpm check:comment-mask-corpus`, `pnpm check:shell-escape-residue` | exit 0 each | | `pnpm type-check:scripts`. This test is in its file list, counted with `tsc --listFilesOnly` | exit 0 | | `pnpm exec eslint --no-inline-config --format json` on the touched file | 1 file linted, 0 errors, 0 warnings | | `node scripts/check-governed-queue-guard.mjs --test` on the touched path | NOT GOVERNED | | Adjacent tests: `markdown-test-inputs`, `check-new-cross-file-line-citations`, `cross-file-line-citation-census` | 3 files, 132 passed | Not run locally: - The `@object-ui/types` type-check and its consumer packages. No package file moves, so the contract-face lane rule does not apply. - Full `pnpm test` and `pnpm lint`. Those belong to CI. ## Acceptance notes - **Acceptance ①.** No line address is left in the fixture list. Every file named beside a live negative declares or quotes that spelling at head: `export type ObjectValidationRule =`, `export interface DesignerValidationRule {`, `export interface FieldValidationRules {`, `interface ValidationRuleDraft {`, and the `ConditionalValidation` docblock, which names `BaseValidationRuleShape`. This was checked by hand. Nothing re-derives it, and the comment says so. - **Acceptance ②.** The fixture strings are unchanged byte for byte, and the matcher's negative cases pass. - **Acceptance ③.** No changeset: `check-changeset-presence` owes none. - **Scope beyond the claim's locus.** The claim's file surface is this one file, and nothing outside it is touched. The claim names "the two fixtures and their comment" as the locus. This PR also edits: - the other five fixture citations in the same list, which the card's own Acceptance requires; - the one stale address in the objectui#5106 block. AGENTS.md #11 says "When you touch a file anyway, fix the cross-file line addresses inside it". It is the same defect class and a mechanical content-anchor conversion, in the same gate family, and no other claim or open PR holds the file. - **Remaining `path:line`-shaped strings in this file** are expected `site` values of synthetic fixture pages, which the gate under test computes. They are not citations. - **Observation, not filed.** `node scripts/cross-file-line-citation-census.mjs` exits 1 on `origin/main` `bf14b6460` and prints "this run is NOT a reading". Its `non-firing` control, the `getJsxManifest` citation from `layout-containers-declare-containment.test.tsx` into `renderers/layout/page.tsx`, now scores `drifted`. It is a report-only tool behind no public door. Carrier: none named. - **Premise.** The Finding holds for its two addresses. It under-reads the population its own Acceptance covers: four more addresses were already stale before objectui#10759. Session: `session_014fWVhLzhxR8qrFsJ5o8TYW` (dispatched `os-dev`, seat `domain:spec#1`). --- _Generated by [Claude Code](https://claude.ai/code/session_014fWVhLzhxR8qrFsJ5o8TYW)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent bff63cc commit dac022c

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

‎scripts/__tests__/check-doc-component-types.test.ts‎

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,8 @@ describe('objectui#5106 — plugin key tables are judged, on both halves', () =>
16251625
// The universe is a UNION across the repo, so a call skipping its own bare
16261626
// fallback says nothing about whether another package registers that bare
16271627
// name — and in this tree one does. Asserting the negative would red a
1628-
// correct row (`plugins/plugin-grid.mdx:185` is the live specimen).
1628+
// correct row (the `view:grid` row of `plugins/plugin-grid.mdx` is the live
1629+
// specimen).
16291630
const { findings, counters } = tableTree(
16301631
['| `view:widget` | none — `skipFallback: true` | `W` |'],
16311632
"ComponentRegistry.register('widget', W, { namespace: 'view', skipFallback: true });\n" +
@@ -2497,10 +2498,13 @@ describe('objectui#5118 — the plugin-form page teaches the real `validation` s
24972498

24982499
it('the bare-`ValidationRule` match discriminates every near-spelling that really exists', () => {
24992500
// Fixtures rather than the tree, so the negative control stays decidable
2500-
// when the types move. Every negative is a spelling this repository really
2501-
// writes, cited where it lives — an assertion that red on `FieldValidationRules`
2502-
// would be deleted by the first person who hit it, and the claim would be
2503-
// back to unguarded.
2501+
// when the types move. A negative with a file beside it is a spelling this
2502+
// repository really writes, cited by that file and never by line: a line
2503+
// address rots the first time a line lands above it (objectui#7853), and
2504+
// nothing here re-derives either kind of citation. The others are shapes the
2505+
// matcher must refuse whether or not anything writes them today. An
2506+
// assertion that red on `FieldValidationRules` would be deleted by the first
2507+
// person who hit it, and the claim would be back to unguarded.
25042508
for (const source of [
25052509
'export interface ValidationRule {\n type: string;\n}',
25062510
'export type ValidationRule = { type: string };',
@@ -2515,13 +2519,18 @@ describe('objectui#5118 — the plugin-form page teaches the real `validation` s
25152519
}
25162520

25172521
for (const source of [
2518-
'export interface AdvancedValidationRule {}', // packages/types/src/data-protocol.ts:708
2519-
"export type ValidationRuleType = 'required';", // packages/types/src/data-protocol.ts:748
2520-
'export type ObjectValidationRule = { name: string };', // packages/types/src/data-protocol.ts:1129
2521-
'export interface DesignerValidationRule {}', // packages/types/src/designer.ts:762
2522-
'export interface FieldValidationRules {}', // packages/types/src/form.ts:744
2523-
'interface ValidationRuleDraft {}', // app-shell ObjectValidationsPanel.tsx:46
2524-
'interface BaseValidationRuleShape {}', // quoted at types/src/data-protocol.ts:980
2522+
// SYNTHETIC. objectui#10719 retired both names; its retirement pin
2523+
// (`phase35-validation-types-retired-10719.test.ts` in `packages/types`)
2524+
// keeps them out of `@object-ui/types`. They stay as negatives for their
2525+
// shapes, not their provenance: `ValidationRuleType` is the only negative
2526+
// here that puts a SUFFIXED name on the `type … =` branch.
2527+
'export interface AdvancedValidationRule {}',
2528+
"export type ValidationRuleType = 'required';",
2529+
'export type ObjectValidationRule = { name: string };', // packages/types/src/data-protocol.ts
2530+
'export interface DesignerValidationRule {}', // packages/types/src/designer.ts
2531+
'export interface FieldValidationRules {}', // packages/types/src/form.ts
2532+
'interface ValidationRuleDraft {}', // app-shell studio-design/ObjectValidationsPanel.tsx
2533+
'interface BaseValidationRuleShape {}', // a spec type, quoted in the `ConditionalValidation` docblock of types/src/data-protocol.ts
25252534
"import { ValidationRuleSchema } from '@objectstack/spec/data';",
25262535
"export { ValidationRuleSchema } from '@objectstack/spec/data';",
25272536
'export function buildValidationRules(field: unknown) {\n return field;\n}',

0 commit comments

Comments
 (0)