Skip to content

Commit 1d959b0

Browse files
feat(cli): os migrate stored-forms — the read-only census and upgrade precheck of stored forms (#38613)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Jianguo** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb167ZCpMdeb4qXoLc6eb4Tz)_ _Rework round M6 and ruling 7265816895 step 3 requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8UTneJdpiRssyj6z8JRdywN)_ Part of #37111 — PR 1 of 2 (the read-only half). PR 2 (`--apply`: the move, the fold and the removal, inside the upgrade command, with the security pins on both doors) closes the card. Supersedes #38464 (its branch `claude/project-thread-zmwgyw` at `4c8f7dbb` is this branch's start; the dev who held it ran out of tokens, and this card thread took the work over under takeover Claim 7255642518). Clause-②: yes Metadata-protocol: none Skills-docs: none — stored-row ceremony, nothing an author writes changes ## 维护者速读 - 用户能看到什么变化:管理员升级到下一个大版本之前,可以先跑一次只读检查,逐条看到数据库里还按旧写法存着的表单升级时会被保留、迁移、合并、删除还是原样不动,以及升级能不能放行;服务启动时遇到读不懂的旧表单,日志会指向这条检查。 - 为什么做:这是「表单成为独立元数据类型」专题(ADR-0159)第五张卡的前半,升级命令要先能说清每一行旧表单的去向,后半才动数据。 - 出错会怎样:这一半只读不写,判错只会让报告写错某一行的去向或误报拦住升级,不会改动任何数据;去掉这条命令也不影响现有功能。 - 要你做什么:无(合并前由席位安排契约审核,再按 Tier H 交你批;你已拍板的「两个地址生效的行拦住升级」在本 PR 的检查里兑现)。 ## What changes **The delta at this head** (`24ab30abef`; the round on delta review PASS 7271195568 is the ADR `24ab30abef`; the round on delta review PASS 7270096541 is `91ab3f3565`, the ADR `de6086d289` and `944aa67cb8`; the round on delta review PASS 7269115759 is `7e825b6de1`, the ADR `53ddab680e` and `dd1ab297bc`; the patch round on delta review FAIL 7268307582 is `4d69b3fccb`, `2484041cc0` with the ADR `76581c1e88`, `622c806f7d`; before it, code round `e6c48803c3`, then the hold's second reading `a909cc2b4e` and `34aaf95bd4`, the split removal `5d073e6171`, the per-row hold over every address `379a62b7b4` and its action wording `7294c1d592`, and the ADR `79126e6573`, `dcb87dc337`, `d58359ae3c`, `e956a57d36`, `2871ae2d07`) answers Contract review FAIL 7265481017 and L1 7265512812 (at `04ffc859`), and carries step 3 of the maintainer's ruling on #38661: - **M6 (D7-d).** Where the read's own order at the address of a package a row is bound to is headed by a row the plan reads at another address, every row bound to that address now folds behind that row where it is planned, and the address gets no plan of its own (`servedAheadFromElsewhere`, the one place the case is decided). A withdrawal carried from such a row is newly closing unless that package's own per-package layer reads it today, which is measured on the real read for both shapes the pins seed. Pins: three planner tests and four engine tests over the real read, each engine test asserting what the read serves today before the plan; all seven were red at `04ffc859`'s planner and are green now. - **Ruling A on #38661** (「A 拦住升级·同类全覆盖」, ruling record [7265816895](#38661 (comment))), step 3: a slot of a pair that more than one plan of a name claims holds the upgrade at every claimant's address (`holdContestedPairSlots`, the one place the case is decided), cause `app_author` (no administrator's exit that leaves every address's answer as it is was measured). The precheck names each claimant's row once, with every address it is read at, and `canSwitch` is false. That covers a row the read serves at two addresses of one App and two rows whose plans land in one pair. No new cause value, plan kind, "not counted" kind or protocol key. The four tests that pinned two moves (planner: "a row two packages serve…", "a row the read serves at its own package as well…"; engine: "served at two modules…", "served at its own package as well…") and the planner test of the sibling case are re-pinned; an ablation of the hold's predicate brings the moves back and turns exactly those five red. - **The hold reads served addresses per row too** (`a909cc2b4e`, `34aaf95bd4`, on the seat's order under the same ruling, "moved at neither"): where one address of the App leaves a row in place (an internal form ahead of a linked row) and another would move it into the App's pair, both plans hold and the precheck names the row once; a base whose pair the ensure door refuses is read as the App's by its App. The contested hold's action names the App (D7-c), and its sentences say only what is planned. Three planner pins and one engine pin, each red before its commit; an ablation of each new reading turns exactly its pins red. - **A removal asks every address that serves the row** (`5d073e6171`, on the seat's order under the same ruling, "changed at neither"): where one address would remove a row (an internal record form) and another address that serves it gives it anything else (an internal form left in place ahead of a linked row), the row is removed at neither, every plan of it holds (`app_author`) and the precheck names it once with every address (`holdSplitRemovals`, run after the contested-slot hold). One planner pin and one engine pin (two holds, `counts.remove` 0), each red at `34aaf95bd4`'s source; disabling the new check turns exactly those two red. - **The hold is decided per stored row over every address that serves it, whatever App** (`379a62b7b4`, on the seat's order under the same ruling): `holdRowsServedApart` replaces the second-address reading of the contested slot and the split-removal check. Where one address would move or remove a row and another keeps it (left in place, already at its destination, or holding; a base whose App cannot be read among them), or one would move it and another remove it, every plan of the row holds and the precheck names it once. Addresses of two Apps count as two packages of one App do. Moves at every address (each into its own pair) and removals at every address are unchanged; the slot rule keeps only a slot claimed more than once. Three planner pins (moved at one App's base and left in place at another's; the same where the other base's App cannot be read; moved at one and held at the other) and a control (moved at both, into two pairs), and one engine pin over the real read; each red at `e956a57d36`'s source. Restricting the hold to addresses of one readable App turns exactly the three cross-App planner pins and the engine pin red; not counting a holding address as keeping the row turns exactly the third planner pin red. - **The round on delta review PASS 7271195568** (ADR prose only, `24ab30abef`, same `os-dev` seat, effort xhigh): **S15**, the row-wide rule holds the row a further address serves, not the row S13's case holds, so one clause states it in Status, "Decided by", the D7-d bullet, the switch bullet (now three exceptions) and the "precheck refuses" pin, each marked the seat's step and an exception to "The upgrade is not blocked"; **N33**, "stay as stored at every address under that name". No code, no pins. N32 (the engine half of the S14 pins) is carried to PR 2. - **The round on delta review PASS 7270096541** (`91ab3f3565`, ADR `de6086d289`, `944aa67cb8`): - **S14 (the seat's step under ruling record 7249158572).** The rows an address keeps as stored under the ruling (the internal form left in place, and every form row behind it there) are kept so at every address: no plan folds one into the row it serves, removes one with that row, moves one, or writes a folded row's withdrawal into one. A plan that would do any of it holds (`app_author`, the refusal cites 7249158572 and names the kept row, the address that keeps it and what the plan would do; the action names no exit), and lists the kept row in `heldApart` (now also on hold plans), not in `behind`; the precheck names that plan's served row once. One rule over the row (`holdChangesToKeptRows`, one predicate `keptRowsChanged`; the kept rows are read by `keptRowsOf` before any hold is given). Planner pins: the reviewer's shape (a package-less internal row ahead of a package-less linked container, kept at one base, behind a row bound to a further base) and the kept rows behind the rows of two further bases; both red at `dd1ab297bc`'s planner, and the predicate made empty turns exactly them red. The address that keeps the rows stays left in place. - **N31.** The waiting refusal no longer says what clearing another hold alone would do (not measured), and a refusal names an address that only keeps a row behind its internal form as keeping it, not as serving it. Assertions on the S13 and N27 pins, red at `dd1ab297bc`. - **`944aa67cb8`, from the ADR seat's reading:** the kept-row hold's action says which addresses the cause spans, instead of "This row is served at" an address that only keeps the other row (assertion on the reviewer's-shape pin, red at `de6086d289`); the report's hold line lists the kept rows apart. - **The page and the changeset** state that neither kept row is folded, moved or removed at any package. - **ADR-0159 D7** (`de6086d289`, same `os-dev` seat, effort xhigh): one sentence under the S13 seat-step mark in "Against D7-d" states the keeping row-wide; "Against D7-c" drops the unmeasured clearing claim. TL;DR 10 stays at six. - **The round on delta review PASS 7269115759** (`7e825b6de1`, ADR `53ddab680e`, `dd1ab297bc`): - **S13 (A, the seat's step under ruling records 7249158572 and 7265816895).** Where an address leaves an internal form in place ahead of a linked row (「两行都不动」), that address keeps the linked row behind it as it keeps the row it serves. Where another address serves that linked row and would move it, every address holds, cause `app_author`, the refusal cites ruling 7249158572 and the action names no exit. Planner pin (a package-less internal row served at the module ahead of the row bound to the App, which the App's own address serves linked) and engine pin over the real read (both addresses answer as before, the census writes nothing), each red at `622c806f7d`'s planner; counting the row kept behind as served elsewhere turns exactly them red. - **A row waits only on a hold taken for itself** (`dd1ab297bc`): where that module's plan also holds for the row it serves (a third address serves that row apart), the row kept behind still holds on its own at the App's address, with its own precheck entry and no exit, instead of waiting on a hold that is another row's. Planner pin, red at `53ddab680e`'s planner; reading any hold of the plan as the row's own turns exactly it red. D7 stands as `53ddab680e` states it. - **N27.** A plan waits on another hold only where clearing that hold lets every address treat the row alike; with a third address that would still differ, the waiting text does not say the row then moves, and the action names no exit. Planner pin (a third address whose pair door refuses). - **N28.** The measured two-address exit is named only where no address outside the slot serves the row. Planner pin (a package-less row at two modules and a standalone base). - **N29.** The report's line for `heldApart` says it stands only while that hold does. PR 2's plan notes that its "writes nothing" pin seeds the third-address shape. - **N30.** The M7 engine pin's first half asserts the effective form list its title names. - **ADR-0159 D7** (`53ddab680e`, same `os-dev` seat, effort xhigh): Status, "Decided by", D7 and D7-d mark S13 as the seat's step and as an exception to "The upgrade is not blocked"; the switch bullet and "Against D7-c" carry N27 and N28. TL;DR 10 stays at six. - **The patch round on delta review 7268307582** (`4d69b3fccb`, `2484041cc0`; ADR `76581c1e88`, `622c806f7d`): - **M7.** The slot of a pair is read from the pair's own row too: a row the pair holds of the name as its own item (no `overrides`), read at the pair's own address (`package_form` into the pair, kept or moved), claims the slot beside a row another address plans into that pair, and both hold. Planner pin (old-shape `view` row and stored `form` row) and control; engine pin over the real read, asserting first that the module serves the bound row and the pair's per-package layer reads its own row. Both red at `2871ae2d07`'s planner; removing the pair's own reading turns exactly them red, and disabling the slot predicate turns them red with the other slot pins. - **S10.** A plan held only because another plan of its row holds waits on that hold: it takes that hold's cause and action, and its refusal names the address and repeats that hold's refusal. A package this environment writes is named as such; a pair's own address counts as its App. Pins: the administrator and the unreadable-App door holds (the waiting plan takes each cause), and a row removed at a writable package and left in place at an App's base (the action says where it is served). Red at `2871ae2d07`; ablating the waiting turns exactly its pin red. - **S11.** The slot's action, and a row served apart with no measured exit, promise none: no action on this release clears it, and every address answers as it does today. Only one row read at two addresses of one App, with no other row at its slot, keeps the measured exit, worded "until the App ships the form from one of these packages only" (N24). Pins on the two-row slot and on a two-address row whose slot the pair's own row claims too. - **S12.** A held row is folded into no other row: where it stands behind a row another address keeps or moves, that plan lists it in `heldApart` (not `behind`) and reads the fold without it; the report prints it apart. Planner pin (its withdrawal not carried); red at `2871ae2d07`, and ablating the pass turns exactly it red. - **Named once.** A row one of whose plans already holds at the pair door is not named a second time by the slot. - **N21–N25.** ADR switch bullet's exception clause; the page and changeset bound the two-package hold to both moving, name the pair's own claimant and the fold; the hold jsdoc, the command docblock and the report's hold line (no "cannot move"); a kept claimant "already stands in" its pair; a clearing-table row for these holds ("No one, on this release"). N26 (an engine half for the third M6 pin) is carried to PR 2's engine block, as the record allows. - **ADR-0159 D7** states each of these (the pair's own claimant, the waiting hold as the seat's step, the no-exit actions and the one measured exit, the held row folded into none); TL;DR 10 stays at six. - **The action names each App** (`7294c1d592`): where the addresses that serve a held row are of more than one App, or one is a base whose App cannot be read, the action says the row is served at packages of more than one App and names each App that can be read, instead of reading as if one App could clear it. Two planner assertions and one engine assertion, red at `379a62b7b4`'s source; the planner pin for a base whose App cannot be read now builds that base with two Apps and no namespace. - **ADR-0159 D7 at `2871ae2d07`** (same `os-dev` seat, effort xhigh): D7 states the hold per stored row over every address that serves it, whatever App, a base whose App cannot be read among them; the slot more than one plan claims stays its own case; D7-c and "Against D7-c" state the action for more than one App. Still marked as the owning seat's step; TL;DR 10 stays at six. - **ADR-0159** (step 2 of the ruling, by an `os-dev` at `CONTRACT_REVIEW_TIER`, effort xhigh, its own order): D7 records the ruling and its reach against D7-b, D7-c, D7-d and D7-e, the `pair_form` pin says what holds instead of a move, "Decided by" gains the item, Status dates the revision of 2026-11-30, and three more D7 sentences that the ruling made false are corrected (the switch bullet, the precheck-refuses pin, the per-row deletion sentence). At `e956a57d36` D7 states the third held case (a row one address would remove and another that serves it would not) where it states the removal, under "What is held", against D7-b, D7-c and D7-d, in the switch bullet and in both pins. The hold's cause class and the split-removal hold are entered as the owning seat's steps; TL;DR 10 stays at six points. - **Step 8's premise, verified before the edit:** once one package of the App ships the form, the row is read at that address alone and moves there (the planner control and the engine test "bound to the App: the read serves it at the module…", one `move` each). The hold's action sentence says that for a row read at two addresses, and nothing it did not measure. - **N19.** The operations page bounds the move of a row served at another package's address to one address, and says a row read at two packages of one App, or a slot two moves would land in, holds the upgrade. The clearing-table row is step 6, PR 2's. - **The M2 planner fixture** gives each of its two bases (two Apps) a pair of its own: its subject is the per-row deletion, and with one shared pair the new hold applied. - **The changeset** names the contested slot among the holds. - **Main** merged at `f5da514b` (clean). **The rounds before it**, in brief: at `04ffc859` (records 7258026145 and 7258039491) M5 (a container's member is read at the package the container is bound to), S9 and N18; at `793f6688` M4 (ruling record [7254350842](#37111 (comment)): a row the read serves at another address is classed by the base it stands over there), S8 and N17; at `4c8f7dbb` (PR #38464) M3, S6, S7, N15 and the ADR fixes the earlier records asked for. Each is in the records on the card. **The PR as a whole:** - **`packages/metadata-protocol/src/protocol-stored-form-migration.ts` (new).** The read-only half of the ADR-0159 D7 ceremony. `planStoredForms(input)` is a pure planner: for each form name at each package address that can serve it (each read-only package shipping it in either type, each writable package shipping it or holding its own row, else the environment), it takes the stored rows in the served-row order and answers one outcome: `keep` (already a stored `form` row at the destination), `move` (to the pair's declared override at a read-only base, a pair's own `view` override keeping its pair and `basedOn` without asking the ensure door, the pair's own `form` item for a row bound to a package that ships no form of the name (`pair_form`, ruling 7250977204), the package's own `form` row at a writable package, a package-less `form` row in the environment), `remove` (an internal record form, all three parts of D7, decided per row: a package-less row read at several addresses is removed only where it is internal at every one), `hold` (the pair cannot be ensured, D7-c, classed `administrator` / `app_author` / `kernel`, the ensure door's refusal repeated with the action for its cause; the earlier per-package pair's action says no command on this release clears it, ruling 7250982640; and a slot of a pair more than one plan claims, `app_author`, ruling record 7265816895 on #38661) or `left_in_place` (`served_no_form`, D7-d, a lone list over a base that ships the form included; `internal_ahead_of_linked_row`, ruled below). The form rows behind the served one fold into it, a list row behind is left as stored (`untouched`), and each plan names the rows another address reads too, with that address's outcome (`alsoReadAt`); a carried withdrawal no layer reads today is flagged `newlyClosed`, with the kept body's own slug. The name has the environment's address only while no stored row of it is bound to a package. Old-shape drafts are listed, and a move names the drafts it leaves behind (`draftsLeftBehind`, ruling 7250982640). Every unreadable stored body holds the upgrade (D7-c, rule 7). `listStoredForms(host)` reads the stored rows, the registry (shipped forms through the projection, `type: 'form'` action targets, `fieldGroups`) and the ensure door's judgement, and hands them to the planner; `listStoredFormsOf(protocol)` is that census over a protocol instance. The precheck is part of the census (`precheck.canSwitch`, `precheck.holds`, `precheck.counts`), so #37112 reads the same words. - **The ruled case lives in one constant**, `INTERNAL_AHEAD_OF_LINKED_ROW`: an internal record form served ahead of a same-named row that declares a link (switch on or off) moves nothing and deletes nothing, and both rows are reported left in place. Maintainer ruling 「两行都不动,写进报告」, ruling record [7249158572](#37111 (comment)), for the package-less row behind; any other linked row behind is ADR-0159's own reading, marked as such. ADR-0159 D7-d and the precheck's "Not counted" sentence carry it. - **ADR-0159.** Records the four ruling records on #37111 (7249158572, 7250977204, 7250982640 with its two answers, 7254350842) under "Decided by" and in D7 where each applies (the `pair_form` destination, drafts, the earlier per-package pair's text), syncs Status, TL;DR 10 (six points past the rulings' words), the question 4 paragraphs and Consequences with the new uncounted kind, states the per-row deletion, and adds two pins to the ones card ⑤ owes (the internal form ahead of a linked row; the row bound to a package that ships no form of its name, byte-equal before and after). - **`protocol-form-reads.ts`.** `orderedFormRowsAt(places, name, packageId | null, installed, admits?)` is the served-row order over both types, every row in order; `servedFormHolding` is now its first row, so the `form` read and the census read one order (the read serves what it served: 227/227 `public-form*` tests). `StoredFormPlace` and `storedFormPlaces` are exported for the census. The start-up message for an unreadable body now names `os migrate stored-forms` (item 3). - **`os migrate stored-forms` (new, `packages/cli`).** Read-only, no `--apply`: boots as `os serve` composes (`deferSchemaDdl` + `readOnlyProbe`), prints one line per form and address, the unreadable bodies, the old-shape drafts (which cannot be published after the upgrade) and the shared slugs, then the counts and the switch verdict; `--json` emits the census. Exit 0 whenever the census ran. - **Docs:** a new operations page `content/docs/deployment/stored-forms-upgrade.mdx` (in `meta.json`, and in `scripts/docs-audit/handwritten-docs.json` as `check:docs-audit-scope` asks), the `cli.mdx` command row and occupancy row, and a platform-checklist item `cli.stored-forms-census-and-precheck`. **Read first** (by risk): 1. `packages/metadata-protocol/src/protocol-stored-form-migration.ts`: `servedAheadFromElsewhere` and the fold step in `planStoredForms` after the rows of each address are read, then `holdContestedPairSlots` (a slot claimed more than once) and `holdRowsServedApart` (a row served at several addresses that would not all do the same) and where they run (before `alsoReadAt` is filled), then `foldOf`'s `folded` reading. 2. The two test files' new blocks: the planner's "a member of a stored container behind a row the read serves at another address" and the engine's four tests of the same rule, each asserting the read today first. 3. `docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md`: Status, "Decided by", D7's destination bullet and its five sub-bullets, and the `pair_form` pin. **Two-minute check:** `pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol-stored-form-migration.test.ts` prints `Tests 82 passed (82)`. ## Tests - `packages/metadata-protocol/src/protocol-stored-form-migration.test.ts` (82; 80 at `dd1ab297bc`, 79 at `7e825b6de1`, 76 at `622c806f7d`, 71 at `2871ae2d07`, 67 at `e956a57d36`, 66 at `34aaf95bd4`, 63 at `e6c48803c3`, 59 at `04ffc859`, 58 at `793f6688`, 45 at `4c8f7dbb`, 37 before that). **This round:** three tests for M6 (the row folds behind the row served ahead of it, in both shapes; its withdrawal newly closing only where its own package's layer does not read it; beside a package-less row), three re-pinned to the hold of ruling record 7265816895 and one control (one serving package moves; two pairs move); then three for a row held at two addresses where one leaves it in place (with a control for a package-less row, and a base whose pair door refuses); then one for a row removed at one address and left in place at another (both hold); then four for a row served at addresses of two Apps (three holds, one control). Before: every outcome and every hold cause on its own seed fixture, the ruled case and its twin (the link switched off), the fold's `newlyClosed` both ways and its slug, the served body kept, the package-less row read at every address, the shared slug; for the first L2 round: M1, M2, S1, S2, S3, the `pair_form` destination (moved, held when the pair cannot be ensured, the pair's override needing no ensure, a package-less row folding behind it, an internal one removed), the drafts left behind, and the earlier pair's action. **At `4c8f7dbb`:** M3 with the override switching the form off, carrying no link, and already a stored `form` row (one plan at the base's address, `pair_form` into the override's pair, the open bound row behind, nothing carried, a refusing ensure door holding nothing); M3 with a withdrawal in the bound row (carried, not newly closed: the base's own layer reads it today); M3 with a `view` and a `form` override in one pair (read together, one `keep`); M3 with the override in an earlier per-package pair (one plan, into that pair, not a second form of the App's pair); M3 with an override in each pair (two plans, each body in its own pair); S6 (the row behind is `servedElsewhere`, `behind` is empty, the other address moves it) and its control (with no other address the row goes with the removal). **This round:** thirteen tests named for ruling 7254350842, stating the rule only: the planner follows D7 as amended, with the hold where the pair cannot be ensured, the internal test at that base, and controls where the row stays at its own address. - `packages/objectql/src/protocol-stored-form-migration.test.ts` (22; 21 at `622c806f7d`, 20 at `2871ae2d07`, 19 at `e956a57d36`, 18 at `34aaf95bd4`, 17 at `e6c48803c3`, 13 at `04ffc859`, 12 at `793f6688`, 5 at `4c8f7dbb`). **This round:** four tests for M6 over the real read, two re-pinned to the hold, one for a row left in place at one module and moved at the other, one for a row removed at one module and left in place at the other, and one for a package-less row moved at one App's base and left in place at another App's module (each asserting what the read serves today, that the census writes nothing, and that both addresses answer as before). Before: the census over the real protocol and engine: a move to the pair with `basedOn` and no write (no row, no pair), an unreadable body holding, a no-namespace App holding as the App author's cause with the door's refusal, an internal record form listed for removal. **At `4c8f7dbb`:** M3 over the real read: the effective `form` list serves the override's body under the base and under the pair and the bound row's nowhere, and the census plans one move with the bound row behind it, writing nothing. **This round:** seven tests named for ruling 7254350842. Each asserts what the real read serves today before it asserts the plan, and that the census writes nothing. - `packages/cli/src/commands/migrate/stored-forms.integration.test.ts` (3, integration tier; its dist-resolved loads are paid at module top): the empty census, the move listed with the store unchanged byte for byte, the unreadable hold. - `packages/cli/src/utils/schema-migrate.one-shot-family.integration.test.ts`: the `bootSchemaStack` family table declares the command, report-only (its one mode leaves the database byte-identical and creates no missing SQLite file). - `packages/rest/src/public-form-two-type-withdrawal.test.ts` pin 6: the start-up line names the command. - `packages/cli/test/json-stdout-purity.e2e.test.ts`: the command joins the roster (its `--json` stdout is one document). - The two report sentences the `4c8f7dbb` round changed are not text-pinned (prose a consumer does not parse). Printed from the real `storedFormPlanText` for the S6 plan: "will be removed: view "crm_lead.form", package 'com.acme.crm' is an internal record form (no public link, no action opens it); not removed with it, because another address serves it: view "crm_lead.form", no package. New and Edit of 'crm_lead' follow its field groups, which it declares; view "crm_lead.form", no package is also read at read-only package 'com.acme.other', where it is served and moves". ## Acceptance notes - **Line count.** 17 files, +4236 / -32 against `origin/main` (merge base `f5da514b`): over the 3,000-line threshold, which the Claim's Tier H note already counts for the card. - **Surface.** Inside the claim's surface (the 17 files; this round touches 6 of them and adds none), with four declared differences: (1) `protocol.ts` is unchanged: a facade method there breached `check:facade-delegation-only`'s line ceiling (11723 over 11705; raising it is maintainer-only), so the census is `listStoredFormsOf(protocol)` beside the facade and the CLI calls it; (2) the engine-level census test sits in `packages/objectql/src/`, where the precedent ceremony's protocol test sits; (3) `scripts/docs-audit/handwritten-docs.json` gains the new page, regenerated by `check-audit-scope.mjs --write`; (4) ADR-0159 D7-d carries the Q1 reading, as the seat asked on the ruling. - **Drafts**, ruled (7250982640, 「A 留下并提醒(推荐)」): old-shape draft `view` rows are listed, neither moved nor deleted, with the warning that they cannot be published after the upgrade; a move names the draft it leaves behind; `form` drafts are not listed. - **The earlier per-package pair**, ruled (7250982640, 「B 只改文字,不开卡」): the class stays `administrator`; the per-row action, D7-c, the page and now the closing line all say no command on this release clears it. - **The package-less row at several addresses.** The census names it at each address with the others' outcomes (`alsoReadAt`); it is removed only where it is internal at every address, so it is either removed at each or moved at each; behind a removed form it is named apart when another address serves it (`servedElsewhere`). PR 2 owes the order of the moves (a copy per pair, the row deleted once every copy reads back). - **Owed by PR 2, not changed here** (each named by the review record 7252114084 or the L1-b record 7252045790): - the byte-equal address pin for the `pair_form` move (ruling 7250977204). It should state that the destination drops the `overrides` declaration, so that if the base ships that name again later the pair's own form no longer replaces the base's; and it should seed N11's case; - N4: `newlyClosed` for a `view` row outranked by a `form` row at the same place, reachable only by an out-of-band pair of rows; - N5: the planner's own sentence when `pairOf` fails, not the door's text; - N11: D7's "is served today at the package it is bound to" is not always so. Where exactly one other package ships a view of the name, the env-wide list drops the row and no door serves it today; - N13 / L1-b item 1: pin `storedFormPairFix`'s earlier-pair 409 and other-owner 422 through the real ensure door, or read the owner structurally with a positive control; and pin the draft read over the real protocol; - N14: `pairFormDestination` holds when the base records no version, for a `basedOn` the `pair_form` item never declares. - **One more for PR 2, from the `4c8f7dbb` round's reading** (not in either record): the M3 arrangement through both doors, before `--apply` and after it; the ADR's `pair_form` pin now names it. - **Owed by PR 2, added this round:** - N16 (record 7253682863), with N4: at a base that ships the form, a second pair's override that withdraws the form folds behind the first with `newlyClosed: true`, though that pair's own per-package layer reads it today; - the record's ③ note: `pairFormDestination` reads a pair's destination from the address kind, so a pair held as booted code would be sent to the ensure door; - the L1 nit (7253529114): the page's `moves` row says "Older rows of the same form fold into it", and the row that folds is the one the order serves second; - the both-doors before/after pin for a row the read serves at another address, with the ablation the ADR's pin names; - steps 5 to 7 of ruling record 7265816895: a held row writes nothing (with such a row stored, `--apply` writes nothing, every stored row is byte-equal, both doors answer the same at both addresses before the refused run and after it); the operations page's clearing-table row for the contested slot; the dev's note that the engine tests' store does not enforce one row per slot, so the pin of one slot, one row needs a store that does; - N32: the engine half of the two S14 planner pins, over the real read; - N33: with a container one of whose members is kept as stored under ruling 7249158572 and a sibling member of the same container moved, the kept member reads back byte-equal after `--apply`; - N29: the "writes nothing" pin of a held row seeds the third-address shape too (a row kept behind an internal form left in place at one address, served and moved at another, and the internal row served apart at a third); - where the package that ships the name ships only a list there, the read labels the stored form under that package while the census names it at the package it is bound to (same pair, same body). - **Security.** A security item is with the owner seat (GHSA-4m68-3464-prgc). Not in this PR. - **For the seat:** N16 stays carried to PR 2 with N4. N20 is answered by the Status sentence of 2026-11-30. - **Kernel grep** as read at `793f6688`, not re-run this round: `git grep -lE "formViews|viewKind: 'form'|viewKind === 'form'" -- packages/platform-objects packages/plugins packages/services packages/triggers packages/drivers packages/connectors packages/apps` finds `packages/platform-objects/CHANGELOG.md` and `packages/plugins/plugin-auth/CHANGELOG.md`, no source: the kernel hold is empty. ## Verification Head `24ab30abef`: the merge of `main` (`9b318da210`), the fix (`8a38a0ba16`), the changeset sentence (`e6c48803c3`), the ADR (`79126e6573`, `dcb87dc337`, `d58359ae3c`, `e956a57d36`), the hold's second reading (`a909cc2b4e`, `34aaf95bd4`), the split removal (`5d073e6171`) the per-row hold over every address (`379a62b7b4`, `7294c1d592`), the ADR's fourth round (`2871ae2d07`), the patch round on review 7268307582 (`4d69b3fccb`, `76581c1e88`, `2484041cc0`, `622c806f7d`), the round on review 7269115759 (`7e825b6de1`, `53ddab680e`, `dd1ab297bc`), the round on review 7270096541 (`91ab3f3565`, `de6086d289`, `944aa67cb8`), and the ADR round on review 7271195568 (`24ab30abef`). - **CI:** `e6c48803c3` 44 success, 17 skipped, 0 failed. At `dd1ab297bc` and at `944aa67cb8`: 61 check runs each, success or skipped, 0 failed. At this head: running when this body was written; the seat reads the check-runs. - **Build:** `pnpm --filter '@objectstack/metadata-protocol^...' build` after the merge, exit 0; `@objectstack/metadata-protocol` rebuilt on the final source before the engine runs. - **Type-check:** `pnpm --filter @objectstack/metadata-protocol typecheck`, inside the locked run below. - **`24ab30abef`** changes only the ADR (its gates exit 0); the code is `944aa67cb8`'s. **At `944aa67cb8`, under the verify lock:** metadata-protocol test + typecheck and objectql test on the rebuilt package, VERDICT command-exit 0: 374 files passed and 9 skipped, 23744 passed and 45 skipped; objectql 641/641 files, 14566/14566 tests; the planner file 82/82, the engine file 22/22 (the same at `91ab3f3565`). eslint on the three changed code files exit 0; the CLI's `tsc` is not measurable on this box (the workspace packages it imports are not built here; no error is in `stored-forms.ts`), CI's Type Check owns it. **Red before (this round):** at `dd1ab297bc`'s planner 4 of 82 failed (the two S14 pins, the N31 assertions on the S13 and N27 pins); at `de6086d289`'s planner 1 of 82 (the action assertion). **Ablation:** `keptRowsChanged` made to return nothing turns exactly the two S14 pins red. `de6086d289` changes only the ADR (its gates exit 0). - **At `dd1ab297bc`, under the verify lock:** metadata-protocol test + typecheck and objectql test on the rebuilt package, VERDICT command-exit 0: metadata-protocol 374 files passed and 9 skipped, 23742 passed and 45 skipped; objectql 641/641 files, 14566/14566 tests; the planner file 80/80, the engine file 22/22. eslint and the metadata-protocol typecheck on the two changed code files exit 0. **Red before (this round):** at `622c806f7d`'s planner 4 of 80 failed (S13, N27, N28, and the per-row waiting pin) and the S13 engine pin failed; at `53ddab680e`'s planner 1 of 80 (the per-row waiting pin). **Ablations:** counting the row kept behind as served elsewhere turns exactly the S13 pins red; reading any hold of a plan as the row's own turns exactly the per-row waiting pin red; the N27 and N28 conditions each turn exactly their own pin red. `53ddab680e` changes only the ADR. - **At `2484041cc0`, under the verify lock:** metadata-protocol build + test + typecheck and objectql test, VERDICT command-exit 0: metadata-protocol 374 files passed and 9 skipped, 23738 passed and 45 skipped; objectql 641/641 files, 14565/14565 tests; the planner file 76/76, the engine file 21/21. `622c806f7d` changes only the ADR (its gates exit 0). **At `4d69b3fccb`, under the verify lock:** 23736 passed and 45 skipped; objectql 14565/14565. eslint on the four changed code files exit 0; the docs and repo gates above exit 0. **Red before (this round):** at `2871ae2d07`'s planner, the M7, S10 (waiting, writable package), S11 (slot exit) and S12 pins failed (5 of 74), the M7 engine pin failed (1 of 21); at `4d69b3fccb`'s planner the three pins of `2484041cc0` failed (3 of 76). **Ablations:** each new condition disabled alone turns exactly its own pins red (the pair's own claim: its planner and engine pins; the waiting hold; the held-apart pass; the slot's exit bound; the named-once check; the waiting refusal), and the slot predicate turns the slot pins red with M7's. **At `7294c1d592`, under the verify lock:** metadata-protocol build + test + typecheck and objectql test, VERDICT command-exit 0: 23733 passed and 45 skipped; objectql 641/641 files, 14564/14564 tests; the planner file 71/71, the engine file 20/20. `2871ae2d07` changes only the ADR (its gates exit 0). **At `379a62b7b4`'s tree, under the verify lock:** metadata-protocol build + test + typecheck and objectql test, VERDICT command-exit 0: metadata-protocol 374 files passed and 9 skipped, 23733 passed and 45 skipped; objectql 641/641 files, 14564/14564 tests; the planner file 71/71, the engine file 20/20. eslint on the three changed code files exit 0; `check:nul-bytes`, `check:doc-authoring`, `check:doc-anchors`, `check:docs-single-h1`, `check:doc-frontmatter`, `check:closed-ceremony-text`, `check:role-word`, `check:corpus-claim-drift`, `check:issue-citations`, `check:scripts-symbol-anchors`, `check:adr-symbol-anchors`, `check-affected-docs.mjs`, `check-drift-comment.mjs` exit 0. **At `5d073e6171`, under the verify lock:** metadata-protocol test + typecheck, VERDICT command-exit 0 (374 files passed and 9 skipped; 23729 passed, 45 skipped); objectql test, VERDICT command-exit 0 (641/641 files, 14563/14563 tests); the planner file 67/67, the engine file 19/19 on the rebuilt package. `e956a57d36` changes only the ADR. **At `a909cc2b4e`, under the verify lock:** metadata-protocol test + typecheck, VERDICT command-exit 0 (23727 passed, 45 skipped); objectql test, VERDICT command-exit 0 (641/641 files, 14562/14562 tests). **At `34aaf95bd4`:** the planner file 66/66, the engine file 18/18 on the rebuilt package, metadata-protocol typecheck exit 0. **At `e6c48803c3`, under the verify lock:** `pnpm --filter @objectstack/metadata-protocol test && pnpm --filter @objectstack/metadata-protocol typecheck && pnpm --filter @objectstack/objectql test`, VERDICT command-exit 0: metadata-protocol 374 files passed and 9 skipped, 23725 tests passed and 45 skipped; objectql 641/641 files, 14561/14561 tests. The planner file 63/63, the engine file 17/17. - **Red before (M6):** at `04ffc859`'s planner, the three new planner tests failed (3 failed / 59 passed) and the four new engine tests failed (4 failed / 13 passed), each engine test at its plan assertion with the assertions on what the read serves today passing. - **Ablation (the hold):** the hold's predicate disabled in the built package (`claimants.length < 2` made never true): planner 3 failed / 60 passed, engine 2 failed / 15 passed, exactly the five re-pinned tests, each showing a `move` again where the pin asks a hold; restored from the saved source, rebuilt, and green. With the hold disabled the planner answers as `04ffc859`'s did for those rows, so this is also their red-first reading. - **Red before and ablation (the second reading):** at `dcb87dc337`'s source the new planner pin and engine pin failed (1 of 65, 1 of 18); with the served-address reading disabled, the same two failed; at `a909cc2b4e`'s source the pair-door pin failed (1 of 66), and with the App reading disabled it failed again; at `34aaf95bd4`'s source the split-removal pins failed (1 of 67, 1 of 19), and with the new check disabled the same two failed; at `e956a57d36`'s source the cross-App pins failed (3 of 71, 1 of 20), and the two ablations named above turned exactly their pins red; each restored, rebuilt and green. - **Not run locally this round, CI owns:** `rest` `public-form*` (no file of the `form` read changed this round), the CLI integration tier, the dogfood battery (no `!` in the title, no narrowing arm). <details><summary>Derived gates: 119 derived; 15 run locally on the 4 files this round changed, the rest to CI</summary> `node scripts/pm/dispatch-gates.mjs --commands` at `9b318da210` derives 119 commands from the branch's 17 paths against merge base `f5da514b`. Narrowed locally to the families that read this round's four files (the docs page, the planner and the two test files), at the final tree, each exit captured before any pipe, all exit 0: `check:nul-bytes`, `check:doc-authoring`, `check:doc-anchors`, `check:docs-single-h1`, `check:doc-frontmatter`, `docs-audit/check-affected-docs.mjs`, `docs-audit/check-drift-comment.mjs`, `check:issue-citations` (and the script directly), `check:adr-symbol-anchors`, `check:scripts-symbol-anchors`, `check:closed-ceremony-text`, `check:role-word`, `check-closing-keyword-parity.mjs`, `check:corpus-claim-drift`. The other 104 are `Lint & Repo Gates` on this head. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxba7sJxPLc8kzW8QTyd <!-- signed: repo:objectstack#2 · os-warren · session_01JQwxba7sJxPLc8kzW8QTyd --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 830ff8b commit 1d959b0

17 files changed

Lines changed: 4236 additions & 32 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/cli': patch
4+
---
5+
6+
feat(cli): `os migrate stored-forms`, the read-only census and precheck of the stored-form ceremony (ADR-0159 D7)
7+
8+
Clause-②: yes
9+
Metadata-protocol: none
10+
11+
The next protocol major stops reading the three old shapes of a form (a view container's `form`, a `formViews` entry, a `viewKind: 'form'` item). Its upgrade command moves the stored rows that still hold one, in the same run that switches to the major, all or nothing. `os migrate stored-forms` shows that outcome before the upgrade and writes nothing: for each form name at each package that can serve it, whether the row is kept, moved (into the base's paired `.custom` package as a declared override, into a writable package's own form row, or into the environment), folded into the served row, removed as an internal record form, or left in place; and whether the upgrade can switch, naming each row that holds it (its pair cannot be ensured, its form content cannot be read, or one slot of a paired `.custom` package is claimed by more than one move) with the action for its cause. A row bound to a read-only package that ships no form of its name moves into that package's paired `.custom` package as a form of its own. Old-shape drafts are listed: they are neither moved nor deleted, and cannot be published after the upgrade. A row read at several packages is named at each, and is removed only where it is an internal record form at every one of them; read at two packages of one App that would both move it, it holds the upgrade, since the App's `.custom` package holds one row of a form's name (as does a row that package already holds of the name, beside a row planned into it); read at several packages, of one App or several, that would not all move it or all remove it, it holds the upgrade at each of them; a row with a public link behind an internal form left in place holds the upgrade where another package would move it, and neither row is folded, moved or removed at any package (a plan that would do so holds); and a row that holds is folded into no other row. A withdrawal a folded row carries that no layer reads today is named newly closed.
12+
13+
`listStoredFormsOf(protocol)` answers the census over a protocol instance; it and its types are exported (`StoredFormCensus` and the shapes it names). The start-up message for a stored view whose form content cannot be read now names the command. `orderedFormRowsAt` is the served-row order the effective `form` read already used, now read by the census too; the read serves what it served.
14+
15+
The operations page is `content/docs/deployment/stored-forms-upgrade.mdx`.

‎content/docs/deployment/cli.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,7 @@ written.
13411341
| `os migrate security-catalog-overlays --apply` | **Refuses** likewise — it deletes `sys_metadata` rows, and a live process saving metadata is exactly the collision |
13421342
| `os migrate packageless-overlays --apply` | **Refuses** likewise — it moves `sys_metadata` rows into each base's pair |
13431343
| `os migrate stored-references bind` | **Refuses** likewise — it writes one row's package column |
1344+
| `os migrate stored-forms` | Warns and continues — it is read-only |
13441345
13451346
The check applies to SQLite only: Postgres and MySQL take their own server-side
13461347
locks. Only same-user processes are visible without elevated privileges, and a
@@ -1564,6 +1565,7 @@ where the data lives.
15641565
| `os migrate meta --stored` | Replay the metadata conversion chain over this deployment's `sys_metadata` rows and rewrite the ones still carrying a pre-protocol shape. Hygiene, not a gate — nothing depends on it having run |
15651566
| `os migrate security-catalog-overlays` | List the environment-wide permission-set and position rows (the legacy plurals `permissions` / `positions` included) stored over a name a configured package holds — the rows a v18 cold boot refuses — each with the package that holds its name; `--apply` deletes them, one history tombstone per row. Run it before the first v18 boot, with the flags and environment the deployment boots with: the platform security plugin's sets are held only where `os serve` composes it (an auth secret set, and the `auth` tier on), and the step takes `serve`'s `--preset` and `--dev` with `serve`'s meaning. Adopts nothing; exits 1 while it lists a row |
15661567
| `os migrate packageless-overlays` | List the package-less view, dashboard, report, translation and email-template rows stored over a name exactly one installed package ships — the customizations Setup saved before ADR-0146 D11 closed that write — and with `--apply` move each into that package's paired `<base>.custom` (created when absent) as a declared override, `basedOn` the base's installed version; the package-less row is deleted only after the moved one reads back as served. A name no package ships is environment metadata and is not touched; a name several packages ship, or one the pair already holds a row of, is listed and left with the reason. So is a view container (`list`, `listViews`, `form`, `formViews`): only a single view declares an override, so it is listed `cannot_declare` and never attempted, with the way out — save each of its views into the pair as a single view, then delete the container row. Takes `serve`'s `--preset` and `--dev`. Idempotent: a second run moves nothing. Run it once after upgrading |
1568+
| `os migrate stored-forms` | Read-only: list what the upgrade to the next protocol major does with every stored row that still holds a form in an old shape (a view container's `form`, a `formViews` entry, a `viewKind: 'form'` item) — kept, moved, folded, removed as an internal record form, or left in place — and whether that upgrade can switch, naming each row that holds it (its `.custom` pair cannot be created, or its form content cannot be read) with the action for its cause, and listing the old-shape drafts that cannot be published after the upgrade. No `--apply`: the move runs only inside the upgrade command. Takes `serve`'s `--preset` and `--dev`. See [Check stored forms before the next major](/docs/deployment/stored-forms-upgrade) |
15671569
| `os migrate stored-references` | List the stored references the upgrade left naming no package because the one resolution rule (ADR-0150 D3) refuses them: a user's permission-set assignment, an audience-binding suggestion, a managed sharing rule, a queue membership, an open approval request, a paused flow run, a flow credential, a flow dispatch key, a connector connection, an assignment cursor or a legacy email template whose name more than one package holds, each with its row id and every candidate by its qualified address (`namespace/name`). A suggestion a package wrote naming an environment-authored permission set, or one held only outside the package's declared dependencies, is listed with the fix and is never bindable. Also lists the packaged fields whose picklist the rule refuses (served with no options) the names two packages held before the one-holder rule, and each installed package whose namespace spells a literal segment of the address grammar (`actions`, `connectors`, `global`, `hooks`, `oauth`, `runs`, `trigger`): the boot keeps it with one warning, its items are read with `?package=ID`, and only a rename of its namespace gives them qualified addresses at the door that reads the literal (for `runs` that door is the inbound hook alone, reached at its bare address until then). Read-only, and `--json` prints the same bytes on every run. Run before the release's first boot, it reads a table that has no package column yet as nothing bound yet, lists the rows that boot's backfill will leave unbound, and says so once; it adds no column. A table this composition does not carry (automation, approvals) is named, not skipped: compose as `os serve` does, with `--preset`/`--dev`. Then `os migrate stored-references bind --table T --id ID --package P` writes the package you chose into that one row: it asks the rule again first and refuses, writing nothing, when the row is already bound, now resolves on its own, or the package is no longer a candidate (a stale report), and refuses (`duplicate`) a bind the table's unique key refuses because a row bound to that package already holds the key, such as a connector connection the instance already has in that organization. Each bind leaves a `sys_audit_log` row; a second run writes nothing. Confirm with `--yes` |
15681570
| `os migrate duplicates` | Report business identifiers already minted twice across the organization partitions, and the rows blocking the boot-time NULL-safe index tightenings — a read-only inventory as JSON on stdout. Renumbers nothing and writes no row and no schema; run it before the boot-time tenancy repair, which overwrites part of the evidence |
15691571

‎content/docs/deployment/meta.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"backup-restore",
77
"tenancy-modes",
88
"seed-tenancy-repair",
9+
"stored-forms-upgrade",
910
"single-project-mode",
1011
"marketplace-handbook",
1112
"publish-and-preview",
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Check stored forms before the next major
3+
navTitle: Stored Forms Check
4+
description: What `os migrate stored-forms` reports about the forms your database still stores as views, what the upgrade to the next protocol major will do with each, and how to clear a row that holds the upgrade.
5+
---
6+
7+
A form used to be stored as a view: a view container's `form`, a `formViews`
8+
entry, or a view item with `viewKind: 'form'`. Forms are now their own
9+
metadata type, and the next protocol major stops reading those three shapes.
10+
Whatever your database still stores in them is moved by the major's upgrade
11+
command, in the same run that switches to the major. The move and the switch
12+
are all or nothing: if one stored row cannot be moved, the upgrade does not
13+
switch, and the deployment stays on the release it is running.
14+
15+
`os migrate stored-forms` shows you that outcome before you upgrade. It writes
16+
nothing, and it has no `--apply`: the move is reached only from the upgrade
17+
command.
18+
19+
```bash
20+
os migrate stored-forms
21+
os migrate stored-forms --json
22+
```
23+
24+
It composes the deployment the way `os serve` does, so pass the `--preset`
25+
and `--dev` flags the deployment boots with, and `--database-url` (or
26+
`$OS_DATABASE_URL`) for the database. The boot is read-only. The command exits
27+
`0` whenever the check ran; `canSwitch` in the `--json` output says whether
28+
the upgrade would switch.
29+
30+
## What it reports, per form
31+
32+
A form is reported at each package that can serve it: a read-only package
33+
that ships it (an installed app, or a package your code provides), a writable
34+
package of your own, or the environment itself when no package ships it.
35+
36+
| Outcome | What the upgrade does |
37+
|---|---|
38+
| **kept** | The form is already stored as a form. Older rows of the same form fold into it. |
39+
| **moves** | The row moves to a form row, with its body as written: into the package's paired `.custom` package as a declared override for a read-only package, into the package itself for a writable one, or into the environment. An override already stored in a `.custom` package keeps its package and the version it is based on. A row bound to a read-only package that ships no form of that name, or an override of a package that ships none, moves into that package's `.custom` package as a form of its own, with no override declared; its public address answers as it does today. Where the server today serves such a row at one other package's address, it moves as a row of that package does, into that package's `.custom` package as a declared override. Older rows of the same form fold into it. |
40+
| **will be removed** | The row is an internal record form: a create or edit form with no public link that no action opens, over nothing that has a link. New and Edit follow the object's field groups instead, and the report says whether the object declares any. A row bound to no package is read at every package that ships its form: it is removed only when it is an internal record form at each of them, and moves at each of them otherwise. An older row behind the removed one goes with it, unless another package serves that row: the report then names it as not removed, with what happens to it there. |
41+
| **left in place** | Nothing moves. The row served for the name carries no form (a list stored over it, alone or with older form rows behind it), or an internal record form is served ahead of a row with a public link and is not removed because of it. Every row of the name stays as stored, and the address keeps answering as it does today. Where another package serves that row with a public link and would move it, the row holds the upgrade at every one of those packages instead: both rows stay. Both rows stay as stored at every other package too: where either stands behind a row another package would move or remove, that move or removal holds the upgrade instead of folding or removing it. When the row served is one whose form content cannot be read, the form waits on that row, which holds the upgrade (below). |
42+
| **holds the upgrade** | The row cannot be moved. The report repeats the reason and the action. |
43+
44+
A list stored behind the row served for a form is not part of it: the upgrade
45+
leaves it as stored, and the report says so. When a row is read at more than
46+
one package, the report names it at each. Where the server today serves one
47+
row at two packages' addresses of one app that would both move it, or two
48+
rows would move into one slot of the app's `.custom` package (a row the
49+
`.custom` package already holds of that name among them), each such row
50+
holds the upgrade: a
51+
`.custom` package holds one row of a form's name, so neither address can be
52+
given a destination. Where the server serves one row at several packages,
53+
of one app or of several, and those packages would not all move it or all
54+
remove it (one moves or removes it, another leaves it in place or holds),
55+
the row holds the upgrade at each of them too: moving or removing a row
56+
takes it from every package that serves it. Nothing moves, and every
57+
address keeps answering as it does today. The row is named once, with every
58+
address it is read at. A row every package that serves it would remove is
59+
removed, and one every package leaves in place is left in place. A row that
60+
holds the upgrade is not folded into another row: where it stands behind a
61+
row that moves, the report names it apart.
62+
63+
When several rows of one form are stored (an override in the `.custom`
64+
package, a row bound to the package, a row bound to no package), the body
65+
kept is the one served today. A folded row carries one thing: if it switched
66+
the form off (its link kept, `enabled` or `allowAnonymous` set to `false`), the
67+
kept form keeps its link and is switched off too. When the folded row was one
68+
that nothing reads today, that closes a form that is open today. The report
69+
marks it **NEWLY CLOSED**, with the kept form's address. Switch it on again in Setup after
70+
the upgrade if it should stay open.
71+
72+
A row that declares a public link, or that stands over a form that declares
73+
one, is never offered for deletion. Deleting such a row would open a form
74+
that is closed today.
75+
76+
## Clearing a row that holds the upgrade
77+
78+
| Cause | Who can clear it | What to do |
79+
|---|---|---|
80+
| The paired `.custom` package cannot be created: another package sits under its id or holds its namespace, or the app that carries the package is not installed | The administrator | Make the fix the quoted refusal names on the release you are running, then run the check again. |
81+
| A `.custom` package an earlier version created for one package of the app holds the namespace | No one, on this release | The row holds the upgrade until that package is re-identified as the app's `.custom` package (ADR-0146 D3, merge question 12), and no command on this release does that. The row keeps working as it does today meanwhile. |
82+
| The app declares no namespace, or an invalid one; its version is not SemVer; or the package belongs to several apps and its namespace picks none | The app's author | The deployment stays on the release it is running until the app ships a version without the cause. The row keeps working as it does today meanwhile. |
83+
| The package is a kernel package, which has no `.custom` package in this version | The platform maintainers | Report it before upgrading. |
84+
| Two rows would land in one slot of an app's `.custom` package, or one row that several packages serve would not be treated alike by all of them | No one, on this release | No exit from it was measured: the deployment stays on the release it is running, and every address keeps answering as it does today. Where the row is read at two packages of one app that would both move it, the app shipping the form from one of those packages only lets it be read at that package alone. Where the row waits on another hold of its own, it takes that hold's row above. |
85+
| The stored view's form content cannot be read | The administrator | Save the view again with its form content repaired (a `form` or `formViews` entry that is an object), then run the check again. On the release you are running, both public doors answer for the row as they do today. On the next major its links close, and that server's start-up log names each such row and points to this command. |
86+
87+
## Also listed
88+
89+
- **Drafts**: a draft view with form content in an old shape is neither moved
90+
nor deleted. After the upgrade it cannot be published, so publish the drafts
91+
you want to keep before upgrading. A form that moves names its draft, which
92+
stays behind as stored.
93+
- **Shared addresses**: a public address that two form names declare, such as
94+
a retired form and the one that replaced it.

0 commit comments

Comments
 (0)