Skip to content

refactor(core): one shared record-source ladder, five plugins delegate (objectui#7632) - #7660

Draft
os-sam wants to merge 2 commits into
mainfrom
claude/issue-7632-shared-get-data-config
Draft

refactor(core): one shared record-source ladder, five plugins delegate (objectui#7632)#7660
os-sam wants to merge 2 commits into
mainfrom
claude/issue-7632-shared-get-data-config

Conversation

@os-sam

@os-sam os-sam commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Fixes #7632

getDataConfig — the ruled three-rung record-source ladder — was hand-copied into five
plugin components with no gate holding them together. @object-ui/core now publishes one
implementation, resolveRecordSourceConfig, beside the objectui#7627 reader
resolveRecordSourceObjectName whose input it produces.

Premise re-measurement (the first deliverable)

Re-measured on origin/main 1ec291c0, which carries PR #7637. The population is still
five
#7637 collapsed the reader (which object a block resolves), not the producer.
Only the line numbers drifted:

file card (11edab88) measured (1ec291c0)
packages/plugin-calendar/src/ObjectCalendar.tsx 117 118
packages/plugin-gantt/src/ObjectGantt.tsx 320 321
packages/plugin-grid/src/ObjectGrid.tsx 428 428
packages/plugin-map/src/ObjectMap.tsx 127 128
packages/plugin-tree/src/ObjectTree.tsx 92 93

One card claim did not survive re-measurement. The card says four of the five are
"byte-identical modulo the parameter type", with calendar the sole divergence. Measured,
there are three shapes, and the third one is behavioural:

  • ObjectGantt, ObjectTree — the bare ladder.
  • ObjectCalendar — the in-guarded ladder (the card's named divergence).
  • ObjectGrid, ObjectMapa bare-array data shorthand normalized to
    { provider: 'value', items } that the other three do not have.

That third shape matters, because the card's "all five copies agree today for every input
tested" is false for a bare array under data: grid and map normalize it, while calendar,
gantt and tree return the array verbatim, so dataConfig.provider reads undefined
downstream and the block draws nothing.

Disposition: consolidate, preserving both measured divergences

The shared rung is contract-strict. Neither divergence was flattened, following the
precedent PR #7637 set when it left the off-contract { provider: 'object' } tails at
ObjectGrid and ObjectTree rather than folding them into the shared reader (AGENTS.md
#0.1).

Calendar's in guards — measured as type-level, not behavioural. They exist because
the parameter is the union ObjectGridSchema | CalendarSchema and CalendarSchema
declares neither data nor staticData. When a property is absent the read yields
undefined, which is falsy either way, so the guard can never change which rung is taken.
The shared reader's optional-property parameter accepts that union directly, so the guard
is gone rather than flattened — and the equivalence is pinned on a fixture that really
lacks both keys, not argued in prose.

The array shorthand — measured as real, and kept at the two sites that have it.
ObjectGrid and ObjectMap keep the head above the shared call. Hoisting it above the
call is behaviour-neutral because an array is always truthy, [] included, so
if (schema.data) could never have let one fall through to rung 2 or 3.

ObjectTree's schema: any now goes through the shared reader's typed parameter. Types
are erased at runtime, so nothing it resolves moves; no call-site behaviour changed, so
there is nothing to report under that heading.

A docblock claim corrected

ObjectMap.tsx's docblock listed ObjectTree among the blocks that accept the array
shorthand. Measured: plugin-tree has no Array.isArray on schema.data anywhere (lit
control — the same grep finds its five other Array.isArray uses), so it answers the
shorthand with a silently empty tree. The comment now says so. That divergence is not
fixed here; it is reported separately for triage.

Evidence

Behaviour neutrality is the claim, so
packages/core/src/utils/__tests__/record-source-config.behaviourNeutrality-7632.test.ts
follows the pattern #7637 shipped: it transcribes all five pre-collapse bodies verbatim
and asserts the post-collapse spelling agrees with each across a 15-shape contract-valid
matrix, plus a 4-shape off-contract fork that pins both sides of the array-shorthand
divergence. Two lit controls guard the instrument: one asserts the matrix actually reaches
every rung of the ladder, one asserts the calendar fixtures really lack the keys.

Ablation legs, each with the prediction written before the run, the mutation proved on disk
by anchored grep counts and git hash-object movement off the HEAD blob, and the
restore proved by blob equality plus an empty git diff HEAD under an EXIT INT TERM trap:

leg predicted observed
swap rungs 1 and 2 in the shared reader red on the both-keys fixtures only; the #7627 sibling stays green met — 6 failed / 185 passed; all five site rows on all-three plus the gantt/tree/calendar arm of array-shorthand+staticData; sibling green
delete the array head from ObjectMap ObjectMap.schemaDataShorthand.test.tsx goes red met — 3 failed / 2 passed

The second leg is what makes the preservation argument measured rather than stylistic: had
it stayed green, the head would have been decorative and folding it in would have been the
right call.

Both ablations read source, not dist — the neutrality test imports '../record-source.js'
from inside core and the map test imports './ObjectMap' relatively, so no rebuild leg
applies. That was checked rather than assumed, since a green ablation from a stale dist
is indistinguishable from a dead assertion.

Verification, all at 028f4f20

The merge of origin/main below is included, so these are readings on the tree as pushed.

  • turbo run build --filter='!@object-ui/site' — 43/43 successful.
  • type-check for core and all five plugins — exit 0, all 6 script names echoed (a
    --filter matching zero scripts exits 0 silently, so the echo is the guard). Core's
    tsconfig.test.json is in that run and --listFiles confirms the new test file is inside
    its program, so this is a measurement and not a NOT-MEASURED reading.
  • vitest from the repo root: packages/core/ + calendar + tree + map — 168 files, 2756
    tests passed; packages/plugin-grid/ + packages/plugin-gantt/ — 175 files, 1511 tests
    passed.
  • 13 gates, each exit code captured by redirect before any pipe: check:control-bytes,
    check:readme-exports, check:element-data-source-declaration, check:phantom-deps,
    check:self-import, check:esm-specifiers, check:sdui-registration-pins,
    check:spec-symbols, check:entry-guard, check:side-effects-array,
    check:node-esm-load, check:vi-mock-specifiers, check:vi-mock-inherit — all exit 0.
  • lint for the six affected packages — exit 0, 0 errors (warnings pre-existing; the tree
    package sheds one no-explicit-any with the schema: any copy gone). Type-aware linting
    is not enabled in eslint.config.js, so this diff cannot move the verdict on any file it
    does not touch.

check:readme-exports and check:sdui-registration-pins first came back exit 1 and exit 2
with an unbuilt population — a PRECONDITION NOT MET, which is NOT MEASURED rather than a
red. Both were re-run after a full workspace build and report lit populations: readme-exports
reads 37 of 40 packages with 52 keys compared both ways, and the sdui gate weighs 518 chunks
with its 3 ruled controls in the derived set.

Clause-② determination: yes — parked

resolveRecordSourceConfig is a new exported symbol on @object-ui/core, so the published
surface widens and there is no shape of this change that avoids it: the reader is consumed
from five other packages, which requires the export. needs:contract-review applied to both
carriers; opened as a draft and deliberately not flipped ready or enqueued, the same route
PR #7637 took.

Scope

packages/types/** untouched. None of the six object-schema census files (#7642) touched.
No sixth producer added and KanbanSchema.data not re-typed — #7651 is an open maintainer
decision and stays out of scope here. scripts/check-doc-links.mjs untouched (#7644).

PR #7648 landed while this was in flight and touches ObjectTree.tsx and
ObjectCalendar.tsx in different regions; origin/main was merged in, no conflicts, and
the whole verification above was re-run on the merge result. That branch's history was not
rewritten.


🤖 Generated with Claude Code

https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3


Generated by Claude Code

…e (objectui#7632)

`getDataConfig` — the ruled three-rung record-source ladder (`data`, then
`staticData`, then `objectName`) — was hand-copied into five plugin components
with no gate holding them together. That ladder is published contract on both
faces: `packages/types/src/objectql.ts` and its zod mirror ship `.describe()`
strings naming the order (objectui#6939, maintainer ruling 2026-09-02), pinned
by `objectql-record-source-refinement-6939.test.ts`. A change to the ruled order
had five edit sites and nothing that noticed a missed one — the AGENTS.md #0.1
drift class.

`@object-ui/core` now publishes `resolveRecordSourceConfig`, beside the
objectui#7627 reader `resolveRecordSourceObjectName` whose input it produces.
ObjectCalendar, ObjectGantt and ObjectTree call it directly; ObjectGrid and
ObjectMap keep their bare-array `data` shorthand as a documented head above it.

Two divergences were measured rather than assumed, and both are preserved:

- ObjectCalendar's `'data' in schema` guards are a TypeScript narrowing device
  for its `ObjectGridSchema | CalendarSchema` parameter, not a behavioural one —
  an absent property reads `undefined`, falsy either way. Pinned on a fixture
  that really lacks both keys.
- ObjectGrid and ObjectMap normalize a bare-array `data`; calendar, gantt and
  tree return it verbatim. That is a real divergence on off-contract input, so
  the shared rung stays contract-strict and the head stays at those two sites,
  exactly as objectui#7627 left its off-contract tails at theirs. Both sides of
  the fork are pinned.

`record-source-config.behaviourNeutrality-7632.test.ts` transcribes all five
pre-collapse bodies verbatim and asserts the post-collapse spelling agrees with
each across the whole input matrix, with lit controls proving the matrix reaches
every rung and that the calendar fixtures really lack the keys.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 50 chunks) 3180.1 KB 3191.4 KB
Main entry chunk (gzip) 143.2 KB 350 KB
Entry file index-BPnN_BRI.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) 15.67KB 5.75KB
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) 5.13KB 2.35KB
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) 510.70KB 116.21KB
core (index.js) 6.96KB 2.79KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 180.00KB 50.20KB
fields (index.js) 242.27KB 61.22KB
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) 4.28KB 1.75KB
i18n (index.js) 3.65KB 1.47KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
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.98KB 10.98KB
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.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 11.71KB 4.29KB
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) 5.12KB 1.74KB
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) 15.75KB 3.80KB
plugin-calendar (index.js) 47.87KB 13.31KB
plugin-charts (index.js) 70.92KB 19.75KB
plugin-chatbot (index.js) 196.19KB 46.43KB
plugin-dashboard (index.js) 132.86KB 34.68KB
plugin-designer (index.js) 212.86KB 43.19KB
plugin-detail (index.js) 250.55KB 64.06KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 132.87KB 32.66KB
plugin-gantt (index.js) 167.26KB 41.00KB
plugin-grid (index.js) 209.29KB 56.78KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.44KB 6.78KB
plugin-markdown (index.js) 13.70KB 4.68KB
plugin-report (index.js) 43.57KB 11.96KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.20KB 3.19KB
plugin-view (index.js) 85.24KB 20.94KB
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) 81.07KB 26.86KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 20.57KB 5.88KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 10.35KB 3.60KB
types (ai.js) 0.20KB 0.17KB
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.74KB 1.41KB
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 (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.58KB 2.23KB
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 (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finding(plugins): getDataConfig — the three-rung record-source ladder — is hand-copied in five plugin components

2 participants