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

Commit 7478334

Browse files
test(console): parity ledger reads a retirement from the spec, and no older reason may hide one (objectui#10033) (#10391)
Fixes #10033 Clause-②: no ## The card's question, answered from the test's own population logic **Is the waiver population derived from the spec at all?** Yes. And retired keys are **in** it, in a special form. That makes this case (b) of the dispatch. - **Population.** `covered`, `registeredWithoutInputs` and `accounts for every spec-carried block` all start from `Object.keys(ComponentPropsMap)`. The partition test requires `covered` ∪ `registeredWithoutInputs` ∪ `UNJUDGED_SPEC_BLOCKS` to equal that set exactly, with each block counted once. - **A stale waiver (a key outside the population) is already caught, in two places.** The first is the partition's converse (`accounted for a block ComponentPropsMap does not carry`). The second is the ledger rot check (`is ledgered but the spec no longer carries it — delete the entry`). So this PR adds no new tripwire for that case. - **Retired keys stay in the population, because the spec keeps their rows on purpose.** The row is one of the retirement's refusal doors. Readings from the installed `@objectstack/spec` 17.4.0 (lockfile-resolved), taken at base `ea02938cd`, using the `@object-ui/test-support` tombstone judge: | type | in `PageComponentType` | in `RETIRED_PAGE_COMPONENT_TYPES` | row keys listed / tombstoned / authorable | empty bag parses | |:--|:--|:--|:--|:--| | `user:profile` | no | **yes** | 0 / 0 / 0 (`z.never`) | refused | | `element:form` | no | no | 6 / 6 / 0 | accepted | | `element:filter` | no | no | 6 / 6 / 0 | accepted | | controls: `cloud-connection:panel`, `marketplace:installed-list`, `mcp:connect-agent` | no | no | 0 / 0 / 0 | accepted | Three things follow from that reading: - **Mechanism assumption 3 is half false.** `RETIRED_PAGE_COMPONENT_TYPES` has exactly one member, `user:profile`. `element:form` left `PageComponentType` through the **element-grain** retirement (objectstack#9249, listed in the spec's 17.3.0 changelog), not through that table. `element:filter` left the same way earlier (objectstack#9220, 17.1.0). So "read the spec's retired set" as that table alone would not cover `element:form`. - **Excluding retired rows from the population is the wrong way round.** A registration of a retired type in this repo would drop out of `covered` together with its row, and nothing would judge it. objectui#8176 built this ledger to end exactly that absence. With the rows kept in, such a registration is judged (every input it publishes is off-spec) and is also counted twice, which the partition refuses. - **Both waiver reasons the card names are false today.** `user:profile` is false in both halves, as the card measured. `element:form` cites a `block-types.ts` palette exclusion that says "no renderer — use the object-bound `object-form` block". That entry was deleted by commit `639114c4d`, the delivery of objectui#7122 through PR #7685. It now appears in that file only as a note that the type is RETIRED UPSTREAM. ## What changed (test-only, one file plus an empty changeset) 1. **`isRetiredUpstream(type)`** reads both of the spec's retirement spellings, and never a list kept here. A type counts as retired when it is out of `PageComponentType` **and** one of these holds: - it is named in `RETIRED_PAGE_COMPONENT_TYPES` (retired by name); - its row lists keys and every one of them is a tombstone (retired at element grain). Leaving the enum is required but is not enough on its own: the controls above are outside the enum too, and the predicate answers `false` for them. 2. **A third ledger class, `RETIRED UPSTREAM`.** The rot check asserts two things for it: `isRetiredUpstream(type)` is true, and the accepted key set is empty. If upstream restores the type or gives its row a key, the entry goes red. 3. **The class-closing guard.** An entry under `EMPTY SPEC SHAPE` or `NOT REGISTERED, DELIBERATELY` now fails when the spec retires its type. That is the check that stops a hand-written reason from outliving a retirement, which is what happened to both entries here. 4. **Entries rewritten.** `user:profile` and `element:form` now say what is true, citing the upstream ruling and landing (objectstack#14159, objectstack#15112, objectstack#9249) and the objectui-side reconciliation (objectui#7122). - ⚠️ `element:filter` moves too. This is an in-place fix under the same-class exemption, and I am naming it here because the claim's file surface names only the other two entries. It was retired at element grain by objectstack#9220 (17.1.0), and its `EMPTY SPEC SHAPE` reason never mentioned that. The new guard turns exactly that state red, so leaving it behind would not pass. It is the same file, the same defect class and the same gate, with nothing new to verify. 5. **The docblock** now has three classes (it said two) and a paragraph on why a retired block stays in the population. The census does not move: `specCarried` 45, `judged` 29, `registeredPropless` 7, `ledgeredUnjudgeable` 9. It is the same nine entries under corrected reasons. **Changeset.** The dispatch expected none. `node scripts/check-changeset-presence.mjs` refused without one, because it counts any file under a released package's `src/`, test files included. So the PR adds `.changeset/10033-parity-ledger-retired-upstream.md` with an **empty frontmatter**, which declares that nothing is released. The gate now passes. ## Verification record at head `4893d87cb` Every exit code is captured before any pipe, and each verdict line is quoted from the gate's own output. | step | result | |:--|:--| | `pnpm exec vitest run apps/console/src/__tests__/registry-inputs-spec-parity.test.ts scripts/__tests__/check-installed-spec-pin-claims.test.ts` (repo root, under `os-verify-lock.sh`). The second file is the only other test that reads this file, by content. | `Test Files 2 passed (2)` · `Tests 228 passed (228)` · `VERDICT command-exit 0` | | same parity file at base `ea02938cd`, before the edit (control: the stale reasons were green then) | `Tests 199 passed (199)` | | `pnpm exec turbo run build --filter='@object-ui/console^...' --concurrency=2` (the dependency closure the type-check reads, under the lock) | `Tasks: 34 successful, 34 total` · `VERDICT command-exit 0` | | `pnpm --filter @object-ui/console type-check` (script echoed: `tsc --noEmit && tsc -b tsconfig.node.json --force`) | exit 0. `tsc --listFiles -p apps/console/tsconfig.json` includes `registry-inputs-spec-parity.test.ts` (1 hit), so the test file is in the checked set. | | eslint on the touched file (`apps/console`, the console's own `eslint .` config) | exit 0 · `--format json`: 1 file, 0 errors, 0 warnings. **This is a narrowing, with its evidence:** (1) the population comes from eslint's own config, where `isPathIgnored` is false for the test file and true for the changeset; (2) the file count comes from the JSON output; (3) type-aware linting is off (`calculateConfigForFile` shows no `parserOptions.project` or `projectService`), so this diff cannot change the verdict on any file it does not touch. | | `pnpm check:control-bytes` | `OK (scanned 8435 tracked text file(s); skipped 85 binary)` | | `pnpm check:new-line-citations` | `VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0` | | `node scripts/check-changeset-presence.mjs` | exit 0 · `1 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)` (empty frontmatter) | | `pnpm check:changeset-claims` | exit 0 (report-only). It names one pending changeset that mentions this file, `.changeset/8067-component-input-member-kind.md`. I read that paragraph: it is about `page:header.actions` and is still true. | | `check-changeset-no-major` · `-overwrite` · `-fixed` · `check-pending-changeset-literals` · `check-installed-spec-pin-claims` · `check-test-path-roots` · `check-vi-mock-{specifiers,inherit,override-shape}` · `check-type-check-coverage` · `check-lint-coverage` | all exit 0 | | `node scripts/check-governed-queue-guard.mjs --test` over both paths | `NOT GOVERNED — 2 path(s) checked against 5 governed surface(s); none matched.` | objectui has no `dispatch-gates.mjs`. I derived the gate list by hand from `.github/workflows/*.yml`, keeping the gates whose scripts read test sources, `apps/console` or `.changeset/`. The full `pnpm lint` and `pnpm test` shards are left to CI. ## Ablation: three legs, from the committed state Each leg used `node ../objectstack/scripts/ablation-replace.mjs` in wrap mode, with the test running under the lock. I wrote down the expected result before each run: exactly one failed test, the rot check, naming the mutated type. The observed direction was red on all three, as expected. | leg | mutation (landing proven: anchor count 1 → 0, blob changed) | result | |:--|:--|:--| | 1 | `user:profile` entry → its exact pre-fix text | `1 failed / 198 passed` · `user:profile is retired upstream, and its ledger reason does not say so — rewrite the entry as RETIRED UPSTREAM` | | 2 | `element:form` entry → its exact pre-fix text | `1 failed / 198 passed` · `element:form is retired upstream, and its ledger reason does not say so …` | | 3 | specificity control: `cloud-connection:panel` (outside the enum, empty shape, not retired) relabelled `RETIRED UPSTREAM` | `1 failed / 198 passed` · `cloud-connection:panel is ledgered as retired upstream, and the spec does not retire it …` | Every restore was `git checkout HEAD --` on the absolute path, proven by blob == HEAD (`f714fdd786dc`), `git diff HEAD` empty and `git status --porcelain` empty. The control run at the base (199 passed) shows that legs 1 and 2 describe a state that was green before this PR. ## Acceptance notes - Nothing is filed. There are no class a/b/c findings from this run. - AGENTS.md #11 asks for opportunistic repair of cross-file `path:line` citations in a file you touch. This file has older ones, outside the ledger entries, and I left them alone because the claim's surface is the ledger. Nobody is carrying that repair. - `ai:chat_window`'s `NOT REGISTERED, DELIBERATELY` reason was re-read against `placeholders.tsx` and `block-types.ts` and is still true. The new guard also passes for it. --- _Generated by [Claude Code](https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3ef0b51 commit 7478334

2 files changed

Lines changed: 89 additions & 5 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
4+
Test-only change to the console's registry-inputs spec-parity gate; no published behaviour changes. The unjudged-block ledger gains a third reason class, RETIRED UPSTREAM, checked against the spec's own retirement signals, and the two older reasons now fail on a type the spec retired. `user:profile`, `element:form` and `element:filter` move to it.

‎apps/console/src/__tests__/registry-inputs-spec-parity.test.ts‎

Lines changed: 85 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@
244244

245245
import { describe, it, expect } from 'vitest';
246246
import { ComponentRegistry } from '@object-ui/core';
247-
import { ComponentPropsMap, PageComponentSchema } from '@objectstack/spec/ui';
247+
import {
248+
ComponentPropsMap,
249+
PageComponentSchema,
250+
PageComponentType,
251+
RETIRED_PAGE_COMPONENT_TYPES,
252+
} from '@objectstack/spec/ui';
248253
import { MANIFEST_INPUT_TYPES, inputTypeArms } from '@object-ui/sdui-parser';
249254
import type { ComponentInput } from '@object-ui/types';
250255
import {
@@ -616,6 +621,33 @@ const EXPECTED_WITHOUT_INPUTS = [
616621
'nav:menu',
617622
];
618623

624+
/**
625+
* Has `@objectstack/spec` RETIRED this block, keeping its `ComponentPropsMap`
626+
* row only as a refusal door? (objectui#10033)
627+
*
628+
* Read from the spec, never listed here. The spec retires a page component type
629+
* in one of two spellings, and both drop the value from `PageComponentType`:
630+
*
631+
* - REFUSED BY NAME — the type is a key of `RETIRED_PAGE_COMPONENT_TYPES`
632+
* (`page.zod.ts`), and its row is `retiredComponentProps(type)`: a `never`
633+
* that refuses every props bag, `{}` included. It lists no key at all, so
634+
* the tombstone reading below cannot see it; the table is the signal.
635+
* - ELEMENT GRAIN — no table names the type; the retirement IS the row, kept
636+
* with every key it lists a `retiredKey()` tombstone. It lists keys and
637+
* accepts none of them.
638+
*
639+
* Absence from `PageComponentType` is required and is not enough on its own:
640+
* the enum is the page-authoring vocabulary, and live blocks sit outside it
641+
* too — every `object-*` block, and empty-shaped ones such as
642+
* `cloud-connection:panel`. A row that merely accepts no key is the EMPTY SPEC
643+
* SHAPE class below, not a retirement.
644+
*/
645+
function isRetiredUpstream(type: string): boolean {
646+
if ((PageComponentType.options as readonly string[]).includes(type)) return false;
647+
if (RETIRED_PAGE_COMPONENT_TYPES.has(type)) return true;
648+
return specTombstonedKeys(type).length > 0 && specTopLevelKeys(type).length === 0;
649+
}
650+
619651
/**
620652
* The third and last place a `ComponentPropsMap` entry may land: blocks this
621653
* gate CANNOT judge, each with the reason it cannot (objectui#8176).
@@ -632,11 +664,17 @@ const EXPECTED_WITHOUT_INPUTS = [
632664
* a block can no longer leave the judged population without a line here saying
633665
* so and a diff someone reviews.
634666
*
635-
* ## Two classes, each mechanically checked so an entry cannot rot
667+
* ## Three classes, each mechanically checked so an entry cannot rot
636668
*
637669
* `every unjudged-block ledger entry still describes a block this gate cannot
638670
* judge` asserts the reason, not just the name:
639671
*
672+
* - RETIRED UPSTREAM — the spec retired the type and keeps its row only as a
673+
* refusal door, so the row accepts no authoring key and neither direction
674+
* has a question to ask. Asserted as `isRetiredUpstream(type)`, which reads
675+
* the retirement from the spec rather than from a list here, plus
676+
* `specTopLevelKeys(type).length === 0` — so the day upstream restores the
677+
* type, or gives its row a key, this entry goes red.
640678
* - EMPTY SPEC SHAPE — `ComponentPropsMap[type]` accepts no top-level key at
641679
* all, so neither direction has a question to ask. Whether this repo happens
642680
* to register the block is irrelevant to that, which is why it is the
@@ -651,6 +689,27 @@ const EXPECTED_WITHOUT_INPUTS = [
651689
* assertion cannot be satisfied by the very stub-blindness objectui#8176 is
652690
* about), so registering one of them forces this entry out.
653691
*
692+
* The first class is EXCLUSIVE, and that is what keeps a hand-written reason
693+
* from outliving a retirement (objectui#10033): an entry under either of the
694+
* other two reasons FAILS when the spec retires its type. Before that check, a
695+
* retirement changed what an entry was about and nothing told the entry — two
696+
* rows the spec retired in the same release sat here under two unrelated
697+
* reasons, neither of which mentioned the retirement, and one of which cited a
698+
* palette exclusion that release's reconciliation had deleted.
699+
*
700+
* ## Why a retired block stays in this population
701+
*
702+
* The population is `Object.keys(ComponentPropsMap)`, and the spec KEEPS a
703+
* retired type's row on purpose: the row is one of the retirement's refusal
704+
* doors, and it is what lets every reader that dispatches on the map still
705+
* recognise the name. Dropping retired rows from the population here would
706+
* reopen the absence this ledger exists to close — a registration of a retired
707+
* type in this repo would leave `covered` along with the row, and go unjudged.
708+
* Kept in, such a registration is judged (every input it publishes is
709+
* off-spec) and is accounted for twice, which the partition refuses. A ledger
710+
* entry for a type the map no longer carries at all is the opposite case, and
711+
* already fails twice over: in the partition's converse and in the rot check.
712+
*
654713
* `aria` is not a member of the empty-shape reasoning: it is a key on non-empty
655714
* shapes and has its own uniform cover in `GLOBALLY_UNPUBLISHED_SPEC_KEYS`.
656715
*/
@@ -662,17 +721,17 @@ const UNJUDGED_SPEC_BLOCKS: Record<string, string> = {
662721
'cloud-connection:panel':
663722
'EMPTY SPEC SHAPE. New in `@objectstack/spec` 17.3.0, which declares it with no top-level key at all, so neither direction has a question to ask. It IS registered — `app-shell/src/console/cloud-connection/CloudConnectionPanel.tsx` registers it propless — but by `@object-ui/app-shell`, which this file does not import; the empty shape is the load-bearing half either way, exactly as for `app:launcher` above. objectui#7122, ledger objectui#8176.',
664723
'element:filter':
665-
'EMPTY SPEC SHAPE. The pin declares no top-level key for it, and no package in this repo registers the tag. Nothing to judge on either count. objectui#8176.',
724+
'RETIRED UPSTREAM. `@objectstack/spec` 17.1.0 retired it at element grain (objectstack#9220, ADR-0049): out of `PageComponentType`, and its row kept with every key a `retiredKey()` tombstone, so it accepts no authoring key and neither direction has a question to ask. objectui#10033, ledger objectui#8176.',
666725
'element:form':
667-
'NOT REGISTERED, DELIBERATELY. `app-shell/src/views/metadata-admin/previews/block-types.ts` records the reason verbatim: no renderer, use the object-bound `object-form` block, which IS registered and IS judged here. objectui#8176.',
726+
'RETIRED UPSTREAM. `@objectstack/spec` 17.3.0 retired it at element grain (objectstack#9249, ADR-0049), the `element:filter` shape one element over: out of `PageComponentType`, and its row kept with every key a `retiredKey()` tombstone whose prescription names the live replacement — the object-bound `object-form` block, which IS registered and IS judged here. objectui#10033, ledger objectui#8176.',
668727
'global:notifications':
669728
'EMPTY SPEC SHAPE. Same shape and same reasoning as `app:launcher` above: `app-shell/src/views/global-notifications-renderer.tsx` registers it propless because the spec shape is empty, and that registration is not in this file\'s import graph. objectui#8176.',
670729
'marketplace:installed-list':
671730
'EMPTY SPEC SHAPE. New in `@objectstack/spec` 17.3.0, which declares it with no top-level key at all. Registered propless by `@object-ui/app-shell` (`src/console/marketplace/InstalledListWidget.tsx`), outside this file\'s import graph; the empty shape is the load-bearing half either way. objectui#7122, ledger objectui#8176.',
672731
'mcp:connect-agent':
673732
'EMPTY SPEC SHAPE. New in `@objectstack/spec` 17.3.0, which declares it with no top-level key at all. Registered propless by `@object-ui/app-shell` (`src/console/connect/ConnectAgentWidget.tsx`), outside this file\'s import graph; the empty shape is the load-bearing half either way. objectui#7122, ledger objectui#8176.',
674733
'user:profile':
675-
'EMPTY SPEC SHAPE. Declared by the spec with no top-level key; in this repo it exists only as a `PROTOCOL_COMPONENTS` placeholder name, which is a scaffold rather than a renderer and publishes no authoring surface. objectui#8176.',
734+
'RETIRED UPSTREAM. `@objectstack/spec` 17.3.0 retired it by name (objectstack#14159, landed by objectstack#15112): out of `PageComponentType`, named in `RETIRED_PAGE_COMPONENT_TYPES`, and its row `retiredComponentProps` — a `never` that refuses every props bag, `{}` included — so there is no authoring surface for either direction to judge. The same release\'s reconciliation here (objectui#7122) took it out of `PROTOCOL_COMPONENTS` in `@object-ui/components` `renderers/placeholders.tsx`, so not even the placeholder scaffold stands in for it. objectui#10033, ledger objectui#8176.',
676735
};
677736

678737
/*
@@ -3707,6 +3766,27 @@ describe('registry `inputs` vs `@objectstack/spec` ComponentPropsMap (repo-wide)
37073766
Object.keys(ComponentPropsMap),
37083767
`${type} is ledgered but the spec no longer carries it — delete the entry`,
37093768
).toContain(type);
3769+
if (reason.startsWith('RETIRED UPSTREAM')) {
3770+
// Both halves, so neither can rot alone: the spec still retires the
3771+
// type, and its kept row still accepts nothing.
3772+
expect(
3773+
isRetiredUpstream(type),
3774+
`${type} is ledgered as retired upstream, and the spec does not retire it — ` +
3775+
'give the entry its real reason, or judge the block',
3776+
).toBe(true);
3777+
expect(
3778+
specTopLevelKeys(type),
3779+
`${type} is ledgered as retired upstream, and its row accepts keys — judge it`,
3780+
).toEqual([]);
3781+
continue;
3782+
}
3783+
// objectui#10033: the other two reasons may not describe a retired type,
3784+
// or a retirement leaves a reason in place that no longer says why.
3785+
expect(
3786+
isRetiredUpstream(type),
3787+
`${type} is retired upstream, and its ledger reason does not say so — ` +
3788+
'rewrite the entry as RETIRED UPSTREAM',
3789+
).toBe(false);
37103790
if (reason.startsWith('EMPTY SPEC SHAPE')) {
37113791
expect(
37123792
specTopLevelKeys(type),

0 commit comments

Comments
 (0)