Repository navigation
test(app-shell): measure whether a { group } form section reaches SchemaForm (#8725) - #8739
Conversation
…chemaForm (objectui#8725)
objectui#8725 was filed with reachability explicitly unmeasured. It is
reachable: the `form` document SchemaForm renders arrives from the
`/meta/types` registry as `RichMetadataTypeEntry.form`
(`Record<string, unknown>`, unvalidated) and is handed over as
`form={entry?.form as any}`, so the REQUIRED `fields` on `FormSectionSpec`
stands between a TypeScript author and this renderer and nothing else.
Pins the measurement without deciding either half of the fix: the render
throws a TypeError out of the component body and leaves no DOM, the whole
document dies with one bad section, and the read that fires first is
`SchemaFormBody`'s `for…of` pre-flight — not the `.map` sites the card
predicts, so guarding only those leaves the crash in place.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
…nothing Empty frontmatter — the explicit exemption for a test-only change under a published package's `src/`, per scripts/check-changeset-presence.mjs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
|
Contract review — accepted, flipped out of draft, auto-merge armed. Green on 30 of 33 with three shards still running; nothing failed. This is the decision tree's prescribed output, not a half-finished fix: reachability came back YES, so the card's own tree routes to "report with the measurement and STOP", and what ships is seven pins and an empty-frontmatter changeset — no source, no type, no behaviour. Two of the card's own premises were falsified, and the second one would have shipped a non-fix. The card guessed the inputs were this repo's ⭐ And the card predicts Three things I checked rather than took on trust.
The declared narrowing is acceptable because it is measured. The full
The ruling on the escalation is on objectui#8725: arm A fenced, arms B and C ruled in, parts 1 and 2 land together, and the unresolvable- Generated by Claude Code |
…the shared resolver (objectui#8725)
Part 1: FormSectionSpec.fields becomes optional, matching @objectstack/spec's
FormSection, where `group` is the other way to declare a section's members.
Arm B: every read of a section's `fields` in SchemaForm now sees a resolved
section. A { group } section goes through @object-ui/plugin-form's
resolveSectionGroupReferences (the resolver ObjectForm and the console FormPage
already use) before the pre-flight loop that used to throw
"s.fields is not iterable". SchemaForm hosts carry no object definition, so it
is called with objectDef null and resolvable false: a group resolves empty and
the dangling key is reported, which is the resolver's defined answer. A section
declaring neither `fields` nor `group` still throws, now a TypeError naming it.
The measurement pins of PR #8739 went red with this change and are rewritten in
the same commit onto the ruled behaviour; the two type-level collaterals the
widening surfaced (PIN D and mergeServerFields.test.ts) read the optional key
through NonNullable and a non-null assertion.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN
… of crashing, and the form-section types match the spec (objectui#8725) (objectstack-ai#10902) Fixes objectstack-ai#8725 Clause-②: yes Implements the PM ruling on objectui#8725 (comment 5594804560), relayed by triage 5858999555 and claimed by the `domain:ui` seat 2 claim 5863212314. Session: `https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN`. ## What changed - **Part 1.** `FormSectionSpec.fields` is optional in `form-spec.ts`, matching `@objectstack/spec`'s `FormSection`. In the spec, `group` is the other way to declare a section's members. - **Arm B.** `SchemaForm` resolves a form's sections once, in a new module-private `resolveFormSections`, before any read of `fields`. The pre-flight `for…of` in `SchemaFormBody` is one of those reads, and it was the one that threw first. A `{ group }` section goes through `@object-ui/plugin-form`'s `resolveSectionGroupReferences`, the resolver `ObjectForm` and the console `FormPage` already use. `SectionedSchemaForm` now takes the resolved sections, typed `ResolvedFormSection` (`fields` present), so the simple and tabbed reads cannot see an unresolved section. A section declaring neither `fields` nor `group` still throws, now as a `TypeError` that names the section. ⛔ No `?? []` on any section's `fields`. - **Behaviour change beyond the crash.** A section carrying both `fields` and `group` (a shape `@objectstack/spec` 17.4.0 refuses at parse, re-measured) now takes the resolver's answer for its `group`. In a metadata-type editor that is an empty section plus the same `console.error`, where it used to render its enumerated `fields`. Forms none of whose sections carries a `group` key are unchanged: the resolver returns such a list by identity. - **Arm C, last.** `RichMetadataTypeEntry.form` is `FormViewSpec` instead of `Record OF (string, unknown)`. Its JSDoc says this is a TYPE on an unvalidated server document, not a check of it, and names the measured shape gaps (below). The `as any` casts at the three `ResourceEditPage` reads and the one `EmbeddedItemEditor` read are gone. `EmbeddedItemEditor`'s fallback form slot takes the same type; no fallback entry declares a form. - **Pins.** The objectstack-ai#8739 crash pins went red with the fix and were rewritten in the same commit (arm C's type pin moved with arm C). Type-level collateral: `FormSectionSpec['fields'][number]` is now read through `NonNullable` in `form-spec.containers.test.tsx` PIN D and in the console's `FormPage.fieldSpec.test.ts`, and four `mergeServerFields.test.ts` reads use `!`. The `!` throws; `?? []` would have made their `not.toContain` legs vacuous. - **Changesets.** `.changeset/8725-formsection-group-resolves.md` bumps `@object-ui/app-shell` `minor` with a **BREAKING (types)** banner (see the consumer sweep). The pending measurement entry `.changeset/quiet-pans-repeat.md` gets a dated note, in the objectui#10533 form, with byte-identical (empty) frontmatter. ### What object definition `SchemaForm` resolves against, measured The resolver resolves `group` against the bound object's `fieldGroups`. `SchemaForm`'s 13 production call sites are all metadata-type editors: forms carrying `data: { provider: 'schema', schemaId }`. The `/meta/types` entry carries a `schema` and a `form` but no field groups: `RichMetadataTypeEntry` declares none, and objectstack's `metadata-protocol`, `objectql` and `rest` sources have zero `fieldGroups` hits. No host hands `SchemaForm` an object definition. So the resolver is called with `objectDef: null, resolvable: false`. The second is its own documented flag for "this form can never load an object definition". Every `{ group }` section here is therefore the ruling's "group that names no declared field group", and it gets the resolver's defined answer for that case.⚠️ This departs from the dispatch's first suggested pin ("renders the resolver's fields, matching FormPage for the same document"). That pin presupposes an object definition this component never has. Adding an `objectDef` prop would put an input with zero producers on the published component. The pin is written instead against the resolver called with `SchemaForm`'s own inputs. That is the same answer `FormPage` gives for the same section over an object that does not declare the group (H2 b). ## H1 to H3 **H1 (confirmed on base `45dbf1cba`).** A server-shaped form `{ type: 'simple', data: { provider: 'schema', schemaId }, sections: [{ group: 'contact_info' }] }` makes `SchemaForm` throw `TypeError: s.fields is not iterable`. The `{ fields: ['a'] }` control renders `BasicsField A`. **H2 (measured, resolver and `FormPage.buildSections` over a `ticket` object declaring `contact_info` and `billing`).** | case | `resolveSectionGroupReferences` | `FormPage.buildSections` | |---|---|---| | (a) `{ group: 'billing' }` | `{ name: 'billing', label: 'Billing Details', fields: ['invoice_no','po_number'] }`, no diagnostic | label `Billing Details`, fields `invoice_no, po_number` | | (b) `{ group: 'no_such_group' }` | `{ fields: [] }` plus one `console.error` naming the group, the object and `fieldGroups` | no label, zero fields, one `console.error` | | (b) no objectDef, `resolvable` default | `{ fields: [] }`, **no** diagnostic (read as a load in flight) | n/a | | (b) no objectDef, `resolvable: false` | `{ fields: [] }` plus the same `console.error` | n/a (the arm `SchemaForm` takes) | | (c) `{ fields: ['channel'], group: 'billing' }` | the billing section; authored `channel` dropped, no diagnostic | `Billing Details` with `invoice_no, po_number` | | neither, `{ label: 'X' }` | returned untouched, by identity | label `X`, zero fields, silent (FormPage's own `?? []`) | **H3 (reader census).** - *Typed reads of `FormSectionSpec.fields`, found by the compiler.* With part 1 alone, the app-shell src program reports three TS18048 errors, all in `SchemaForm.tsx`: the pre-flight `for…of`, the `renderSection` `.map` and the tabbed `.some`. All three now read `ResolvedFormSection` (arm B). The test programs report PIN D (TS2537) plus four TS18048 in `mergeServerFields.test.ts`. The console test program reports TS2537 on the `FormPage.fieldSpec.test.ts` element path, which cascades into its excess-key directive. All are fixed as above. - *Guarded or untyped reads, found by grep.* `mergeServerFields.formDeclaredFields`, and the `dashboard-schema` / `page-schema` / `report-schema` / `view-schema` adapters, read `s.fields ?? []` over the BUNDLED spec forms. These predate this change. Measured against installed spec 17.4.0, 17 bundled metadata forms (75 sections, 222 field rows) carry no `group` section and no section without `fields`, so these adapters see only enumerated sections. `ResourceEditPage`'s issue-label lookup is `Array.isArray`-guarded. For a `{ group }` section it falls back to the schema title, the same thing `SchemaForm` shows after resolving the section empty. `FormPage`'s later `sec.fields` reads take its `RenderableSection` rows, which `buildSections` builds from the resolver's output. `ObjectForm` resolves first (objectui#7051). `metadata-form-i18n` and `ViewPreview` guard with `Array.isArray`. `ViewPreview` spreads the section, so `group` survives and `ObjectForm`'s resolver still resolves it. - *`RichMetadataTypeEntry.form`.* It has four reads, in `ResourceEditPage` (two `SchemaForm` handoffs and the label lookup) and `EmbeddedItemEditor` (one). All are typed now. `SchemaForm` is the only renderer. **Arm C's server-shape check.** The spec's parsed `FormView` type is not assignable to `FormViewSpec`. A per-key probe finds 12 incompatible positions. Section level: `label`, `visibleWhen`, `visibleOn`, `fields`. Field level: `options`, `label`, `placeholder`, `helpText`, `colSpan`, `visibleWhen`, `visibleOn`, `fields`. These are the narrowings `form-spec.ts` already declares: `I18nLabel` versus `string`, `ExpressionInput` versus `VisibilityPredicate`, and the 26-key converged leaf. The values measured on the 17 bundled forms stay within `FormViewSpec`. Every label is a string, every predicate is a string or has `source`, and every `colSpan` is 1 to 4. The exceptions are keys `FormFieldSpec` does not declare: `span` (the parse default `'auto'`, on all 222 rows) and `keyField` (one `objectForm` row). Reported per the ruling, not widened. Whether a live `/meta/types` response ever carries a locale-map label is **NOT MEASURED** (no server in this run). ## Pins and ablation The pin file `SchemaForm.groupSectionReachability-8725.test.tsx` has two parts. Runtime (vitest, per-test JSON reporter): - CONTROL (`fields` section renders) - ORDER (resolver's fields, resolver's order, siblings intact) - DIAGNOSTIC (a group naming no declared group renders empty AND `console.error` names the group, the `schemaId` and `fieldGroups`) - TABBED (the tabbed arm resolves and keeps its other tabs) - REFUSAL ×2 (a section with neither key throws a `TypeError` naming it, simple and tabbed) Type-level (judged by `tsc -p packages/app-shell/tsconfig.test.json`): - T1: `{ group }` compiles as `FormSectionSpec`, with a `@ts-expect-error` negative control on `{ group: 42 }`. - T2: `RichMetadataTypeEntry['form']` equals `FormViewSpec` and refuses an undeclared key. | leg | tree | result | |---|---|---| | head | `496c63c061` | 6/6 passed; app-shell `type-check` exit 0 | | base: the five changed sources checked out at `45dbf1cba`, head pins kept | proved on disk (5 blobs equal BASE, not HEAD); restored by state (`git diff HEAD` empty, 5 blobs equal HEAD) | runtime 1 passed / 5 failed: CONTROL green; ORDER, DIAGNOSTIC and TABBED fail on `expected TypeError: s.fields is not iterable to be undefined`; both REFUSAL pins fail on `expected 's.fields is not iterable' to contain '"Contact"'`; 0 suite deaths. tsc: T1 TS2322 plus TS2344, T2 TS2344 plus TS2578 | | leg 1: arm B's resolution reverted (the mapping reads `form.sections` instead of the resolver's output) | anchor 1→0, injected 0→1, blob changed, restored | exactly ORDER, DIAGNOSTIC and TABBED red; CONTROL and both REFUSAL pins green | | leg 2: the report silenced (`resolvable: false` becomes `true`) | same proof | **first run NEGATIVE**: all green, because the test's own resolver call also reported and the console was read after it. The pin was fixed to read the console right after render (`b392cbd44f`). Rerun: DIAGNOSTIC alone red | | leg 3: arm-A caricature (a memberless section becomes `fields: []`) | first attempt **VOID**: the replacement contained the anchor, and `ablation-replace.mjs` refused it (anchor 1→1). Rerun with a disjoint anchor landed | both REFUSAL pins alone red | Each leg ran from a committed tree through `ablation-replace.mjs` WRAP mode, with EXIT/INT/TERM restore on absolute paths and restore proven by blob hash plus `git diff HEAD`. No build is needed: the pin imports `./SchemaForm` relatively, and vitest aliases `@object-ui/plugin-form` to its `src`, so no `dist` is on the path. Base leg and leg 1 were rerun on the final head. ## Consumer sweep (a gate) `git grep` for `FormSectionSpec|FormViewSpec|RichMetadataTypeEntry|resolveSectionGroupReferences|\bSchemaForm\b` over `packages/*/src/*` and `apps/*/src/*` returns 113 files. The population is 5230 files; the control is `metadata-admin/SchemaForm.tsx`, 1 hit. Of the 113, 56 are tests. Outside `src`, the hits are changesets, CHANGELOGs, docs and one script test. Every hit test was run, plus every `FormPage.*` test and the whole `metadata-admin/` (inspectors included) and `studio-design/` directories. All ran at `496c63c061`, under the verify lock, JSON reporter, requested-versus-reported file counts reconciled: | chunk | files | tests | result | |---|---|---|---| | console `FormPage.*` (23), plugin-form (2), core ratchet (1), `scripts/__tests__/one-authority-per-exported-name-6273` (1) | 27 | 219 | 219 passed, 0 suite deaths | | `packages/app-shell/src/views/metadata-admin/` (3 chunks) | 329 | 3935 | 3934 passed, 1 skipped (a pre-existing `flow-node-config.spec-reconciliation` case), 0 suite deaths | | `packages/app-shell/src/views/studio-design/` | 67 | 365 | 365 passed, 0 suite deaths | Type-checks, after building the dependency closure `pnpm --filter '@object-ui/console^...' build` (33 packages), all at `496c63c061`: - `@object-ui/app-shell` exit 0. - `@object-ui/console` exit 0. - `@object-ui/plugin-form` exit 0. The importers of these types are app-shell and the console. The `core` and `react` hits name `SchemaForm` in comments only. Reverse verification (console reads the REBUILT `.d.ts`): a temporary console file typed `{ group: 'contact_info' }` as `FormSectionSpec`, which compiled, and gave `RichMetadataTypeEntry['form']` an undeclared key, which was refused with TS2353 (`does not exist in type 'FormViewSpec'`). The file was then removed. **Semver.** Outside `SchemaForm`, whose three reads (TS18048 under part 1) are what this change fixes, no published source had to change to compile. The other readers that changed were tests: two type-level test pins (app-shell PIN D, console `FormPage.fieldSpec.test.ts`) and four `mergeServerFields` assertions. That is exactly what an external reader of `section.fields` faces, hence `minor` plus the **BREAKING (types)** banner and the `!`. ⛔ Not `major`. ## Gates All verdict lines were read with the exit code captured before any pipe, at `496c63c061`: - `check-changeset-presence` exit 0: "9 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)". - `check-changeset-no-major` exit 0. - `check-changeset-overwrite` exit 0. It reports `quiet-pans-repeat.md` as modified (the dated note: case 2, prose correction, frontmatter empty before and after). - `check-changeset-claims` exit 0. Five pending changesets name touched files (6247, 5596, 5542, 5040, 5595). Each paragraph was re-read and none became false. - `check-changeset-fixed` exit 0. - `check:pending-changeset-literals` exit 0. - `check:control-bytes` exit 0 (9149 files), plus a manual control-byte scan of the 11 changed files: no hits. - `check:new-line-citations`: "0 new citation(s)". - `check:phantom-deps` and `check:unused-deps` exit 0. `@object-ui/plugin-form` was already declared; `AppContent` and `MetadataProvider` already import it statically, so the eager closure gains no module. - `check:spec-symbols` exit 0. - `check:vi-mock-inherit` exit 0. Every app-shell `vi.mock` of `@object-ui/plugin-form` spreads `importOriginal`. - `check:test-path-roots`, `check:unreferenced-sources` and `check-type-check-coverage` exit 0. - `check-governed-queue-guard --test` on the 11 paths: NOT GOVERNED. ESLint, declared narrowing: the 9 changed TS files, counted from `--format json`, gave 0 errors and 90 warnings, all on pre-existing lines. The four removed `as any` casts take their warnings with them. The population is `eslint.config.js`'s `**/*.{ts,tsx}` blocks. Type-aware linting is not configured there (no `parserOptions.project` or `projectService`), so this diff cannot move a verdict on an untouched file. The repo-wide `pnpm lint` is CI's. NOT MEASURED: - `check:eager-closure`, which needs a console `vite build`. `performance-budget.yml` runs it. - `check:readme-exports`: no export changed. - The full `@object-ui/app-shell` suite outside `metadata-admin/` and `studio-design/`: declared to CI. Every file that names these symbols is inside the swept set. ## Serial The open-PR file lists were re-read before the first edit (9 open PRs, no overlap) and before the final push (5 open PRs). Nothing touches `metadata-admin/form-spec.ts`, `SchemaForm*` or `packages/plugin-form/src`, or any other file here. The one exception is the release PR objectstack-ai#5400 (`changeset-release/main`), which deletes pending changesets, `quiet-pans-repeat.md` among them. If it lands first, the dated-note hunk becomes a modify/delete conflict, resolved by taking the deletion. `git merge-tree --write-tree` against a fresh `origin/main` (`244d516df4`) is clean. None of main's 226 files changed since the base names a swept symbol. The merge queue was empty at branch time. ## Fix round 1 (contract review), head `e8422e785e` One text-only commit, `e8422e785e`, on top of `496c63c061`: - **Changeset, closing line.** Replaced. The "spec refuses at parse" clause was re-measured on installed `@objectstack/spec` 17.4.0: `FormSectionSchema` REJECTS `{ fields, group }` ("mutually exclusive"), and `FormViewSchema` rejects it at `sections.0.group`. Controls: `{ group }` alone and `{ fields }` alone both ACCEPT. - **Changeset, BREAKING paragraph.** It now says `SchemaForm`'s three reads were the published source part 1 broke. The frontmatter is byte-identical. - **`RichMetadataTypeEntry.form` JSDoc.** Comment lines only; the typed line `form?: FormViewSpec;` is byte-identical. `FormViewSpec` is not widened. - **REFUSAL pin.** `expect(html).toBe('')` is dropped. It could only pass, because `html` was assigned only when nothing threw. `html` is gone from the helper. The pin stays red on base for its stated reason and red under the arm-A caricature. Verdicts at `e8422e785e`, under the verify lock: - **Pin file:** 6/6 passed. - **Base leg** (the five changed sources at `45dbf1cba`, restored by state): 1 passed, 5 failed. Both REFUSAL pins fail on `expected 's.fields is not iterable' to contain '"Contact"'`. 0 suite deaths. - **Ablation leg 3** (arm-A caricature): both REFUSAL pins, and only they, go red with `expected undefined to be an instance of TypeError`. - **Changeset-reading tests:** 11 `scripts/__tests__` files, 369/369 passed. They are `check-changeset-claims`, `-presence`, `-overwrite`, `-no-major`, `-fixed`, `check-pending-changeset-literals`, `changeset-polarity-census`, `changeset-release-action-ref-pin`, `render-changeset-claims-comment`, `check-spec-range-floors` and `quick-reference-current-release-4143`. - **`@object-ui/app-shell` type-check:** exit 0, after rebuilding its dependency closure. - **Gates**, all exit 0: - `check-changeset-claims`: same 5 pending changesets named, none false. - `check-changeset-presence`: "9 source file(s) of 2 released package(s) changed, and this change declares 1 changeset(s)". - `check-changeset-overwrite`: reports the `quiet-pans-repeat.md` dated note. - `check-changeset-no-major`: "No changeset declares a `major` bump". - `check-changeset-fixed`, `check:pending-changeset-literals`, `check:control-bytes` and `check:new-line-citations` (0 new). ## Acceptance notes - **Scope grew by three files beyond the claim's list.** Arm C's retype lives in `useMetadata.ts`, and dropping its casts touches `ResourceEditPage.tsx` and `EmbeddedItemEditor.tsx`. The console's `FormPage.fieldSpec.test.ts` took the type collateral. - `resolveSectionGroupReferences` silently drops authored `fields` beside a `group` that resolves (H2 c). The resolver's own header says it refuses "the shapes the spec refuses, out loud rather than silently", and `GROUP_OWNED_SECTION_KEYS` does not list `fields`. The spec door refuses that shape at parse. No reach was measured, so this is not filed. In `SchemaForm` the group never resolves, so the dangling-group `console.error` fires regardless. Carrier: none. - `FormPage.buildSections` renders a section with neither `fields` nor `group` as a silent empty card (its own `?? []`). The spec door refuses that shape. Not touched here (objectstack-ai#8725's ruling covers `SchemaForm`). Carrier: none. - The bundled-form adapters (`view-schema` and its three siblings) would drop a `{ group }` section of a BUNDLED spec form silently, because they filter out sections whose `fields ?? []` is empty. No bundled form authors one (measured above). Carrier: none. - `requiredInGatedSection.sectionMemberNames` reads enumerated members only, so that advisory does not examine a `{ group }` section's members. This is a read-only inference; carrier: none. - `SchemaForm` gains a module-level diagnostic: one `console.error` per (schemaId, group) pair, from the resolver's own `reportOnce`. --- _Generated by [Claude Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Part of #8725 — deliberately not
Fixes. This PR delivers the card's first deliverable, the reachability measurement, and stops there. Neither half of the fix is here: the half that remains is the type widening plus a disposition for the three read sites, which is a behaviour ruling on a renderer. See "What this PR does not do".Leg 1 — reachability: YES, and the card's guess about the inputs is false
The card was filed with reachability explicitly unmeasured and named that as its own gap. It guessed the inputs were "this repo's own
*.form.tscreate/edit schemas, which do not authorgroup" — which would have made the defect latent.Sweep. Population: 4,231 tracked
.ts/.tsxfiles underapps/andpackages/(git ls-files -- 'apps/**/*.ts' 'apps/**/*.tsx' 'packages/**/*.ts' 'packages/**/*.tsx' | wc -l). Lit control on the same command shape over the same population: 1,904 files matchgit ls-files -- '*.ts', andgit grep -l "from 'react'"overpackages/ apps/ examples/lights 1,875 files. Against that non-empty population,git ls-filesmatches 0 files named*.form.tsand 0 files containing.form.at all. The premise names a file class this repository does not contain.What the inputs actually are. A
git grepfor the JSX opening tag ofSchemaFormover the whole tracked tree returns 13 production call sites; seven pass aformprop, and they take it from exactly two channels:RichMetadataTypeEntry.form(useMetadata.ts:93) is aRecordofstringtounknown— the/meta/typesregistry response, deserialised inuseMetadataTypeswith no validation and no normalisation — andResourceEditPage.tsx:2798/:2822hand it over asform={createMode && config.createSchema ? undefined : (entry?.form as any)}.EmbeddedItemEditor.tsx:76does the same withsubEntry?.form as any.getPageForm/getViewForm/getReportForm/getDashboardFormreadpageFormand friends straight out of@objectstack/spec/ui, an upstream versioned document this repo does not author either.So the REQUIRED
fieldsonFormSectionSpecstands between a TypeScript author and this renderer, and between nothing else. On the channel that actually reachesResourceEditPage, there is no compile-time barrier at all.Premise re-measured against the installed
@objectstack/spec17.3.0 (root export is thin, so via the/uisubpath):The control fires, so the accept is a real reading of a strict schema. Also measured on 17.3.0: none of
pageForm/viewForm/reportForm/dashboardFormdeclares agroupsection or a section missingfieldstoday — a property of one spec release, not a barrier.The DOM reproduction, and one word the card has wrong
Reproduced in
happy-domthrough the same untyped channel. The render throws out of the component body; there is no partial tree and no per-section boundary could contain it. ContainerinnerHTMLis the empty string — the card's parent measurement (#8641) found a visible empty bordered card for its defect; this one leaves no DOM at all. A well-formed sibling section in the same document dies with it, and the tabbed arm dies identically.The card predicts
Cannot read properties of undefined (reading 'map'). That is not what fires. The observed throw is:SchemaForm.tsx:786isfor (const f of s.fields), insideSchemaFormBody's pre-flight "does this layout name any field the schema has" loop — upstream ofSectionedSchemaForm, so the.mapsites at:1030and:1147are never reached. Guarding only the two.mapsites the card quotes leaves the crash exactly where it is. This is proved mechanically by ablation leg A below, not by reading.What this PR does not do, and why
Nothing here widens
FormSectionSpec.fieldsand nothing here touches a read site.?? []at the read sites degrades a group-referencing section to an empty one — today's silent drop, made non-throwing. That is a behaviour ruling on a renderer.SchemaFormis not handed.@object-ui/plugin-formpublishesresolveSectionGroupReferencesfor exactly that (PR fix(console,plugin-form): render a form section that references a field group (#8641) #8727, still open and not merged at the time of writing), so that route is an import, never a new derivation — no assembly rule may be re-implemented on the objectui side (Consume the spec section group-reference form (objectstack#13855, ruled B) — pagerecord:detailssections and viewform.sectionsresolvegroup:keys viaderiveFieldGroupLayout#7051, objectstack#13855).One thing the card could not know, measured here: the trap is real but loud, not silent. Widening
fieldsto optional makes this package's owntype-checkreport, immediately:So part 1 cannot ship without its author confronting every read. What
strictNullCheckscannot do is stop them from typing?? []to silence it — which is precisely the ruling this card is holding open.What landed
One new test file,
packages/app-shell/src/views/metadata-admin/SchemaForm.groupSectionReachability-8725.test.tsx, plus an empty-frontmatter changeset. No source file, no type, no behaviour changes.Its runtime pins assert what this renderer does today, which is to die. They are a measurement, not an endorsement: whoever rules on the disposition is expected to turn them into pins on the chosen behaviour, and their going red is the intended signal that the ruling landed.
tsc{ group }section is refused byFormSectionSpec(ts-expect-error, so it is two-way: wideningfieldsreds this file and puts the runtime pins in front of the author)tscRichMetadataTypeEntry['form']— the barrier guards one channel and not the reaching onefieldsstill renders themTypeErrorof thes.fieldsfamily and leaves no DOMfor…of, not a.mapT1 carries a positive control (
groupis a declared key, so T1's refusal is about the missingfieldsand not an unknowngroup).Evidence
Every pin observed red. Five ablation legs, each run from a committed tree, each mutation line-preserving and proved on disk in both directions (anchor counts before and after,
git hash-objectdiffering from the HEAD blob, a line-total gate), each restored by state (git checkout HEAD -- ABSOLUTE_PATH, thengit diff HEADempty and the blob hash back to the HEAD blob), each under atrap ... EXIT INT TERMwith absolute paths. Per-test classification read from vitest's JSON reporter, with file-levelfailureMessage(suite death) counted separately — it was 0 in every leg, so every result below is a failing assertion and not a suite death.:786onlyCannot read properties of undefined (reading 'map')— the card's own quote, from:1030. Proves the ordering claim and that a two-site fix is a non-fix.FormSectionSpec.fieldswidened to optionalTS2578: Unused 'ts-expect-error' directive), plus theTS18048inventory quoted above.RichMetadataTypeEntry.formretyped toFormViewSpecTS2322), and measured as the only error in the package — so T2 is a measurement, not a tautology.Type-level pins are inside the checked program.
tsc -p packages/app-shell/tsconfig.test.json --listFilesreads 4,474 files and the pin file is one of them (input #4,099). Legs D and E confirm behaviourally that the project judges it.Non-regression, structurally.
tsc -p packages/app-shell/tsconfig.json --noEmit --listFilesreads 3,697 files: the new file is not among them, and no*.test.tsxis (control:SchemaForm.tsxis). The emitting program's inputs are byte-identical tomain, so nothing any form builds can have moved. R1 is the runtime half of the same claim.Suites run (from the repo root with paths, per objectui#3378):
Declared narrowing. The full
@object-ui/app-shellsuite exceeds this container's foreground budget, so it was narrowed to the change's measured blast radius and the remainder is declared to CI. The radius is measured, not assumed: of 41 tracked files importingSchemaFormorform-spec, 39 are underviews/metadata-admin/and the other two aresrc/index.ts(a re-export) andviews/studio-design/ObjectHooksPanel.tsx— both directories were run in full above.Collisions
git ls-remote --heads origin 'gh-readonly-queue/*'at branch time listed PRs 8720, 8721, 8723, 8732, 8733. Diffing the queue tip against this branch's base gives 26 files; the intersection with this PR's two files is empty, and none of them is underviews/metadata-admin/.The decision this PR is asking for
{ group }can reachSchemaForm, so parts 1 and 2 have to land together. Part 2's disposition is the ruling:?? []at the three read sites. Cheapest, no new dependency. It makes a group-referencing section render as an empty one: today's silent drop, no longer fatal. That is a behaviour ruling on a renderer, and it is what the compiler will tempt the next author into typing.resolveSectionGroupReferencesfrom@object-ui/plugin-form(blocked on fix(console,plugin-form): render a form section that references a field group (#8641) #8727 landing). Correct, and the only route that does not re-implement an assembly rule here — butSchemaFormis not handed an object definition today, so it needs a new input threaded fromResourceEditPage/ the inspectors.RichMetadataTypeEntry.form(leg E measured this as the only error in the package) and dropping theas anycasts. This does not fix the crash — a server document can still carry the shape at runtime — but it stops the type from claiming a guarantee it does not provide.A and B are not exclusive with C.
Generated by Claude Code