Repository navigation
Commit f42afe7
feat(spec)!: a view holds lists only; view-held forms are tombstoned (#38957)
repo:objectstack@os-support-ai · os-support-ai ·
session_01WGufzj7Sj3euvc1cYXrhNA
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBDjzWFC3d7kCBaYY5Z9GpAL)_
Fixes #37112
Supersedes #38908, which superseded #38888. The maintainer handed this
card to seat `repo:objectstack@os-support-ai` (claim 7315188352 on
#37112, amendments 1–15). This branch starts at #38908's head
`573b29bb88` (every commit of #38908 and #38888 kept) and merges `main`.
#38908 and #38888 close when this PR lands.
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: `skills/objectstack-i18n/SKILL.md` sends a form's heading
and thank-you panel to the `forms` group and drops `title` /
`submitBehavior` from the `_views` row;
`skills/objectstack-ui/rules/list-views.md` already teaches `forms:` and
refuses a form inside a view
## 维护者速读
- 用户能看到什么变化:升级到 19 版后,视图只放列表,表单只认独立的 `form` 类型;三种旧写法在校验、`defineStack`
和保存时被拒绝(422),并给出改法;没跑升级命令的部署会拒绝启动,并提示该跑哪条命令。
- 有意和 18 版不同的地方(跑完升级命令前):存在旧格式行里的表单,在 `os migrate protocol --to 19
--apply` 搬走之前一律不对外服务(404),搬走后按原名、原链接恢复服务。其中包括 18 版会在链接上打开的、19
版之前存下的「开着的副本」;自己组装内核、不挂启动守卫的宿主也一样。还包括:某个包已经以 `form`
类型发布了一个表单、部署里另有旧格式行也存着它时,18 版在链接上打开它,19 版在搬走前同样回
404,搬走后恢复。已下线的表单在搬之前、搬之后都保持下线。
- 测试含义变化:组织归属迁移在 single 姿态下,`withdrawalsCarried` 由 0 变为 1(表单下线也会搬到
`form` 上,偏向关闭);API 调用方能看到的错误码变化:带表单、撞上已占用公开链接的 `view` 保存,原来回
`FORM_ADDRESS_TAKEN`,现在回 `422 INVALID_METADATA`。
- 为什么做:表单拆成独立类型这个专题的收尾一步,19 大版本按裁定一次切换。
- 出错会怎样:影响升级到 19 版的部署和作者;合并前可撤回,发版后撤回要再出一个版本。
- 要你做什么:契约复审和 L1 通过后请你批(Tier H);落地时请顺手关闭 #38908 和 #38888(它们的提交都已在本 PR
里)。
## What changes
PR 2 of 2 for #37112 (PR 1, #38844, shipped the conversions, `os migrate
protocol --to 19` and the switch marker).
- [x] Tombstones in `@objectstack/spec`: `view.form`, `view.formViews`,
the `form` view kind, the flattened form overlay, and the
`_views.KEY.title` / `.submitBehavior` translation tails (ADR-0159 D7,
D8). New exports `ServedViewItem`, `expandServedViewContainer`,
`isServedViewItem`.
- [x] Boot guard (ruling 7303149461): a 19 runtime without the switch
marker refuses to start with `FORM_TYPE_SWITCH_REQUIRED` and names the
command; no skip switch. Birth marker (ruling 7308112533): a store
created from empty records the marker itself.
- [x] View reads serve lists only (metadata-protocol, intake, rest,
loaders); the `view` save door refuses the old shapes with the `forms:`
prescription (`422 INVALID_METADATA`); saving a served old-shape
container back is refused, so no stored state is lost.
- [x] The `form` type's write doors and validators moved from `view` to
`form`; lint stops reading the old shapes;
`form-view-internal-not-loaded` is retired (its successor
`form-consumer-less` stays).
- [x] Withdrawn public forms stay closed across the switch: the door
judges the base's own form ahead of its override; a stored copy's
withdrawal keeps closing the copying package's form; `os migrate
organization-ownership --apply` carries a form withdrawal into the pair
at 19.
- [x] Withdrawn forms stay closed across the switch for every stored
shape: a stored row is read under the name its package's form is served
under at 19, and a row whose package cannot be told apart reads closed
at each package that ships the form (contract-review round 1, M1; claim
amendment 16).
- [x] Fix: a form save into a pair no longer hangs on SQLite when legacy
organization rows exist (the read joins the save's transaction).
- [x] `os migrate packageless-overlays` deletes a view container it
cannot move only after `os migrate protocol --to 19 --apply` has moved
its form members.
- [x] Console (`ui/`): list switcher, Studio view editor and view
preview handle lists only.
- [x] Docs, spec prose, liveness re-cite, BREAKING changeset
`.changeset/37112-view-holds-lists-only.md`.
## Why
ADR-0159 card ⑤b: forms are their own metadata type, and major 19 stops
reading the three view-held form shapes (ruling record 7142585849 on
#36868: convert first, then switch, in the next major).
## Deliberate differences from 18 until the ceremony
On protocol 19, before `os migrate protocol --to 19 --apply --yes` has
moved them, forms held only in stored old-shape rows answer `404` on
both doors, whoever asks; after the move they are served as `form` items
under the same name and link. This includes a pre-19 stored copy of a
package's form saved open, which 18 served at its link (amendment 10,
7325088362, records the per-cell 18 reading), and it holds on a host
that assembles its own kernel without the boot guard. It also includes a
form a package ships as a `form` item while a stored old-shape row also
holds it: 18 served it at its link, and on 19 it answers `404` until the
ceremony moves the row (seat ruling on contract-review round 1).
Withdrawn arms are unchanged: closed before and after the move.
## Rewritten tests (none deleted; every flip is 200→404 within the ruled
classes Q2/Q3)
- Q2: 'an old-shape form open in the base's code is read as no `form`
item … 404 (ADR-0159 D7)'; 'an old-shape form whose `data.object`
differs … served on neither door'; the reads-once by-name form read
answers `undefined` and the door GET 200→404 (×2); the title-i18n
overlay case renamed to its 404.
- Q3: 'package-less form at the environment's own address … 404 before
`--apply`, served after' (×3); 'the fold, writable-base twin … closed
before and after'; 'retired form and its successor … 404 before, served
after'; 'three old shapes … lists only'.
- The three ceremony cases in `public-form-two-type-withdrawal.test.ts`
now answer 404 before `--apply` and serve after it, renamed '(ADR-0159
D7)'.
- `public-form-section-i18n.test.ts`: 3 cases (overlay 404; container
slots 404).
- The audience-gated stored old-shape item on `/meta/view` and
`/meta/form` answers 404 to stranger and holder alike (was 403/200).
- The taken-link `view` write answers `422 INVALID_METADATA` (was
`FORM_ADDRESS_TAKEN`; named in the changeset).
- The four stored-copy withdrawal pins: the open arm reads 'the copy
opens nothing' (was 'doors serve the shipped form'); the four (i)(b)
form cells the same.
- Dogfood: the `isDefault`-on-default-form assertion is replaced by its
refusal case (ADR-0159 D1 refuses `isDefault` on form items).
- Ownership migration: 'under single, a withdrawal travels with the
promoted row' now reports `withdrawalsCarried` 1 (was 0; the form carry
also closes the served `form`, fail-closed); the control case's open
list drops the package-less entry (the double serves `form` items only);
the pair case runs `isolated`.
- New describe '[ADR-0159 D7] a stored row is read under the name its
package's form is served under on protocol 19' in
`public-form-two-type-withdrawal.test.ts`: two controls and three cells
(closed on both doors before and after `--apply`, the ceremony moves the
withdrawal into the pair; a row whose package cannot be told apart reads
closed at each; the row's list keeps its name). Ablation: with the new
reading reverted the three cells answer 200 instead of 404 and the two
controls stay green; restored to `blob == HEAD`.
- Withdrawal pins over old-shape bases re-pointed to `form` items, each
with its named ablation measured red; new twins 'narrowing only, the 19
twin' and 'pin 2b, the 19 twin'. Renames (old → new):
- 'pin 1 — … closed (ablate: the `view` half of the layer)' → 'pin 1 — …
closed three ways over (ablate together: the closed reading of a served
old-shape row, the `form` half and the `view` half of the layer; any two
of them alone leave it closed, and pin 3 carries the `view` half
alone)'. Measured: red only with all three ablated.
- 'pin 2 — the mirror: withdrawn by a `form` override, open as an
old-shape item in the base (ablate: the `form` half)' → 'pin 2 — the
mirror on 19: a `form` override switched off over a base whose old-shape
item serves no form stays closed (the `form` half is carried red by pin
5 for `form`, "narrowing only, the 19 twin" and "pin 2b, the 19 twin")'.
- 'rule 9 — an organization-scoped `form` save is refused as the same
`view` save is, the withdrawal held in the other type, and nothing is
written' → 'rule 9 — an organization-scoped `form` save is refused under
every posture …: nothing is written, and both doors stay closed'.
- New: 'the switched-off form in a record-form slot, the stored twin
over a base whose `form` item in the slot declares no link …', red under
its named ablation (judge "public" by `sharing.enabled === true`).
Renames change titles and ablation labels only; no assertion was
weakened or dropped.
## Verification
Gates below ran on head `8b171d71`; the M1 fix (head `83a0f872`) re-ran
the metadata-protocol (23,940 tests), rest (9,243), spec (29,057) suites
and the dogfood battery (53), all green, plus the typecheck, alias,
NUL-byte and changeset gates. Unless noted (logs kept by the card
thread). Body refreshed 2026-12-02T02:45Z.
- `node scripts/pm/dispatch-gates.mjs --ran`: 176 derived, 176 run, 0
NOT-MEASURED, 0 UNRUN (a derived zero: every line recorded its exit
code). 172 ran on `22acdd4e` (the same tree but one rest test file); the
4 that first refused for want of a build (`check-plugin-teardown-shape
--self-test`, `check:skill-examples`, `check:dual-build-cjs-loads`,
`check:published-readme-exports`) passed on `8b171d71` after `pnpm
build`.
- `@objectstack/metadata-protocol` full suite: 381 files passed, 9
skipped; 23,940 tests passed.
- `@objectstack/rest` full local project: 448 files, 9,238 tests passed,
exit 0.
- Dogfood battery, real booted stacks: 7 files, 53 tests passed
(`public-form-withdrawal-walled`, `guest-grants-channel`,
`guest-owner-stamp`, `public-form-read-back-masking`,
`public-form-submit-answer`, `form-type-switch-boot-refusal`,
`view-container-default-form`); every rewritten withdrawal test keeps
its 404s and runs.
- Ablations: every new or re-pointed withdrawal pin was measured red
under its named mutation and restored to `blob == HEAD`; the SQLite
transaction pins time out without the join; the ownership carry pins go
red with the carry pointed at the `view` read.
- CI on `11c52522` (`83a0f872` with `main` merged in; a pure merge, the
spec regeneration chain and the skills token ratchet re-ran with no
change): 66 success, 9 skipped, 1 failure (PR-body guards, below); the
opt-in dogfood battery (three shards) is green on this head and on
`83a0f872`.
Known red:
- **PR-body guards** (duplicate check): #38908 and #38888 still carry
`Fixes #37112`. Every commit of both is in this PR. They close as
superseded when this PR lands; until then this guard stays red by
design.
## Follow-ups
- #39003: UI leftovers unreachable at 19 (Studio form family, dead
helpers, a dead i18n key) and the semantic migration's stale rule id
(after #38875).
- #39004: `GET /api/v1/meta/form?object=X` ignores `object`
(pre-existing, made visible by 19).
## Human Minimum
- [ ] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [ ] 2. Every name I added uses the casing for its kind.
- [ ] 3. No formatter ran; `pnpm lint` passes.
- [ ] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [ ] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [ ] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [ ] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [ ] 8. Title, body and comments are in English.
- [ ] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzj7Sj3euvc1cYXrhNA
<!-- signed: repo:objectstack@os-support-ai · os-support-ai ·
session_01WGufzj7Sj3euvc1cYXrhNA -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 363c967 commit f42afe7
287 files changed
Lines changed: 11434 additions & 6761 deletions
File tree
- .changeset
- content/docs
- concepts
- deployment
- getting-started
- references/ui
- ui
- docs/audits/2026-07-unknown-key-strictness-ledger.counts
- packages
- cli
- src
- commands
- migrate
- utils
- test
- lint/src
- rule-explanations
- metadata-core/src
- metadata-protocol/src
- metadata/src
- objectql/src
- plugins/plugin-auth/src
- qa/dogfood/test
- rest/src
- runtime/src
- spec
- api-surface
- authorable-surface
- docs/references
- api
- system
- export-origins
- liveness
- state-counts
- scripts
- liveness
- src
- api
- conversions/entries/19
- migrations/entries/retired-keys
- system
- ui
- verify/src
- scripts
- codemod
- skills/objectstack-i18n
- evals
- ui
- apps/console/src
- __tests__
- components
- packages
- app-shell/src
- providers
- utils
- views
- metadata-admin
- previews
- studio-design
- core/src/utils
- __tests__
- types/src
- __tests__
- zod
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
0 commit comments