…default and drawer arms (objectui#9849 step 1) (objectstack-ai#10236)
Part of objectstack-ai#9849
Clause-②: no
Step (1) of the two the director ruling orders on this card (comment
`5749155880`, letter E, maintainer 「同意」): 「the three `collapsed` /
`collapsible` resolutions converge to the declaration-based one
objectui#9780 established, before the gate rule lands on it.」 Step (2)
(E in `projectSectionDivider`, deleting `SectionDividerGate`, re-pinning
`drawerFormSectionDescription-9834` row 5, the diagnostic pin) is ⛔ not
in this PR and stays on the card. That is why the first line says `Part
of`.
## What changed
- `fieldGroups.ts` gains `resolveSectionCollapse`, beside
`projectSectionDivider`. It is module-internal: the package barrel
`src/index.tsx` names `fieldGroups` zero times, and `package.json`
`exports` declares only `"."`. It is the ONE resolution of the authored
pair, and it follows objectui#9780 letter A:
- `collapsed` implies `collapsible`, read off the declaration and never
off the live state.
- `collapsible: false` with `collapsed: true` resolves to collapsed,
with the control present.
- `collapsible` alone is open, with the control.
- A section declaring neither member is untouched.
- A section is only collapsed while it is collapsible, and it is only
collapsible when the row the arm draws can carry the control
(`hostsControl`). This states the default arm's 「an untitled bucket is
never collapsible」 once, for every arm.
- `ObjectForm.tsx` (grouped layout, explicit and derived sections share
one loop): the inline objectui#9780 expression moves into the helper.
Behaviour is unchanged (see the table).
- `DrawerForm.tsx`, both pushes, now call the same helper:
- The explicit push was still the objectui#9780 trap: it read
`collapsible` alone for the control and `collapsed` unconditionally for
the state.
- The derived push gated the state on `collapsible`, which is a third
spelling.
- The unseeded `useState` replaces a seed that read `collapsed` a second
time. An untoggled section falls back to its declaration inside the
helper, as in ObjectForm.
- `.changeset/9849-collapse-resolution-converge.md`: `patch` for
`@object-ui/plugin-form`.
⛔ No new accepted key or value, no new package export, no new prop.
`DrawerFormSectionConfig` and `ModalFormSectionConfig` are unchanged,
and no section map in `ObjectForm.tsx` copies a new key.
## Premise, re-measured on `origin/main` `62597c5` by printing every
`collaps` line in the four files
- **ObjectForm grouped layout, one site** (the objectui#9780
resolution): `isCollapsible = Boolean(section.collapsible) ||
Boolean(section.collapsed)`, the state `collapsedSections[key] ??
section.collapsed`, and fields hidden only on `label && isCollapsed`.
- **DrawerForm explicit push**: `collapsible: section.collapsible`,
`onToggle` only for `section.collapsible`, and the state
`collapsedSections[key] ?? section.collapsed` read unconditionally,
which hides the fields. A `useState` seed also read `s.collapsed`.
- **DrawerForm derived push**: the state read only when
`section.collapsible`, the control only for `section.collapsible`.
- **ModalForm: zero `collaps` lines.** It has no resolution of its own.
Neither route reads either member, `ModalFormSectionConfig` declares
neither, and `ObjectForm`'s modal map copies neither. So the modal draws
every field and no control, whatever the section declares.
- `fieldGroups.ts` at base only maps the `@objectstack/spec` `collapse`
enum onto the pair (`deriveFieldGroupSections`) and copies a resolved
pair onto the row (`projectSectionDivider`). Neither step is a
resolution.
⇒ The code has **three resolutions, as the ruling says**.
objectui#10172, objectstack-ai#10161 and objectstack-ai#10141 did not move them. But there are only
**two in behaviour**:
- The derived drawer push agrees with objectui#9780 on every input an
author can write. `deriveFieldGroupLayout` never emits `collapsed`
without `collapsible` (the deprecated `collapsed: true` alone maps to
`'collapsed'`, which maps to both), and every keyed group gets a heading
(label defaults to the key).
- Ablation leg 2 below measures this: putting the derived push back on
its old resolution reddens nothing.
- The live trap was the explicit drawer push only.
## Before / after, per route
Read by `__tests__/collapseResolution-9849.test.tsx` through a real
renderer. "Before" means the same pin file run against the base source:
`Tests 9 failed | 21 passed (30)`. Every failure was on a drawer
explicit route or a drawer trap row, and each failed for the right
reason (0 controls while the fields were hidden).
| route | `collapsed` alone | `collapsible: false` + `collapsed` |
`collapsible` alone | neither | no heading, no blurb, `collapsed` | no
heading, blurb, `collapsed` alone |
| --- | --- | --- | --- | --- | --- | --- |
| ObjectForm default, explicit `sections` | closed + control → **same**
| closed + control → **same** | open + control → same | open, no control
→ same | open → **same** | open, no control (blurb-only row,
objectui#9835 B) → same, not re-pinned here
(`objectFormSectionMembers-8071` row 8 owns it) |
| ObjectForm default, derived `fieldGroups` | closed + control → same
(both `collapse: 'collapsed'` and deprecated `collapsed: true`) | n/a |
open + control → same | open, no control → same | not author-reachable |
not author-reachable |
| ObjectForm `formType: 'drawer'` (drawer map) | ⛔ closed, **0
controls** → closed + control | ⛔ closed, **0 controls** → closed +
control | same | same | ⛔ fields hidden, **nothing on the page** → open
| see next row |
| DrawerForm explicit, direct | ⛔ closed, **0 controls** → closed +
control | ⛔ closed, **0 controls** → closed + control | same | same | ⛔
fields hidden, **nothing on the page** → open | ⛔ blurb drawn, fields
hidden, **0 controls** → closed, control on the blurb row |
| DrawerForm derived `fieldGroups` | closed + control → same | n/a |
same | same | not author-reachable | not author-reachable |
| ModalForm explicit, ObjectForm `formType: 'modal'`, ModalForm derived
| every field drawn, no control → **same** (a reading, see below) | same
| same | same | same | same |
⚠️ The last column differs between the default arm (open, no control)
and the drawer (a control on the blurb row). That is the **gate**
residual (`SectionDividerGate`, step 2), ⛔ not the resolution. The
default arm's blurb-only row carries no collapse pair under
objectui#9835 letter B. The drawer's explicit push draws a row for every
member, and `SectionDivider` renders that row when it has a heading or a
blurb. Both answers keep the fields reachable, and that is all the new
file asserts there.
⚠️ The modal rows are a READING, ⛔ not a ruling. The modal honours
neither member, so objectui#9780's one promise (a declared section is
never unreachable) holds there trivially. The pin asserts that, and it
records "no control" so that step (2)'s 「on every arm」 (ruling E item 1)
flips those rows on purpose. Bringing the pair to the modal needs a new
member on `ModalFormSectionConfig`, which this step does not add.
## Evidence, all at head `8cb4574b`
**Pins.** New
`packages/plugin-form/src/__tests__/collapseResolution-9849.test.tsx`,
30 rows:
- one block per route that emits a collapse pair (3 explicit, 2
derived), each asking the objectui#9780 questions;
- the drawer trap rows;
- the modal reading.
Every zero is lit: each absent-fields row also reads the heading drawn
and the same reader non-empty after a click, and each no-control row is
paired on its route with a row where the same reader finds one.
- Before, on the base source: `Tests 9 failed | 21 passed (30)`.
- After: 30 passed.
**Ablation.** Run through `ablation-replace.mjs`: each anchor hit
exactly once, each write was verified on disk by blob hash and marker
count, and each restore was proven by state (blob equals HEAD, `git diff
HEAD` empty) with a wrapper trap on EXIT/INT/TERM. The run covered the
new file plus `collapsedImpliesCollapsible-9780`,
`objectFormSectionMembers-8071` and `fieldGroupSections.test.tsx` (53
tests). Directions were written down before the run, and all three
matched:
| leg | mutation (blob before → during) | result |
| --- | --- | --- |
| 1 | drawer EXPLICIT push back on its old resolution (`d0dc3ee90d5b` →
`c0de0a1cc600`, marker 0 → 3 → 0) | `Tests 9 failed \| 44 passed (53)`:
exactly the 9 drawer explicit and drawer trap rows. **Every ObjectForm
row stays green**, and so do the objectstack-ai#9780 and 8071 files |
| 2 | drawer DERIVED push back on its old resolution (`d0dc3ee90d5b` →
`4bda9e2214c5`) | `Tests 53 passed (53)`: predicted, because the old
derived resolution is behaviourally identical on every author-reachable
input |
| 3 | the ONE helper loses the implication (`c24e82e8e24c` →
`8a713103f65a`) | `Tests 10 failed \| 43 passed (53)`: the
`collapsed`-alone and contradiction rows on **all three explicit routes
at once**, the drawer blurb row, `collapsedImpliesCollapsible-9780` rows
1 and 3, and `objectFormSectionMembers-8071` row 4. One mutation reddens
the default arm and the drawer together, which shows that one path
serves both |
No `dist/` is involved: the suite imports `plugin-form` from source
through the root vitest config, so no dist preflight applies.
**Suites and gates** (heavy runs under the shared verify lock, `VERDICT
command-exit 0`):
- `pnpm exec vitest run packages/plugin-form/` from the repo root: `Test
Files 109 passed (109)`, `Tests 1074 passed | 1 skipped (1075)`.
- `pnpm --filter @object-ui/plugin-form run type-check` echoed `tsc
--noEmit && tsc -p tsconfig.test.json` and exited 0, after building the
dependency closure (`--filter '@object-ui/plugin-form^...' build`, exit
0). `tsc -p tsconfig.test.json --listFilesOnly` lists the new pin file,
so its types are checked.
- Lint, as a DECLARED NARROWING to the 4 touched `.ts`/`.tsx` files:
- population: `eslint.config.js` applies to `**/*.{ts,tsx}`;
- count: `--format json` reports 4 files, 0 errors;
- invariance: the config enables no type-aware linting (no
`projectService`, no `parserOptions.project`), so this diff cannot move
the verdict of a file it does not touch;
- warnings on the edited sources are unchanged against BASE (ObjectForm
61 → 61, DrawerForm 22 → 22, fieldGroups 0 → 0). The new pin's 13
warnings are all `no-explicit-any` schema casts, the sibling pins'
pattern;
- the repo-wide `pnpm lint` is CI's.
- `pnpm check:control-bytes`, `check:new-line-citations` (0 new), `node
scripts/check-changeset-presence.mjs` (names the changeset),
`check:changeset-claims`, `check:pending-changeset-literals`,
`check:test-path-roots`, `check:vi-mock-specifiers` and
`check:vi-mock-override-shape` all exited 0. `check-governed-queue-guard
--test` over the 5 paths reported NOT GOVERNED. A manual control-byte
grep over the 5 files found no match.
- ⚠️ NOT MEASURED locally: the CI farm, including `Spec Main Shape
Gate`, which is red on every PR today on untouched test files
(objectui#10229). ⛔ Not addressed here.
## Acceptance notes
- **Two edge behaviours moved, both in the safe direction:**
- Sections that share a key: on the default arm, toggling a collapsible
section could hide the fields of a non-collapsible twin whose row had no
control. A non-collapsible section is now never collapsed.
- The drawer no longer seeds its live state at mount, so a section whose
declared `collapsed` changes after mount follows its declaration until
the user toggles it, as ObjectForm always has.
- `FormSectionContainer` (`FormSection.tsx`, a published React
component) has the same pair shape at the prop level. The objectui#9780
report already recorded it as not class (c): it is a component prop, and
its only caller (the wizard) passes neither. It is outside this file
surface and not touched.
- The pending `.changeset/9849-single-divider-projection.md` says of
that change that 「every arm's gate, its collapse resolution and its
predicate handling are unchanged」. That was a description of that
change's diff, and it is still true of it. This changeset follows it in
the same CHANGELOG and states the convergence.
- `check:changeset-claims` asks for a read of
`.changeset/8738-object-form-fields-description.md`, which names
`ObjectForm.tsx`. It was read: it concerns the top-level `fields`
vocabulary, which this diff does not touch, and it is still true.
Dispatched by the `domain:ui` seat, session
`https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC`, claim comment
`5812052116`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01BA3nKVUwKQJf8DBxrSVtNC)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Fixes #9511
Clause-②: yesExecutes director batch #195 item 1, letter A (comment
5749154869, maintainer 「同意」 2026-09-20T10:11Z), standing on batch #136 item 5 letter B. The ruling's operative clause, quoted:and its acceptance pin:
维护者速读
改了什么。 记录 id 从今天起在每一扇门上都是字符串。第五扇也是最后一扇门
DataSource.findOne收窄了,连带它背后三个作者直接手写的元数据键也收窄了 —— 表单的recordId、详情的resourceId(两个拼法、三处声明),每个都在两张已发布的面上同时动:TypeScript 声明,和手写的 zod 校验器。为什么必须动 zod 那一半。 因为 TypeScript 声明在解析时根本不运行。作者写进 JSON 的数字,只有 zod 校验器拦得住。只改声明、不改镜像,结果是已发布面上的
declared ≠ enforced,而且zod-mirror-parity.test.ts会一路绿着放它过去 —— 那个仪器只抓「镜像比声明更窄」,镜像更宽它不吭声。所以两张面一起动,这是本卡真正的技术核心。作者会看到什么。 今天把记录 id 写成裸数字的元数据,升级后校验不过,而且报错会直接告诉你怎么改:加引号,
42写成'42'。⛔ 平台不会替你转换,这是故意的 —— 主键是数字的部署方在自己的适配器边界转一次,于是下游每个作者、每个调用方、每个适配器看到的都是同一种形状。这类部署方的线上字节其实早就是'42'了(update在 objectui#9333、delete/bulkUpdate/bulkDelete在 objectui#9712),本卡只是让最后那扇不一致的门跟上。代价在哪。 另外四扇门当初在本仓一个调用点都不用改;成本全在
findOne这一扇,因为它的读取方是作者面。这次连带动了五张表单面,外加两处编译器强制的残留(下面单独交代)。风险与回滚。 风险集中在一件事:外部消费者如果手写了数字 id,升级即报错 —— 这正是裁决要的效果,报错带修法。回滚就是 revert 本 PR,没有数据迁移、没有生成物、没有 schema 基线要还原。
你要做的。 这是一次作者面收窄,
Clause-②已申报yes,下面是完整的 accept-set 测量。⛔ 未获批准前本 PR 停在 draft,不翻 ready、不入队。Clause-② — the accept set moved, measured in both directions
Differential over 45 documents across the three mirrors, parsed twice: once on this branch's freshly built
dist(--force, no cache, from813aaf75) and once on a comparison worktree at the merge base0c2eb5eee0. Same script, same corpus, same instrument on both sides.The 9 that moved are the only 9 that could: the three keys times three numeric spellings (integer
42, negative-1, float4.5). Every one refuses withinvalid_typeat that key's own path, and every message names both'42'andobjectui#9511.Nothing that parsed red now parses green — that is the
RED to GREENrow, and it is a measurement over a corpus deliberately stocked with already-red documents, not an inference from the shape of the edit.Every zero carries a lit control on the same instrument and corpus:
title: 42/objectName: 42invalid_type, before and aftertypeset to a wrong literalinvalid_value, before and afternullat the same key'42','rec_1',''zzqNoSuchKey⭐ Without the red-both and green-both halves the 9 refusals would prove nothing: a mirror that had simply broken would pass the subject rows too.
All five
DataSourceid parameters readstring—update,delete,bulkUpdate,bulkDelete,findOne— asserted two ways indata-source-id-surface-9511.test.ts: compile-timeExpectrows judged bytsc -p tsconfig.test.json, and a runtime census over the declaration text that reds even in a tree wheretscnever runs.Reverse verification — both new pins are proven able to fail
Run through
ablation-replace, which requires the anchor to hit and verifies the mutation on disk by blob hash before the command runs, then restores and proves the restore byte-identical.crud.zod.tsresourceIdback to the unione70c30156759to90bb646a8847authorable-record-id-string-9511.test.ts5 failed / 28 passeddata.tsfindOneback tostring or number0f2a090279e1to3b5444834866data-source-id-surface-9511.test.ts1 failed / 11 passedBoth restored: blob equals HEAD,
git diff HEADempty. ⭐ Leg 1 is the sharper reading — only theDetailSchemarows went red while the other two mirrors stayed green, so the pin discriminates per mirror instead of failing wholesale. Leg 1 also proves these pins resolve the source and not a staledist: no rebuild happened between mutation and red.The two paths outside the granted file surface — kept, and why
Both are compiler-forced fallout of the ruled narrowing, not scope creep. The full build does not compile without them, and each is the identical one-token edit as the five granted plugin-form faces.
packages/plugin-grid/src/components/BulkActionDialog.tsx—BulkActionDialogProps.dataSourcehand-restatesfindOne. Without the edit:⭐ This is the one shape in the tree where narrowing the protocol reaches a consumer at all. The interface declares
findOneas a method, which TypeScript compares bivariantly — that is why theDataSourcedocblock has always warned that narrowing here does not reach implementors. This face declares it as a property, which is checked contravariantly understrictFunctionTypes. That file's own comment had already predicted the event, in terms: it says deriving those doors fromDataSourcemeans "any future drift of that face reddens HERE instead of passing silently". It did.packages/plugin-view/src/ObjectView.tsx—buildFormSchemaasserted an untyped record bag's id asstring or number or undefinedand assigns it into the now-narrowedObjectFormSchema.recordId. Without the edit:src/ObjectView.tsx(1989,7): error TS2322.selectedRecordis aRecordof unknowns, so this was always a hand-written assertion; it now asserts the protocol instead of the wide shape. ⛔ Deliberately notString(...)— a reader-side coercion is the option the ruling refused by name, because eight such sites contradict 「the conversion lives in one typed place」.findOnecall sites concluded every other site was already string-clean. That survey was incomplete by construction: the failingplugin-formtask had stopped 5 of 29 build tasks from ever running. Re-run withplugin-formcompiling, the build reached all 43 tasks and named these two. ⇒ the reading in this PR is by compiler, not by declaration, and 43 of 43 tasks now report.The ruling's
KnownDriftnote is an instruction over an EMPTY SETThe ruling's execution section asks for 「the
KnownDrift/ mirror-parity ledger rows shrunk in the same change」. There are none to shrink. Measured inpackages/types/src/__tests__/zod-mirror-parity.test.ts:resourceIdappears 0 times andrecordId1, and that single hit is prose about anonNavigatesignature, not a ledger row. Independently re-verified by the dispatching seat againstMirroredUndeclared50 as the control, so the zero is a real absence and not a dead query.⇒
zod-mirror-parity.test.tsis untouched — which is also why excluding it from this PR's file surface cost nothing. Stated here so the next reader does not go hunting for rows that never existed.Gates — hand-derived, since
dispatch-gates.mjsrefuses for objectuiThat script derives families from the objectstack tree it runs in and says so outright; this list comes from objectui's own root
package.jsonscripts and.github/workflows/. Every exit code was captured to a file before any pipe.turbo run build --filter=!@object-ui/site --force(43 of 43 tasks)turbo run type-check(81 of 81 tasks)vitest runover the four affected packages — 504 files, 7685 passed, 1 skippedturbo run lintover the four affected packages (0 errors; 875 pre-existing warnings)check:control-bytes·check:new-line-citations(0 new)check-changeset-fixed·check-changeset-no-major·check-changeset-presencecheck:pending-changeset-literals·check:changeset-claimscheck:spec-symbols·check:component-surface-parity(report-only)check:doc-types·check:doc-snippets(672 of 672 blocks judged) ·check:doc-examples·check:doc-fences·check:doc-example-ids·check:doc-example-readerscheck:prompt-keys·check:registry-bare-names·check:handler-key-reads·check:designer-field-key-paritycheck:test-path-roots·check:vi-mock-specifiers·check:vi-mock-inherit·check:vi-mock-override-shapecheck:readme-exports·check:unreferenced-sources·check:self-import·check:sdui-registration-pins·check:element-data-source-declarationcheck:skills-paths·check:skill-examplescheck-governed-queue-guard --testover 6 changed pathsHonest notes on three of those readings, rather than letting them read stronger than they are.
check:skill-examplesexits 0 over 0 selected fences — no marked skill example carries these types, so that gate's corpus for this diff is empty. It is a real zero, ⛔ not coverage.check:component-surface-parityandcheck:new-line-citationsare report-only by their own design; their 0 means "no findings", not "blocking and green".;, so the wrapper printedbatch-last-exitand warned it does not cover both parts. That warning is correct and the wrapper's number is ⛔ not used here: each part's own exit code was written to its own file (0and0) and those are what the table reports.turbo run type-checkwas measured on tree0492a2b5. HEAD differs from that tree by exactly one file —.changeset/9511-record-id-is-a-string.md— and no tsconfig project in this repo includes.changeset(the one textual hit intsconfig.scripts.jsonis inside a comment). The reading therefore transfers; said explicitly rather than presented as a run on HEAD.A note on this branch's history
The first commit on this branch,
0492a2b5, is labelled INCOMPLETE AND UNREVIEWED and was not authored by this seat — the dispatching seat made it to stop the container reclaiming an idle worktree after this seat hit the usage wall mid-task. Every hunk in it has since been re-read line by line against the ruling and against the granted surface, and is adopted deliberately in813aaf75. Nothing in it was built on unreviewed. This repository squash-merges, so that WIP message does not reachmain; this body is the record.In-flight overlap, declared
Two open pull requests touch files this one touches. Both unions are trivial and neither overlaps a line here:
ObjectGallerySchema.filter) touchespackages/types/src/objectql.tsandpackages/types/src/zod/objectql.zod.ts— different keys, different members. Whichever lands first, the other rebuilds in the queue.packages/plugin-grid/package.json,packages/plugin-form/package.jsonandpackages/types/src/objectql.ts— manifests and an unrelated member.strict-authoring-face.ts) and the merge queue arbitrates.Acceptance notes
packages/plugin-form/src/MasterDetailForm.tsxstill declaresrecordIdasstring or number. ⛔ Left alone deliberately: it is not one of the five faces the ruling names, it does not hand that value tofindOne(it goes throughString(...)at its own read point), and it therefore does not break the build. It is the same survivor class as the three declarations on objectui#10078 and belongs with them in one decision rather than being narrowed here on this seat's own initiative. noted, not filed — successor: whoever answers objectui#10078.DataSourceMutationEvent.id,CommentSearchResult.recordIdandRecordSubscription.recordIdare on objectui#10078 and are ⛔ not touched here.String(...)coercions introduced is zero, which is the measurable form of the ruling's 「the conversion lives in one typed place」.Generated by Claude Code