Skip to content

feat(types, fields, plugin-grid)!: converge the lookup dialect on the spec's camelCase - #7641

Merged
os-warren merged 1 commit into
mainfrom
claude/issue-7155-snake-lookup-dialect-retire
Sep 4, 2026
Merged

feat(types, fields, plugin-grid)!: converge the lookup dialect on the spec's camelCase#7641
os-warren merged 1 commit into
mainfrom
claude/issue-7155-snake-lookup-dialect-retire

Conversation

@claude

@claude claude Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #7155

Implements the maintainer ruling A′ recorded in comment 5523072764 (director seat, summon #11, decision batch #19, 2026-09-03, maintainer verbatim 「同意」), re-confirmed in comment 5535917075. A′ supersedes the 2026-09-01 deletion ruling on that ruling's falsified premise, and explicitly does not take option D (delete the reader alone).

The defect: two published contracts, opposite dialects

@objectstack/spec FieldSchema (object metadata) @object-ui/types LookupFieldMetadata (widget metadata)
camelCase declared compile error (TS2561)
snake_case refused (unrecognized_keys) declared

@object-ui/fields' read chains served both bags, and they read the snake leg first — so the dialect the object contract refuses outranked the one it declares. content/docs/fields/lookup.mdx:18 taught the snake dialect as normative ("the source of truth for the key set"), and that page is not in check-doc-snippet-types.mjs's UNGATED_DOCS, so CI compiled those snake snippets on every run.

What this PR does — one concept, one spelling, one payment

Premise re-measured on this base (0b24d7f85), with lit controls

1. FieldSchema is strict and refuses the four. strictObject(options, shape) is z.object(shape).strict() (packages/spec/src/shared/strict-object.ts:327). Declared key set read from objectstack's own generated packages/spec/authorable-surface.base.json (machine-readable, no hand parsing):

data/Field declared property count: 66
LIT CONTROL name/type/label: {'name': True, 'type': True, 'label': True}
camelCase controls : displayField DECLARED · descriptionField DECLARED · lookupColumns DECLARED · lookupFilters DECLARED · reference DECLARED
the four           : display_field ABSENT · description_field ABSENT · lookup_filters ABSENT · id_field ABSENT
also               : idField ABSENT

⚠️ My first attempt at this measurement hand-parsed the Zod source and returned a dark control (name/type/label all False, 0 properties). I discarded it rather than reporting it — the number above comes from the generated baseline.

2. Nothing inbound manufactures a snake spelling. Zero occurrences of all four across packages/data-objectstack/src, against a lit control (reference_to present: index.ts 1, getObjectSchema.test.ts 7).

3. The FieldSchema-absence gate. It did not simply "keep passing" — under the deletion it would have passed vacuously (for (…) { if (e.verdict !== 'legacy-alias') continue; … } over an empty class). It is therefore retired with the keys and replaced, per A′ and the #7070 discipline, by a gate that asserts the retired dialect reaches no consumer and no verdict — with the surviving camel spellings as its lit control.

Verification

Heavy runs through scripts/pm/os-verify-lock.sh (slot issue-7155). All results are from b7c45e83, the final commit.

run verdict line
vitest packages/fields/ packages/app-shell/src/utils/ … Test Files 3 failed → after triage: 245 passed; final: Test Files 356 passed (356) / Tests 3690 passed | 9 skipped
vitest packages/plugin-grid/ packages/plugin-detail/ (targeted) Test Files 4 passed (4) / Tests 19 passed (19)
turbo run type-check --concurrency=2 Tasks: 81 successful, 81 total
check:doc-snippets Semantic phase: 452 of 452 block(s) judged, 0 failed — "Every covered documentation snippet compiles against the built types" (own sentinel controls lit: sentinel 1 diagnostic, positive 0)
check-changeset-presence.mjs ✅ 27 source file(s) of 5 released package(s) changed, and this change declares 1 changeset(s)
check:control-bytes · check:doc-types · check:doc-fences · check:designer-field-key-parity · check:docs-route-closure · check:spec-symbols · check:spec-floors · check:readme-exports all exit 0
eslint over the 27 changed lintable files exit 0 — 0 errors, 389 warnings (pre-existing whole-file no-explicit-any counts, none introduced)

check:readme-exports first exited 1 with type entry ./dist/index.d.ts is not on disk for @object-ui/plugin-ai — an unbuilt-package precondition, not a defect in this diff (that package is untouched). Green after building it.

Lint narrowing, declared. I ran eslint over the 27 changed files rather than repo-wide eslint .. The narrowing is a measurement, not a gap: file count 27 read from --format json output length, and the config is not type-aware (tseslint.configs.recommended, no project/projectService in languageOptions), so every rule judges each file in isolation and this diff cannot move the verdict of a file it did not touch. CI runs the full farm regardless.

Ablation — predicted vs observed, including a miss

Both legs: mutation proved on disk by anchored grep counts and blob-hash movement (never by the editor's exit code); restore via git checkout HEAD -- <absolute path> under an EXIT INT TERM trap, verified by empty git diff HEAD and blob-hash equality. No build leg applies and none is claimed — vitest.config.mts:417 aliases @object-ui/fields to ./packages/fields/src, so tests run against source.

Leg A — restore the cell's snake read leg only. Predicted: the #6875 refusal pin and the derivation gate go red.
Observed: derivation gate RED as predicted (2 tests, including fields/src/index.tsx#LookupCellRenderer reads 'display_field' again). The #6875 pin stayed GREENprediction missed, and the miss is informative: the copy set is a second, independent barrier. With display_field off RELATIONAL_META_KEYS, the key never reaches the cell's bag at all, so restoring the reader alone changes nothing observable. The retirement is defended in depth.

Leg B — restore the reader leg and re-add display_field to the copy set. Predicted: #6875 test 2 red (snake column resolves again → ACME-42 count 2 not 1, Wrong Name absent); test 1 (camel control) stays green.
Observed: exactly thatTests 1 failed | 1 passed, failing at expect(screen.getByText('Wrong Name')).toBeInTheDocument(). The camel control passed, so the render path was live and the red is a reading.

Housekeeping

The two unmeasurable populations — declared as NOT MEASURED, not argued away.

This is a behaviour change, not a compile-only one: the chains used to read snake first, so removing that leg changes which value wins for any bag carrying both spellings.

  • NOT MEASURED — host applications outside objectstack + objectui. A host may hand-feed a DataSource whose getObjectSchema returns snake_case defs. Unmeasurable in principle from these two repos: nothing here can enumerate third-party DataSource implementations. For such a host, a lookup's display value degrades to the referenced record's generic name heuristic — visible, and recoverable by renaming the four keys.
  • NOT MEASURED — stored metadata authored before FieldSchema became strict. If any is persisted it would still be served. Unmeasurable from a source repo: it is a property of deployed databases, not of this tree.

⛔ The objectstack census does not cover either population, and nothing in this PR should be read as claiming it does. What the census does establish is the in-repo half: every snake occurrence across objectstack is prose against lit camelCase controls.

⚠️ Note the direction of the surprise on this card: the 2026-09-01 ruling assumed no host fed snake_case, and that premise was falsified by this repo's own published contract and docs. The two populations above are what remains after that one was closed.

Out of scope — a second, separate population found while measuring

Six sites read the four snake spellings off an object-schema field def (FieldSchema), not off the widget bag this PR converges. Those are dead legs already — FieldSchema refuses the spellings — but they are a different finding with a different fix, and A′ does not name them. Left untouched, filed separately:

packages/plugin-charts/src/ObjectChart.tsx:197,208 · packages/plugin-form/src/deriveMasterDetail.ts:249,303 · packages/plugin-list/src/ListView.tsx:2714,2736 · packages/plugin-list/src/UserFilters.tsx:300 · packages/app-shell/src/utils/resolveActionParams.ts:304-310 (which documents its own source as "an object schema field def, i.e. the protocol") · packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx:1145.

Also out of scope, and deliberately not renamed: the wider snake dialect on the same widget bag that A′'s four keys do not cover — reference_to, title_format, lookup_columns, lookup_page_size, depends_on, allow_create, avatar_field. paramToField now emits a deliberately mixed bag, and paramToField.test.ts asserts that mixed shape so the two halves stay visibly separate.

Fences

Respected. Three fenced files carry stale prose mentioning display_field and were left alone — packages/plugin-grid/src/ObjectGrid.tsx:2455,2658,2816 and packages/core/src/utils/expand-fields.ts:49 (both dispatch #7627), plus packages/plugin-dashboard/src/ObjectDataTable.tsx:359. All are comments; no behavioural collision. packages/types/src/complex.ts and packages/types/src/__tests__/zod-mirror-parity.test.ts (parked PR #7633) are untouched, and I verified the parity test references none of these keys, so there is no collision with that PR.

Clause-②: yes

A published type's member set and two published doc pages change, and the renderer's accept behaviour narrows. needs:contract-review is on this PR and on the card. Kept a draft, not enqueued — it parks for the director seat at CONTRACT_REVIEW_TIER.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3


Generated by Claude Code

… spec's camelCase

Two published contracts declared OPPOSITE dialects for the same four lookup keys,
and `@object-ui/fields`' read chains served both with the snake leg FIRST — so the
dialect the object contract refuses outranked the one it declares:

  @objectstack/spec  FieldSchema           camelCase declared / snake refused
  @object-ui/types   LookupFieldMetadata   snake declared / camelCase TS2561

`LookupFieldMetadata` and `UserFieldMetadata` now declare `displayField`,
`descriptionField`, `lookupFilters` and `idField`; the snake members are removed,
not deprecated. The two doc pages, all seven in-repo producers and the inline-edit
enrichment allow-list move with them, and the read chains read the spec spelling
only. `relationalMetaKeys.ts` drops the four `legacy-alias` verdicts and retires
that verdict class; its gate is restated to assert the class no longer exists
rather than passing vacuously. objectui#6875's both-spellings parity pin is
inverted into a refusal pin.

`idField` is kept as a widget-contract key: it carries objectstack#3508's
machine-name hydration, which has no FieldSchema twin and needs none.
`reference_to` stays — the adapter choke point genuinely stamps it.

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-6Jk790mf.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.12KB 2.42KB
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) 48.09KB 13.34KB
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.40KB 41.05KB
plugin-grid (index.js) 209.41KB 56.81KB
plugin-kanban (index.js) 52.71KB 14.55KB
plugin-list (index.js) 113.28KB 27.59KB
plugin-map (index.js) 20.55KB 6.80KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.57KB 11.96KB
plugin-timeline (index.js) 30.84KB 8.85KB
plugin-tree (index.js) 9.38KB 3.22KB
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

@os-warren
os-warren marked this pull request as ready for review September 4, 2026 14:46
@os-warren
os-warren added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit 351eb31 Sep 4, 2026
34 checks passed
@os-warren
os-warren deleted the claude/issue-7155-snake-lookup-dialect-retire branch September 4, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants