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

fix(plugin-grid): derive the bulk executor data-source face from DataSource and stop erasing the check at the hand-off - #9732

Merged
os-sales merged 1 commit into
mainfrom
claude/issue-9722-bulk-executor-datasource-face
Sep 17, 2026
Merged

os-sales merged 1 commit into
mainfrom
claude/issue-9722-bulk-executor-datasource-face

Conversation

@os-sales

Copy link
Copy Markdown
Collaborator

Fixes #9722

BulkExecutorOptions.dataSource RESTATED the members it consumes instead of deriving them, and
the 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, after DataSource narrowed both doors to plain strings. Both
members are declared with property syntax, so strictFunctionTypes compares their
parameters contravariantly: the real DataSource was therefore not assignable to that
face 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 result
was read. They needed different answers.

Cast 1 — the RecordDetailPanel hand-off: paying for NOTHING

PRE  anchor count 2 ; bytes 296938 ; blob faa5a1b8…
POST anchor count 1 ; bytes 296931 ; blob f406dade… ; BYTE_DELTA=-7
TYPECHECK_EXIT=0        (zero errors)
RESTORE_BLOB_EQUAL=yes ; GIT_DIFF_HEAD_BYTES=0

Both sides already declare the same DataSource | undefined from @object-ui/types — the
grid's own prop type and RecordDetailPanelProps.dataSource are the same import. ⚠️ Note this
site is not a bulk-door hand-off at all: it hands the value to RecordDetailPanel, not to
BulkActionDialog. That correction to the card's table is the only thing on it that did not
survive re-derivation; everything else did.

A zero needs a lit control on the same instrument at the same address. Instrument DOMAIN:
tsc --noEmit over packages/plugin-grid plus tsc -p tsconfig.test.json. PREDICATE: JSX prop
assignability. Control — with the cast gone, the prop value at that address was mutated to a
string:

MUTATOR: line 4728 now 'dataSource={dataSource as unknown as string}'
POST blob 325e581b… ; BYTE_DELTA=21
TYPECHECK_EXIT=2
src/ObjectGrid.tsx(4728,13): error TS2322: Type 'string' is not assignable to type 'DataSource of any'.
RESTORE_BLOB_EQUAL=yes ; GIT_DIFF_HEAD=empty

⇒ the instrument reports at that exact address, so the zero above is an absence, not a blind
spot. Cast removed outright.

Cast 2 — the BulkActionDialog hand-off: paying for TWO separate things

Removing it outright reddens, and the first error tsc prints is not the card's finding:

src/ObjectGrid.tsx(5328,7): error TS2322: Type 'DataSource of any, or undefined' is not assignable to …
  Type 'undefined' is not assignable to …

That is the optional-vs-required arm — this grid declares dataSource?: DataSource, the
dialog demands one. ⚠️ tsc stops at the first failing union member, so reading only this run
would have hidden the rest. A second run removed that factor with a non-null assertion alone:

POST line 5328: dataSource={dataSource!} ; BYTE_DELTA=-6
TYPECHECK_EXIT=2
src/ObjectGrid.tsx(5328,7): error TS2322: Type 'DataSource of any' is not assignable to …
  Types of property 'bulkUpdate' are incompatible.
    … Types of parameters 'ids' and 'ids' are incompatible.
      Type 'readonly (string | number)[]' is not assignable to type 'readonly string[]'.

⇒ exactly the contravariance the card predicted, and it is the second thing the cast was
carrying, not the only one. The dialog's find / findOne intersection members turned out to
be innocent: they raise nothing once the bulk doors agree.


The repair

  1. useBulkExecutor — the two bulk doors are now the interface's own members,
    DataSource['bulkUpdate'] / DataSource['bulkDelete']. A copy that merely agrees today can
    drift again; identity cannot.
  2. update / delete stay spelled out, deliberately. Picking all four instead imports
    return 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.ts lines 100 / 236 / 254 / 279). A narrowing here would be the
    opposite arm of Clause-②, so the loose returns are kept.
  3. The BulkActionDialog hand-off is now dataSource={dataSource!}. The non-null assertion
    erases 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 at
    that site is checked again.
  4. The RecordDetailPanel hand-off takes the value plain. The neighbouring objectSchema
    cast is a different question and is deliberately left alone.
  5. ⛔ DataSource is not re-widened. objectui#9511's ruling B is maintainer-adopted; this
    card 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-time
identity rows plus a source-text census. ⚠️ A count is invariant under quotation: the prose
that retires each spelling also quotes it, so every census row reads a scoped slice (the
dataSource member block; one JSX opening tag), and a control row asserts that the files
themselves 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:

PRE  blob 9d18c09d… ; CONTROL: tsc -p tsconfig.test.json BEFORE the mutation = exit 0
POST blob 1d01b3f0… ; BYTE_DELTA=176 ; 9 insertions, 2 deletions
TYPETESTS_AFTER_EXIT=2
  src/ObjectGrid.tsx(5352,7): error TS2322        ← the hand-off is a real check again
  bulkExecutorDataSourceFace-9722.test.ts(72,10): TS2344 'false' does not satisfy 'true'
  bulkExecutorDataSourceFace-9722.test.ts(74,10): TS2344 'false' does not satisfy 'true'
  bulkExecutorDataSourceFace-9722.test.ts(88,9):  TS2322 whole-adapter assignability
  bulkExecutorDataSourceFace-9722.test.ts(94,3):  TS2578 Unused '@ts-expect-error'
  bulkExecutorDataSourceFace-9722.test.ts(96,3):  TS2578 Unused '@ts-expect-error'
vitest: Tests 2 failed | 7 passed (9)   ← the two census rows, with their reasons
RESTORE_BLOB_EQUAL=yes ; GIT_DIFF_HEAD=empty

Both @ts-expect-error controls going unused under the mutation is the point: each fires for
exactly 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 bulkUpdate accepting only strings used to
be 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.ts scores 0 for BulkExecutorOptions, useBulkExecutor
and BulkActionDialog, against 3 for ObjectGridComponentProps (lit) and 0 for a
nonsense token (absent). The type is shipped as bytes — files ships dist — but it is not
reachable from the package entry and the exports map declares no subpath wildcard. The
conservative arm is taken anyway, which is why this PR declares Clause-②: yes (widening) and a
minor changeset, and why the determination is handed to the seat rather than settled here.

In-tree consumers outside packages/plugin-grid: none. Every hit for useBulkExecutor /
BulkActionDialog elsewhere in packages, apps, examples, e2e is prose in a comment;
lit control, 17 files inside plugin-grid.

Gates — exit code captured to a variable before any pipe, verdict line quoted

gate exit reading
pnpm --filter @object-ui/plugin-grid type-check 0 VERDICT command-exit 0
pnpm exec vitest run packages/plugin-grid/ (repo root, the CI-equivalent form) 0 Test Files 134 passed (134) · Tests 1247 passed (1247)
pnpm --filter @object-ui/types type-check 0 VERDICT command-exit 0
node scripts/check-changeset-presence.mjs 0 "2 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)"
pnpm check:control-bytes 0 "scanned 7825 tracked text file(s); skipped 85 binary"
pnpm check:new-line-citations 0 VERDICT new-cross-file-line-citations: 0 new citation(s)
pnpm check:changeset-claims 0 report-only; 3 pending changesets name ObjectGrid.tsx — read, see below
node scripts/check-governed-queue-guard.mjs --test … 0 "NOT GOVERNED — 4 path(s) checked against 5 governed surface(s)"
pnpm check:test-path-roots 0 the new census anchors on import.meta.url, never the cwd
pnpm check:unreferenced-sources · pnpm check:pending-changeset-literals 0 · 0 OK

The dispatch named node scripts/pm/check-governed-queue-guard.mjs; in this repo the script is
at scripts/check-governed-queue-guard.mjs (the first spelling exits 1 with MODULE_NOT_FOUND,
which is a wrong path, not a red gate).

check:changeset-claims asked me to read three pending changesets that name ObjectGrid.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 JSX
prop values and adds comments, and touches no locale key, no relational-meta pass-through and no
exportOptions reader.

Declared narrowings. eslint was run on the three changed files only (exit 0; 0 errors, 210
pre-existing warnings in ObjectGrid.tsx); the repo-wide pnpm lint is CI's run. The
integration-style browser tiers are likewise left to CI.


Generated by Claude Code

…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
@github-actions

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 3 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/4730-retire-dead-locale-key-batch.md

  • names ObjectGrid.tsx → packages/plugin-grid/src/ObjectGrid.tsx — edited by this change

    • Superseded twin vocabularies. cellRender.* and rowAction.* duplicated a grid.* vocabulary that won. RowActionMenu.tsx is fully i18n-wired and reads grid.openMenu / grid.edit / grid.delete; ObjectGrid.tsx reads grid.empty / grid.yes / grid.no / grid.systemFields. The twins had no reader on either side. - Labels that outlived their control. calendar.agenda labelled a view mode objectui#5740 retired from CalendarViewMode (now 'month' | 'week' | 'day'). home.quickActions.createApp*, layout.systemNav.createApp, actionDialog.defaultActionTitle / .ok and grid.bulk.selectPlaceholder sit in namespaces whose consumers are live and wired but demonstrably read other siblings. - Surfaces that left the product. map.* is the strongest form: @object-ui/plugin-map declares no @object-ui/i18n dependency and contains no t() call at all, so it cannot consume a locale string. home.stats.* and recordDetail.viewersTooltip name surfaces nothing renders.

.changeset/6597-retire-fieldmeta-referenceto.md

  • names plugin-grid/src/ObjectGrid.tsx → packages/plugin-grid/src/ObjectGrid.tsx — edited by this change

    No authoring story survived the search either. ObjectGrid's own relational-meta pass-through (applyRelationalMeta, plugin-grid/src/ObjectGrid.tsx) copies reference_to / reference / display_field / etc. from the SCHEMA field def only, at all three of its call sites — never from an authored column override. No doc, example, or fixture in this repo shows a table column pinning a lookup's target away from what its schema field already says. Under the maintainer's standing startup-stage rule (2026-08-27: deprecated/alias spellings retire immediately, no transition windows), no measured demand selects withdraw.

.changeset/7762-object-grid-export-options-bare-array-refusal.md

  • names ObjectGrid.tsx → packages/plugin-grid/src/ObjectGrid.tsx — edited by this change

    What was measured, on this branch's base. The mirror declared NO exportOptions member at all, and BaseSchema is .passthrough(), so ObjectGridSchema.safeParse({ type: 'object-grid', objectName: 'accounts', exportOptions: ['csv', 'xlsx'] }) returned success: true with the array back VERBATIM — as did { formats: ['csv', 'pdf'], compression: 'gzip' }. Nothing on the render path parses, and ObjectGrid.tsx reads schema.exportOptions?.formats and only that, so the authored array then lost SILENTLY to the ['csv', 'json'] default: the useEffect that warns about dropped formats reads .formats too and returns early when it is absent, while !!schema.exportOptions kept the export button on screen. An author declared ['csv', 'xlsx'] and got csv/json with no error, no warning and no console line. The two authoring faces disagreed in the direction opposite to objectui#6956's: the TypeScript interface already declared the object form only, so TS refused what zod admitted.

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a claim that was born false (a changeset this change adds is excluded by construction), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 2dbb49975 (merge-base with origin/main): 3 file(s) changed outside .changeset/, read against 1131 pending declaration(s) that publish a body (1643 pending in total). · run

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3049.2 KB 3104.5 KB
Main entry chunk (gzip) 145.7 KB 350 KB
Entry file index-DnyzLIkC.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.69KB 6.21KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 545.93KB 130.69KB
core (index.js) 8.94KB 3.59KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 215.98KB 59.97KB
fields (index.js) 249.27KB 62.92KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.22KB 2.26KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 32.15KB 10.49KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.83KB 10.95KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 49.92KB 14.22KB
plugin-charts (index.js) 71.49KB 19.99KB
plugin-chatbot (index.js) 195.34KB 46.51KB
plugin-dashboard (index.js) 131.44KB 34.65KB
plugin-designer (index.js) 215.94KB 44.33KB
plugin-detail (index.js) 253.29KB 65.88KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.71KB 34.16KB
plugin-gantt (index.js) 167.62KB 41.26KB
plugin-grid (index.js) 212.64KB 57.91KB
plugin-kanban (index.js) 48.10KB 14.94KB
plugin-list (index.js) 112.73KB 27.69KB
plugin-map (index.js) 21.48KB 6.99KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.41KB 11.93KB
plugin-timeline (index.js) 30.07KB 8.74KB
plugin-tree (index.js) 10.58KB 3.72KB
plugin-view (index.js) 85.04KB 21.01KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 104.82KB 34.67KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.66KB 2.50KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 14.82KB 4.99KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 14.04KB 5.36KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 04f7df346d86f3ba16e2de3541891c4415917e57

Isolated at-tier review: fed the card (objectui#9722, every comment), the governing ruling (objectui#9511, Ruling: batch #136 item 5 · letter B, maintainer-adopted) and this PR only. Every number below was re-measured on a detached worktree at the head above with the dependency dists built, plus the published @object-ui/plugin-grid@17.6.0 tarball; no repository file was edited. Angle brackets are spelled out on purpose.

① Derived judgments

J1 — the moved face, BulkExecutorOptions['dataSource']: a strict RELAXATION for implementors, a narrowing for callers, and both are correct. Domain: a scratch tsc program (same strict/bundler options as the package) over the head executor and the built @object-ui/types; predicate: assignability, each expectation self-checked by a @ts-expect-error that reddens as TS2578 if it does not fire; control file lit both directions (TS2578 on an unused directive, TS2322 on an unguarded error). Readings, one run, exit 0: the real DataSource is NOT assignable to the base face (the card's rot, R1) and IS assignable to the head face (R2); every value the old face accepted the new face accepts (D1) and not the converse (D2); an implementor whose bulk doors take only strings was refused and is now accepted (I1), one taking the union was and still is accepted (I2); the two doors are identical to DataSource['bulkUpdate'] / ['bulkDelete'] and the old ones were not (K1–K3); a caller through the face may no longer pass a numeric id (C1). patch moves from Record of string to unknown to Partial of any — subsumed in D1/D2, same direction. The executor's only call sites hand both doors a string[] (lines 278–302), so the narrowing on the caller side costs nothing. Judged correct.

J2 — is it a PUBLISHED accept set? No. The Clause-②: yes declaration is the prescribed conservative arm, not a fact about the contract. Measured on the published 17.6.0 bytes, not a local build: files ships dist and dist/hooks/useBulkExecutor.d.ts + dist/components/BulkActionDialog.d.ts exist; the exports map addresses only .; a closure walk of dist/index.d.ts over relative imports reaches 18 declaration files and neither of those two — lit member ObjectGrid.d.ts and components/BulkActionBar.d.ts ARE in the closure, absent probe not; the entry file scores 0 / 0 / 0 for BulkExecutorOptions / useBulkExecutor / BulkActionDialog against a lit 3 for ObjectGridComponentProps and 0 for a nonsense token, same file; dist/ObjectGrid.d.ts references neither. In-tree consumers outside packages/plugin-grid: 0 files for useBulkExecutor and BulkExecutorOptions, and the 2 non-comment hits for BulkActionDialog are both string literals — lit 9 / 13 / 5 files inside the package, absent 0. Contract reading: the exports map IS the package's declaration of what it publishes; a declaration file it does not address and the entry's type graph does not reach is shipped bytes, not a public surface — the one route to it is legacy node10 resolution that ignores exports, which is outside the package's declared contract by construction and which this repo does not use (moduleResolution: bundler). What follows: nothing on a published surface moves; this review is the whole cost of the yes; the declaration stands as filed and is NOT to be re-posted as no (that would need a Contract-text: citation and a gate re-run and buys this PR nothing); the general question — whether an entry-unreachable, exports-unaddressed d.ts ever counts — is the card the dispatching seat promised, and this record is the contract-side reading for it. Even on the opposite reading, J1 shows the direction is a relaxation, so no published accept set narrows either way.

J3 — ObjectGrid → BulkActionDialog hand-off, as any → !: correct, and the hand-off is a live check again. Scratch probe over ComponentProps of the head dialog: a whole DataSource is assignable with no cast (H1); plain DataSource | undefined is refused and ! is accepted (H2) — the assertion erases exactly the optional arm and nothing else, and ! is erased at runtime, so behaviour is unchanged.

J4 — ObjectGrid → RecordDetailPanel hand-off, cast removed: correct, and the card's table was wrong to list it as a bulk-door site. RecordDetailPanelProps.dataSource is DataSource | undefined from @object-ui/types (read in @object-ui/plugin-detail), the same as the grid's prop; DataSource | undefined assigns (H3) and a string mutant at that slot reddens (H4, lit). The PR's correction of the card is right.

J5 — nothing contradicts objectui#9511 ruling B. packages/types/src/data.ts is byte-identical base..head (git diff --quiet exit 0); both DataSource bulk doors still refuse a numeric id (B1, B1b). The repair narrows the CONSUMER to the ruling; it re-widens nothing on the boundary, and neither refused letter (A: leave doors wide; C: revert) is re-run. findOne remains string | number on DataSource — deliberately held open by the ruling's own follow-up, untouched here.

J6 — update / delete kept spelled out: the stated reason holds. Pick of the four members refuses a double whose delete resolves Promise of unknown while the head face accepts it (P1 / P2). Their text is unchanged, so no Clause-② move in either direction.

J7 — scope: exactly the card, nothing more. 4 files: the executor face + its docblock (the "without importing it" claim was false — DataSource was already imported in this file — and correcting it belongs to the face repair), two JSX prop values in ObjectGrid.tsx (dataSource={dataSource as any} reads 2 at base, 0 at head; the rest of that file's hunks are comments), the new pin, the changeset.

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 ObjectGrid.tsx is 296938 bytes at blob faa5a1b8…, head useBulkExecutor.ts is blob 9d18c09d…, both as the body states; the cited addresses (5352,7) and (4728,13) are the two hand-off lines at head with the column matching the indentation. The ablation discipline is stated correctly (mutation proven by blob + byte delta before reading, restoration by blob equality + empty git diff HEAD), its six-way redden is what the pin's rows predict (two identity rows, one whole-adapter row, two directives going unused, the hand-off) and its 2-of-9 vitest failures are the two census rows. Re-run here without mutation: turbo run type-check --filter=@object-ui/plugin-grid exit 0 with the dependency builds; the pin file 9 / 9 under vitest; check-changeset-presence and check-changeset-no-major exit 0; CI on this head 33 success, 3 skipped, 0 non-green of 36.

② Semver level

minor on @object-ui/plugin-grid, consistent with the declared widening: an enlarged accept set is additive, which is minor, and AGENTS.md forbids only major. On J2 the honest floor is patch (no published surface moves), but minor is not wrong and is inert in practice — the fixed group already carries hundreds of pending minor entries, so the released level is unchanged either way. Declaration and changeset agree; no change required.

③ Boundary flags

  • Security / permissions: none. No key becomes writable, no runtime path changes, no wire bytes move.
  • Gate strength: up, not down — the hand-off is a real check (J3), and the pin refuses both retired spellings from a scoped slice with a quotation control that proves the slice is narrower than the file.
  • Open question 1 (Clause-②): answered at J2 — not a published accept set; the declaration stands as the conservative arm; the precedent question needs its own card.
  • Open question 2 (claim legibility): moot — check-clause2-carriers --pair 9732 read exit 0 (both carriers agree) before this record was posted.
  • Noted, not filed — agreed with the implementer: (a) the optionality gap (grid dataSource? vs executor demanding one) is pre-existing and reachable only if a grid with no data source can open the bulk dialog; the ! neither creates nor worsens it; (b) the neighbouring objectSchema as any is a separate question, untouched.
  • One further note for the seat that closes findOne: BulkActionDialogProps.dataSource still RESTATES findOne with id: string | number. That is correct today because DataSource.findOne is held open by objectui#9511's follow-up — but it is the same restatement class as this card, and it will rot the day findOne narrows unless it is derived then. Not this PR's.
  • Independence: Implemented-by is the branch (mode:subagent); Reviewed-by is the adopting seat's session, which the implementation claim also names — the in-seat compensating design the reference describes. This record was rendered by an isolated review sub-agent fed the card, the ruling and the PR only.

Implemented-by: claude/issue-9722-bulk-executor-datasource-face
Reviewed-by: session_01UanLVj6xvbS6puBCewLr8L

VERDICT: PASS


Generated by Claude Code

@os-sales
os-sales marked this pull request as ready for review September 17, 2026 22:04
@os-sales
os-sales added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 20b5e36 Sep 17, 2026
38 checks passed
@os-sales
os-sales deleted the claude/issue-9722-bulk-executor-datasource-face branch September 17, 2026 22:24
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 28, 2026
…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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants