This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(scripts): pin the retired-field-key tombstone registry as the designer parity gate's single source - #7290
Merged
Conversation
…esigner key-parity gate `check-designer-field-key-parity.mjs` now reads `packages/types/src/internal/retired-field-keys.ts` (the objectui#6527 registry) off the tracked source via the TypeScript AST — the same walk it already uses for `PAYLOAD_SHAPES`, so the gate gains no build precondition — and derives one rule from it: a retirement is NOT waivable at a site that strips the key. Where a wire shape IS one of the registry's strip sites and the tombstone marks that site `true`, a `KNOWN_UNPARSEABLE_KEYS` row can no longer quiet the key; the violation cites the registry entry instead of inviting a new ledger row, and the row itself is reported as stale. The per-site asymmetry survives as DATA: the rule is evaluated per (key, site), the citation reproduces the tombstone's columns verbatim on both the stripped and NOT-stripped sides, and the read door — which declares no payload shape (coverage note 3) — is recorded shapeless so nothing is ever asserted there. That keeps objectui#6526 option B (`formula` must NOT be stripped at the read door) structurally out of the gate's reach. A registry site the gate accounts for nowhere, a shape naming a site the registry does not declare, and every unreadable registry are `ExtractionError`s, never a pass. Columns consumed: `key`, `retiredBy`, `sites`. `specEquivalent` and `defensive` are deliberately not read. The registry's own contract stays pinned by `packages/types/src/__tests__/retired-field-key-tombstones.test.ts` and is not duplicated here. Fixes #6699 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #6699
Makes the objectui#6527 tombstone registry the parity gate's single source for retirement. A registry with no gate pinning it is a convention, and conventions drift — this repo's own history is the proof the card cites.
File surface, as dispatched:
scripts/check-designer-field-key-parity.mjsandscripts/__tests__/check-designer-field-key-parity.test.tsonly. The registry, its test, the three strip sites andpermission-slice.tsare untouched.Measured premise (re-measured on this base,
eb33a8d4c)The gate carried no retired-key set of its own — the card's "derive what it checks from the registry" had no existing copy to delete:
KNOWN_UNPARSEABLE_KEYSis{}at run time (node -e "... Object.keys(m.KNOWN_UNPARSEABLE_KEYS)"prints[]). It is a different ledger anyway: card-anchored keys whose resolution is still OPEN, with theformula/sortOrderrows already resolved and removed.git grep -n "RETIRED\|retired\|tombstone"over the gate returned only prose — the header'sRETIRED_FIELD_KEYS = ['indexed']sentence is history (lines 51-58), plus one comment.So the deliverable had to be a concrete, non-vacuous derivation, proven by ablation. It is; the ablation table below is the proof.
The derivation shipped
A retirement is not waivable at a site that strips the key. Where a wire shape IS one of the registry's strip sites (
stripSite) and the tombstone marks that sitetrue, aKNOWN_UNPARSEABLE_KEYSrow can no longer quiet the key. The ledger is for keys whose resolution is still open; a tombstoned key's resolution already happened, on the card the tombstone names, so a fresh row would re-open a settled retirement in silence — the ledger becoming the hiding place the header's ratchet note says it must never be. The violation cites the registry entry instead of the "file a card and record it inKNOWN_UNPARSEABLE_KEYS" invitation, and the row itself is reported as stale with the registry's reason.Two
ExtractionErrorlink checks come with it, in both directions:stripSitethe registry does not declare (a renamed site must not leave a shape enforcing nothing);The registry is read from the tracked source
packages/types/src/internal/retired-field-keys.tsthrough the TypeScript AST — the same walkPAYLOAD_SHAPESalready use — not through the built@object-ui/types/internal/retired-field-keyssubpath, so the gate gains no build precondition and still runs on a cold cache. Extraction failure is anExtractionError, never a pass and never a silent skip: missing file, missing constant, empty tombstone array, a tombstone with nokeyor noretiredBy, a non-boolean column, or asitesrecord naming a site outsideRETIRED_FIELD_KEY_SITES. The header's two standing constraints are kept as they were: extraction failure is an ERROR, and the accept set is still read from the installed schema and never listed in the file.Rejected, with the measurement
FieldSchema"). Rejected as a duplicate.packages/types/src/__tests__/retired-field-key-tombstones.test.tsalready pins exactly this, per key, withunrecognized_keysasserted and a positive control: "every registry key is refused BY NAME by the installed FieldSchema" (lines 104-113). A second copy of an assertion is a second thing to keep honest. The gate leans on route (i) instead, and its header says so.inForcetoObject.values(sites).some(Boolean)and two pins go red. A flat set decidessortOrderatMetadataFieldsPageandformulaat the read door in the direction the registry refused.isSystemandreferenceToare tombstoned keys the in-memory model still declares, the converters strip them, anduiOnlyis the correct verdict. They are now annotated with their retiring card in the run log instead — visible, not red.Per-site columns: consumed vs deliberately not
keyretiredBysitesinForceissites[thisShape.stripSite] === true; the whole record is reproduced verbatim in the citation, on both the stripped and NOT-stripped sidesspecEquivalentformula(FieldSchemavalidates the key, not the language, so a blind rename launders non-CEL text into a formula that parses green and evaluates to null). A gate that read it would sooner or later suggest it.defensiveThe asymmetry survives as data, and is measured:
formulaat the read door. The gate asserts nothing atmetadataAdminFieldsReadDoorand cannot: the read door declares no payload shape at all (coverage note 3 —readFieldscarries rawRecorddefs), so it is recorded inSITES_WITH_NO_DECLARED_SHAPEwith that reason and no shape can name it. WhereformulaIS cited, the read door appears only on the NOT stripped at side — the registry's own word for it, never inverted. This keeps objectui#6526 option B structurally out of the gate's reach: "the READ door must NOT strip it (false) — RULED, objectui#6526 option B … Flipping thisfalseis overturning a maintainer ruling, not tidying an inconsistency."sortOrder's single site. Treated exactly as the registry states it —trueatmetadataServiceCarryOver,falseatmetadataFieldsPageCarryOver. One key, one ledger row, two sites, two different verdicts: at the stripping site the row is refused; at the other the ordinary ledger path applies and the row is honoured, because there the registry makes no claim to enforce. That pair is a test (⭐ the SAME key at a site whose column is false …) and it is what a flattened set cannot produce.sortOrderis refused at both levels by two different schemas and is two different cards (objectui#6045 field-level, objectui#6223 object-level). The citation is scoped toFieldSchema, so the object-level card's own ledger row still works — pinned, and visible in the run log whereObjectDefinition'ssortOrderis the one uiOnly entry carrying no citation.Ablation table
Every leg: mutate, prove the mutation ON DISK by text count and by
git hash-objectdiffering from the HEAD blob, measure, restore, prove the restore by blob hash equal to HEAD and an emptygit diff HEAD— never by an exit code. The harness carriestrap ... EXIT INT TERMwith absolute paths, so a mid-run kill cannot leave the tree mutated. A1-A5 mutate the gate (mine to mutate, in my worktree); A6 mutates a copy of a real wire-shape file, because the strip sites are fenced.waivable && !(retired && retired.inForce)to!(false && …))3b2062f3vs HEAD93a13cf5expected [] to deeply equal [ 'formula:true' ],[ 'sortOrder:true' ]tombstones: []) — the silently-empty readed705770expected [] to deeply equal ArrayContaininginForceignores the per-site column5fdf7abcfalse-column case starts refusing the waiver (expected [ {…} ] to deeply equal []) andinForceflips (expected true to be false)SITES_WITH_NO_DECLARED_SHAPEbb3c5cc7EXTRACTION FAILED … declares strip site(s) 'metadataAdminFieldsReadDoor' this gate accounts for nowhere; 30 test failuresstripSitevalues)[metadataFieldsPageCarryOver, metadataServiceCarryOver], blobdeb1e32fFieldMetadataPayload is mapped to the wrong siteformulaon a copy ofMetadataService.ts+ a matching ledger row57277b29vs original HEAD blobe41a23fa; original blob after the rune41a23fa(untouched),git diff HEADemptywaiverRefused: true,retiredBy: objectui#6043,inForce: true,strippedAt: [metadataServiceCarryOver, metadataFieldsPageCarryOver],notStrippedAt: [metadataAdminFieldsReadDoor]; stale row: "the registry retires it (objectui#6043) andmetadataServiceCarryOverstrips it — a retirement cannot be waived by a ledger row"Every restore leg printed
blob == HEADandgit diff HEAD: ''; the harness's final line confirms a clean tree.Gate verdict lines, before and after
Before (
eb33a8d4c, exit 0) and after (2c9a1ec26, exit 0) both end indesigner-field-key-parity: OK. The run gained the registry block, so a silently empty extraction cannot read as "nothing is retired" in a green log:and the two retired spellings still on the UI model are now annotated rather than reading as ordinary UI keys:
(the object-level
sortOrderdeliberately carries none — different oracle, different card.)Gates run, with their own verdict lines — all at
2c9a1ec26, the final commitExit codes captured by redirect-then-
$?, never through a pipe.pnpm exec vitest run scripts/__tests__/check-designer-field-key-parity.test.ts scripts/__tests__/zod-wrapper-keys.shared.test.ts --maxWorkers=2Test Files 2 passed (2)/Tests 69 passed (69)— the parity file went 45 to 62 casespnpm check:designer-field-key-paritydesigner-field-key-parity: OKpnpm type-check:scriptstsc -p tsconfig.scripts.json)pnpm check:control-bytescheck-control-bytes: OK (scanned 6008 tracked text file(s); skipped 85 binary).pnpm check:entry-guardcheck:entry-guard: 58 scripts/ file(s) — no entry guard outside the baseline; … 52 export bindings, 52 of them inert on importpnpm check:esm-specifiersno un-ledgered package emits an extensionless relative specifiernode scripts/check-changeset-presence.mjsNo source or published contract of a released package changed in this range, so no changeset is owed.(2 files changed, 0 published source)Declared narrowing — lint. Repo-wide
pnpm lintwas NOT run; it is a repo scan CI owns, and it is not in this card's gate list.eslint --no-inline-configwas run on the two changed files: 0 errors, 0 warnings, and the narrowing is measured rather than assumed — (1) the universe read from ESLint's OWN config via its API (isPathIgnored+calculateConfigForFileover every tracked file): 4024 of 6093 tracked files carry rules, 1964 are ignored by eslint's own config, 105 match no rule-carrying entry; (2) files actually linted, from--format json: 2; (3)eslint.config.jsdeclares noparserOptions.projectand noprojectService, so type-aware linting is off and no rule's verdict on an untouched file can move with this diff — the only cross-file rule configured isno-restricted-imports, which is per-file, and the only file importing the gate is its own test, which was linted.No console build was needed and no heavy verify was run, so the shared verify lock was not taken.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
Generated by Claude Code