Skip to content

docs(types): record that field is excluded from the form-field pin ON PURPOSE - #6635

Merged
os-sales merged 1 commit into
mainfrom
claude/issue-6609-declared-keys-header-honesty
Aug 28, 2026
Merged

docs(types): record that field is excluded from the form-field pin ON PURPOSE#6635
os-sales merged 1 commit into
mainfrom
claude/issue-6609-declared-keys-header-honesty

Conversation

@os-sales

Copy link
Copy Markdown
Collaborator

Fixes#6609

Prose only. No schema change, no test-logic change, no behaviour change — every changed line in both source files is a comment line (proof below).

The fence, honoured

field was not added to DECLARED_KEYS and not added to FormFieldSchema, and the new prose exists specifically to stop a future reader from doing it. The pin's own rule — "any schema edit must touch the list here in the same PR" — read as an invitation to close the discrepancy in the wrong direction; admitting field would make objectui validate accept and type a runtime-only stash on authored documents, re-opening the spec-vocabulary pun objectui#3090 closed at the normalizeSectionField chokepoint. The header now names that outcome so the widening cannot arrive disguised as housekeeping.

No fork to report: the schema should not carry field, and nothing in the merged tree argued otherwise.

Premise re-verified on the merged tree

Branched from origin/main at 4de9110c1 — after objectui#6236 landed, so fieldsis in the list (line 79) and the card's quoted measurement is superseded. What was not already corrected is the header sentence itself: on 4de9110c1 it still read, verbatim,

/** Every key `FormField` (../form.ts) declares by name, in declaration order. */

and packages/types/src/form.ts still declares field?: Record(string, any) on FormField (the resolved object-field metadata stash, objectui#3090). So the overclaim was live and the card's premise holds.

Two further inaccuracies in that one sentence, found while correcting it and neutralised rather than restated:

  1. "in declaration order" was also false — visibleOn precedes hidden/readonly in the interface and follows them in the list. The replacement states the order is a reading aid and that the assertion sorts both sides.
  2. The FormFieldSchema doc comment in packages/types/src/zod/form.zod.ts carried the same overclaim one layer over ("Keys mirror the FormField interface in ../form.ts"). Corrected the same way — the card's optional half.

The corrected header, next to the list it describes

/** * The AUTHORABLE key surface of `FormField` (../form.ts) — the keys a DOCUMENT * may itself carry, and so the keys `objectui validate` parses through this * schema. Ordered to follow the interface loosely, as a reading aid only: the * assertion sorts both sides, so the order here carries no claim (`visibleOn` * precedes `hidden`/`readonly` in the interface and follows them here). * * ⚠️ NOT "every key the interface declares by name", and the gap is DELIBERATE. * `FormField` also declares `field` — the resolved object-field metadata stash * (#3090), which the object-bound form paths fill at RUNTIME with a * server-served field definition so widgets can read `precision`, `currency`, * `reference_to`, … No document ever writes it. And on the SPEC form-view side * — the other authoring surface, the one #3090 keeps separate — that same key * name means something else entirely: a STRING naming the referenced object * field. Admitting `field` here and to `FormFieldSchema` would therefore make * `objectui validate` accept and type a runtime-only stash on authored * documents, re-opening the exact spec-vocabulary pun #3090 closed at the * `normalizeSectionField` chokepoint. The refusal is pinned below by the * `still rejects the SPEC form-field vocabulary` case: `{ field: 'email' }` * must not parse. So a `field` entry here is a contract widening to be ruled * on — never housekeeping that restores consistency (objectui#6609). */constDECLARED_KEYS=['id','name','label','description','type','inputType','required','disabled','placeholder','options','validation','condition','widget','dependsOn','hidden','readonly','visibleOn','visibleWhen','readonlyWhen','requiredWhen','colSpan','span',// objectui#6236 — the section grouping claim (section-divider rows only).'fields',];

The file-level docblock's rule sentence gained the matching clause, since that is the sentence that does the inviting:

 * list here in the same PR. That list is the AUTHORABLE key surface, not every
* key the interface declares — one declared key sits outside it on purpose, for
* the reason its own note records (objectui#6609).

Anchored proof that field was NOT added

Each zero is paired with a positive control in the same query shape, so it reads as an absence rather than a broken pattern. Run on dc44f49d:

A1 probe grep -c "^ 'field',$" ...form-field-zod-coverage.test.ts -> 0
A2 control grep -c "^ 'fields',$" ...form-field-zod-coverage.test.ts -> 1 (line 79)
A3 control grep -c "^ 'span',$" ...form-field-zod-coverage.test.ts -> 1 (line 77)
B1 probe '^ field:' in the FormFieldSchema z.object body -> 0
B2 control '^ fields:' in the FormFieldSchema z.object body -> 1
B3 control '^ span:' in the FormFieldSchema z.object body -> 1
B4 every 'field:' token at ANY depth in that body:
19: z.object({ field: z.string(), param: z.string().optional() }),

B4 is the one hit, and it is pre-existing and unrelated: the lookup-parameter entry nested inside dependsOn, not a top-level schema key.

Logic untouched, measured the same way — for each source file, every added/removed line stripped of leading whitespace, counting the ones that are not comment lines:

packages/types/src/__tests__/form-field-zod-coverage.test.ts: 0
packages/types/src/zod/form.zod.ts: 0

Changeset

The Changeset Declaration gate ruled, and it was allowed to rule rather than pre-empted. Both source files live under packages/types/src/, which the gate guards wholesale, so it failed with "2 source file(s) of 1 released package(s) changed, and this change adds no changeset". The answer it prescribes for a change that releases nothing is an empty-frontmatter changeset, which is what .changeset/6609-declared-keys-header-honesty.md carries. Re-run verdict:

✅ 2 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s): .changeset/6609-declared-keys-header-honesty.md.
Every one of them has an EMPTY frontmatter — declared as releasing nothing, which
is the explicit exemption and a complete answer to this gate.

Verification — all on dc44f49d, the final commit

checkverdict line
pnpm exec vitest run packages/types/Test Files 65 passed (65) / Tests 772 passed (772) — includes the pin file, logic untouched
pin file aloneTest Files 1 passed (1) / Tests 11 passed (11)
pnpm --filter @object-ui/types run type-checkexit 0 (tsc --noEmit + tsconfig.examples.json + tsconfig.test.json)
pnpm --filter @object-ui/types run lint✖ 247 problems (0 errors, 247 warnings), exit 0 — all warnings pre-existing no-explicit-any
pnpm check:control-bytes✅ check-control-bytes: OK (scanned 5487 tracked text file(s); skipped 85 binary).
pnpm check:spec-symbols✅ spec symbol derivation: 1315 files scanned against 4959 spec export names
node scripts/check-changeset-presence.mjs✅ … declares 1 changeset(s)
pnpm changeset:check✅ No changeset declares a major bump.
node scripts/check-changeset-overwrite.mjs✅ No pre-existing changeset was modified or deleted.

The typecheck claim was itself checked rather than assumed: tsc -p tsconfig.test.json --listFiles lists the edited test file (1 hit) and the main project lists the edited zod file (1 hit), so "typecheck clean" actually covers both edits.

The pin test was first run through pnpm --filter @object-ui/types exec vitest, which this repo's vitest guard refuses by name (it would have resolved the wrong root and reported 22 console files as green). Re-run from the repo root as the guard instructs; the numbers above are from that run.

Serial note

Held draft PR #6627 also touches packages/types (retired-field-keys.ts + the index barrel). This branch touches neither file — its whole diff is the two files above plus the changeset — so there is no crossing.


Generated by Claude Code

…ON PURPOSE
`packages/types/src/__tests__/form-field-zod-coverage.test.ts` introduced its
pinned key list as "Every key `FormField` (../form.ts) declares by name". The
interface declares one key the list deliberately omits — `field`, the resolved
object-field metadata stash (objectui#3090) — so the sentence overclaimed, and
the pin's own rule ("any schema edit must touch the list here in the same PR")
read as an invitation to close the gap by adding `field` to `DECLARED_KEYS` and
to `FormFieldSchema`. That would make `objectui validate` accept and type a
runtime-only stash on authored documents, re-opening the spec-vocabulary pun
objectui#3090 closed at the `normalizeSectionField` chokepoint — a contract
widening arriving disguised as housekeeping.
The list header now says what the list is (the authorable key surface) and
records the exclusion as deliberate, with the reason. The `FormFieldSchema` doc
comment in `packages/types/src/zod/form.zod.ts` carried the same "keys mirror
the interface" overclaim and is corrected the same way.
Prose only: no schema change, no test-logic change, no behaviour change. Every
changed line in both files is a comment line.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_8ca04858-ea8e-5b85-9182-de59aa49e00c
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

MetricValueBudget
Eager closure (gzip, 52 chunks)3237.3 KB3266.6 KB
Main entry chunk (gzip)157.3 KB350 KB
Entry fileindex-DZpGdrcH.js
StatusPASS

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

PackageSizeGzipped
app-shell (consoleActionDispatch.js)0.20KB0.19KB
app-shell (index.js)11.89KB4.50KB
app-shell (runtime-config.js)20.61KB7.35KB
app-shell (types.js)0.01KB0.04KB
app-shell (urlParams.js)10.06KB3.86KB
auth (ActiveOrganizationStorage.js)25.05KB9.16KB
auth (AuthContext.js)0.31KB0.24KB
auth (AuthGuard.js)2.07KB1.00KB
auth (AuthProvider.js)40.18KB10.59KB
auth (AuthShell.js)3.49KB1.40KB
auth (ForgotPasswordForm.js)12.21KB3.45KB
auth (LoginForm.js)18.15KB5.39KB
auth (PreviewBanner.js)0.90KB0.50KB
auth (RegisterForm.js)6.65KB2.22KB
auth (SocialSignInButtons.js)9.61KB3.89KB
auth (UserMenu.js)3.41KB1.23KB
auth (auth-gate-events.js)1.29KB0.66KB
auth (authStyles.js)5.04KB1.72KB
auth (createAuthClient.js)40.21KB10.80KB
auth (createAuthenticatedFetch.js)8.46KB3.43KB
auth (index.js)3.19KB1.44KB
auth (invitation-status.js)1.22KB0.70KB
auth (org-roles.js)6.66KB2.78KB
auth (phone-identifier.js)1.11KB0.66KB
auth (types.js)0.59KB0.35KB
auth (useAuth.js)5.30KB1.02KB
auth (useWorkspaceAdminStatus.js)5.13KB2.35KB
collaboration (CommentThread.js)26.08KB7.56KB
collaboration (LiveCursors.js)3.17KB1.27KB
collaboration (PresenceAvatars.js)6.49KB2.64KB
collaboration (PresenceProvider.js)2.79KB1.13KB
collaboration (index.js)1.68KB0.73KB
collaboration (useCollaborationTranslation.js)6.05KB2.52KB
collaboration (useCommentSearch.js)1.98KB0.88KB
collaboration (useConflictResolution.js)7.75KB1.86KB
collaboration (useMentionNotifications.js)1.81KB0.68KB
collaboration (usePresence.js)6.33KB1.84KB
collaboration (useRealtimeSubscription.js)7.91KB2.01KB
components (index.js)507.69KB114.99KB
core (index.js)5.30KB2.13KB
create-plugin (index.js)10.08KB3.26KB
data-objectstack (index.js)173.10KB47.96KB
fields (index.js)238.89KB60.02KB
i18n (LocalizationContext.js)1.76KB0.96KB
i18n (currency.js)1.22KB0.64KB
i18n (fallbackInterpolation.js)6.25KB2.77KB
i18n (i18n.js)4.28KB1.75KB
i18n (index.js)3.44KB1.39KB
i18n (pickLocalized.js)7.62KB3.26KB
i18n (provider.js)26.89KB9.04KB
i18n (useDisplayLocale.js)2.85KB1.45KB
i18n (useObjectLabel.js)33.40KB8.71KB
i18n (useSafeTranslation.js)5.60KB2.33KB
layout (index.js)38.95KB10.97KB
mobile (MobileProvider.js)0.92KB0.49KB
mobile (ResponsiveContainer.js)0.94KB0.38KB
mobile (breakpoints.js)1.51KB0.70KB
mobile (createOfflineDataSource.js)5.61KB1.75KB
mobile (index.js)1.55KB0.62KB
mobile (offlineQueue.js)3.91KB1.35KB
mobile (pwa.js)0.97KB0.49KB
mobile (serviceWorker.js)1.48KB0.62KB
mobile (serviceWorkerSource.js)3.41KB1.48KB
mobile (useBreakpoint.js)1.54KB0.65KB
mobile (useGesture.js)6.96KB1.98KB
mobile (useOfflineSync.js)1.99KB0.72KB
mobile (usePullToRefresh.js)2.53KB0.85KB
mobile (useResponsive.js)0.72KB0.42KB
mobile (useResponsiveConfig.js)1.37KB0.63KB
mobile (useSpecGesture.js)4.32KB1.64KB
mobile (useTouchTarget.js)1.01KB0.54KB
permissions (MePermissionsProvider.js)9.53KB3.38KB
permissions (PermissionContext.js)0.31KB0.25KB
permissions (PermissionGuard.js)0.89KB0.45KB
permissions (PermissionProvider.js)4.64KB1.50KB
permissions (evaluator.js)5.12KB1.74KB
permissions (index.js)0.93KB0.41KB
permissions (store.js)0.91KB0.42KB
permissions (useFieldPermissions.js)1.28KB0.53KB
permissions (usePermissions.js)1.93KB0.88KB
plugin-ai (index.js)15.75KB3.80KB
plugin-calendar (index.js)46.85KB12.89KB
plugin-charts (index.js)64.66KB18.32KB
plugin-chatbot (index.js)190.33KB45.10KB
plugin-dashboard (index.js)133.46KB34.48KB
plugin-designer (index.js)212.80KB43.15KB
plugin-detail (index.js)245.29KB62.39KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)132.01KB32.23KB
plugin-gantt (index.js)165.16KB40.33KB
plugin-grid (index.js)201.66KB54.57KB
plugin-kanban (index.js)53.11KB14.62KB
plugin-list (index.js)112.86KB27.54KB
plugin-map (index.js)20.09KB6.62KB
plugin-markdown (index.js)13.72KB4.69KB
plugin-report (index.js)43.51KB11.94KB
plugin-timeline (index.js)26.72KB7.71KB
plugin-tree (index.js)9.26KB3.13KB
plugin-view (index.js)85.87KB21.12KB
providers (DataSourceProvider.js)0.75KB0.39KB
providers (MetadataProvider.js)1.37KB0.59KB
providers (ThemeProvider.js)1.90KB0.85KB
providers (UploadProvider.js)11.66KB3.50KB
providers (index.js)0.45KB0.23KB
providers (types.js)0.01KB0.04KB
react-runtime (index.js)5.62KB2.34KB
react (LazyPluginLoader.js)4.47KB1.63KB
react (SchemaRenderer.js)65.97KB21.98KB
react (data-invalidation.js)5.05KB2.08KB
react (index.js)2.44KB1.21KB
react (schema-input.js)2.32KB1.24KB
react (spec-input.js)0.20KB0.18KB
sdui-parser (codegen.js)5.41KB2.34KB
sdui-parser (dashboard-widget-options.js)3.08KB1.30KB
sdui-parser (index.js)4.93KB2.24KB
sdui-parser (input-type.js)2.84KB1.40KB
sdui-parser (parse.js)12.13KB3.65KB
sdui-parser (provenance.js)3.66KB1.82KB
sdui-parser (types.js)0.28KB0.23KB
sdui-parser (validate.js)9.30KB3.22KB
types (ai.js)0.20KB0.17KB
types (api-types.js)0.20KB0.18KB
types (app.js)2.87KB0.99KB
types (base.js)0.20KB0.18KB
types (blocks.js)0.20KB0.18KB
types (complex.js)2.74KB1.41KB
types (crud.js)0.20KB0.18KB
types (dashboard-filter-alias.js)6.23KB2.74KB
types (data-display.js)3.75KB1.85KB
types (data-protocol.js)0.20KB0.19KB
types (data.js)0.20KB0.18KB
types (designer.js)1.85KB0.85KB
types (disclosure.js)0.20KB0.18KB
types (error-code.js)1.54KB0.88KB
types (feedback.js)0.20KB0.18KB
types (field-types.js)0.20KB0.18KB
types (form.js)0.20KB0.18KB
types (http-inflight.js)8.87KB3.73KB
types (http-retry.js)4.32KB2.02KB
types (icon-key-migration.js)4.26KB1.63KB
types (index.js)4.72KB2.24KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)2.59KB1.31KB
types (navigation.js)0.20KB0.18KB
types (objectql.js)0.20KB0.18KB
types (overlay.js)0.20KB0.18KB
types (permissions.js)0.20KB0.18KB
types (plugin-scope.js)0.20KB0.18KB
types (record-components.js)0.20KB0.19KB
types (record-semantics.js)1.28KB0.67KB
types (registry.js)0.20KB0.18KB
types (reports.js)0.20KB0.18KB
types (spec-report.js)5.05KB1.93KB
types (spec-ui-namespace.js)0.20KB0.19KB
types (system-fields.js)3.33KB1.54KB
types (theme.js)6.28KB2.87KB
types (ui-action.js)3.40KB1.71KB
types (views.js)0.20KB0.18KB
types (widget.js)0.20KB0.18KB

Size Limits

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

@os-sales
os-sales marked this pull request as ready for review August 28, 2026 07:32
@os-sales
os-sales added this pull request to the merge queueAug 28, 2026
Merged via the queue into main with commit 5361083Aug 28, 2026
30 checks passed
@os-sales
os-sales deleted the claude/issue-6609-declared-keys-header-honesty branch August 28, 2026 07:44
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant

@os-sales