Repository navigation
fix(plugin-grid): derive the bulk executor data-source face from DataSource and stop erasing the check at the hand-off - #9732
Conversation
…ataSource` `BulkExecutorOptions.dataSource` restated the members it consumes, and the restatement had drifted: it still spelled `ReadonlyArray<string | number>` for `bulkUpdate` / `bulkDelete` after `DataSource` narrowed both doors to strings (objectui#9511). Both are declared with property syntax, so their parameters are compared contravariantly under `strictFunctionTypes` — the real `DataSource` was not assignable to that face at all, and the one in-tree hand-off compiled only because it cast to `any`. The two bulk doors are now `DataSource['bulkUpdate']` / `DataSource['bulkDelete']` themselves. `update` / `delete` stay spelled out on purpose: picking them too would import return types this executor never reads and narrow what a consumer may inject (measured: four in-tree doubles redden on `delete`'s `Promise<boolean>`). Both `as any` hand-offs were measured one at a time before removal: the `RecordDetailPanel` one was paying for nothing (both sides already declare `DataSource | undefined`) and is gone; the `BulkActionDialog` one was paying for the optional-vs-required arm as well as the bulk-door contravariance, so it is now a non-null assertion — same runtime behaviour, and a drifting face reddens there again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Isolated at-tier review: fed the card (objectui#9722, every comment), the governing ruling (objectui#9511, ① Derived judgmentsJ1 — the moved face, J2 — is it a PUBLISHED accept set? No. The J3 — J4 — J5 — nothing contradicts objectui#9511 ruling B. J6 — J7 — scope: exactly the card, nothing more. 4 files: the executor face + its docblock (the "without importing it" claim was false — J8 — the PR's measurements are sound. Every zero in the body carries a lit control on the same instrument and corpus (reachability 0/0/0 vs 3; out-of-package 0 vs 17 files; the RecordDetailPanel cast's zero errors vs a TS2322 at the same address). Blob hashes and byte counts are real: base ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
…ey, and hand the direction back (objectui#9729) (objectstack-ai#9735) Fixes objectstack-ai#9729 Clause-②: no — and the declaration is about THIS PR's diff, which is test-only and moves no published accept set.⚠️ The REMEDY the card asks about is `Clause-②: yes`, per key, and is deliberately **not** taken here: this branch measures, proposes, and hands back for the at-tier contract review. ## What this PR is The card carries two LOCAL entries of the `MirroredUndeclared` ledger — a key the published zod mirror states and the published TypeScript twin does not. Either remedy moves a face `@object-ui/types` already ships, so the dispatch forbade picking one. What was missing for the review was the per-key evidence, so that is what landed: four readings, each with a lit control on the same instrument, plus the pins that keep them honest. ## The four readings the card asked for ### 1. Who reads each key at runtime ⛔ A source grep cannot answer this in this tree — `SchemaRenderer` hands a node's leftover keys to the component as props, so a renderer can consume a key it never names. Both readings below are therefore **rendered**, and both landed as tests rather than being pasted here. - **`dueLike` is READ.** `DetailSection` spreads the authored field into the enriched bag (`enrichDetailField` opens with a spread of the view field) and hands that bag to the resolved cell renderer, where `resolveDueLike` reads it. Measured on a field named `end_date`, which deliberately does **not** match the due/deadline field-NAME convention that read falls back to, so the authored key is the only thing that can move the output: with the key the cell draws the overdue wording, without it the neutral relative wording. The control leg renders BY VALUE — it asserts the neutral wording is present, not merely that the overdue wording is absent, which would also be true of a document that drew nothing. Pinned by `DetailSection.dueLikeReachesTheCell-9729.test.tsx`. - **`operators` changes NOTHING drawn.** Measured with a byte ruler: the same `object-grid` document drawn twice and compared as markup. The ruler is pinned stable first (identical documents, identical bytes), then a LIT CONTROL on a key the renderer demonstrably does read (`label`, which moves the bytes and appears in them), and only then the measurement — taken twice, once on a plain grid and once with the filter surface on, since `operators` is a filtering word and a grid with no filter affordance would be the wrong corpus to ask. Both come back byte-identical.⚠️ The claim is bounded by the ruler: this is what the RENDERED output does with the key. Pinned by `ObjectGrid.operatorsInert-9729.test.tsx`. ### 2. What `@objectstack/spec` says on the corresponding surface Probed against the installed spec by parsing documents through it, not by grepping it — with a declared-key control and a nonsense-key control on the same schema: - **`operators` on the grid: the protocol REFUSES it by name.** `ObjectGridPropsSchema` for `object-grid` is a strict object, and a document carrying `operators` comes back RED with `unrecognized_keys` — and the refusal message itself proposes the rename to `operations`. Controls: the bare document and one carrying `operations` both parse GREEN. ⇒ the mirror admits a key the protocol rejects, and the protocol has already classified that spelling as a misspelling of a key both this block's authoring vocabulary and the twin declare. - **`dueLike` on the detail-view field: the spec has no such surface to declare it on.** `RecordDetailsProps` types its `fields` (and `sections[].fields`) as field NAMES — a string array. Every object-shaped field entry is refused there, carrying `dueLike` or not (control: a string entry parses GREEN, an object entry is RED whatever keys it carries). The whole object-shaped `DetailViewField` is objectui's own contract, so for this key there is no "toward the protocol" pull in either direction. ### 3. Who AUTHORS either key in-tree - **`dueLike` is authored** — in `content/docs/fields/date.mdx` and `content/docs/fields/datetime.mdx`, where the published docs tell an author to write it.⚠️ Read the (interface, name) carefully: those examples author it on `DateFieldMetadata` / `DateTimeFieldMetadata`, the object-field metadata faces, ⛔ not on a detail-view field entry. So narrowing the mirror would falsify no in-tree document by itself — while leaving the docs teaching a key the detail-view face would then reject. - **`operators` is authored NOWHERE** in the doc, example, app or e2e corpora on a grid node. Lit control on the same instrument and the same corpora: `operations` lights up in them. ### 4. The ledger, and its floor Both keys are already recorded, as the two LOCAL single-key entries the card describes: `objectql.zod.ts#ObjectGridSchema` names `operators`, `views.zod.ts#DetailViewFieldSchema` names `dueLike`. ⛔ The seeded entry and key totals are deliberately not repeated here: they live in exactly one place — the `MirroredUndeclared` docstring — and are re-derived from that ledger's own AST by the census at the bottom of `zod-mirror-parity.test.ts` ("the fourth direction is enumerated and sized at test time"). That ledger is a FLOOR that can only shrink, and the ratchet reddens on growth, on fresh drift and on a stale entry alike. ## ⭐ The third option the measurement produced: these are TWO decisions, not one The card allowed for a third option if the measurement showed one, and it does — the two keys are not the same defect wearing two names: | | `dueLike` on `views.zod.ts#DetailViewFieldSchema` | `operators` on `objectql.zod.ts#ObjectGridSchema` | |---|---|---| | mirror | judges the key and KEEPS it | judges the key and keeps it | | twin | `DetailViewField` has **no index signature**, so TypeScript REFUSES the key (`TS2353`) | `ObjectGridSchema` extends `BaseSchema`, whose index signature ABSORBS it as `any` — neither declared nor refused | | runtime | READ, and the read changes what is drawn | inert on the rendered path, by a ruler with a lit control | | `@objectstack/spec` | no counterpart surface — the field entry is a string there | REFUSES it by name, and names the rename to `operations` | | authored in-tree | yes, on the sibling metadata faces, taught by the published docs | no | | twin's neighbour | — | the twin already declares `operations`, the key everything else spells | ⇒ what the two faces DO differs in kind. For `dueLike` the two published faces actively CONTRADICT each other — the validator keeps the key, the compiler rejects the same document — and the runtime honours it. For `operators` they do not contradict; one is simply silent, nothing reads it, the protocol refuses it, and the key sits one letter away from the word the whole stack uses. ⭐ There is also a precedent in the tree for the `dueLike` direction, and it is worth the reviewer's attention: `DateTimeFieldMetadata.dueLike` was declared by objectui#8958, and its docblock gives the reason in the reviewer's own words — leaving it off "would keep the mismatch alive with the sign flipped — a key the renderer honours but the authoring type rejects." ⛔ Recommending is not deciding, and this PR decides nothing. Both remedies remain open on both keys. ##⚠️ The third key the card names is NOT this defect — re-derived, not inherited `complex.zod.ts#DashboardConfigSchema`'s `aria` was re-derived on this branch rather than taken from the hand-back: it is `z.never(...)` with an `error` message beginning "RETIRED (objectui#5852)" and an `.optional()`, and a document carrying the key comes back RED at path `aria` with that remedy. A LIT CONTROL on the same schema shows an unrecognised key is NOT refused, so the rejection is BY NAME and not a strictness the whole object has; a document that omits the key stays green. ⇒ its consequence is the OPPOSITE of the other two — they admit silently, it rejects loudly — and a sweep treating the three alike would ask a maintainer to repair something already doing its job. ⛔ It is untouched here, and it is pinned as the CONTRAST so the grouping cannot come back by accident. ## What landed - `packages/types/src/__tests__/mirror-only-published-keys-9729.test.ts` — the per-key consequence pins. Each key's pin is paired with an unrecognised-key control through the same schema, because a green parse proves nothing on its own: one mirror strips unknown keys, the other passes them through unexamined, so what distinguishes a MIRRORED key is that the mirror JUDGES it. The TypeScript side carries a `ts-expect-error` directive on the `DetailViewField` literal — that directive IS the assertion, and it fails in BOTH directions, since it also reddens as unused if the key ever becomes declared. - `packages/plugin-detail/src/__tests__/DetailSection.dueLikeReachesTheCell-9729.test.tsx` and `packages/plugin-grid/src/__tests__/ObjectGrid.operatorsInert-9729.test.tsx` — the two runtime readings, landed as tests beside the renderers that own the read paths rather than pasted into this body. - `packages/types/src/__tests__/zod-mirror-parity.test.ts` — two ledger docstrings corrected. The `dueLike` entry justified itself with "a `git grep` finds it in the mirror and nowhere in this package's TypeScript declarations", and that sentence is FALSE as written: `field-types.ts` declares that name on `DateFieldMetadata` and on `DateTimeFieldMetadata`, both in this package. ⭐ A NAME is not a KEY — a key is (interface, name) — and a package-wide grep for the name answers a question the ledger is not asking. The MEASUREMENT was right and stays; only its stated reason was wrong, and it is corrected rather than repeated. The `operators` entry gains the neighbouring-name reading. - `.changeset/9729-mirror-only-published-keys-measured.md` — empty frontmatter, the explicit "releases nothing" declaration. ## Gates Each exit code was captured to disk before any pipe. | gate | verdict | |---|---| | `pnpm --filter @object-ui/types type-check` | exit 0 — all three legs, including `tsconfig.test.json`, which is the leg that reads the directives above | | `pnpm --filter @object-ui/types test` | exit 0 — 204 files, 4769 tests | | `pnpm --filter @object-ui/plugin-detail --filter @object-ui/plugin-grid type-check` | exit 0, after building the dependency closure — the first attempt failed with TS2307 on every workspace import, which is a missing prerequisite and ⛔ not a reading | | the three new test files | exit 0 — 6 + 7 assertions across the three | | `node scripts/check-changeset-presence.mjs` | exit 0 — "4 source file(s) of 3 released package(s) changed … Every one of them has an EMPTY frontmatter" | | `pnpm check:control-bytes` | exit 0 — "check-control-bytes: OK"; also swept the changed files directly with a control-character grep, which found none | | `pnpm check:new-line-citations` | exit 0 — "0 new citation(s), enforcement report-only" | | `pnpm check:changeset-claims` | exit 0, report-only — 10 pending changesets name `zod-mirror-parity.test.ts`. Read, as the gate asks: every one of them describes `EXCLUSIONS`, `RuntimeOnlyDeclared`, `KnownDrift` or `UnmirroredDeclared`, and none mentions the fourth ledger or either key this branch touched. ⇒ nothing went false, so nothing is corrected | | `node scripts/check-governed-queue-guard.mjs --test` (5 paths) | exit 0 — "NOT GOVERNED — 5 path(s) checked against 5 governed surface(s); none matched"⚠️ the dispatch spelled this script under `scripts/pm/`; it lives at `scripts/check-governed-queue-guard.mjs`, and the first invocation was a MODULE_NOT_FOUND, ⛔ not a red gate | | targeted `eslint` over the changed files | exit 0.⚠️ Repo-wide `pnpm lint` is CI's run and is ⛔ not measured here | ## Reverse validation — both pins were made to fail, then restored Run from the committed state, each leg with an on-disk anchor count before and after the edit, and each restore proven by an empty `git diff HEAD` plus a blob hash identical to the HEAD blob: 1. **Delete the mirrored `dueLike` member from `views.zod.ts`** — anchor count 1 to 0, then the new pin goes RED: 2 of its 7 assertions fail. ⇒ the pin measures the mirror, not itself. 2. **Delete the `ts-expect-error` directive from the pin** — anchor count 1 to 0, then `tsc -p tsconfig.test.json` exits 2 with `TS2353: … 'dueLike' does not exist in type 'DetailViewField'`. ⇒ the refusal is real and the directive is load-bearing. Both mutations are gone; nothing from them is in this branch. ## Serial constraint — re-taken against the LIVE pull requests Re-taken at 2026-09-17T22:16Z, after the sibling appeared: objectui#9637 is now PR objectstack-ai#9734, and its file list is two changesets, one new changeset and `packages/plugin-detail/src/__tests__/recordDetailsInputs.spec-parity.test.ts` — it does **not** touch `zod-mirror-parity.test.ts`, so the warning's stop condition did not trigger. PR objectstack-ai#9732 (plugin-grid) lists `ObjectGrid.tsx`, `hooks/useBulkExecutor.ts`, one test and a changeset; the file added here is a different file. PR objectstack-ai#9540 does list `packages/types/src/objectql.ts` and `packages/types/src/zod/objectql.zod.ts` — ⛔ neither is edited here, since no accept set moves on this branch.⚠️ **Surface delta, declared:** the claim named `packages/types/src/{views,objectql}.ts` and their zod twins. None of those four is edited — the measurement outcome is that nothing on a published face should move without the review. Two test files outside the declared surface were added instead, in the packages that own the two runtime read paths, because the card's first question cannot be answered from `packages/types`, which has no renderer. --- _Generated by [Claude Code](https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L)_ Co-authored-by: Claude <noreply@anthropic.com>
Fixes #9722
BulkExecutorOptions.dataSourceRESTATED the members it consumes instead of deriving them, andthe restatement had rotted: it still spelled the pre-objectui#9511 union — read it as
"ReadonlyArray of string-or-number" (angle brackets are spelled out in this body on purpose;
GitHub's body sanitizer eats tag-shaped fragments, including inside backticks) — for
bulkUpdate/bulkDelete, afterDataSourcenarrowed both doors to plain strings. Bothmembers are declared with property syntax, so
strictFunctionTypescompares theirparameters contravariantly: the real
DataSourcewas therefore not assignable to thatface at all. The one in-tree hand-off compiled only because it cast to
any.⇒ objectui#9712's reading that narrowing those doors costs zero call sites was true BY
THAT CAST, not because the consumer agreed.
Clause-②: yes (widening) — declared conservatively, and handed to the contract-review seat
rather than settled here (see "What moves, and for whom" below).
⭐ What each cast was paying for — established BEFORE anything was repaired
The card marked this NOT MEASURED and named it as the whole risk: deleting a cast to make one
claim true, while silently erasing a different check, would be this defect committed a second
time. So each cast was removed on its own, with the mutation proven on disk (blob hash
against the HEAD blob, byte delta, anchor count) and restored under a
trap, before any resultwas read. They needed different answers.
Cast 1 — the
RecordDetailPanelhand-off: paying for NOTHINGBoth sides already declare the same⚠️ Note this
DataSource | undefinedfrom@object-ui/types— thegrid's own prop type and
RecordDetailPanelProps.dataSourceare the same import.site is not a bulk-door hand-off at all: it hands the value to
RecordDetailPanel, not toBulkActionDialog. That correction to the card's table is the only thing on it that did notsurvive re-derivation; everything else did.
A zero needs a lit control on the same instrument at the same address. Instrument DOMAIN:
tsc --noEmitoverpackages/plugin-gridplustsc -p tsconfig.test.json. PREDICATE: JSX propassignability. Control — with the cast gone, the prop value at that address was mutated to a
string:⇒ the instrument reports at that exact address, so the zero above is an absence, not a blind
spot. Cast removed outright.
Cast 2 — the
BulkActionDialoghand-off: paying for TWO separate thingsRemoving it outright reddens, and the first error tsc prints is not the card's finding:
That is the optional-vs-required arm — this grid declares⚠️ tsc stops at the first failing union member, so reading only this run
dataSource?: DataSource, thedialog demands one.
would have hidden the rest. A second run removed that factor with a non-null assertion alone:
⇒ exactly the contravariance the card predicted, and it is the second thing the cast was
carrying, not the only one. The dialog's
find/findOneintersection members turned out tobe innocent: they raise nothing once the bulk doors agree.
The repair
useBulkExecutor— the two bulk doors are now the interface's own members,DataSource['bulkUpdate']/DataSource['bulkDelete']. A copy that merely agrees today candrift again; identity cannot.
update/deletestay spelled out, deliberately.Picking all four instead importsreturn types this executor never reads and so NARROWS what a consumer may inject —
measured, not assumed: it reddened four in-tree doubles on
delete's "Promise of boolean"alone (
useBulkExecutor.test.tslines 100 / 236 / 254 / 279). A narrowing here would be theopposite arm of Clause-②, so the loose returns are kept.
BulkActionDialoghand-off is nowdataSource={dataSource!}. The non-null assertionerases exactly one thing — the optional arm — and preserves today's runtime behaviour
exactly (a grid with no data source still hands the dialog
undefined). Everything else atthat site is checked again.
RecordDetailPanelhand-off takes the value plain. The neighbouringobjectSchemacast is a different question and is deliberately left alone.
DataSourceis not re-widened. objectui#9511's ruling B is maintainer-adopted; thiscard is repaired on the consumer's side only.
The new pin, and its full ablation
packages/plugin-grid/src/__tests__/bulkExecutorDataSourceFace-9722.test.ts— compile-timeidentity rows plus a source-text census.
that retires each spelling also quotes it, so every census row reads a scoped slice (the
dataSourcemember block; one JSX opening tag), and a control row asserts that the filesthemselves still contain both retired spellings while the slices do not.
Ablation — the restatement was put back (both doors re-spelled with the old union), mutation
proven on disk, restored under a
trap:Both
@ts-expect-errorcontrols going unused under the mutation is the point: each fires forexactly the drift it guards, and the neighbouring string calls stay legal.
What moves, and for whom
For an implementor the executor's face relaxes: a
bulkUpdateaccepting only strings used tobe refused and is now accepted; one accepting the old union was accepted before and still is.
Nothing narrows; no runtime behaviour changes.
Reachability of the moved face, measured on the built package (lit control / absent control on
the same instrument):
dist/index.d.tsscores 0 forBulkExecutorOptions,useBulkExecutorand
BulkActionDialog, against 3 forObjectGridComponentProps(lit) and 0 for anonsense token (absent). The type is shipped as bytes —
filesshipsdist— but it is notreachable from the package entry and the
exportsmap declares no subpath wildcard. Theconservative arm is taken anyway, which is why this PR declares
Clause-②: yes (widening)and aminorchangeset, and why the determination is handed to the seat rather than settled here.In-tree consumers outside
packages/plugin-grid: none. Every hit foruseBulkExecutor/BulkActionDialogelsewhere inpackages,apps,examples,e2eis prose in a comment;lit control, 17 files inside
plugin-grid.Gates — exit code captured to a variable before any pipe, verdict line quoted
pnpm --filter @object-ui/plugin-grid type-checkVERDICT command-exit 0pnpm exec vitest run packages/plugin-grid/(repo root, the CI-equivalent form)Test Files 134 passed (134)·Tests 1247 passed (1247)pnpm --filter @object-ui/types type-checkVERDICT command-exit 0node scripts/check-changeset-presence.mjspnpm check:control-bytespnpm check:new-line-citationsVERDICT new-cross-file-line-citations: 0 new citation(s)pnpm check:changeset-claimsObjectGrid.tsx— read, see belownode scripts/check-governed-queue-guard.mjs --test …pnpm check:test-path-rootsimport.meta.url, never the cwdpnpm check:unreferenced-sources·pnpm check:pending-changeset-literalsThe dispatch named
node scripts/pm/check-governed-queue-guard.mjs; in this repo the script isat
scripts/check-governed-queue-guard.mjs(the first spelling exits 1 withMODULE_NOT_FOUND,which is a wrong path, not a red gate).
check:changeset-claimsasked me to read three pending changesets that nameObjectGrid.tsx(
4730-retire-dead-locale-key-batch,6597-retire-fieldmeta-referenceto,7762-object-grid-export-options-bare-array-refusal). None is falsified: this diff moves two JSXprop values and adds comments, and touches no locale key, no relational-meta pass-through and no
exportOptionsreader.Declared narrowings.
eslintwas run on the three changed files only (exit 0; 0 errors, 210pre-existing warnings in
ObjectGrid.tsx); the repo-widepnpm lintis CI's run. Theintegration-style browser tiers are likewise left to CI.Generated by Claude Code