diff --git a/.changeset/36403-view-column-state-retired.md b/.changeset/36403-view-column-state-retired.md new file mode 100644 index 00000000000..cde2f0ae4a4 --- /dev/null +++ b/.changeset/36403-view-column-state-retired.md @@ -0,0 +1,25 @@ +--- +'@objectstack/spec': minor +--- + +fix(spec)!: retire `columnState` from the stored `view` row — column widths live in each reader's browser and a column order is saved into the view itself + +Clause-②: no (narrowing) — `columnState` stops being an accepted key on a view item record and on a flattened view overlay; no published export is removed +Metadata-protocol: narrowed + + + +**BREAKING** for a stored `view` row, a package view or a source that still carries `columnState`. The key held the console grid's per-user column order and widths on a shared view row (admitted as a runtime-only overlay key in 17.1.0). Since #35955 nothing writes it: a column drag goes to the list's draft and is saved into the view's own `columns` / `fieldOrder`, and column widths are kept in the reader's browser, per view. Until this release a stored layout was still applied: a reader with no column order or widths of their own in the browser saw the order and widths the row held. It is not carried forward (the maintainer's ruling on #35955, restated on #36403 in comment 7079029398: a stored layout is not migrated): from this release that reader sees the view's own columns, column order and widths. No stored order is moved into `fieldOrder`; to keep a layout for everyone, reorder the columns and Save to the view, or set `width` on the columns. + +What moves (each line FROM → TO): + +- `columnState` on a view item record (`ViewItemWireSchema`, member 1 of the `view` union the `PUT /api/v1/meta/view/:name` save validates) and on a flattened view overlay (`VIEW_METADATA_MEMBERS.listOverlay` / `formOverlay`): FROM `{ order?: string[]; widths?: Record }` accepted and stored TO a `retiredKey()` tombstone — the save answers 422 `INVALID_METADATA` with the prescription at the key, and `tsc` types the key `never`. +- `VIEW_CONSOLE_ROUND_TRIP_KEYS` (`@objectstack/spec/ui`): FROM six keys TO five; `columnState` is gone, so the console derivations read off it (`@object-ui/data-objectstack`'s `listViews()` row keys, `@object-ui/app-shell`'s view-config save) stop carrying it without an edit. +- `columnState` on an authored view item or a list view body: still refused by name, now with the retirement text instead of the runtime-only note. +- a stored `view` row (every read replays the conversions before the row is served or badged), a package export or environment artifact (`viewItems`), and a source run through `os migrate meta --from 17`: the D2 conversion `view-column-state-removed` deletes the key from a view item record and from a flattened overlay; containers are untouched. + +The fix: delete the key. To ship a default column order, list `columns` in that order (or set `fieldOrder`); to ship a default width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources, and `os migrate meta --stored --apply` to rewrite stored rows. + +One stored class is not brought back into the accept set: an overlay row that held nothing but its identity (`name` / `object` / `viewKind` / `label`) and `columnState` — what a column drag on a system view wrote before the overlay writer retired — is left identity-only, which the `view` door refuses ("only identity fields"). It is served badged invalid and `--apply` reports it `failed`. Delete such a row; it held only a column layout that is not carried forward. D3 entry: `view-column-state-retired`. + +The retirement kit: `retiredKey()` tombstones in `ui/view.zod.ts`, D2 `view-column-state-removed` (step 18), `RETIRED_KEYS_BY_MAJOR[18]` rows `ui/ViewItemWire:columnState` and `ui/ViewMetadata:columnState`, D3 `view-column-state-retired`, the regenerated `view.mdx` reference, and the pin `ui/view-column-state-retirement.test.ts`. diff --git a/content/docs/references/ui/view.mdx b/content/docs/references/ui/view.mdx index 9779e690ef6..7c132674c7d 100644 --- a/content/docs/references/ui/view.mdx +++ b/content/docs/references/ui/view.mdx @@ -2338,7 +2338,7 @@ This schema accepts one of the following structures: | **isPinned** | `boolean` | optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. | | **sortOrder** | `integer` | optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. | | **visibility** | `Enum<'private' \| 'team' \| 'organization' \| 'public'>` | optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. | -| **columnState** | `{ order?: string[]; widths?: Record }` | optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored) | +| **columnState** | `never` | optional | [REMOVED] `view.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it held one column order and set of widths on a shared view row; nothing writes it any more, and a stored layout is no longer applied, so every reader sees the view's own column order and widths. The console keeps column widths in each reader's browser and saves a column order into the view itself. Delete the key. To ship a column order, list `columns` in that order (or set `fieldOrder`); to ship a width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **options** | `never` | optional | Refused: a view item record carries no top-level `options` bag. Its per-kind blocks live under `config` (`config.kanban`, `config.timeline`, …); the legacy `options.KIND` bag belongs to the flattened list overlay only. | ### Nested Shape: `ViewItemWire[viewKind='list'].config` @@ -2408,13 +2408,6 @@ This schema accepts one of the following structures: | **package** | `string` | ✅ | The base package id whose same-named item this item replaces whole (e.g. "com.acme.crm"). Only an item of the base's paired "``.custom" package declares an override. | | **basedOn** | `string` | ✅ | Recorded, never a gate: the base package's `manifest.version` this override was taken from (e.g. "3.2.0"), not a history version of the item. Nothing is refused, merged or rebased on it; it tells a person re-basing the override where it started. One reader, as advice: a base's upgrade plan lists an override whose `basedOn` is not the installed base version as stale, beside each override whose base item the upgrade changes (ADR-0146 D2, as amended). | -### Nested Shape: `ViewItemWire[viewKind='list'].columnState` - -| Property | Type | Required | Description | -| :--- | :--- | :--- | :--- | -| **order** | `string[]` | optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). | -| **widths** | `Record` | optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). | - --- #### Option 2 @@ -2445,7 +2438,7 @@ This schema accepts one of the following structures: | **isPinned** | `boolean` | optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. | | **sortOrder** | `integer` | optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. | | **visibility** | `Enum<'private' \| 'team' \| 'organization' \| 'public'>` | optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. | -| **columnState** | `{ order?: string[]; widths?: Record }` | optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored) | +| **columnState** | `never` | optional | [REMOVED] `view.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it held one column order and set of widths on a shared view row; nothing writes it any more, and a stored layout is no longer applied, so every reader sees the view's own column order and widths. The console keeps column widths in each reader's browser and saves a column order into the view itself. Delete the key. To ship a column order, list `columns` in that order (or set `fieldOrder`); to ship a width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. | | **options** | `never` | optional | Refused: a view item record carries no top-level `options` bag. Its per-kind blocks live under `config` (`config.kanban`, `config.timeline`, …); the legacy `options.KIND` bag belongs to the flattened list overlay only. | ### Nested Shape: `ViewItemWire[viewKind='form'].config` @@ -2491,13 +2484,6 @@ This schema accepts one of the following structures: | **package** | `string` | ✅ | The base package id whose same-named item this item replaces whole (e.g. "com.acme.crm"). Only an item of the base's paired "``.custom" package declares an override. | | **basedOn** | `string` | ✅ | Recorded, never a gate: the base package's `manifest.version` this override was taken from (e.g. "3.2.0"), not a history version of the item. Nothing is refused, merged or rebased on it; it tells a person re-basing the override where it started. One reader, as advice: a base's upgrade plan lists an override whose `basedOn` is not the installed base version as stale, beside each override whose base item the upgrade changes (ADR-0146 D2, as amended). | -### Nested Shape: `ViewItemWire[viewKind='form'].columnState` - -| Property | Type | Required | Description | -| :--- | :--- | :--- | :--- | -| **order** | `string[]` | optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). | -| **widths** | `Record` | optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). | - --- diff --git a/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md b/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md index 5cbe68fcbb7..206c3ad36ea 100644 --- a/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md +++ b/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md @@ -21,7 +21,7 @@ The `strict` column is the one the campaign schedules against; it counts both th | Dir | Sites | strict | passthrough | catchall | strip | |---|---|---|---|---|---| -| `ui/` | 225 | 214 | 6 | 0 | 5 | +| `ui/` | 224 | 214 | 6 | 0 | 4 | ## `ui/` — sites @@ -44,9 +44,9 @@ classify and is not listed (it becomes reportable the day it grows its first sit | `report.zod.ts` | 4 | | `responsive.zod.ts` | 1 | | `sharing.zod.ts` | 1 | -| `view.zod.ts` | 60 | +| `view.zod.ts` | 59 | | `widget.zod.ts` | 1 | -| **total** | **225** | +| **total** | **224** | ## `ui/` — open @@ -54,21 +54,21 @@ Per file, how many of its sites still silently discard unknown keys. The `Class` column that decides the bucket split is hand-written in the ledger; the arithmetic over it is here. -**5 strip of 225**, in 4 file(s). +**4 strip of 224**, in 4 file(s). | File | Strip | Sites | |---|---|---| | `action-params.zod.ts` | 1 | 1 | | `app.zod.ts` | 1 | 20 | -| `view.zod.ts` | 2 | 60 | +| `view.zod.ts` | 1 | 59 | | `widget.zod.ts` | 1 | 1 | -| **total** | **5** | **225** | +| **total** | **4** | **224** | | Bucket | Sites | |---|---| | authorable — the ruling's forced scope | 1 | | unresolved — needs a per-schema verdict | 0 | -| wire / open — out of forced scope | 2 | +| wire / open — out of forced scope | 1 | | no door — no carrier, ADR-0049 territory | 1 | | no gate — carrier live, no parse | 0 | | covered — no carrier, no parse, guarded at every consumer | 1 | diff --git a/docs/audits/2026-07-unknown-key-strictness-ledger.md b/docs/audits/2026-07-unknown-key-strictness-ledger.md index ca3888d0c89..5c7cea8853c 100644 --- a/docs/audits/2026-07-unknown-key-strictness-ledger.md +++ b/docs/audits/2026-07-unknown-key-strictness-ledger.md @@ -952,7 +952,7 @@ next person to open that file will look. | File | Class | Batch | |---|---|---| -| `view.zod.ts` | mixed · 1 authorable, 1 wire | **15 of 20 closed at #4001 批 18**, a sixteenth (`UserFiltersSchema`) at **#5073** once its protocol blocker was adjudicated, a seventeenth — `ViewFilterRuleSchema`, closed by an EARLIER wave — reopened at **#5114**, and then the file's last authoring debt cleared at **#5074**, which closed `ViewItemSchema` (×2 arms), `ListView.sort` AND `ViewFilterRuleSchema` in one structural change. **The strip count went 5 → 3, and the arithmetic is the finding, not the number: FOUR sites closed and TWO were ADDED** — the two arms of the new `ViewItemWireSchema`, which are strip BY DESIGN. That is why this row's Class cell is now a split (`1 authorable, 2 wire`) rather than a smaller `authorable` count: the wire contract that used to live on "the member nobody closed" now has a name, and this map measures posture, not intent. Closed: `ViewDataSchema`'s four provider arms, `UserFilterField.options`, `GanttQuickFilter.options`, `GanttConfig.tooltipFields`, `ListView.conditionalFormatting` / `.emptyState`, `FormFieldBase.keyField`, `FormView.subforms`, and `submitBehavior`'s four arms. Reachability was measured, not assumed: a BFS from all 24 metadata-type roots plus `ObjectStackSchema` resolves every one `root-graph`, with `ViewSchema`/`FormViewSchema`/`ViewItemSchema`/`PageSchema` as positive controls and 批 13's no-door shapes UNREACHABLE **in the same run** — and the instrument had to be fixed first: `lazySchema` returns a Proxy, but a carrier writes `X.optional()`, which RESOLVES it, so the closure holds the real instance and comparing the Proxy alone false-negatived `ViewDataSchema` (caught by cross-checking its two literal carrier keys, not by trusting the reading). ⚠️ **Re-checked against #5056**: every 批 18 target is `root-graph` by **identity**, so **none** of the fifteen rests on the `derived-clone` bridge that 批 16 found can mark a dead shape reachable. The one `derived-clone` verdict in the run is `ListViewSchema` — a positive CONTROL, not a target, and independently identity-reachable via `ObjectListViewSchema`. Every closed shape also has a literal carrier key in this file and a named parse door (`defineView` / `defineViewItem` / the `view` metadata-type schema / objectui's `GanttConfigSchema.safeParse` at `plugin-gantt/src/ObjectGantt.tsx:408`) — the strong-evidence class #5056 leaves standing. ⚠️ **`ListView.sort` was closed, REVERTED, and closed again at #5074 — the round trip is the file's most useful finding.** It carried `direction → order`, the #4721 alias for the identical tuple (`{field, direction:'desc'}` parsed to `{field, order:'asc'}` — a silently REVERSED sort). The full suite then failed one case: `view-metadata-schema.test.ts` pins `sort: [{ id, field, order }]` as the exact body a console column-sort PUT persists, and objectui stamps that `id` per row (`components/src/custom/sort-builder.tsx:68`/`:94`, `crypto.randomUUID()`). **The mechanism governs every nested block in this file and is the opposite of what the union's own comment implies: `.strip()` does NOT recurse.** `ViewMetadataSchema` rescues Studio's round-trip keys by making its flattened members `.strip()`, but that re-opens the TOP level only — a nested block closed inside `ListViewSchema` is still reached through that member, so a console-stamped key inside it becomes a 422 regardless. `id` was deliberately NOT declared to silence it: it is a React list key, and declaring it would put a UI artifact on the authorable surface and tell an AI author to emit one. **#5074 supplied the missing half and the shape is now CLOSED**: the write door removes the declared decoration vocabulary (`VIEW_CONSOLE_ROW_DECORATIONS` / `stripViewConsoleDecorations`, the mirror of `stripReadDecorations`) BEFORE the union runs, so the opening is recursive-effective where a member-level `.strip()` can never be, and the authoring surface never grew the key. The `direction → order` alias came back with it. Curation on what DID close is anchored to named siblings: an option `count` gets a wrong-layer pointer to `showCount` because objectui COMPUTES it per render; and a bare `name` on the `object` data source is deliberately NOT aliased — it is a real key on the view ITEM, so a rename would be finding 7 again. `submitBehavior` became a `discriminatedUnion` on the `kind` literal it already required: as a plain union of four strict members the rejection is an `invalid_union` whose prescription #5014 measured the renderers flattening away. ⚠️ **`GanttConfigSchema` / `TreeConfigSchema` are `strictObject(…).passthrough()`** — open at the parent by design, and this ledger's own counter used to read them as `strict`, because `postureOf` returned early on the `strictObject` idiom instead of walking the chain. **Fixed at #5072**: the idiom now seeds the initial posture and the chain always runs, so the two read `passthrough` and the directory's strict count drops by 2. The strip count was never affected — neither posture is strip — so this row's numbers do not move. **`UserFiltersSchema` is CLOSED as of #5073, and it is the one site in this file whose blocker was never a strictness question.** Closing it would have 422'd `allowAddTab` — a key objectui's renderer reads (`plugin-list/src/UserFilters.tsx:182`/`:742`) and the spec never declared; because `saveMetaItem` validates but persists the ORIGINAL body, the stripped key still reached the renderer, so the capability WORKED and closing would have removed it rather than making a silent failure loud. 批 18 stopped and filed rather than guessing, and the maintainer adjudicated **promote, then close, in one PR** (2026-08-04): `allowAddTab` is now DECLARED here, so the capability is discoverable from the contract (JSON Schema / Studio SchemaForm / an AI author) instead of living in one React file, and the shape closes behind it with no intermediate state. The rejected option was `SANCTIONED_LOCAL` in objectui, which would have made spec and objectui two sources of truth for one contract — the fork #2231's derive-by-reference exists to prevent (PD#12) — and would have taught authors to delete a working key with a rejection that was itself "correct" (finding 7). Two details the close is worth remembering for. **(a)** The promotion is scoped to what the renderer really does: the add-tab button objectui renders carries no click handler, so `allowAddTab` declares that the affordance RENDERS and deliberately says nothing about creating presets — a `.describe()` promising more would be PD#10's advertise-what-you-don't-deliver, and the renderer gap is filed as **#5236**. **(b)** The 批 6e reliance question resolved exactly as predicted — `ObjectUserFiltersSchema` is `.omit()`ed off this base and `.omit()` inherits posture, so the pin flipped from "drops" to "rejects", which is wanted (the CLI lint `validate-list-view-mode.ts` was already reporting these) — but inheriting the posture also inherits the base's ERROR MAP, whose `knownKeys` were read from the base shape and therefore still listed the omitted keys. Measured on the flip: `tab` was answered *"Did you mean `tab` → `tabs`?"*, steering the author at the one key that surface refuses — finding 7 produced by the fix for finding 7. So the object variant now carries its own map built over the OMITTED shape (the shape still derived by `.omit()`, so #2231 holds), with `guidance` pointing all three page-only keys at `listViews`. **⚠️ #5074 — the authoring/wire SPLIT, and the row's headline.** `ViewItemSchema` wore two contracts: the authoring gate (`defineViewItem`, objectui's view-create form, which validates `createBuildBody`'s output against the real spec schema) and member 1 of `ViewMetadataSchema`, the union `saveMetaItem` validates every persisted `view` body against. The wire role was measured, not inferred — objectui's pin control PUTs `{...storedItem, isPinned}` (`ObjectView.tsx:882` → `data-objectstack/src/index.ts:2801`); a stored ViewItem record carries `viewKind` AND `config`, so the merged body lands on member 1 (the flattened members are excluded by their `config: z.undefined()` guard) and closing the one schema would have 422'd pinning a saved view. The maintainer ruled **split** (2026-08-04), and the two-axis reasoning is worth keeping: `defineViewItem({name, object, viewKind, confg: {…}})` — one letter — used to strip the typo and hand back a ViewItem with **no view configuration at all**, parsed clean, which is #1535's `workflows: [...]` replayed on the file's densest authoring surface. `ViewItemSchema` is now `strictObject` on both arms; `ViewItemWireSchema` is the `.strip()` wire variant, built from the SAME `viewItemArmShape()` (derive-by-reference, #2231 — a `discriminatedUnion` cannot be `.extend()`ed, so sharing the shape factory is what keeps one contract from becoming two transcriptions), and `isPinned`/`sortOrder` are DECLARED on it — an explicit home, instead of surviving because nobody closed the member. **The scope addendum's hard requirement was recursive-effective openness, and that is the part a posture flip could not deliver.** `.strip()` re-opens a member's TOP level only, so the two console-decorated NESTED blocks (`ListView.sort[].id`, `ViewFilterRule.id`) were still reached at full strictness through it. The route taken is the addendum's second sanctioned one: a declared decoration vocabulary stripped before validation, at the wire door, reaching every carrier at every depth — including ones added later, which a hand-maintained parallel wire tree would not. It is deliberately NOT a second schema tree (PD#12's fork) and deliberately NOT a declared `id` (批 18 Q1's two-axis rejection: a React list key on the authoring surface teaches AI authors to emit UUIDs). Two landmines were named in the ruling and both are pinned in `view-authoring-wire-split.test.ts` §5: `z.toJSONSchema()` must still emit a four-member `anyOf` (the `/api/v1/meta/types/view` endpoint feeds Studio's SchemaForm from it — it does; a pipe converts to its output side, asserted in BOTH io directions), and the `lazySchema` Proxy's ADR-0089 D3a crash (`Cannot set properties of undefined (setting 'ref')`) must not recur under a pipe-rooted lazy schema — it does not, and each new schema is converted directly rather than only through its parent. **One real hazard the change surfaced, fixed in the same PR:** a `z.preprocess` at a registered root put TWO gate walkers into the exact blind spot #4488 had already found and fixed in `check-liveness.mts` — `metadata-authoring-lint.ts` and `metadata-form-zod-reconciliation.test.ts` both unwrapped a pipe via `def.in`, which for a preprocess is the TRANSFORM, so each reported `view` as *not key-bearing* and silently stopped covering it. Caught by their own coverage assertions (`lintables.length >= 1`, `root schema is not key-bearing`), which is precisely what those assertions exist for; both now prefer whichever side is not the transform. **A gate going quiet is worse than a gate failing** — and the pattern will recur on the next preprocess-rooted registration, so it is recorded here rather than only in the diff. **Still open, one site, measured:** `FormFieldBaseSchema` — a module-private BASE whose sole consumer already applies `.strict()` plus the ADR-0089 visibility error map (`strictVisibilityError` when this was measured; folded into the shared template as `VISIBILITY_STRICT_OPTIONS` + `strictObjectError` at #6619, deliberately WITHOUT closing the base — the site keeps its literal `z.object(` spelling so this instrument keeps counting it); the door is closed, the ledger counts the base. The two remaining strip sites beyond it were `ViewItemWireSchema`'s arms, `wire` by design (closed at #26711, below). `ViewFilterRuleSchema` — **the same wire contamination, one block over, and it was already LIVE on `main`** (#5114): closed by an earlier wave, while objectui's filter builder stamps `id: crypto.randomUUID()` on every row it writes (`components/src/custom/filter-builder.tsx:228`, re-stamped on read-back at `plugin-view/src/config/view-config-utils.ts:146`/`:160`), and `saveMetaItem` persists the AUTHORED body verbatim — so saving a filter from the console 422'd, on all three paths including the flattened overlay that is the body actually PUT. Reopened as a p1 hotfix; `id` deliberately NOT declared, for the reason given for `sort` above. **That reopen was explicitly PROVISIONAL — "pending #5074" — and #5074 retired it rather than leaving it standing: the shape is CLOSED again, by the same decoration strip that closed `sort`, so the authoring gate rejects `id` by name while the console's own three paths still parse.** Its pin file now asserts the split per door, and the direction is the INVERTED one worth flagging to the next reader: probes 1/3 and 2/3 were GREEN before #5074 and are RED after (that IS the close), while 3/3 — the body the console actually PUTs — is green on BOTH sides and must stay so; a file that only asserted "the console body parses" would have passed unchanged through a change that quietly declared `id` as authorable. Two details worth keeping: the overlay path's rejection surfaces as `invalid_union` / *"Invalid input"* — still true of zod — and **at this reopen (2026-08-04) the #5014 flattening then meant the key that caused it was not in the message the author saw, which is why this sat on `main` unnoticed**. ✅ **That second half is LIFTED and no longer describes the tree:** #5014 closed on 2026-08-05 alongside **#4971** (`formatZodError`) and **#5341** (the CLI), and both spec-side walks now rank the union's branches through `selectUnionBranches` (`packages/spec/src/shared/union-branch-policy.ts`, consolidated there at **#8318**), so the offending key, its surface and its rename all arrive indented under the wrapper line — which is the union's only remaining cost. And the reopening was verified in BOTH directions (re-close it and 7 assertions in `view-filter-rule-wire-id.test.ts` go red, while that file's two mechanism CONTROLS — top-level aux key rides, nested `emptyState` still rejects — stay green either way, which is what makes them controls). #5074's scope addendum named this site; the gate it was waiting on — a wire opening that REACHES a nested block — landed with it. Each verdict is recorded in three places (schema JSDoc + `view-strictness-batch18.test.ts` / `view-filter-rule-wire-id.test.ts` + this row). **#9933 added the file's fourth strip site, and it is `wire` by design, not debt: `ViewColumnStateSchema`** — the inner shape of the runtime-only `columnState` personalization overlay key (per-user column order/widths the console grid persists; maintainer-accepted ruling of 2026-08-19 on objectui#5233, mirroring objectui's `gridNonAuthorKeys` disposition). It is deliberately NOT `.strict()`: the console owns the internals of this per-user state, so a future console-written inner key must not 422 against an older server (`saveMetaItem` stores the original body verbatim either way). It is module-private, carried only by the wire faces (`flattenedViewOverlayFields` on the two overlay members, `viewItemWireFields` on the ViewItem wire member), and the AUTHORING doors reject the carrier key by name with a runtime-only prescription (`VIEW_ITEM_SURFACE.guidance` + `ListViewSchema`'s `guidance`) — pinned both ways in `view-metadata-schema.test.ts` §#9933 ⚠️ **#15469 (2026-09-05) closed the file's two `strictObject(…).passthrough()` sites — `GanttConfigSchema` and `TreeConfigSchema` now read `strict`; `ui/` passthrough 5 → 3, strict 157 → 162 (the two closures plus three NEW nested strict sites the declaration adds — `interactions`, `timeSegments` and its band entry — so this file's site count is 58 → 61), this file's strip count unchanged at 4.** Maintainer ruling A (director comment on the card, decision batch #41 item 2, verbatim 「同意」): both windows close. The ten keys plugin-gantt read through the gantt window (`borderColorField`, `lockField`, `objectField`, `summaryExtent`, `defaultCollapsedDepth`, `dependencyTypes`, `timeZone`, `exportFileName`, `interactions`, `timeSegments` — types from objectui's `GanttConfigExtensionFields` at pin `a472b07`) are DECLARED with a describe each; plugin-tree's `getTreeConfig` was measured to read exactly the four keys already declared from the `tree` block, so the tree close declares nothing and the ruled fallback (a dated close) was moot. **Triage's open question, answered by reading the gate:** a `.passthrough()` site is NOT invisible to `check:strictness-ledger` — `postureOf` (`scripts/lib/strictness-ledger.ts`) walks the chain since #5072 and the counts artifact's posture table records it as `passthrough` — but it is not DEBT the ratchet retires either: the remaining-strip map, the bucket subtotals and the reverse pin all count `strip` sites only, and `passthrough` is a non-strip posture, so an open-by-passthrough site never enters a row's strip count, never needs a `Class` verdict, and never moves the ratchet when it is closed or reopened. Its only ledger trace is the per-directory posture column and the row prose — which is why this closure is written here and not left to the numbers. Pinned in `view-gantt-tree-config-closed-15469.test.ts` (the card's five-schema probe with both controls; every declared key accepted at its type and refused at a wrong one; `ListView.gantt.colourField` refused through `ObjectStackDefinitionSchema`) and in `scripts/strictness-ledger.test.ts` (both sites read `strict`, with a mutated-copy red control). **#26711 closed the write door's top level, and this file's strip count went 4 → 2.** `ViewItemWireSchema`'s two arms are `strictObject` now, and the two flattened overlay members (`.extend(…).strip()`, which this instrument never counted as sites) are closed by `closeWireMember` with a refusal built from their own shape. The `wire` verdict on those arms was right when it was written: the save stored the ORIGINAL body, so `.strip()` was what let Studio's undeclared round-trip keys through. #20051 made the save store the PARSED body and #20456 declared every round-trip key (`VIEW_CONSOLE_ROUND_TRIP_KEYS`), so the strip no longer carried anything; it only answered success for a misspelt or retired key and dropped it (the studio-qa finding: `PUT /api/v1/meta/view/…` with `striped: true` → 200, key absent). Measured with the members closed: every `view` body the three examples with views ship, as authored and as expanded, still parses (59 of 59), and on a live dev boot every one of the 36 served views saves back unchanged. The two sites left are `FormFieldBaseSchema` (authorable, its door closed one level up) and `ViewColumnStateSchema` (wire, the console owns its internals). Pinned in `view-wire-unknown-key-refusal.test.ts` | +| `view.zod.ts` | authorable | **15 of 20 closed at #4001 批 18**, a sixteenth (`UserFiltersSchema`) at **#5073** once its protocol blocker was adjudicated, a seventeenth — `ViewFilterRuleSchema`, closed by an EARLIER wave — reopened at **#5114**, and then the file's last authoring debt cleared at **#5074**, which closed `ViewItemSchema` (×2 arms), `ListView.sort` AND `ViewFilterRuleSchema` in one structural change. **The strip count went 5 → 3, and the arithmetic is the finding, not the number: FOUR sites closed and TWO were ADDED** — the two arms of the new `ViewItemWireSchema`, which are strip BY DESIGN. That is why this row's Class cell is now a split (`1 authorable, 2 wire`) rather than a smaller `authorable` count: the wire contract that used to live on "the member nobody closed" now has a name, and this map measures posture, not intent. Closed: `ViewDataSchema`'s four provider arms, `UserFilterField.options`, `GanttQuickFilter.options`, `GanttConfig.tooltipFields`, `ListView.conditionalFormatting` / `.emptyState`, `FormFieldBase.keyField`, `FormView.subforms`, and `submitBehavior`'s four arms. Reachability was measured, not assumed: a BFS from all 24 metadata-type roots plus `ObjectStackSchema` resolves every one `root-graph`, with `ViewSchema`/`FormViewSchema`/`ViewItemSchema`/`PageSchema` as positive controls and 批 13's no-door shapes UNREACHABLE **in the same run** — and the instrument had to be fixed first: `lazySchema` returns a Proxy, but a carrier writes `X.optional()`, which RESOLVES it, so the closure holds the real instance and comparing the Proxy alone false-negatived `ViewDataSchema` (caught by cross-checking its two literal carrier keys, not by trusting the reading). ⚠️ **Re-checked against #5056**: every 批 18 target is `root-graph` by **identity**, so **none** of the fifteen rests on the `derived-clone` bridge that 批 16 found can mark a dead shape reachable. The one `derived-clone` verdict in the run is `ListViewSchema` — a positive CONTROL, not a target, and independently identity-reachable via `ObjectListViewSchema`. Every closed shape also has a literal carrier key in this file and a named parse door (`defineView` / `defineViewItem` / the `view` metadata-type schema / objectui's `GanttConfigSchema.safeParse` at `plugin-gantt/src/ObjectGantt.tsx:408`) — the strong-evidence class #5056 leaves standing. ⚠️ **`ListView.sort` was closed, REVERTED, and closed again at #5074 — the round trip is the file's most useful finding.** It carried `direction → order`, the #4721 alias for the identical tuple (`{field, direction:'desc'}` parsed to `{field, order:'asc'}` — a silently REVERSED sort). The full suite then failed one case: `view-metadata-schema.test.ts` pins `sort: [{ id, field, order }]` as the exact body a console column-sort PUT persists, and objectui stamps that `id` per row (`components/src/custom/sort-builder.tsx:68`/`:94`, `crypto.randomUUID()`). **The mechanism governs every nested block in this file and is the opposite of what the union's own comment implies: `.strip()` does NOT recurse.** `ViewMetadataSchema` rescues Studio's round-trip keys by making its flattened members `.strip()`, but that re-opens the TOP level only — a nested block closed inside `ListViewSchema` is still reached through that member, so a console-stamped key inside it becomes a 422 regardless. `id` was deliberately NOT declared to silence it: it is a React list key, and declaring it would put a UI artifact on the authorable surface and tell an AI author to emit one. **#5074 supplied the missing half and the shape is now CLOSED**: the write door removes the declared decoration vocabulary (`VIEW_CONSOLE_ROW_DECORATIONS` / `stripViewConsoleDecorations`, the mirror of `stripReadDecorations`) BEFORE the union runs, so the opening is recursive-effective where a member-level `.strip()` can never be, and the authoring surface never grew the key. The `direction → order` alias came back with it. Curation on what DID close is anchored to named siblings: an option `count` gets a wrong-layer pointer to `showCount` because objectui COMPUTES it per render; and a bare `name` on the `object` data source is deliberately NOT aliased — it is a real key on the view ITEM, so a rename would be finding 7 again. `submitBehavior` became a `discriminatedUnion` on the `kind` literal it already required: as a plain union of four strict members the rejection is an `invalid_union` whose prescription #5014 measured the renderers flattening away. ⚠️ **`GanttConfigSchema` / `TreeConfigSchema` are `strictObject(…).passthrough()`** — open at the parent by design, and this ledger's own counter used to read them as `strict`, because `postureOf` returned early on the `strictObject` idiom instead of walking the chain. **Fixed at #5072**: the idiom now seeds the initial posture and the chain always runs, so the two read `passthrough` and the directory's strict count drops by 2. The strip count was never affected — neither posture is strip — so this row's numbers do not move. **`UserFiltersSchema` is CLOSED as of #5073, and it is the one site in this file whose blocker was never a strictness question.** Closing it would have 422'd `allowAddTab` — a key objectui's renderer reads (`plugin-list/src/UserFilters.tsx:182`/`:742`) and the spec never declared; because `saveMetaItem` validates but persists the ORIGINAL body, the stripped key still reached the renderer, so the capability WORKED and closing would have removed it rather than making a silent failure loud. 批 18 stopped and filed rather than guessing, and the maintainer adjudicated **promote, then close, in one PR** (2026-08-04): `allowAddTab` is now DECLARED here, so the capability is discoverable from the contract (JSON Schema / Studio SchemaForm / an AI author) instead of living in one React file, and the shape closes behind it with no intermediate state. The rejected option was `SANCTIONED_LOCAL` in objectui, which would have made spec and objectui two sources of truth for one contract — the fork #2231's derive-by-reference exists to prevent (PD#12) — and would have taught authors to delete a working key with a rejection that was itself "correct" (finding 7). Two details the close is worth remembering for. **(a)** The promotion is scoped to what the renderer really does: the add-tab button objectui renders carries no click handler, so `allowAddTab` declares that the affordance RENDERS and deliberately says nothing about creating presets — a `.describe()` promising more would be PD#10's advertise-what-you-don't-deliver, and the renderer gap is filed as **#5236**. **(b)** The 批 6e reliance question resolved exactly as predicted — `ObjectUserFiltersSchema` is `.omit()`ed off this base and `.omit()` inherits posture, so the pin flipped from "drops" to "rejects", which is wanted (the CLI lint `validate-list-view-mode.ts` was already reporting these) — but inheriting the posture also inherits the base's ERROR MAP, whose `knownKeys` were read from the base shape and therefore still listed the omitted keys. Measured on the flip: `tab` was answered *"Did you mean `tab` → `tabs`?"*, steering the author at the one key that surface refuses — finding 7 produced by the fix for finding 7. So the object variant now carries its own map built over the OMITTED shape (the shape still derived by `.omit()`, so #2231 holds), with `guidance` pointing all three page-only keys at `listViews`. **⚠️ #5074 — the authoring/wire SPLIT, and the row's headline.** `ViewItemSchema` wore two contracts: the authoring gate (`defineViewItem`, objectui's view-create form, which validates `createBuildBody`'s output against the real spec schema) and member 1 of `ViewMetadataSchema`, the union `saveMetaItem` validates every persisted `view` body against. The wire role was measured, not inferred — objectui's pin control PUTs `{...storedItem, isPinned}` (`ObjectView.tsx:882` → `data-objectstack/src/index.ts:2801`); a stored ViewItem record carries `viewKind` AND `config`, so the merged body lands on member 1 (the flattened members are excluded by their `config: z.undefined()` guard) and closing the one schema would have 422'd pinning a saved view. The maintainer ruled **split** (2026-08-04), and the two-axis reasoning is worth keeping: `defineViewItem({name, object, viewKind, confg: {…}})` — one letter — used to strip the typo and hand back a ViewItem with **no view configuration at all**, parsed clean, which is #1535's `workflows: [...]` replayed on the file's densest authoring surface. `ViewItemSchema` is now `strictObject` on both arms; `ViewItemWireSchema` is the `.strip()` wire variant, built from the SAME `viewItemArmShape()` (derive-by-reference, #2231 — a `discriminatedUnion` cannot be `.extend()`ed, so sharing the shape factory is what keeps one contract from becoming two transcriptions), and `isPinned`/`sortOrder` are DECLARED on it — an explicit home, instead of surviving because nobody closed the member. **The scope addendum's hard requirement was recursive-effective openness, and that is the part a posture flip could not deliver.** `.strip()` re-opens a member's TOP level only, so the two console-decorated NESTED blocks (`ListView.sort[].id`, `ViewFilterRule.id`) were still reached at full strictness through it. The route taken is the addendum's second sanctioned one: a declared decoration vocabulary stripped before validation, at the wire door, reaching every carrier at every depth — including ones added later, which a hand-maintained parallel wire tree would not. It is deliberately NOT a second schema tree (PD#12's fork) and deliberately NOT a declared `id` (批 18 Q1's two-axis rejection: a React list key on the authoring surface teaches AI authors to emit UUIDs). Two landmines were named in the ruling and both are pinned in `view-authoring-wire-split.test.ts` §5: `z.toJSONSchema()` must still emit a four-member `anyOf` (the `/api/v1/meta/types/view` endpoint feeds Studio's SchemaForm from it — it does; a pipe converts to its output side, asserted in BOTH io directions), and the `lazySchema` Proxy's ADR-0089 D3a crash (`Cannot set properties of undefined (setting 'ref')`) must not recur under a pipe-rooted lazy schema — it does not, and each new schema is converted directly rather than only through its parent. **One real hazard the change surfaced, fixed in the same PR:** a `z.preprocess` at a registered root put TWO gate walkers into the exact blind spot #4488 had already found and fixed in `check-liveness.mts` — `metadata-authoring-lint.ts` and `metadata-form-zod-reconciliation.test.ts` both unwrapped a pipe via `def.in`, which for a preprocess is the TRANSFORM, so each reported `view` as *not key-bearing* and silently stopped covering it. Caught by their own coverage assertions (`lintables.length >= 1`, `root schema is not key-bearing`), which is precisely what those assertions exist for; both now prefer whichever side is not the transform. **A gate going quiet is worse than a gate failing** — and the pattern will recur on the next preprocess-rooted registration, so it is recorded here rather than only in the diff. **Still open, one site, measured:** `FormFieldBaseSchema` — a module-private BASE whose sole consumer already applies `.strict()` plus the ADR-0089 visibility error map (`strictVisibilityError` when this was measured; folded into the shared template as `VISIBILITY_STRICT_OPTIONS` + `strictObjectError` at #6619, deliberately WITHOUT closing the base — the site keeps its literal `z.object(` spelling so this instrument keeps counting it); the door is closed, the ledger counts the base. The two remaining strip sites beyond it were `ViewItemWireSchema`'s arms, `wire` by design (closed at #26711, below). `ViewFilterRuleSchema` — **the same wire contamination, one block over, and it was already LIVE on `main`** (#5114): closed by an earlier wave, while objectui's filter builder stamps `id: crypto.randomUUID()` on every row it writes (`components/src/custom/filter-builder.tsx:228`, re-stamped on read-back at `plugin-view/src/config/view-config-utils.ts:146`/`:160`), and `saveMetaItem` persists the AUTHORED body verbatim — so saving a filter from the console 422'd, on all three paths including the flattened overlay that is the body actually PUT. Reopened as a p1 hotfix; `id` deliberately NOT declared, for the reason given for `sort` above. **That reopen was explicitly PROVISIONAL — "pending #5074" — and #5074 retired it rather than leaving it standing: the shape is CLOSED again, by the same decoration strip that closed `sort`, so the authoring gate rejects `id` by name while the console's own three paths still parse.** Its pin file now asserts the split per door, and the direction is the INVERTED one worth flagging to the next reader: probes 1/3 and 2/3 were GREEN before #5074 and are RED after (that IS the close), while 3/3 — the body the console actually PUTs — is green on BOTH sides and must stay so; a file that only asserted "the console body parses" would have passed unchanged through a change that quietly declared `id` as authorable. Two details worth keeping: the overlay path's rejection surfaces as `invalid_union` / *"Invalid input"* — still true of zod — and **at this reopen (2026-08-04) the #5014 flattening then meant the key that caused it was not in the message the author saw, which is why this sat on `main` unnoticed**. ✅ **That second half is LIFTED and no longer describes the tree:** #5014 closed on 2026-08-05 alongside **#4971** (`formatZodError`) and **#5341** (the CLI), and both spec-side walks now rank the union's branches through `selectUnionBranches` (`packages/spec/src/shared/union-branch-policy.ts`, consolidated there at **#8318**), so the offending key, its surface and its rename all arrive indented under the wrapper line — which is the union's only remaining cost. And the reopening was verified in BOTH directions (re-close it and 7 assertions in `view-filter-rule-wire-id.test.ts` go red, while that file's two mechanism CONTROLS — top-level aux key rides, nested `emptyState` still rejects — stay green either way, which is what makes them controls). #5074's scope addendum named this site; the gate it was waiting on — a wire opening that REACHES a nested block — landed with it. Each verdict is recorded in three places (schema JSDoc + `view-strictness-batch18.test.ts` / `view-filter-rule-wire-id.test.ts` + this row). **#9933 added the file's fourth strip site, and it is `wire` by design, not debt: `ViewColumnStateSchema`** — the inner shape of the runtime-only `columnState` personalization overlay key (per-user column order/widths the console grid persists; maintainer-accepted ruling of 2026-08-19 on objectui#5233, mirroring objectui's `gridNonAuthorKeys` disposition). It is deliberately NOT `.strict()`: the console owns the internals of this per-user state, so a future console-written inner key must not 422 against an older server (`saveMetaItem` stores the original body verbatim either way). It is module-private, carried only by the wire faces (`flattenedViewOverlayFields` on the two overlay members, `viewItemWireFields` on the ViewItem wire member), and the AUTHORING doors reject the carrier key by name with a runtime-only prescription (`VIEW_ITEM_SURFACE.guidance` + `ListViewSchema`'s `guidance`) — pinned both ways in `view-metadata-schema.test.ts` §#9933 ⚠️ **#15469 (2026-09-05) closed the file's two `strictObject(…).passthrough()` sites — `GanttConfigSchema` and `TreeConfigSchema` now read `strict`; `ui/` passthrough 5 → 3, strict 157 → 162 (the two closures plus three NEW nested strict sites the declaration adds — `interactions`, `timeSegments` and its band entry — so this file's site count is 58 → 61), this file's strip count unchanged at 4.** Maintainer ruling A (director comment on the card, decision batch #41 item 2, verbatim 「同意」): both windows close. The ten keys plugin-gantt read through the gantt window (`borderColorField`, `lockField`, `objectField`, `summaryExtent`, `defaultCollapsedDepth`, `dependencyTypes`, `timeZone`, `exportFileName`, `interactions`, `timeSegments` — types from objectui's `GanttConfigExtensionFields` at pin `a472b07`) are DECLARED with a describe each; plugin-tree's `getTreeConfig` was measured to read exactly the four keys already declared from the `tree` block, so the tree close declares nothing and the ruled fallback (a dated close) was moot. **Triage's open question, answered by reading the gate:** a `.passthrough()` site is NOT invisible to `check:strictness-ledger` — `postureOf` (`scripts/lib/strictness-ledger.ts`) walks the chain since #5072 and the counts artifact's posture table records it as `passthrough` — but it is not DEBT the ratchet retires either: the remaining-strip map, the bucket subtotals and the reverse pin all count `strip` sites only, and `passthrough` is a non-strip posture, so an open-by-passthrough site never enters a row's strip count, never needs a `Class` verdict, and never moves the ratchet when it is closed or reopened. Its only ledger trace is the per-directory posture column and the row prose — which is why this closure is written here and not left to the numbers. Pinned in `view-gantt-tree-config-closed-15469.test.ts` (the card's five-schema probe with both controls; every declared key accepted at its type and refused at a wrong one; `ListView.gantt.colourField` refused through `ObjectStackDefinitionSchema`) and in `scripts/strictness-ledger.test.ts` (both sites read `strict`, with a mutated-copy red control). **#26711 closed the write door's top level, and this file's strip count went 4 → 2.** `ViewItemWireSchema`'s two arms are `strictObject` now, and the two flattened overlay members (`.extend(…).strip()`, which this instrument never counted as sites) are closed by `closeWireMember` with a refusal built from their own shape. The `wire` verdict on those arms was right when it was written: the save stored the ORIGINAL body, so `.strip()` was what let Studio's undeclared round-trip keys through. #20051 made the save store the PARSED body and #20456 declared every round-trip key (`VIEW_CONSOLE_ROUND_TRIP_KEYS`), so the strip no longer carried anything; it only answered success for a misspelt or retired key and dropped it (the studio-qa finding: `PUT /api/v1/meta/view/…` with `striped: true` → 200, key absent). Measured with the members closed: every `view` body the three examples with views ship, as authored and as expanded, still parses (59 of 59), and on a live dev boot every one of the 36 served views saves back unchanged. The two sites left are `FormFieldBaseSchema` (authorable, its door closed one level up) and `ViewColumnStateSchema` (wire, the console owns its internals). Pinned in `view-wire-unknown-key-refusal.test.ts` **#36403**: `columnState` retired from both wire doors (a `retiredKey()` tombstone), and `ViewColumnStateSchema` went with it — strip sites 2 → 1, the one left the form field's `base` shape (authorable), so the Class cell is no longer a split. | | `widget.zod.ts` | **no door** | ⛔ **not strictness work** — the whole file measured unreachable from every authoring root (#4001 批 16), with no carrier key and zero parse in all three repos. ADR-0049 triage was **#5055**, and it is ANSWERED: eight of the nine sites were REMOVED (the whole widget-registration vocabulary). The row does not disappear, because the NINTH — `FieldWidgetPropsSchema` — was deliberately KEPT: it is a React props contract rather than authorable metadata, it never appeared in the authorable surface at all, and objectui PR #3289 gave it a live compile-time consumer. ⛔ **Do not close it and do not finish this file** — this is the fourth row in the ledger parked at a deliberate floor (after `flow` 批 11, `etl` 批 12 and `i18n` above), and the reverse pin fires on ZERO either way, so only this cell separates "parked" from "unfinished". See the triage row above, including why the campaign's own BFS said otherwise first (**#5056**) | | `app.zod.ts` | covered | **批 19 ran the check and it came back NEGATIVE — no posture change; the `Class` was held at `verify` pending #5249 and is now `covered`, the verdict that ruling created (see below).** `BaseNavItemSchema`. The instruction here was to confirm the members' strictness was not already covering it before touching; it is, and the premise this row carried was wrong twice. (1) **The members do not `.extend()` the base — they spread `...BaseNavItemSchema.shape`.** That is a different mechanism, and the difference is the whole of finding 16: `.extend()` clones INHERIT the base's posture (which is how closing two `view` authoring schemas silently closed the Studio round-trip overlay), while a `...shape` spread copies the per-key schemas into a FRESH `z.object` whose posture is its own. Measured in both directions rather than read off the source, because *"closing the base closes the members"* and *"closing the base is a no-op"* are opposite claims: `strictBase.extend({…})` rejects an unknown key, `z.object({...strictBase.shape})` accepts it, `z.object({...openBase.shape}).strict()` rejects it. (2) **All nine branches already apply their own `.strict()`** with the curated `navItemUnknownKeyError` — asserted per branch through the real door (`AppSchema.navigation`, a `discriminatedUnion` on `type`), with a positive control (every base-contributed key, incl. `requiresService` which no branch declares itself, is ACCEPTED) and a negative control (an undeclared key is REJECTED) in the same run. The base is also module-private and has zero `.parse()` anywhere, so `.strict()` here would be a property of a parse that does not exist. Closing it is therefore a guaranteed no-op, and #4583 is explicit that a no-op closure is not neutral. ⚠️ **The open question was the VOCABULARY, not the measurement** — which is why 批 19 left the cell alone, since it is machine-read and a guess here would be published as a confident subtotal. The two-axis table above resolved carrier-absent + parse-absent to `no door`, whose prescribed follow-up is ADR-0049 retirement — and that prescription is *destructive* here: the vocabulary is fully ALIVE and fully GATED at nine consumers, so retiring the base would delete nine branches' shared keys. `no gate` is wrong for the mirror reason (the gate exists, at the members). `authorable` is the `FormFieldBaseSchema` precedent one row over in `view.zod.ts` — but that base really is `.extend()`ed, so closing it WOULD change behaviour, and calling this one `authorable` invites exactly the later sweep that "finishes the job" on a shape nothing parses. ✅ **RESOLVED at #5249 (maintainer ruling 2026-08-06, option A): the vocabulary grew a ninth verdict, `covered`, and this row is its first and — as of the sweep below — its ONLY instance.** The ruling took the same route 批 15 took for `no gate` rather than rounding to the nearest wrong answer, on the ground that the cell's readers are later agents and a verdict naming the wrong ACTION is amplified by whoever acts on it. The re-review the ruling required was run over all **197** strip sites in the five triaged directories, not just this file, and it is mechanical rather than a reading: `covered` requires the keys to reach consumers by `...X.shape` SPREAD (a spread lands them in a fresh `z.object` with its own posture, so the base is inert), whereas `.extend()`/`.merge()`/`.omit()` inherit posture and keep the base a real door. Exactly **one** of the 197 sites spreads — this one, into eight of the nine branches (`SeparatorNavItemSchema` declares its own two keys and spreads nothing, and is `.strict()` all the same). The three other module-private strip bases all resolve elsewhere and stay put: `view.zod.ts`'s `FormFieldBaseSchema` is `.extend()`ed at `:1475` → posture inherits → a real door → stays `authorable`; `query.zod.ts`'s `BaseQuerySchema` is `.extend()`ed at `:485` into `QuerySchema` → same → stays `open`; `component.zod.ts`'s `EmptyProps` is used as a VALUE under eleven `ComponentPropsMap` carrier keys → carrier present → not carrier-absent at all. The remaining ~50 sites are inline nested literals under a property, so they carry a carrier by construction and cannot be `covered`. Recorded in three places (the `BaseNavItemSchema` JSDoc + `app-strictness-batch19.test.ts` + this row); the pin includes a guard that fails if any branch ever stops rejecting unknown keys, which is the one change that would make this verdict need re-taking | | `action-params.zod.ts` | wire | **out of scope** — `ActionSessionSchema`, the action-body `ctx.session` the runtime hands a body (#5697). Tolerant on purpose, same disposition as `data/hook.zod.ts`'s `HookContextSchema`. What this surface needed was never a closed door but a gate that RUNS: its consistency with the real producer is pinned in `packages/runtime/src/action-session-shape-contract.test.ts`, which asserts that a non-strict parse of the built object returns it UNCHANGED — so a key the builder starts producing without declaring it here is stripped, and the pin goes red | diff --git a/packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts b/packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts index 7b89a6f8d4d..729b5006414 100644 --- a/packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts +++ b/packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts @@ -40,6 +40,9 @@ * double for the reason the #20051 door-half block below gives. */ import { describe, expect, it, vi } from 'vitest'; +// `./protocol.js` reaches `import('@objectstack/lint')` (the diagnostics and +// build probes); pay its first load at collection, never inside a clocked case. +import '@objectstack/lint'; import { ViewMetadataSchema, VIEW_CONSOLE_ROUND_TRIP_KEYS } from '@objectstack/spec/ui'; import { getMetadataTypeSchema, registerMetadataTypeSchema } from '@objectstack/spec/kernel'; import { z } from 'zod'; @@ -269,7 +272,8 @@ describe('#7134 what the save path must NOT change', () => { isDefault: false, sortOrder: 3, visibility: 'team', - columnState: { order: ['name'], widths: { name: 180 } }, + // [objectstack#36403] `columnState` is retired from the record, so + // this GUARD no longer carries it; the retirement pins it refused. _isOverride: true, }; expect(Object.keys(VIEW_CONSOLE_ROUND_TRIP_KEYS).filter( @@ -558,7 +562,8 @@ describe('[#20051] stage (iv): a saved view stores the parsed value of every key ['W1 sort', { sort: [{ id: SORT_ROW_ID, field: 'name', order: 'desc' }] }], ['W2 density', { rowHeight: 'compact' }], ['W3 hidden fields', { hiddenFields: ['status'] }], - ['W4 column state', { columnState: { order: ['status', 'name'], widths: { name: 180 } } }], + // W4 (column state) is gone: `columnState` retired (objectstack#36403), + // and the console no longer writes it. ['W5 inline edit', { inlineEdit: false }], ]; diff --git a/packages/spec/scripts/strictness-ledger.test.ts b/packages/spec/scripts/strictness-ledger.test.ts index 5a06a0f9a33..c8dd126679b 100644 --- a/packages/spec/scripts/strictness-ledger.test.ts +++ b/packages/spec/scripts/strictness-ledger.test.ts @@ -390,7 +390,11 @@ describe('posture reading, with a red control for each', () => { // of the `view` write door (the save stores the parsed body, so a strip // there lost a key silently). The two sites left are `ViewColumnStateSchema` // (above) and the form field's `base` shape, both unchanged by #26711. - expect(countStripSites(at('ui/view.zod.ts'))).toBe(2); + // + // 2 → 1 at #36403: `columnState` retired from both wire doors (a + // `retiredKey()` tombstone now), and `ViewColumnStateSchema` went with it. + // The one site left is the form field's `base` shape. + expect(countStripSites(at('ui/view.zod.ts'))).toBe(1); }); it('lets a chained posture override the idiom in either direction (#5072)', () => { diff --git a/packages/spec/src/conversions/entries/18/view-column-state-removed.ts b/packages/spec/src/conversions/entries/18/view-column-state-removed.ts new file mode 100644 index 00000000000..0415be328ce --- /dev/null +++ b/packages/spec/src/conversions/entries/18/view-column-state-removed.ts @@ -0,0 +1,167 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { MetadataConversion } from '../../types.js'; +import { mapCollection } from '../../walk.js'; +import { ASSEMBLED_VIEW_ITEMS_KEY } from '../../../ui/assembled-views.zod.js'; +import { type Dict, isDict, stripKeys } from '../shared.js'; + +/** + * A stored `view` row's `columnState` leaves the wire surface (protocol 18, + * #36403 — ADR-0049 enforce-or-remove; the spec half of #35955, where the + * maintainer ruled column widths browser-only and the server-side per-user + * list preference layer retired, 2026-11-21). + * + * The key was a runtime-only console round-trip key (`VIEW_CONSOLE_ROUND_TRIP_KEYS` + * in `ui/view.zod.ts`), declared on two wire doors: the view item RECORD + * (`viewItemWireFields()`, member 1 of the `view` union) and the FLATTENED + * overlay (`flattenedViewOverlayFields()`, members 3 and 4). The console's grid + * wrote one column order and set of widths there and applied it on read. The + * writer is gone: the overlay writer retired with objectui#12504, and since #35955 + * a column drag goes to the list's draft while widths live in the reader's + * browser. Writer census before removal, at `main` 97b9d1e6: none in this + * framework, its examples or its console, none in the HotCRM app or the gallery; + * cloud was not reachable. The reader is NOT gone until this conversion runs (see + * the last paragraph). + * + * **Retired from the load path** — the key is a `retiredKey()` tombstone on both + * doors, so a live author is refused at parse with the prescription. The entry + * exists because a STORED row can carry it: the write door accepted and persisted + * it until this release, and every read of a stored `view` row replays the chain + * through `applyConversionsToStoredItem` as `{ views: [row] }` before it is served + * or badged. It also lets `os migrate meta --from 17` list the edits for sources. + * + * **One family, both spellings.** Unlike the `owner` / `hidden` pair, which + * retired from the two doors in two cards and so carries two entries, this key + * retires from both at once: a record (`viewKind` list/form with a `config` + * object) and a flattened overlay (no `config`, no container slot) are both + * stripped here. A container (`list` / `form` / `listViews` / `formViews`) + * never declared the key and is left alone. + * + * What the strip leaves depends on what else the row holds — two classes: + * + * - **Content-bearing** — a record, or an overlay with any view key besides the + * identity the write path stamps (`name` / `object` / `viewKind` / `label`): + * served and badged valid without the key, a GET then a PUT of the whole row + * saves (if it was otherwise valid), and `os migrate meta --stored --apply` + * rewrites it. + * - **Column-state-only overlay** — identity plus `columnState` and nothing else, + * the shape a column drag on a system view wrote before objectui#12504: the + * strip leaves IDENTITY ONLY, which the `view` door's identity precondition + * refuses (#7741, "only identity fields"). The row is served without the key + * but badged invalid; `--apply` reports it `failed` and leaves it as stored, + * and every read strips it again. Remedy: delete the row — the maintainer + * ruled the stored layout is not carried forward (#35955, 「清掉」). + * + * **Two collections**, like the `owner` / `hidden` entries: `views` is the stack + * collection and the stored-row seam's wrapping; `viewItems` + * ({@link ASSEMBLED_VIEW_ITEMS_KEY}) is the assembled-manifest channel, whose + * registration parse (`AssembledViewArtifactSchema`, built from the same + * members) now refuses the key too. Deletion is the whole conversion. + * + * **Not lossless for what a reader sees.** Until this release the console still + * APPLIED a stored layout: a record's key rode `listViews()` through + * `VIEW_ITEM_ROUND_TRIP_KEYS`, an overlay's survived `narrowPersonalizationOverlay` + * through `VIEW_OVERLAY_OWNED_KEYS`, and the list renderer seeded the grid from + * the view's `columnState` for any reader with no draft order and no widths of + * their own in the browser. After the strip that reader sees the view's own + * column order (`columns` / `fieldOrder`) and widths. This is the ruled outcome, + * not a side effect: the maintainer retired the server-side per-user list layout + * and ruled that a stored layout is not migrated — every reader goes back to the + * view's own columns, column order and widths (#35955, items 5 and 6 and its + * acceptance; restated on #36403 as the ruling of record, comment 7079029398). + * So no stored `order` is moved into `fieldOrder`: that would keep a + * layout the ruling drops. + */ +const viewColumnStateRemoved: MetadataConversion = { + id: 'view-column-state-removed', + toMajor: 18, + retiredFromLoadPath: true, + retiredAfter: '18.6.0', + surface: 'view.columnState — on a view item record ({ name, object, viewKind, config }) and on a flattened view overlay ({ name, object, viewKind, …, no config })', + summary: + "view key 'columnState' removed (ADR-0049 — the console's per-user column order and widths, " + + 'stored on a shared view row; nothing writes it since column widths moved to the ' + + "reader's browser and a column order is saved into the view itself, and a stored layout is " + + "no longer applied: every reader sees the view's own column order and widths)", + apply(stack, emit) { + const stripFromRow = (view: Dict, path: string): Dict => { + if (view.config !== undefined) { + const kind = view.viewKind; + if ((kind !== 'list' && kind !== 'form') || !isDict(view.config)) return view; + return stripKeys(view, ['columnState'], emit, path); + } + if (view.list !== undefined || view.form !== undefined) return view; + if (view.listViews !== undefined || view.formViews !== undefined) return view; + return stripKeys(view, ['columnState'], emit, path); + }; + return mapCollection( + mapCollection(stack, 'views', stripFromRow), + ASSEMBLED_VIEW_ITEMS_KEY, + stripFromRow, + ); + }, + fixture: { + before: { + // The assembled-manifest channel: a record a package export carried + // before this release. + viewItems: [ + { + name: 'crm_case.open', + object: 'crm_case', + viewKind: 'list', + columnState: { order: ['subject', 'status'] }, + config: { type: 'grid', columns: ['subject', 'status'] }, + }, + ], + views: [ + // A flattened overlay: the key goes, the live round-trip keys beside + // it (`isDefault`, `label`) are untouched. + { + name: 'crm_case.all', + object: 'crm_case', + viewKind: 'list', + label: 'All cases', + isDefault: true, + columnState: { order: ['status', 'subject'], widths: { subject: 240 } }, + }, + // A record: the key goes, `config` is untouched. + { + name: 'crm_case.mine', + object: 'crm_case', + viewKind: 'list', + columnState: { widths: { subject: 180 } }, + config: { type: 'grid', columns: ['subject'] }, + }, + // A row that never carried the key rides through untouched. + { name: 'crm_case.by_status', object: 'crm_case', viewKind: 'list', order: 3 }, + // A container is not a row of either door: untouched. + { object: 'crm_case', list: { type: 'grid', columns: ['subject'] } }, + ], + }, + after: { + viewItems: [ + { + name: 'crm_case.open', + object: 'crm_case', + viewKind: 'list', + config: { type: 'grid', columns: ['subject', 'status'] }, + }, + ], + views: [ + { name: 'crm_case.all', object: 'crm_case', viewKind: 'list', label: 'All cases', isDefault: true }, + { + name: 'crm_case.mine', + object: 'crm_case', + viewKind: 'list', + config: { type: 'grid', columns: ['subject'] }, + }, + { name: 'crm_case.by_status', object: 'crm_case', viewKind: 'list', order: 3 }, + { object: 'crm_case', list: { type: 'grid', columns: ['subject'] } }, + ], + }, + // One notice per KEY removed: two in `views`, one in `viewItems`. + expectedNotices: 3, + }, +}; + +export { viewColumnStateRemoved }; diff --git a/packages/spec/src/conversions/registry.ts b/packages/spec/src/conversions/registry.ts index 37f041c2953..20985398ae9 100644 --- a/packages/spec/src/conversions/registry.ts +++ b/packages/spec/src/conversions/registry.ts @@ -120,6 +120,7 @@ import { actionAriaRemoved } from './entries/18/action-aria-removed.js'; import { dashboardWidgetChartConfigStructureRemoved } from './entries/18/dashboard-widget-chart-config-structure-removed.js'; import { objectMasterDetailFormDetailSortFieldRemoved } from './entries/18/object-master-detail-form-detail-sort-field-removed.js'; import { objectTenancyOrganizationFieldRemoved } from './entries/18/object-tenancy-organization-field-removed.js'; +import { viewColumnStateRemoved } from './entries/18/view-column-state-removed.js'; import { viewItemOwnerHiddenRemoved } from './entries/18/view-item-owner-hidden-removed.js'; import { viewOverlayOwnerHiddenRemoved } from './entries/18/view-overlay-owner-hidden-removed.js'; import { viewListFilterableFieldsRemoved } from './entries/18/view-list-filterable-fields-removed.js'; @@ -288,6 +289,7 @@ const MAJOR_18_CONVERSIONS: readonly OrderedConversion[] = [ { conversion: translationWidgetSubCaptionRemoved, order: 55 }, { conversion: tursoConfigEncryptionKeyRemoved, order: 74 }, { conversion: tursoConfigTimeoutToTimeoutMs, order: 28 }, + { conversion: viewColumnStateRemoved, order: 83 }, { conversion: viewItemOwnerHiddenRemoved, order: 37 }, { conversion: viewListFilterableFieldsRemoved, order: 71 }, { conversion: viewListTabsRemoved, order: 46 }, diff --git a/packages/spec/src/conversions/view-spelling-walk.test.ts b/packages/spec/src/conversions/view-spelling-walk.test.ts index 11e93976e9a..d6a5eed4839 100644 --- a/packages/spec/src/conversions/view-spelling-walk.test.ts +++ b/packages/spec/src/conversions/view-spelling-walk.test.ts @@ -295,6 +295,9 @@ describe('view conversions reach the flattened-overlay spelling (payload at top * `hidden` are retired (ADR-0049) and `view-overlay-owner-hidden-removed` * strips them. It is asserted GONE below, by that entry, while every key * that still binds or orders the row survives. + * + * [#36403] So did `columnState`: retired from both wire doors, and + * `view-column-state-removed` strips it. Asserted GONE below the same way. */ it('never touches the overlay identity/round-trip fields', () => { const { out, notices } = convertViewRow({ @@ -318,11 +321,12 @@ describe('view conversions reach the flattened-overlay spelling (payload at top expect(out.isDefault).toBe(true); expect(out.order).toBe(3); expect(out.scope).toBe('user'); - expect(out.columnState).toEqual({ order: ['name'], widths: { name: 120 } }); - // The two retired keys on this row — each stripped by its own entry. + // The three retired keys on this row — each stripped by its own entry. expect('filterableFields' in out).toBe(false); expect('owner' in out).toBe(false); + expect('columnState' in out).toBe(false); expect(pathsFor(notices, 'view-overlay-owner-hidden-removed')).toEqual(['views[0].owner']); + expect(pathsFor(notices, 'view-column-state-removed')).toEqual(['views[0].columnState']); }); }); diff --git a/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewItemWire__columnState.ts b/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewItemWire__columnState.ts new file mode 100644 index 00000000000..a1126bb2fcb --- /dev/null +++ b/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewItemWire__columnState.ts @@ -0,0 +1,14 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// #36403 (ADR-0049 enforce-or-remove; the spec half of #35955). The view item +// record's `columnState` — the console grid's per-user column order and widths, +// declared by `viewItemWireFields()` on member 1 of the `view` union +// `saveMetaItem` validates, and stored on the shared row. No writer is left: the +// overlay writer retired with objectui#12504, and since #35955 a column drag +// goes to the list's draft while widths live in the reader's browser (census at +// `main` 97b9d1e6: this framework, its examples and console, HotCRM and the +// gallery; cloud not reachable). Tombstoned with `retiredKey()`; the authoring +// door never declared it. Same blind spot as `ui/ViewItemWire:owner`: a +// discriminated-union def emits no top-level `properties`, so no gate judges +// this row. D2: `view-column-state-removed`. +export const entry = 'ui/ViewItemWire:columnState'; diff --git a/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewMetadata__columnState.ts b/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewMetadata__columnState.ts new file mode 100644 index 00000000000..64fe554542b --- /dev/null +++ b/packages/spec/src/migrations/entries/retired-keys/18.ui__ViewMetadata__columnState.ts @@ -0,0 +1,12 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// #36403 — the flattened overlay's `columnState`, the sibling of +// `ui/ViewItemWire:columnState` (see that row for the measurement). Declared by +// `flattenedViewOverlayFields()` on members 3 and 4 of the `view` union, the +// lean personalization PUT a column drag on a system view wrote before +// objectui#12504. Tombstoned with `retiredKey()` on both overlay members, with +// the record's prescription text. Registered under `ui/ViewMetadata`, the +// exported door the overlay members are reached through; same blind spot as +// `ui/ViewMetadata:owner` (the def is unemitted), so the row is declared, not +// checked. D2: `view-column-state-removed`. +export const entry = 'ui/ViewMetadata:columnState'; diff --git a/packages/spec/src/migrations/entries/semantic/18.view-column-state-retired.ts b/packages/spec/src/migrations/entries/semantic/18.view-column-state-retired.ts new file mode 100644 index 00000000000..3b9c99478f8 --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/18.view-column-state-retired.ts @@ -0,0 +1,57 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #36403 (ADR-0049 enforce-or-remove; the spec half of #35955) — the D3 entry of +// the `view-column-state-removed` family (ruling B on #17152: one D3 entry per +// retirement family, even when D2 is lossless). Registered keys: `columnState` +// on `ui/ViewItemWire` (the record door) and `ui/ViewMetadata` (the door the +// flattened overlay members are reached through). One family on both doors: +// the key retires from both at once, so one conversion and one D3 entry. +export const entry: SemanticMigration = { + id: 'view-column-state-retired', + surface: + 'view.columnState on a stored view row — the view item record and the flattened view overlay ' + + '(the lean PUT /api/v1/meta/view/:name body with no config) the console once wrote a column ' + + 'drag or resize onto', + replacement: + '(removed — no stored column layout exists.) Column widths live in each reader\'s browser, per view; ' + + 'a column order a reader wants kept is saved into the view itself (its `columns` order, or ' + + '`fieldOrder`) through the list\'s Save. A shipped default order is the order of `columns`, and a ' + + 'shipped default width is `width` on the column.', + reason: + 'The D2 conversion `view-column-state-removed` deletes the key from every view item record and ' + + 'every flattened overlay (a view body with no container slot) — in `views` (stack sources, and ' + + 'every stored row, replayed on each read before it is served or badged) and in the ' + + 'assembled-manifest view item channel. The delete is NOT lossless for what a reader sees. ' + + 'Until this release the console still applied a stored layout: a reader with no column order ' + + 'or widths of their own in the browser saw the order and widths the row held. After it, that ' + + 'reader sees the view\'s own columns, column order and widths. That is the maintainer\'s ' + + 'ruling when the server-side per-user list layout retired: a stored layout is not migrated, ' + + 'and every reader goes back to the view\'s own columns, order and widths. So no stored order ' + + 'is moved into `fieldOrder`. The judgment left is about the rows it empties. An overlay row that held nothing but its identity and the key — the ' + + 'shape a column drag on a system view wrote before the overlay writer retired — is left ' + + 'identity-only, a body the view door refuses, so that row needs its owner (see the acceptance ' + + 'criteria). Measured writers in this repository, its console, the HotCRM app and the gallery at ' + + '`main` 97b9d1e6: zero. NOT MEASURED: clients outside this repository, and production stored ' + + 'rows — the write door accepted and stored the key until this release, and no deployment store ' + + 'is reachable from here.', + acceptanceCriteria: + 'After the upgrade, open a list whose view row held `columnState`, in a browser that keeps no ' + + 'column order or widths of your own for that view: you see the view\'s own column order ' + + '(its `columns`, or `fieldOrder`) and its own widths, not the stored layout. If the old layout ' + + 'is wanted for everyone, reorder the columns and Save to the view, or set `width` on the ' + + 'columns. ' + + 'No view item record or flattened view overlay you save carries `columnState`: the write door ' + + 'refuses it with 422 INVALID_METADATA, the issue located at the key and the retirement ' + + 'prescription as its message. A stored row that held it is stripped of it on every read, and ' + + 'what follows depends on what else the row holds. (1) A record, or an overlay with any other ' + + 'view key (a sort, a default flag, an order), is served and badged valid without the key, a GET ' + + 'then a PUT of the whole row answers 200 (if it was otherwise valid), and ' + + '`os migrate meta --stored --apply` rewrites it. (2) A column-state-only overlay — nothing but ' + + 'its identity (name, object, viewKind, label) and `columnState` — is left with identity only, ' + + 'which the view door refuses ("only identity fields"): it is served badged invalid, `--apply` ' + + 'reports it `failed` and leaves it as stored, and every read strips it again. Delete each such ' + + 'row: it held only a column layout the ruling does not carry forward. No source you ship ' + + 'declares `columnState` on a view, a view item or a list view body.', +}; diff --git a/packages/spec/src/migrations/registry.ts.template b/packages/spec/src/migrations/registry.ts.template index 0a9603a8e0d..d3a309d5078 100644 --- a/packages/spec/src/migrations/registry.ts.template +++ b/packages/spec/src/migrations/registry.ts.template @@ -3541,6 +3541,23 @@ const STEP18_RATIONALE: readonly RationaleFragment[] = [ + 'and stored rows, which changes nothing a reader sees. Its D3 record is the semantic entry ' + '`ui-view-personal-declarations-retired`.', }, + { + id: 'view-column-state-retired', + order: 123, + text: + 'It also retires `columnState` from the stored `view` row (ADR-0049; the spec half of the ruling ' + + 'that put column widths in the reader\'s browser and retired the server-side per-user list ' + + 'preference layer): the console grid\'s per-user column order and widths, declared on the view ' + + 'item record and the flattened overlay, written onto a shared row and read back. No writer is ' + + 'left — a column drag goes to the list\'s draft and is saved into the view itself — so the key is ' + + 'a `retiredKey()` tombstone on both doors, and the D2 conversion `view-column-state-removed` ' + + 'strips it in `views` and `viewItems`, so a stored row is served without it and its layout is no ' + + 'longer applied: as ruled, a stored layout is not migrated and every reader sees the view\'s own ' + + 'column order and widths. A row that held ' + + 'other view keys is then valid again and re-saves; an overlay that held nothing but its identity ' + + 'and the key is left identity-only, which the door refuses, and is deleted. Its D3 record is the ' + + 'semantic entry `view-column-state-retired`.', + }, { id: 'view-data-api-provider-retired', order: 95, diff --git a/packages/spec/src/shared/retired-key-removal-version.pin.test.ts b/packages/spec/src/shared/retired-key-removal-version.pin.test.ts index c6b69a906fb..8623216a7f3 100644 --- a/packages/spec/src/shared/retired-key-removal-version.pin.test.ts +++ b/packages/spec/src/shared/retired-key-removal-version.pin.test.ts @@ -440,6 +440,24 @@ const JOIN: Readonly> = { // #26677: value-level retirements — each retired member is refused by the // enum's own error map with its prescription, so the refusal is the parse. 'list-view-options-bag-folded': [tombstone(VIEW_METADATA_MEMBERS.listOverlay, 'view (list overlay)', 'options')], + // #36403: one family on both wire doors — the two flattened overlays carry the + // tombstone in their own shape; the record is a discriminated union, so its + // refusal is read off a parse. + 'view-column-state-removed': [ + tombstone(VIEW_METADATA_MEMBERS.listOverlay, 'view (list overlay)', 'columnState'), + tombstone(VIEW_METADATA_MEMBERS.formOverlay, 'view (form overlay)', 'columnState'), + refusal( + 'a view item record carrying columnState', + () => VIEW_METADATA_MEMBERS.viewItem.safeParse({ + name: 'crm_case.mine', + object: 'crm_case', + viewKind: 'list', + columnState: { order: ['subject'] }, + config: { type: 'grid', columns: ['subject'] }, + }), + 'columnState', + ), + ], 'navigation-mode-overlay-values-removed': [ ...(['modal', 'split', 'popover'] as const).map((mode) => refusal(`navigation.mode '${mode}'`, () => NavigationModeSchema.safeParse(mode)), diff --git a/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts b/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts index 05f264f1572..d8cba8c190b 100644 --- a/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts +++ b/packages/spec/src/system/metadata-form-zod-reconciliation.test.ts @@ -507,13 +507,6 @@ const LEDGER: ReadonlyArray = [ key: 'lookupAutofill', why: "planned, not yet read — a lookup's pick autofill pairs (`[{ target, source, overwrite? }]`) are validated at parse (a single-value relationship; each target a writable field of the same object, named once) and their sources at `os validate` / `os build`, but no form or grid fills a field from them until the ui card's lookup widget writes the declared targets on pick. A form control offered today would let an author declare a fill nothing performs", }, - { - kind: 'omit', - type: 'view', - path: ROOT_PATH, - key: 'columnState', - why: "platform-written, never authored — `Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored)`. Declared on the wire members only so the console's own write parses; the authoring door (`ViewItemSchema`) rejects the key by name", - }, { kind: 'omit', type: 'view', diff --git a/packages/spec/src/ui/view-column-state-retirement.test.ts b/packages/spec/src/ui/view-column-state-retirement.test.ts new file mode 100644 index 00000000000..71343d698f4 --- /dev/null +++ b/packages/spec/src/ui/view-column-state-retirement.test.ts @@ -0,0 +1,235 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * A stored `view` row's `columnState` RETIRED (#36403) — ADR-0049 + * enforce-or-remove, the spec half of #35955 (maintainer, 2026-11-21: column + * widths 「只记在浏览器里」, and the server-side per-user list preference layer + * 「整个退掉」). + * + * The key was the console grid's per-user column order and widths, declared on + * both wire doors of the `view` union — the view item RECORD (member 1) and the + * flattened OVERLAY (members 3 and 4) — and on `VIEW_CONSOLE_ROUND_TRIP_KEYS`. + * No writer is left (census in the `VIEW_COLUMN_STATE_RETIRED` docblock). + * + * Bookkeeping shapes, pinned below: + * 1. One `retiredKey()` text on all three members. The authoring doors never + * declared the key; their `guidance` names the retirement. + * 2. D2 conversion `view-column-state-removed` (step 18), one family on both + * spellings, reaching `views` and `viewItems`, leaving containers alone. + * 3. `RETIRED_KEYS_BY_MAJOR[18]` carries `ui/ViewItemWire:columnState` and + * `ui/ViewMetadata:columnState` — declared, not judged (neither def emits + * top-level `properties`). + * 4. One D3 semantic entry, `view-column-state-retired`. + * 5. The column-state-only overlay residue: the strip leaves identity only, + * which the door refuses. + */ + +import { describe, expect, it } from 'vitest'; + +import { collectConversionNotices } from '../conversions/apply'; +import { applyConversionsToStoredItem } from '../conversions/stored'; +import { getMetadataTypeSchema } from '../kernel/metadata-type-schemas'; +import { MIGRATIONS_BY_MAJOR, RETIRED_KEYS_BY_MAJOR } from '../migrations/registry'; +import { AssembledViewArtifactSchema } from './assembled-views.zod'; +import { + ListViewSchema, + VIEW_CONSOLE_ROUND_TRIP_KEYS, + VIEW_METADATA_MEMBERS, + ViewItemSchema, + ViewMetadataSchema, +} from './view.zod'; + +const LIST_OVERLAY = { name: 'crm_lead.all', object: 'crm_lead', viewKind: 'list' } as const; +const FORM_OVERLAY = { name: 'crm_lead.edit', object: 'crm_lead', viewKind: 'form' } as const; +const RECORD = { + name: 'crm_lead.mine', + object: 'crm_lead', + viewKind: 'list', + config: { type: 'grid', columns: ['name'] }, +} as const; + +/** What the console grid wrote, measured on objectui#5233. */ +const VALUE = { order: ['email', 'name'], widths: { email: 240 } } as const; + +// Unanchored: a thrown `ZodError`'s message is the JSON of its issues. The +// key-first convention is asserted on the issue message itself below. +const PRESCRIPTION = /`view\.columnState` was removed in @objectstack\/spec 18\.7\.0 \(ADR-0049.*Delete the key\..*`os migrate meta --from 17`/s; +const LIST_BODY_PRESCRIPTION = /`listView\.columnState` was removed in @objectstack\/spec 18\.7\.0 \(ADR-0049.*Delete the key\./s; + +type Issue = { code: string; path: PropertyKey[]; message: string; errors?: Issue[][] }; + +const MEMBERS = [ + ['viewItem', VIEW_METADATA_MEMBERS.viewItem, RECORD], + ['listOverlay', VIEW_METADATA_MEMBERS.listOverlay, LIST_OVERLAY], + ['formOverlay', VIEW_METADATA_MEMBERS.formOverlay, FORM_OVERLAY], +] as const; + +describe('columnState retirement — the tombstone, at every door that parses a stored row', () => { + for (const [member, schema, row] of MEMBERS) { + it(`the ${member} member refuses \`columnState\` at its path with the prescription`, () => { + const r = schema.safeParse({ ...row, columnState: VALUE }); + expect(r.success).toBe(false); + if (r.success) return; + const issue = r.error.issues.find((i) => i.path[0] === 'columnState'); + expect(issue, 'the refusal must name `columnState`').toBeDefined(); + expect(issue!.code).toBe('invalid_type'); + expect(issue!.path).toEqual(['columnState']); + expect(issue!.message).toMatch(PRESCRIPTION); + expect(issue!.message.startsWith('`view.columnState` was removed')).toBe(true); + }); + } + + it('the `view` write door refuses every row shape carrying it, the claimed member locating the key', () => { + const door = getMetadataTypeSchema('view'); + expect(door).toBe(ViewMetadataSchema); + for (const row of [LIST_OVERLAY, FORM_OVERLAY, RECORD]) { + const r = door!.safeParse({ ...row, columnState: VALUE }); + expect(r.success, JSON.stringify(row)).toBe(false); + if (r.success) continue; + const top = r.error.issues[0] as unknown as Issue; + expect(top.message).toMatch(PRESCRIPTION); + } + }); + + it('the assembled-manifest channel refuses it too — which is why the D2 conversion reaches `viewItems`', () => { + expect(AssembledViewArtifactSchema.safeParse({ ...LIST_OVERLAY, columnState: VALUE }).success).toBe(false); + expect(AssembledViewArtifactSchema.safeParse({ ...RECORD, columnState: VALUE }).success).toBe(false); + }); + + it('the authoring doors, which never declared it, refuse it by name with the retirement text', () => { + const item = ViewItemSchema.safeParse({ ...RECORD, columnState: VALUE }); + expect(item.success).toBe(false); + if (!item.success) expect(JSON.stringify(item.error.issues)).toMatch(PRESCRIPTION); + + const list = ListViewSchema.safeParse({ type: 'grid', columns: ['name'], columnState: VALUE }); + expect(list.success).toBe(false); + if (!list.success) expect(JSON.stringify(list.error.issues)).toMatch(LIST_BODY_PRESCRIPTION); + + // …and a record whose CONFIG carries it: the record member judges `config` + // with the strict list shape. + expect(ViewMetadataSchema.safeParse({ + ...RECORD, + config: { ...RECORD.config, columnState: VALUE }, + }).success).toBe(false); + }); + + it('CONTROL: the same rows without the key pass every door, and grow no `columnState`', () => { + for (const [label, schema, body] of [ + ['viewItem member', VIEW_METADATA_MEMBERS.viewItem, { ...RECORD, isPinned: true }], + ['listOverlay member', VIEW_METADATA_MEMBERS.listOverlay, { ...LIST_OVERLAY, isDefault: true }], + ['formOverlay member', VIEW_METADATA_MEMBERS.formOverlay, { ...FORM_OVERLAY, isDefault: true }], + ['door (list)', ViewMetadataSchema, { ...LIST_OVERLAY, hiddenFields: ['name'] }], + ] as const) { + const r = schema.safeParse(body); + expect(r.success, `${label} must accept the row`).toBe(true); + if (!r.success) continue; + expect(r.data as Record, label).not.toHaveProperty('columnState'); + } + }); + + it('is gone from the console round-trip record, so no console derivation carries it', () => { + expect(Object.keys(VIEW_CONSOLE_ROUND_TRIP_KEYS)).not.toContain('columnState'); + }); +}); + +describe('columnState retirement — the D2 conversion', () => { + it('a STORED overlay row carrying it rehydrates clean, then parses at the door', () => { + const stored = { ...LIST_OVERLAY, isDefault: true, columnState: VALUE }; + const notices: { conversionId?: string; path?: string }[] = []; + const rehydrated = applyConversionsToStoredItem('view', stored, { + onNotice: (n) => notices.push(n as { conversionId?: string; path?: string }), + }) as Record; + expect(notices.map((n) => [n.conversionId, n.path])).toEqual([ + ['view-column-state-removed', 'views[0].columnState'], + ]); + expect(rehydrated).not.toHaveProperty('columnState'); + expect(rehydrated.isDefault).toBe(true); + expect(ViewMetadataSchema.safeParse(rehydrated).success).toBe(true); + // CONTROL: the stored row itself, unconverted, is what the door now refuses. + expect(ViewMetadataSchema.safeParse(stored).success).toBe(false); + }); + + it('a STORED record carrying it rehydrates clean, `config` untouched', () => { + const stored = { ...RECORD, isPinned: true, columnState: VALUE }; + const rehydrated = applyConversionsToStoredItem('view', stored) as Record; + expect(rehydrated).toEqual({ ...RECORD, isPinned: true }); + expect(ViewMetadataSchema.safeParse(rehydrated).success).toBe(true); + }); + + it('reaches `viewItems`, strips both spellings once each, and leaves containers alone', () => { + const container = { object: 'crm_lead', list: { type: 'grid', columns: ['name'] } }; + const { stack, notices } = collectConversionNotices( + { + viewItems: [{ ...LIST_OVERLAY, columnState: VALUE }, { ...RECORD, columnState: VALUE }], + views: [container], + }, + { includeRetired: true }, + ); + expect(notices.map((n) => [n.conversionId, n.path])).toEqual([ + ['view-column-state-removed', 'viewItems[0].columnState'], + ['view-column-state-removed', 'viewItems[1].columnState'], + ]); + expect(stack).toEqual({ viewItems: [LIST_OVERLAY, RECORD], views: [container] }); + for (const entry of stack.viewItems as unknown[]) { + expect(AssembledViewArtifactSchema.safeParse(entry).success).toBe(true); + } + + // Idempotence, measured: a second replay converts nothing and hands the + // input back by reference (copy-on-write). + const replay = collectConversionNotices(stack, { includeRetired: true }); + expect(replay.notices).toHaveLength(0); + expect(replay.stack).toBe(stack); + }); + + it('is retired from the load path — a live author is refused at parse, never silently rewritten', () => { + const { stack, notices } = collectConversionNotices({ views: [{ ...LIST_OVERLAY, columnState: VALUE }] }); + expect(notices).toHaveLength(0); + expect(stack).toEqual({ views: [{ ...LIST_OVERLAY, columnState: VALUE }] }); + }); +}); + +/** + * The column-state-only overlay — what a column drag on a system view wrote + * before objectui#12504: identity plus `columnState`. The strip leaves identity + * only, which the identity precondition refuses. Stated in the D2 docblock, + * the D3 acceptance criteria and the changeset; pinned here so they stay true. + */ +describe('columnState retirement — the column-state-only residue', () => { + it('strips to identity only, which the door refuses as "only identity fields"', () => { + const rehydrated = applyConversionsToStoredItem('view', { ...LIST_OVERLAY, _isOverride: true, columnState: VALUE }); + // `_isOverride` is the console's settings-overlay marker, a declared + // round-trip key — so a marked row is NOT identity-only and stays valid. + expect(ViewMetadataSchema.safeParse(rehydrated).success).toBe(true); + + const bare = applyConversionsToStoredItem('view', { ...LIST_OVERLAY, columnState: VALUE }); + expect(bare).toEqual(LIST_OVERLAY); + const r = ViewMetadataSchema.safeParse(bare); + expect(r.success).toBe(false); + if (r.success) return; + expect(r.error.issues).toHaveLength(1); + expect(r.error.issues[0]!.code).toBe('custom'); + expect(r.error.issues[0]!.message).toContain('only identity fields'); + expect(r.error.issues[0]!.message).not.toMatch(/was removed in @objectstack\/spec/); + }); +}); + +describe('columnState retirement — ADR-0087 registration', () => { + it('declares the key on both doors under major 18, with the D2 entry in the step-18 chain', () => { + for (const key of ['ui/ViewItemWire:columnState', 'ui/ViewMetadata:columnState']) { + expect(RETIRED_KEYS_BY_MAJOR[18], key).toContain(key); + } + expect(MIGRATIONS_BY_MAJOR[18]!.conversionIds).toContain('view-column-state-removed'); + }); + + it('carries ONE D3 semantic entry, naming its D2 conversion, the measured zero and the unmeasured population', () => { + const semantic = MIGRATIONS_BY_MAJOR[18]!.semantic; + const family = semantic.filter((s) => s.id === 'view-column-state-retired'); + expect(family).toHaveLength(1); + const entry = family[0]!; + expect(entry.reason).toContain('`view-column-state-removed`'); + expect(entry.reason).toContain('NOT MEASURED'); + expect(entry.acceptanceCriteria).toContain('only identity fields'); + const naming = semantic.filter((s) => JSON.stringify(s).includes('view-column-state-removed')); + expect(naming.map((s) => s.id)).toEqual(['view-column-state-retired']); + }); +}); diff --git a/packages/spec/src/ui/view-console-round-trip-keys.test.ts b/packages/spec/src/ui/view-console-round-trip-keys.test.ts index e4cbc4cd7af..dd15ebb7e4f 100644 --- a/packages/spec/src/ui/view-console-round-trip-keys.test.ts +++ b/packages/spec/src/ui/view-console-round-trip-keys.test.ts @@ -48,7 +48,10 @@ const CENSUS: Record = { isPinned: ['viewItem', 'listOverlay'], sortOrder: ['viewItem', 'listOverlay'], visibility: ['viewItem', 'listOverlay'], - columnState: ['viewItem', 'listOverlay'], + // [#36403] `columnState` left the census: the console writes no column layout + // onto a stored row any more (widths live in the reader's browser, a column + // order is saved into the view itself, #35955), so it was retired from both + // members — `view-column-state-retirement.test.ts`. _isOverride: ['listOverlay'], }; @@ -58,7 +61,6 @@ const VALUE: Record = { isPinned: true, sortOrder: 3, visibility: 'team', - columnState: { order: ['name'], widths: { name: 120 } }, _isOverride: true, }; diff --git a/packages/spec/src/ui/view-metadata-schema.test.ts b/packages/spec/src/ui/view-metadata-schema.test.ts index 812ef2cff51..66405ad43df 100644 --- a/packages/spec/src/ui/view-metadata-schema.test.ts +++ b/packages/spec/src/ui/view-metadata-schema.test.ts @@ -14,7 +14,7 @@ import { describe, it, expect } from 'vitest'; import { z } from 'zod'; -import { ListViewSchema, ViewItemSchema, ViewMetadataSchema } from './view.zod'; +import { ViewMetadataSchema } from './view.zod'; const PLACEHOLDER_DATA = { provider: 'object', object: 'crm_lead' } as const; @@ -407,107 +407,18 @@ describe('ViewMetadataSchema — genuine validation across the three runtime sha }); }); - // ── commit d5552ca13: `columnState` — runtime-only overlay key, BOTH halves pinned ─── + // ── `columnState` — admitted at commit d5552ca13, RETIRED at #36403 ─── // - // The maintainer-accepted ruling (objectui#5233, 「全部接受」 2026-08-19): - // `columnState` is admitted to the view-metadata surface as an EXPLICITLY - // runtime-only overlay key — accepted where overlays are validated, NOT - // authorable (objectui's `gridNonAuthorKeys` disposition). The two halves - // below are the card's executable acceptance criterion; a change that flips - // either one is reversing a ruling, not tidying a schema. - describe('columnState — runtime-only overlay key', () => { - // The REAL payload, measured: objectui's `persistViewPatch` sends - // `{ columnState: { order?, widths? }, _isOverride: true }` and - // `normalizeViewMetadata` inherits `name`/`object`/`viewKind` from the - // shadowed entry (#2555). Before commit d5552ca13 this body carried no declared key, - // so the identity precondition 422'd it — the ruled patch-only write for - // a column drag could not persist. - it('HALF 1 — the overlay face accepts a `columnState`-only patch (the patch-only write the console persists)', () => { - const r = ViewMetadataSchema.safeParse({ - name: 'showcase_task.default', - object: 'showcase_task', - viewKind: 'list', - _isOverride: true, // objectui's settings-overlay marker — declared on this member since #20456 - columnState: { order: ['email', 'name'], widths: { email: 240 } }, - }); - expect(r.success).toBe(true); - }); - - it('HALF 1 — a baseline-less columnState patch is refused at the MEMBERS (the object + viewKind binding pair), not the precondition', () => { - // `columnState` is vocabulary now, so the precondition stays inert; what - // refuses the unbound body is the members' object+viewKind requirement. - const r = ViewMetadataSchema.safeParse({ columnState: { order: ['name'] } }); - expect(r.success).toBe(false); - if (r.success) return; - expect(r.error.issues[0]!.code).toBe('invalid_union'); - expect(JSON.stringify(r.error.issues)).not.toContain('Not a `view` body'); - }); - - it('HALF 1 — the inner shape is genuinely validated, not passthrough', () => { - // A declared key that validated nothing would be the same laundering the - // fat write did, one level down. - expect(ViewMetadataSchema.safeParse({ - name: 'v', object: 'o', viewKind: 'list', columnState: { order: 'email' }, - }).success).toBe(false); - expect(ViewMetadataSchema.safeParse({ - name: 'v', object: 'o', viewKind: 'list', columnState: 'wide', - }).success).toBe(false); - // …while a console-owned FUTURE inner key parses (deliberately not - // `.strict()`: the console owns the internals, and an older server must - // not 422 a newer console). - expect(ViewMetadataSchema.safeParse({ - name: 'v', object: 'o', viewKind: 'list', columnState: { order: ['a'], pinnedLeft: ['b'] }, - }).success).toBe(true); - }); - - it('HALF 1 — a merged ViewItem-record write carries it on the wire member (`{...current, ...partial}`)', () => { - const r = ViewMetadataSchema.safeParse({ - name: 'crm_lead.all', - object: 'crm_lead', - viewKind: 'list', - config: { type: 'grid', columns: ['name'], data: PLACEHOLDER_DATA }, - columnState: { widths: { name: 120 } }, - isPinned: true, - }); - expect(r.success).toBe(true); - }); - - it('HALF 2 — the authoring face still REJECTS `columnState` as an authored key, BY NAME', () => { - // `defineViewItem` / Studio's create form are judged by the strict - // `ViewItemSchema`; the refusal must name the key and carry the - // runtime-only prescription, not fall back to a typo suggestion. - const r = ViewItemSchema.safeParse({ - name: 'crm_lead.all', - object: 'crm_lead', - viewKind: 'list', - config: { type: 'grid', columns: ['name'], data: PLACEHOLDER_DATA }, - columnState: { order: ['name'] }, - }); - expect(r.success).toBe(false); - if (r.success) return; - const text = JSON.stringify(r.error.issues); - expect(text).toContain('`columnState`'); - expect(text).toContain('per-user runtime personalization'); - }); - - it('HALF 2 — an authored list CONFIG carrying `columnState` is rejected by name too', () => { - const r = ListViewSchema.safeParse({ type: 'grid', columns: ['name'], columnState: { order: ['name'] } }); - expect(r.success).toBe(false); - if (r.success) return; - const text = JSON.stringify(r.error.issues); - expect(text).toContain('`columnState`'); - expect(text).toContain('per-user runtime personalization'); - // …and through the metadata door: a ViewItem whose CONFIG smuggles it is - // refused (the record member validates `config` with the strict shape). - expect(ViewMetadataSchema.safeParse({ - name: 'crm_lead.all', object: 'crm_lead', viewKind: 'list', - config: { type: 'grid', columns: ['name'], columnState: { order: ['name'] } }, - }).success).toBe(false); - }); - + // It was a runtime-only overlay key (objectui#5233, 「全部接受」 2026-08-19): + // accepted where overlays are validated, never authorable. #35955 retired the + // server-side per-user list layer it carried, so both wire doors now + // tombstone it; `view-column-state-retirement.test.ts` pins the tombstones, + // the D2 conversion and the registrations. What stays here is the siblings' + // behaviour, which the retirement must not move. + describe('personalization overlay keys beside the retired `columnState`', () => { it('sibling runtime keys are UNCHANGED — each still parses alone with the binding pair', () => { - // The accept-set widening is exactly one key; the four measured siblings - // (186/10/8/2 spec hits on the card) keep their prior behavior. + // The four measured siblings (186/10/8/2 spec hits on objectui#5233's + // card) keep their behaviour through `columnState`'s retirement. for (const patch of [ { sort: [{ field: 'name', order: 'asc' }] }, { rowHeight: 'compact' }, @@ -518,7 +429,7 @@ describe('ViewMetadataSchema — genuine validation across the three runtime sha name: 'v', object: 'crm_lead', viewKind: 'list', ...patch, }).success).toBe(true); } - // …and garbage keys are still refused: vocabulary grew by one, not open. + // …and garbage keys are still refused: the vocabulary is not open. expect(ViewMetadataSchema.safeParse({ name: 'v', object: 'crm_lead', viewKind: 'list', colState: { order: [] }, }).success).toBe(false); diff --git a/packages/spec/src/ui/view-overlay-owner-hidden-retirement.test.ts b/packages/spec/src/ui/view-overlay-owner-hidden-retirement.test.ts index 8c5547132fc..0265bbf2b13 100644 --- a/packages/spec/src/ui/view-overlay-owner-hidden-retirement.test.ts +++ b/packages/spec/src/ui/view-overlay-owner-hidden-retirement.test.ts @@ -318,7 +318,9 @@ describe('overlay owner/hidden retirement — the hide-only residue', () => { }); it('CONTROL: a write that adds a real view key (a toolbar toggle) saves — the residue is the identity-only body, not the row', () => { - for (const toggle of [{ isDefault: true }, { order: 2 }, { columnState: { widths: { name: 120 } } }]) { + // [#36403] `columnState` was the third toggle here; it is retired, and + // `hiddenFields` (a live personalization key) stands in for it. + for (const toggle of [{ isDefault: true }, { order: 2 }, { hiddenFields: ['name'] }]) { expect(ViewMetadataSchema.safeParse({ ...IDENTITY, ...toggle }).success, JSON.stringify(toggle)).toBe(true); } }); diff --git a/packages/spec/src/ui/view-overlay-viewkind-arm.test.ts b/packages/spec/src/ui/view-overlay-viewkind-arm.test.ts index 3c2ad2713b2..47c8f111b93 100644 --- a/packages/spec/src/ui/view-overlay-viewkind-arm.test.ts +++ b/packages/spec/src/ui/view-overlay-viewkind-arm.test.ts @@ -93,12 +93,13 @@ describe('a column-less list PATCH is judged by the list member', () => { // The objectui producer: `buildPersistedViewBody` stores `{ ...patch, // viewKind }`, and `updateViewConfig` stamps `object`, `name` and the overlay - // marker. One body per toolbar path the console persists. + // marker. One body per toolbar path the console persists. [#36403] The + // column drag's `columnState` body is gone: the key is retired + // (`view-column-state-retirement.test.ts`). it.each([ ['sort', { sort: [{ field: 'name', order: 'desc' }] }], ['hiddenFields', { hiddenFields: ['email'] }], ['inlineEdit', { inlineEdit: true }], - ['columnState', { columnState: { widths: { name: 120 } } }], ['rowHeight', { rowHeight: 'compact' }], ])('the console %s toggle (a patch-only write, as ruled) is ACCEPTED on listOverlay', (_label, patch) => { const { branch, data } = acceptance({ ...patch, viewKind: 'list', ...ID, _isOverride: true }); diff --git a/packages/spec/src/ui/view.zod.ts b/packages/spec/src/ui/view.zod.ts index 77f7e0bd6aa..804cec9beac 100644 --- a/packages/spec/src/ui/view.zod.ts +++ b/packages/spec/src/ui/view.zod.ts @@ -3368,6 +3368,19 @@ export function checkListViewTimesheetBinding( ctx.addIssue({ code: 'custom', path: ['timesheet'], message: LIST_VIEW_TIMESHEET_NEEDS_BINDING }); } +/** + * [#36403] The list view body's refusal of `columnState`. The key was never + * declared on this authoring shape; it was a wire key of the stored `view` + * row (see `VIEW_COLUMN_STATE_RETIRED`, further down, for the retirement and + * its census). No conversion reaches a list view body, so this text names no + * migration command — the author deletes the key by hand. + */ +const VIEW_LIST_COLUMN_STATE_RETIRED = + '`listView.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it was ' + + 'never a list view key: it held one column order and set of widths the console once stored on a view ' + + 'row, and that layout is no longer applied. Delete the key. To ship a column order, list `columns` in that ' + + 'order (or set `fieldOrder`); to ship a width, set `width` on the column.'; + /** * List View Schema (Expanded) * Defines how a collection of records is displayed to the user. @@ -3417,13 +3430,10 @@ const ListViewShapeSchema = lazySchema(() => strictObject({ surface: 'this list view', history: VIEW_HISTORY, guidance: { - // [commit d5552ca13] Runtime-only overlay key, deliberately NOT declared here: this - // is the AUTHORING shape, and column order/widths are per-user state the - // console grid writes through the `view` metadata API (objectui's - // `gridNonAuthorKeys` disposition). The overlay-validation face declares - // it (`flattenedViewOverlayFields` / `viewItemWireFields`); an author who - // writes it here gets this prescription instead of a bare typo suggestion. - columnState: 'Column order/widths are per-user runtime personalization the console grid writes through the `view` metadata API — not authored metadata. Remove it from authored metadata.', + // [#36403] Never declared on this AUTHORING shape, and now retired from + // the wire members too (`flattenedViewOverlayFields` / `viewItemWireFields` + // tombstone it); an author who writes it here gets the retirement text. + columnState: VIEW_LIST_COLUMN_STATE_RETIRED, }, }, { name: SnakeCaseIdentifierSchema.optional().describe('Internal view name (lowercase snake_case)'), @@ -6177,36 +6187,33 @@ type ViewItemWireArmShape = { }; /** - * [commit d5552ca13] The per-user column layout the console's grid persists through the - * `view` metadata door — an **explicitly runtime-only overlay key**, admitted - * where overlays are validated and deliberately NOT authorable. - * - * Modeled on what the write actually sends (measured on objectui#5233's - * os-dev-report and `ObjectGridColumnState` in objectui's - * `plugin-grid/src/ObjectGrid.tsx`): `onColumnStateChange` emits - * `{ order?: string[]; widths?: Record }` — the merged result - * of a column reorder and a resize — and `persistViewPatch` PUTs it as the - * `columnState` key of a personalization overlay. Until this key was declared, - * a `columnState`-only patch carried no key any {@link ViewMetadataSchema} - * member declared, so {@link assertViewIdentity} refused the body ("no - * recognized `view` key") and the write 422'd — the ruled patch-only write - * (objectstack#7494 comment 5261754173) could not land. It survived only - * inside the fat write's copied base, i.e. laundered past validation. - * - * Posture decisions, both deliberate: - * - **Not `.strict()`**: the console owns the internals of this per-user - * state (objectui's `gridNonAuthorKeys` ruling, 2026-08-18), so a future - * console key here must not 422 against an older server. The two known - * keys are typed; unknown inner keys parse. [#20051] They are not stored: - * the save keeps only the keys the schema declares, so a new console key - * is declared here before the console relies on reading it back. - * - **Not exported, not on {@link ListViewSchema}**: exporting would mint a - * protocol def / authorable-surface entries, and declaring it on the - * authoring shape would bless hand-authoring a payload the product writes - * on the user's behalf. Author-writability is a DIFFERENT spec change, - * explicitly out of commit d5552ca13's scope; the authoring doors keep rejecting the - * key by name (see `VIEW_ITEM_SURFACE.guidance` and `ListViewSchema`'s - * `guidance`). + * [#36403] `columnState` RETIRED — ADR-0049 enforce-or-remove, the spec half + * of #35955 (maintainer: 「只记在浏览器里」 for column widths, and the + * server-side per-user list preference layer 「整个退掉」, 2026-11-21). + * + * [commit d5552ca13] had admitted it as a runtime-only overlay key: the + * console grid's column order and widths, PUT onto a stored `view` row (a + * personalization overlay, or a view item record through `updateView`) and + * applied on read. The writer is gone. The overlay writer retired with + * objectui#12504, and since #35955 a column drag goes to the list's draft + * (saved into the view's own `columns` / `fieldOrder`) while column widths + * live only in the reader's browser. Writer census before removal, at `main` + * 97b9d1e6: none in this framework, its examples or its console + * (`ui/packages/**`), none in the HotCRM app or the gallery; cloud was not + * reachable. The reader was not gone: until this release the console + * applied a stored layout (a record's key rode `listViews()`, an overlay's + * survived its narrowing, and the list renderer seeded the grid from it for a + * reader with no layout of their own in the browser). The D2 conversion + * strips the key on every read, so from this release no stored layout is + * applied and every reader sees the view's own column order and widths — the + * maintainer's ruling that a stored layout is not migrated (#35955). + * + * Tombstoned on BOTH wire doors that declared it ({@link viewItemWireFields} + * and {@link flattenedViewOverlayFields}), never deleted: a bare deletion on + * a closed member reports only "unrecognized key", and the prescription is + * the payload. The authoring doors never declared it; their `guidance` + * entries carry the same retirement text. Stored rows and sources are + * stripped by the D2 conversion `view-column-state-removed`. * * Declared ABOVE the ViewItem section on purpose: `viewItemWireFields()` reads * it, and under `OS_EAGER_SCHEMAS=1` every `lazySchema` factory runs at module @@ -6214,15 +6221,14 @@ type ViewItemWireArmShape = { * TDZ `ReferenceError` at import time (the `strict-object.ts` docblock carries * the measured incident). */ -const ViewColumnStateSchema = z.object({ - order: z.array(z.string()).optional() - .describe('Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored).'), - widths: z.record(z.string(), z.number()).optional() - .describe('Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored).'), -}).describe( - 'Runtime-only personalization overlay key: the column layout (order/widths) the console grid ' - + 'persists through the `view` metadata API. NOT authorable — authoring doors reject it by name; do not write it in metadata source.', -); +const VIEW_COLUMN_STATE_RETIRED = + '`view.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it held one ' + + 'column order and set of widths on a shared view row; nothing writes it any more, and a stored layout is ' + + 'no longer applied, so every reader sees the view\'s own column order and widths. The console keeps ' + + 'column widths in each reader\'s browser and saves a column order into the view itself. ' + + 'Delete the key. To ship a column order, list `columns` in that order (or set `fieldOrder`); to ship a ' + + 'width, set `width` on the column. ' + + 'Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.'; /** The authoring surface `defineViewItem` and Studio's create form are judged by. */ const VIEW_ITEM_SURFACE = { @@ -6236,8 +6242,9 @@ const VIEW_ITEM_SURFACE = { // instead of leaving them to guess. isPinned: 'Pinning is per-user Studio state, not authored metadata — the console writes it through the `view` metadata API. Remove it from authored metadata.', sortOrder: 'Switcher position is per-user Studio state, not authored metadata — use `order` for the authored default. Remove it from authored metadata.', - // [commit d5552ca13] Runtime-only overlay key — same disposition as the two above. - columnState: 'Column order/widths are per-user runtime personalization the console grid writes through the `view` metadata API — not authored metadata. Remove it from authored metadata.', + // [#36403] Retired — tombstoned on the wire members; an author gets the + // same prescription here ({@link VIEW_COLUMN_STATE_RETIRED}). + columnState: VIEW_COLUMN_STATE_RETIRED, // [#20456] Declared on the wire members with the switcher's other row // state; named here so an author who reaches for it as access control is // told what it is. @@ -6376,14 +6383,11 @@ const VIEW_ITEM_OPTIONS_REFUSED = function viewItemWireFields() { return { ...viewSwitcherRowStateFields(), - // Same disposition as the switcher keys: console state written through - // the `view` metadata API ({@link ViewColumnStateSchema} carries the - // key's own ruling). `updateView` PUTs - // `{ ...current, ...partial }`, so on a standalone ViewItem record the - // key arrives at THIS member's top level; declaring it validates the - // shape where `.strip()` used to let it ride through unchecked. - columnState: ViewColumnStateSchema.optional() - .describe('Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view\'s row, which has no per-user scope — not authored)'), + // [#36403] RETIRED — see {@link VIEW_COLUMN_STATE_RETIRED}. `updateView` + // PUT `{ ...current, ...partial }`, so on a standalone ViewItem record the + // key arrived at THIS member's top level; a stored record is stripped by + // the D2 conversion `view-column-state-removed`. + columnState: retiredKey(VIEW_COLUMN_STATE_RETIRED), // [#20051] Pinned ABSENT, refused by name — see // {@link VIEW_ITEM_OPTIONS_REFUSED}. `z.never()` rather than the form // overlay's `z.undefined()` ({@link FORM_OVERLAY_OPTIONS_REFUSED}): this @@ -6442,7 +6446,7 @@ const FORM_OVERLAY_WIRE_SURFACE: StrictObjectOptions = { * The flattened overlays are built by extending an authoring shape, and an * extension inherits that shape's refusal: the surface named in it, and the * candidate list a typo is pointed at, which would miss every key the overlay - * adds (`isPinned`, `columnState`, …). So the member is closed with a refusal + * adds (`isPinned`, `sortOrder`, …). So the member is closed with a refusal * built from its OWN shape — the same `strictObjectError` map * {@link strictObject} attaches — and re-declared as a `closedObject`, so the * refusal is terminal on this surface and the union keeps its envelope. @@ -6724,13 +6728,11 @@ function flattenedViewOverlayFields(kind: K) { + 'personalization PUTs.', ), label: I18nLabelSchema.optional().describe('Display label (inherited from the shadowed entry —).'), - // [commit d5552ca13] Runtime-only overlay key — declared HERE (the overlay-validation - // face) and on `viewItemWireFields()`, never on an authoring shape. This is - // what lets a `columnState`-only personalization patch through the - // identity precondition (the vocabulary is derived from the members' keys) - // AND gets its inner shape genuinely validated instead of ridden past - // `.strip()` unchecked. - columnState: ViewColumnStateSchema.optional(), + // [#36403] RETIRED — see {@link VIEW_COLUMN_STATE_RETIRED}. It was the + // overlay's per-user column order and widths; no writer is left, and a + // stored overlay row is stripped by the D2 conversion + // `view-column-state-removed`. + columnState: retiredKey(VIEW_COLUMN_STATE_RETIRED), // [#20456] A console round-trip key (the switcher's set-default writes it // and reads it back), declared here since before that census; now it // carries its meaning too. @@ -7065,7 +7067,7 @@ const LIST_OVERLAY_DEFAULT_TYPE = 'grid'; const LIST_OVERLAY_TYPE_NEEDS_COLUMNS = 'This list view overlay sets `type` but lists no `columns`. A body that sets `type` is a full inline list ' + 'config, and a full config lists its columns: add `columns: ["field_a", "field_b"]`. A patch on the view ' - + 'it shadows (`sort`, `hiddenFields`, `columnState`, `inlineEdit`, …) sets no `type` and needs no `columns`: ' + + 'it shadows (`sort`, `hiddenFields`, `rowHeight`, `inlineEdit`, …) sets no `type` and needs no `columns`: ' + 'remove `type` to save this body as a patch on the view it shadows.'; /** @@ -7385,7 +7387,6 @@ export const VIEW_CONSOLE_ROUND_TRIP_KEYS = { isPinned: ['viewItem', 'listOverlay'], sortOrder: ['viewItem', 'listOverlay'], visibility: ['viewItem', 'listOverlay'], - columnState: ['viewItem', 'listOverlay'], _isOverride: ['listOverlay'], } as const satisfies Record; diff --git a/ui/packages/app-shell/src/views/ObjectView.viewConfigSaveEnvelope-10210.test.ts b/ui/packages/app-shell/src/views/ObjectView.viewConfigSaveEnvelope-10210.test.ts index 18e6b42b366..68271cf8e71 100644 --- a/ui/packages/app-shell/src/views/ObjectView.viewConfigSaveEnvelope-10210.test.ts +++ b/ui/packages/app-shell/src/views/ObjectView.viewConfigSaveEnvelope-10210.test.ts @@ -33,6 +33,9 @@ */ import { describe, it, expect, vi } from 'vitest'; +// `./ObjectView` reaches `import('@objectstack/lint')` (the preview lints); +// pay its first load at collection, never inside a clocked case. +import '@objectstack/lint'; import { ViewMetadataSchema } from '@objectstack/spec/ui'; import { ObjectStackAdapter } from '@object-ui/data-objectstack'; import { buildViewConfigSaveBody } from './ObjectView'; @@ -95,7 +98,8 @@ const PANEL_DRAFT = { * The same draft when the tab it was built from had absorbed a stored row: the * tab spreads the served document (`config`, registry bookkeeping, read * decorations) and, when a toolbar overlay was merged in, its marker and - * `columnState`. None of that is view body. + * `columnState` (a stored row's, retired by objectstack#36403). None of that + * is view body. */ const TAB_LADEN_DRAFT = { ...PANEL_DRAFT, @@ -188,8 +192,13 @@ describe('objectui#10210 — the view-config save persists a ViewItem envelope', isDefault: false, isPinned: true, sortOrder: 2, - columnState: { widths: { name: 180 } }, }); + // objectstack#36403: `columnState` left the spec's round-trip record, so + // the row-state keys derived from it no longer carry it, and the body + // `config` (read off `ListViewSchema`) never declared it: a stale value + // on the tab is shed, which is what the retired key's door now needs. + expect(body.columnState).toBeUndefined(); + expect(body.config.columnState).toBeUndefined(); expect(body.config.rowHeight).toBe('short'); expect(body._isOverride).toBeUndefined(); expect(body.config._isOverride).toBeUndefined(); diff --git a/ui/packages/data-objectstack/src/listViews.roundTripKeys-11013.test.ts b/ui/packages/data-objectstack/src/listViews.roundTripKeys-11013.test.ts index 91757f9fe92..ed11cbff21b 100644 --- a/ui/packages/data-objectstack/src/listViews.roundTripKeys-11013.test.ts +++ b/ui/packages/data-objectstack/src/listViews.roundTripKeys-11013.test.ts @@ -16,7 +16,8 @@ * nothing else, so the keys the console writes at the record's TOP level — * `isPinned` and `sortOrder` through `updateView`, `columnState` and * `visibility` carried forward by the view-config save — did not come back on - * a reload of this read. The switcher sorts saved views by the `sortOrder` it + * a reload of this read. (`columnState` has since retired from the spec, + * objectstack#36403, so the set read off it no longer carries that one.) The switcher sorts saved views by the `sortOrder` it * reads off this row, so a reordered record lost its place. * * Each case below is a real round trip against a stub `sys_metadata` store: @@ -94,12 +95,15 @@ async function reloadRow(ds: any): Promise> { } describe('objectui#11013 — the carried set is the spec\'s', () => { - it('the ViewItem round-trip keys include the five the card names, read off the spec', () => { + it('the ViewItem round-trip keys include the four the card names that are still live, read off the spec', () => { // Membership (#26238): the set is the spec's, so a key it adds is carried - // too; what this card needs is that these five are among them. - for (const key of ['columnState', 'isDefault', 'isPinned', 'sortOrder', 'visibility']) { + // too; what this card needs is that these four are among them. + for (const key of ['isDefault', 'isPinned', 'sortOrder', 'visibility']) { expect(VIEW_ITEM_KEYS).toContain(key); } + // objectstack#36403: the card's fifth, `columnState`, is retired from the + // spec's record, so the derived set stops carrying it with no edit here. + expect(VIEW_ITEM_KEYS).not.toContain('columnState'); // Control on the same record: a key declared on the list overlay only is not one of them. expect(VIEW_ITEM_KEYS).not.toContain('_isOverride'); expect(Object.keys(VIEW_CONSOLE_ROUND_TRIP_KEYS)).toContain('_isOverride'); @@ -111,7 +115,6 @@ describe('objectui#11013 — the carried set is the spec\'s', () => { isPinned: true, sortOrder: 3, visibility: 'team', - columnState: { order: ['stage', 'name'], widths: { name: 240 } }, }; for (const key of VIEW_ITEM_KEYS) expect(stored, `no probe value for \`${key}\``).toHaveProperty(key); const { ds } = makeDS([{ ...RECORD, ...stored }]); @@ -143,13 +146,6 @@ describe('objectui#11013 — a reload round trip per key', () => { expect(row.isPinned).toBe(true); }); - it('`columnState`: a record-level column layout comes back', async () => { - const { ds } = makeDS([RECORD]); - const columnState = { order: ['stage', 'name'], widths: { stage: 120 } }; - await ds.updateView(OBJECT, NAME, { columnState }); - expect((await reloadRow(ds)).columnState).toEqual(columnState); - }); - it('`isDefault`: the set-default write comes back, and an absent flag still reads `false`', async () => { const { ds } = makeDS([RECORD]); expect((await reloadRow(ds)).isDefault).toBe(false); @@ -177,7 +173,7 @@ describe('objectui#11013 — controls: what the flatten still does', () => { it('a key the record does not carry is not invented on the row', async () => { const { ds } = makeDS([RECORD]); const row = await reloadRow(ds); - for (const key of ['isPinned', 'sortOrder', 'visibility', 'columnState']) { + for (const key of ['isPinned', 'sortOrder', 'visibility']) { expect(row, key).not.toHaveProperty(key); } });