Skip to content

feat(cli): os migrate stored-forms — the read-only census and upgrade precheck of stored forms - #38464

Closed
objectstack-fleet[bot] wants to merge 10 commits into
mainfrom
claude/project-thread-zmwgyw
Closed

objectstack-fleet[bot] wants to merge 10 commits into
mainfrom
claude/project-thread-zmwgyw

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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.

Clause-②: yes
Metadata-protocol: none
Skills-docs: none — stored-row ceremony, nothing an author writes changes

维护者速读

  • 用户能看到什么变化:管理员升级到下一个大版本之前,可以先跑一次只读检查,逐条看到数据库里还按旧写法存着的表单升级时会被保留、迁移、合并、删除还是原样不动,以及升级能不能放行;服务启动时遇到读不懂的旧表单,日志会指向这条检查。
  • 为什么做:这是「表单成为独立元数据类型」专题(ADR-0159)第五张卡的前半,升级命令要先能说清每一行旧表单的去向,后半才动数据。
  • 出错会怎样:这一半只读不写,判错只会让报告写错某一行的去向,不会改动任何数据;去掉这条命令也不影响现有功能。
  • 要你做什么:无(合并前由席位安排契约审核,再按 Tier H 交你批)。

What changes

The delta at this head answers Contract review FAIL 7252114084 (at abacf146):

  • M3. Where no package ships a form of a name, a row bound to a read-only base and a pair's declared override of that base were planned at two addresses, each as its own served row, which D7-d does not allow: the body kept is the one the read serves today, and that is the override's. The planner now reads the override at the base's address whenever a stored row of the name is bound to that base (pairServedAtUnshippedBase, the one place the case is decided): the override is the served row, the bound row folds behind it, one plan goes to pair_form in the pair the override stands in, and the ensure door is not asked. With no row bound to the base, the override keeps its own pair's address, as before.
  • M3, verified against the tree first. mergePackageAwareOverlay seats a slot for every package a stored row is bound to, and isServedOverrideRowOf never asks whether the base ships the name, so the read does serve the override at the base's address and the bound row nowhere. Measured on the real protocol and engine before the change: the effective view and form lists carry the override's body under the base and under the pair, the bound row appears only in the per-package layer, and the head planned two moves to one pair_form.
  • M3, one point where the tree says more than the suggested shape. The App's pair and an earlier per-package pair can each hold an override of one base. The read serves only the first at the base's address; the second stays served at its own pair's address (measured on the real protocol: three items of the name, the App's pair's body under the base and under the App's pair, the earlier pair's body under the earlier pair). So only the pair the served-row order serves at the base is read there, with every override it holds at the name; the other pair's override keeps its own address and moves to its own pair's form. Reading it at the base too would fold away a body the read serves today. The two variants the record names (the override in the App's pair; the override in an earlier per-package pair) plan exactly as the record asks.
  • S6. A form row behind a removed form that is the served row at another address is no longer listed or counted under the removal. The remove plan keeps it out of behind and names it in servedElsewhere; alsoReadAt still says where it is served and what happens there. The report's remove sentence says it is not removed with the form in front of it.
  • S7. The report's closing line no longer tells the operator to remove every cause on this release. It reads: "The upgrade would not switch: N row(s) hold it. Each is listed above with the action for its cause."
  • N15. StoredFormDraft is exported from the @objectstack/metadata-protocol index with the other census shapes.
  • ADR-0159. D7's destination bullet gains the M3 clause, placed after the ruling's sentence and marked as D7-d's (the second-pair half as this record's reading). N8: the pair_form pin is a pin of its own and no longer a seventh fold fixture; it now says what happens when both rows hold one name. N9: the two paragraphs beside question 4 and the Consequences bullet credit the ruling of 2026-11-29 with the package-less row only, and no longer call the kind a third. N10: the stray clause in D7-c and the trailing semicolon in TL;DR 10.
  • Operations page. N12: the start-up log line is the next major's server's, not the pre-upgrade release's. One sentence on a row behind a removed form that another package serves.

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) 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 Major 19: view is lists only, the old form shapes are refused with a prescription, and the upgrade command converts stored forms, then switches (ADR-0159, card ⑤b) #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, 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 rulings on Upgrade to the major converts stored forms: the stored-row ceremony and the precheck report (ADR-0159, card ⑤a) #37111 (7249158572, 7250977204, 7250982640) 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: pairServedAtUnshippedBase and the loop under it in planStoredForms that re-reads the served pair's overrides at the base (which override is read where), then the remove branch (servedAtAnother, servedElsewhere).
  2. docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md: the last two sentences of D7's destination bullet, and the three N9 sentences.
  3. packages/cli/src/commands/migrate/stored-forms.ts: the remove sentence and the closing line.

Two-minute check: pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol-stored-form-migration.test.ts prints Tests 45 passed (45); the seven tests named M3 and the one named S6 are this round's.

Tests

  • packages/metadata-protocol/src/protocol-stored-form-migration.test.ts (45; 37 before this round): 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. This round: 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).
  • packages/objectql/src/protocol-stored-form-migration.test.ts (5; 4 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. This round: 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.
  • 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 this round changes 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

  • Surface. Inside the claim's surface (the 17 files; this round touches 7 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 this 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.
  • Kernel grep re-run before writing, at 5df10ec: 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 4c8f7dbb (three commits on abacf146: 23319636, the planner, the report sentences, the index export and the tests; 7994f274, the ADR and the page; 4c8f7dbb, one sentence of the planner's header). Not merged with origin/main this round: overlap-check against origin/main at 63acc6cd and #38399 answers VERDICT clean exit 0, and AGENTS.md §10 merges main into an open PR only on a GitHub-reported conflict, a main-caused red or a queue removal.

  • CI at this head (57 check-runs): 42 success, 15 skipped, none failed, none pending. Lint & Repo Gates, TypeScript Type Check, Test Core (all 12 shards), Build Core, Build Docs, Check Changeset, Governed Surface Queue Guard, Test UI, Live E2E UI and Dogfood Regression Gate are success.
  • Build: turbo run build over ./packages/** and the five example apps, 88/88, exit 0, at 7994f274; @objectstack/metadata-protocol rebuilt under the verify lock at this head, exit 0.
  • Type-check: tsc --noEmit with check:test-typecheck in metadata-protocol, cli and objectql: exit 0 each.
  • Tests at this head, under the verify lock: the planner 45/45; the engine census 5/5; the CLI integration 3/3 (--project integration). At 7994f274 (this head differs from it by one comment sentence): the whole @objectstack/metadata-protocol suite, 376 files passed and 9 skipped, 23692 tests passed and 45 skipped. rest's public-form* was not re-run: protocol-form-reads.ts is byte-equal to abacf146.
  • Ablations, this round (each through scripts/ablation-replace.mjs, at 23319636, after the commit; restore proven by blob equal to HEAD and an empty git diff HEAD): pairServedAtUnshippedBase made to answer no pair turns the seven M3 tests red (7 failed, 38 passed); servedAtAnother made false turns the S6 test red (1 failed, 44 passed). The planner test imports the planner from src, so no dist build stands between the mutation and the run.
  • Ablations, earlier rounds: INTERNAL_AHEAD_OF_LINKED_ROW.applies forced to false turns the ruled-case test red; the per-row removal reduced to the address's own verdict turns the M2 test red; the environment address added beside a bound row turns the M1 test red. Each restored.
  • The read behind M3, measured on the real protocol and engine (a throwaway probe, not committed; its lasting half is the fifth engine test): with a row bound to the base and the pair's override at a name no package ships, getMetaItems for view and for form answers the override's body under the base and under the pair; getMetaItemsPerPackage answers the bound row under the base. With an override in the App's pair and one in an earlier per-package pair, it answers the App's pair's body under the base and under the App's pair, and the earlier pair's body under the earlier pair.
  • Each precheck kind on its seed fixture (planner test, one fixture each): keep, move (pair override, the pair's own view override, pair_form, the writable package's own row, the environment), remove, hold × administrator (and the earlier per-package pair) / app_author / kernel / unreadable, left_in_place × served_no_form (a lone list included) / internal_ahead_of_linked_row (and its switched-off twin).
  • Kernel grep at 5df10ec: two CHANGELOGs, no source (Acceptance notes).
Derived gates: 117 derived, 117 run, 0 NOT-MEASURED

node scripts/pm/dispatch-gates.mjs --commands (no path list) at 4c8f7dbb derives 117 commands from the branch's 17 paths against merge base f459c863 (changed lines 2738, +2710 / -28, under the 3000 threshold). All 117 were run at this head, after the last commit, each exit code recorded before any pipe: 117 exit 0, and node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE answers "Run reconciliation — 117 derived, 117 run, 0 NOT-MEASURED, 0 UNRUN." The same list was run once before at 7994f274: six families answered exit 3 there (PREREQUISITE NOT MET, nothing measured) and exit 0 once the prerequisite was in place. check:dual-build-cjs-loads, check:i18n, check:i18n-coverage, check:i18n-walk-parity and @objectstack/spec's check:skill-examples wanted the whole workspace built (only the CLI's dependency closure was), and check-plugin-teardown-shape.mjs --self-test wanted its pinned fixture commit, which the shallow clone did not hold (fetched at depth 1). The derivation prints its STALE TREE notice: the branch's tree is 30 commits behind origin/main, with 18 gate files changed in that range, so the list is this tree's; CI runs the merged ref.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP

… of the stored-form ceremony

ADR-0159 D7, card 5a PR 1: listStoredForms() classifies every active stored
row that holds a form in an old shape, per form name and package address
(keep, move, fold, remove an internal record form, hold, left in place), and
answers whether the upgrade to the next major may switch. The command prints
it and writes nothing. orderedFormRowsAt is the served-row order the form
read already used; the start-up message for an unreadable body names the
command.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
…l form ahead of a linked row

ADR-0159 D7-d gains the ruled "not counted" kind: an internal record form
served ahead of a same-named row that declares a public link (switched on or
off) moves and deletes nothing, both rows are reported as left in place, and
the upgrade is not held. The planner's one deciding constant cites the
ruling, and the twin fixture (the link switched off) is pinned.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
The facade-delegation gate caps protocol.ts, so the census entry point is
listStoredFormsOf(protocol) in its own module and the command calls it. The
integration test pays its dist-resolved loads at module top, and the
handwritten-docs roster lists the new operations page.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/metadata-protocol, touching 98 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

44 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc.

⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/metadata-protocol/src/index.ts) — pages documenting those are invisible to this run
  • 40 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 125 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 47 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 78b8556ab57b04e26cac1a66a9b6b28f33b0cd05 — the merge of head 4c8f7dbbbf4614af945cc88eb0786311910f3298 into base 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 78b8556ab57b04e26cac1a66a9b6b28f33b0cd05 && git checkout 78b8556ab57b04e26cac1a66a9b6b28f33b0cd05
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc 4c8f7dbbbf4614af945cc88eb0786311910f3298 && git checkout -B drift-repro 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc && git merge --no-ff 4c8f7dbbbf4614af945cc88eb0786311910f3298

node scripts/docs-audit/affected-docs.mjs --json 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 63acc6cde5fec499ea2077896b62fa9b3fdd2cdc → pass the list as
args.docs, on the commit named under Which tree this was computed on.

ADR-0159 D7-d and the precheck sentence now say the maintainer ruled the
package-less row behind, and the wider predicate is this record's reading.
The operations page no longer sends the per-package pair to a command that
cannot clear it, and drops a kernel claim the hold does not rest on.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
The command boots through bootSchemaStack, so the family table names it:
report-only, its one mode leaves the database byte-identical and creates no
missing SQLite file.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-29T04:40Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 1369ff38321903b7c363efbf2c42e6c8c04561c2
Local-runs: none
Scope: docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md + packages/metadata-protocol/src/protocol-stored-form-migration.ts, packages/metadata-protocol/src/protocol-form-reads.ts, packages/metadata-protocol/src/index.ts, packages/cli/src/commands/migrate/stored-forms.ts, content/docs/deployment/stored-forms-upgrade.mdx, packages/metadata-protocol/src/protocol-stored-form-migration.test.ts, packages/objectql/src/protocol-stored-form-migration.test.ts
Security-touching: yes
Rule-change-verified: none

PR #38464, Part of #37111, PR 1 of 2. Read for this record: the card body and its 8 comments, the PR body, its 17 files, the net diff against merge base f459c863, and the check-runs on the head. Code outside the diff was read to judge the diff, not reviewed. The rest of the diff (the CLI tests, the rest pin, the checklist item, cli.mdx, meta.json, the changeset, handwritten-docs.json) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on the head: 61 runs, 44 success, 17 skipped, none failed, none pending. Of the required contexts, Lint & Repo Gates, TypeScript Type Check, Test Core (all 12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI and Dogfood Regression Gate are success. Lint UI, Type Check UI and Build & E2E UI are skipped. Check Changeset is success.

① Derived judgments

  • A new CLI command, os migrate stored-forms, with --database-url, --json, --preset and --dev. A public-surface widening. Right. It has no --apply, and the one-shot family test holds it to no write.
  • New exports from @objectstack/metadata-protocol: listStoredFormsOf and ten StoredForm* types. A widening. Right. planStoredForms, listStoredForms, storedFormPairFix, INTERNAL_AHEAD_OF_LINKED_ROW, orderedFormRowsAt and storedFormPlaces stay off the package index. Right.
  • The --json census is a machine surface that Major 19: view is lists only, the old form shapes are refused with a prescription, and the upgrade command converts stored forms, then switches (ADR-0159, card ⑤b) #37112 will read (canSwitch, counts, holds, forms, unreadable, unread, drafts, sharedSlugs). Right as a widening. Two of its outcomes are wrong on this head: see M1 and M2.
  • servedFormHolding is now the first row of orderedFormRowsAt. The accept set of the form read does not change: the first candidate with a hit, at its lowest rank, is the row it returned before. Right.
  • The start-up line for an unreadable body gains one sentence naming the command. No behaviour changes. Right.
  • Nothing an author writes changes. No error code is added. Metadata-protocol: none is right.
  • The ADR gains one more kind of row the precheck does not count, and with it one exception to the removal of internal record forms. The package-less case is ruled. Every other linked row behind is the record's own reading. Right as attributed.
  • Security: the ADR hunk, the operations page and the report teach which stored rows keep a public address closed, when a link stays withdrawn, and which rows are never deleted. That is sharing behaviour the path names do not show. The line above reads yes, and the adopting seat adds the security label.

② Semver level

The changeset is patch on @objectstack/metadata-protocol and @objectstack/cli. That matches what the diff publishes: a widening with no protocol kind ships patch. @objectstack/objectql and @objectstack/rest move by one test file each and publish nothing, so they owe no entry. Both declaration lines stand in the PR body and in the changeset body. The Clause-②: line reads yes, and yes is right: the card widens the public surface (a command and exports). Skills-docs: none is present and true.

③ Boundary flags

  • The four surface differences (no method on protocol.ts, the engine test in packages/objectql, handwritten-docs.json, the ADR edit): accepted. listStoredFormsOf reads through protocolHost and writes nothing. The ruling record asked for the ADR edit in this PR.
  • open_questions, drafts: for this head, option A is right. The census lists draft rows and leaves them. For PR 2 the question is escalated to the seat: ADR-0159 D7 says nothing about drafts, and a draft with an old-shape form cannot be published on the major.
  • A package-less row at several addresses (the PR body: "PR 2 owes the order of those two writes"): not answered by an order alone. The plan is per address and a row is one row. See M2.
  • The kernel reading: taken again on this head with the card's git grep. It finds packages/platform-objects/CHANGELOG.md and packages/plugins/plugin-auth/CHANGELOG.md, and no source. The kernel hold is empty.
  • Q1 of the earlier REWORK (a per-package pair of an earlier version is classed administrator, and no shipped command re-identifies it): still open, and escalated. S1 narrows it: a row already stored in a pair needs no ensure. For a package-less or base-bound row over a member of such an App there is still no exit on this release. That is the seat's, or the maintainer's, before PR 2.
  • Pre-dispatch note 1 (the unreadable body on the pre-upgrade release): the page follows D7-c. One report sentence does not. See S4.
  • Pre-dispatch note 2 (a served internal row ahead of a linked row): answered by ruling 7249158572. The served row is found before any removal, the outcome sits in one constant, and the fixture and its twin are pinned.
  • Not flagged by the dev: the unread class. The card and D7 name no such kind, and its premise is wrong. See M1.
  • Readings the claim asked for: each kind has a seed fixture except the lone no-form row (S3) and a .custom view override under a refusing door (S1). The security pins on both doors are PR 2's.
  • SQL push-down: no finding. The census adds no id list and no in-app join. It reads whole row sets by type (and state for drafts) and classes JSON bodies through the spec's projection. A container's row name is not the name its expansion writes, so no row predicate can select by form name. It reads the view rows twice in one run, which is a cost of a one-shot command and not a push-down miss.

④ Design judgment

The ADR (hits).

  • The quotation is byte-equal to ruling record 7249158572. The text credits the maintainer with the package-less row behind an internal served row. It marks every other linked row behind as "this record's reading", in the D7-d bullet and in the "Not counted" sentence, and says that reading is open to correction. The first consumer agrees: INTERNAL_AHEAD_OF_LINKED_ROW.applies is as wide as the bullet, and its docblock says which half is ruled.
  • The claim "both doors answer 404 before and after, and on major 19" holds. The served internal row declares no link. The row behind is not a candidate, because candidates come from the effective form read alone. Nothing is written. On the major the projection serves no content.
  • S5 (should-fix) — the new kind and the new reading stand in D7-d and in the "Not counted" sentence only. The record's own summaries now disagree with D7. The Status line names the revision of 2026-11-25 and not this one. TL;DR 10 lists every point that goes past a ruling "for the approver to accept with the record or strike", and this reading is not there. The paragraph beside question 4 still says "two kinds", and says the uncounted form rows "are read by no layer or stand behind a row the check keeps closed"; a served internal row is neither. Consequences still says "Two kinds of stored row". The list of pins card ⑤ owes gains no fixture for the case, though the ruling record says the pin is owed on every reading.

protocol-stored-form-migration.ts against D7. Two outcomes break the contract.

  • M1 (must-fix) — a move can serve a body that is not served today, and open an address that is closed today. bindingOf classes a row bound to a read-only package that ships no form of the name as unread ("no address serves it"), and a pair's declared override of a base that ships none the same way. The planner then drops that row from every address. On this tree the read does serve such a row. mergePackageAwareOverlay seats a slot for every package a stored row is bound to, serves that package's own row there, and lists no package-less row beside it. The env-wide narrowing keeps "every item of a name no package or several packages ship". protocol.org-scoped-write-refused.test.ts, case (c), pins it: "a row bound to COPYING, of a name no package ships" is "served from the row". So take a name no package ships, a bound row A, and a package-less row B. Today the read serves A at A's package and reads B nowhere. The planner lists A as unread, adds the environment address because no binding is at, finds B alone there, and plans move to a package-less form row. After that move readEffectiveFormList lists B as its own item beside A's projection. Where A carries no link and B is open, both doors answer 404 today and B answers after. D7-d forbids this: the served row is found "among every stored row at the address", and "a body the read does not serve today is never served by the ceremony". Two smaller effects of the same class: A alone is served today, is reported under "Rows nothing reads", and stops being served at the major with no line that says so; and a withdrawal in A is read today by the per-package layer. The fix at least never adds the environment address while a stored row of the name is bound to a package. What a form row bound to a read-only package that ships no form of the name gets is not in the ADR: that is a decision to put to the maintainer, not to settle in the planner.
  • M2 (must-fix) — remove is decided per address, and a deletion is per row. isInternal asks only the base of the address it is called at. A package-less row is read at every address of its name. Where two read-only packages ship the name, one form without a link and one with, a link-less row in a record-form slot is remove at the first and move at the second. The report prints "will be removed" for a row that stands over a linked base. The card forbids that line ("no report or precheck lists it for removal or reset"; its item 2 and D7-e say the same). Run as planned, the removal serves the second base's form. A row behind a removed row has the same gap: the header and the report say the upgrade removes the internal row "with the rows behind it", and a row behind can be the served row at another base. The PR body flags two moves of one row. It does not flag this.
  • S1 (should-fix) — a .custom view override is planned through the ensure door. D7 says it "keeps its package, its name and its overrides declaration, basedOn unchanged". The planner gives it destination.pair from pairOf and basedOn from the base's installed version, and the report prints both. When the door refuses now, the row is hold, though nothing needs ensuring. The same row stored as a form row is keep on purpose ("nothing to create"). So an override that sits in an earlier version's per-package pair, which pairsOf serves today, holds the upgrade with an action no command on this release can take. That covers every switch Setup wrote there.
  • S2 (should-fix) — the rows behind the served row include rows that hold a list: orderedFormRowsAt returns every place that holds the name. The report counts them as rows that "fold into it", and under remove as removed "with" the internal form. D5 removes form content only, and ruling 3 keeps lists byte-equal. Say what a list row behind gets, and count form rows only.
  • S3 (should-fix) — the card's "Done when" says a row that carries no form over a linked base is "reported as left in place". names is built from rows that hold a form, so a lone list row over a linked base is not reported at all. Report it, or state in the PR body that PR 2 owes it.
  • S4 (should-fix) — the unreadable hold says "The public forms it names are closed". The claim corrected this premise before dispatch, and D7-c says it: on the pre-upgrade release both doors answer for that row as they do today. Rule 7 closes those links on main and on the major. An administrator reads this sentence on a deployment that still runs the pre-upgrade release.
  • The rest agrees with D7. The three-part internal test reads the link whether it is on or off (D7-a), reads the base (D7-b), and never removes a form row. The body kept is the served one, and a folded row carries a withdrawal and nothing else. A hold repeats the door's refusal and classes its cause as D7-c lists them. hold and left_in_place change no door's answer, and keep only narrows, by a withdrawal it carries.

protocol-form-reads.ts. Agrees. orderedFormRowsAt is the old loop with every hit kept, in the same candidate order and the same rank. null addresses the package-less rows alone. The start-up line matches D6 rule 7 as revised and card item 3.

index.ts. Agrees with the changeset.

stored-forms.ts (CLI). Agrees with its docblock: read-only boot, exit 0 whenever the census ran, canSwitch in --json. Its sentences carry M1 ("no address reads"), M2 and S2 ("will be removed ... with the N row(s) behind it") and S1 (the pair and basedOn it prints).

stored-forms-upgrade.mdx. Agrees with the code, sentence by sentence, except "Rows nothing reads" (M1). The administrator row of the clearing table is true at this head.

The two pin files. They hold what they assert. No fixture reaches M1, M2 or S1. The unread test pins M1's premise in the one case where it is true: a name one other package ships as a view.

Nits.

  • N1 (nit), ADR: "switched on or off" stands inside the sentence that reports the maintainer's answer. The question put to him names a package-less row with a public link; the switched-off twin is in the ruling record's Reading. Say so.
  • N2 (nit), ADR: the wider example calls a linked row bound to the base one "no layer reads today". D7-d says the base's per-package layer reads that row. "The read does not serve today" is the accurate phrase.
  • N3 (nit), report: the NEWLY CLOSED line prints the folded row's slug. The address that closes is the kept body's, and rule 6 matches by name, so the two can differ.
  • N4 (nit): newlyClosed is true unless the withdrawing row is the base layer's first non-override row. A view row outranked by a form row at the same place is still in the effective view list, so its withdrawal is read today. Only an out-of-band pair of rows reaches it.
  • N5 (nit): when pairOf fails, the refusal is the planner's own sentence, with the raw reason code for every reason but no_single_app. It is not the door's text.
  • N6 (nit), page: the count of rows "left in place" includes an address that waits on an unreadable row, and the page says left in place holds nothing.
  • N7 (nit), report: the line for the ruled case says "neither moves". The ruling record's reading asks it to say the internal form was not removed because a linked row stands behind it.

Implemented-by: claude/project-thread-zmwgyw
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
2026-11-29T04:42Z · security label added: the CONTRACT_REVIEW_TIER record 7250799697 at 1369ff38 answers Security-touching: yes and means it (the ceremony decides which stored rows a public form address serves). Tier H stands.

…rulings

A package-less row read at several addresses is removed only where it is
internal at every one, and moves at each otherwise; a plan names the rows
another address reads with that address's outcome. A pair's stored view
override keeps its pair and basedOn without asking the ensure door. List rows
behind the served row are left as stored and not folded. A list alone over a
base that ships the form is reported left in place. The carried withdrawal
names the kept body's slug.

The maintainer's rulings: a form row bound to a read-only package that ships
no form of the name moves into that package's pair as its own form item, and
the name has no environment address while such a row stands; old-shape drafts
are listed, neither moved nor deleted, with a warning that they cannot be
published after the upgrade; the earlier per-package pair hold says no command
on this release clears it. ADR-0159 records them and syncs its summaries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzWj7MTrb8KnuXA6YP
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nKeNC91jfN3AY3HKz
2026-11-29T06:32Z · Final green head declared for L1 and L2: abacf146cb37410dec0e1374206ae68a0612124f.

  • Checks at this head (pr-state.mjs via l1-face.mjs --pr 38464): 44 success, 17 expected skip, 0 unexpected skip, 0 failed, 0 pending; mergeable_state clean; Lint & Repo Gates and TypeScript Type Check success. overlap-check.mjs at this head: clean against origin/main e32d173 and feat(cli): os migrate meta --stored lists the stored permission sets whose View All / Modify All lost their field reach in 19 #38399 (the one open PR sharing a file, packages/metadata-protocol/src/index.ts).
  • Card Upgrade to the major converts stored forms: the stored-row ceremony and the precheck report (ADR-0159, card ⑤a) #37111 (PR 1 of 2, Part of #37111): claim 7251908983 (seat 5, resumes seat 3's claim 7248743419 and Release 7251457843); delta os-dev-report 7251447223 answers Contract review FAIL 7250799697 (at 1369ff38) and folds in rulings 7250977204 and 7250982640. The earlier L1-a ACCEPT 7250594901 was at 1369ff38; this head owes the L1 delta and the L2 delta.
  • l1-face flags one item, the changeset: @objectstack/objectql and @objectstack/rest each move by one test file (packages/objectql/src/protocol-stored-form-migration.test.ts, packages/rest/src/public-form-two-type-withdrawal.test.ts) and publish nothing, so they owe no entry. FAIL 7250799697 ② reads the same.
  • Contract faces read off this head: one governed path (docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md), and the bare Clause-②: yes declaration in the PR body and the changeset. The L2 owed is a CONTRACT_REVIEW_TIER delta with ④ against 7250799697.
  • Lands as Tier H: check-governed-merges.mjs --pr 38464 reads GOVERNED (docs/adr/** ×1), size 2,480 changed lines, and the PR carries the security label. After the L1 delta ACCEPT and the same-head L2 PASS, it goes to the seat for the hand-off. L1 by thread L1-b.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nKeNC91jfN3AY3HKz
2026-11-29T06:34Z

Contract-review-claim: session_01FEkQ5nKeNC91jfN3AY3HKz · head abacf14 · 2026-11-29T06:34Z

The L2 delta against Contract review FAIL 7250799697 runs from this card thread as an isolated CONTRACT_REVIEW_TIER sub-agent with ④ (ADR-0159 is a governed path). The L1 delta goes to thread L1-b.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB

席位核对 — ACCEPT · L1-b · area o5-ux · Head-sha abacf146cb37410dec0e1374206ae68a0612124f · 2026-11-29T06:44Z

Delta review of 1369ff38..abacf146 (one commit, 8 files +434/−118) after L1-a ACCEPT 7250594901, at TIER_DEFAULT. The design reading against ADR-0159 D7 and FAIL 7250799697 ④ belongs to the isolated L2 delta the card thread runs. I did not start a second one. Two small items go to PR 2 (below), and they do not need this head to move.

Checklist (l1-face --pr 38464 at abacf14: 1 flag, read below)

  • Changeset flag: @objectstack/objectql and @objectstack/rest. Each moves by one test file, and neither is in this delta. They publish nothing, so they owe no entry, as L1-a and FAIL ② read it.
  • Scope: all 8 delta files are on the claim's File surface: (7251908983). Shape: open draft → main, Part of #37111, PR 1 of 2. Clause-②: yes · Metadata-protocol: none, and the changeset is still patch on @objectstack/metadata-protocol and @objectstack/cli. The one new export, the type StoredFormElsewhere, is a widening.
  • Gates at this head: 44 success, 17 expected skip, 0 failed, 0 pending, mergeable_state clean.
  • Tier H: GOVERNED docs/adr/**, the security label, and the card total over 3,000 lines. After the same-head L2 delta PASS it goes to the seat for the hand-off, not to the area.

My readings of the delta, at this head

  • Each L2 item has a code answer and a named test.
    • M1: the environment address is added only while no stored row of the name is bound to a package. The unread class is gone. A bound row whose package ships no form of the name is unshipped → pair_form.
    • M2: removable asks isInternal at every address in readAt, and alsoReadAt names each other address with its outcome.
    • S1: ownOverride → keptDestination, so the door is not asked.
    • S2: behind holds form rows only, and list rows go to untouched.
    • S3: a name is added when a package ships it as a form. shippedForms lists a package only when it ships a form or a view that projects one, so a list over a list is still not reported (test "a list row at a name no package ships as a form is a list's").
    • S4: the unreadable refusal now says both doors answer as today on this release.
    • N3: carries.slug is served.link, and foldOf returns nothing to carry when the kept body names no link.
    • The report states two ablations (M1, M2), each restored.
  • The rulings.
    • 7250977204: pair_form names the base and the pair. pairFormDestination asks the door for a row bound to the read-only package, and holds when the pair cannot be ensured. It does not ask the door for a pair's override of a base that ships none, because that row already stands in the pair. The public-address byte-equal pin is named as PR 2's.
    • 7250982640, drafts: view/views drafts with old-shape form content only (a form draft is new-shape), and draftsLeftBehind on a move.
    • 7250982640, the earlier pair: the class stays administrator, and only the action text changes.
  • Docs and changeset, sentence by sentence. The four outcome rows and the new paragraph of stored-forms-upgrade.mdx match the planner. That covers the override kept with its basedOn; the pair_form move; per-row removal; a list behind left as stored; a row named at each address; the kept form's address on NEWLY CLOSED; the split cause rows; the unreadable row on this release; and the drafts. The cli.mdx row and the three new changeset sentences (the pair_form move, the drafts, removal only where internal at every package) hold. The CLI text drops unread from the human output and from --json alike.

Two items for PR 2, carried by the card thread (claim amendment for PR 2, and the body's PR 2 list) before the seat hand-off. No head move:

  1. The earlier-pair reading has no pin through the real door. storedFormPairFix sets earlierPair by matching the 409 refusal's text (refused.message.includes('re-identified as the App\'s pair'), ~863). The door's 409 carries no code. The only test that names earlierPair stubs pairFix (planner test ~253). Neither the engine census test nor the CLI tests reach a namespace held by an earlier per-package pair, as a grep for earlier, re-identif and getNamespaceOwners shows. So a rewording of the door's sentence would silently bring back the action ruling 7250982640 retired ("Remove the cause … then run the upgrade command again"). PR 2 owes one of two fixes, with a positive control: a test that drives the real door for the 409 earlier-pair case and the 422 other-owner case, or a structural reading (the owner's base and App, as the door computes them) in place of the text match.
  2. StoredFormDraft is not exported. StoredFormCensus.drafts is now readonly StoredFormDraft[], but index.ts adds only StoredFormElsewhere, while the changeset says the types are exported, "StoredFormCensus and the shapes it names". A consumer can still write StoredFormCensus['drafts'][number]. Export it in PR 2, which touches the same index.

Owed before the hand-off: the same-head L2 delta PASS at CONTRACT_REVIEW_TIER (④ against 7250799697), the two PR 2 items recorded as above, and the dogfood battery from the landing head. Then the seat hands off (Tier H). #37111 stays open with pm:dispatched for PR 2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nKeNC91jfN3AY3HKz
2026-11-29T06:51Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: abacf146cb37410dec0e1374206ae68a0612124f
Local-runs: none
Scope: docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md + packages/metadata-protocol/src/protocol-stored-form-migration.ts, packages/metadata-protocol/src/protocol-form-reads.ts, packages/metadata-protocol/src/index.ts, packages/cli/src/commands/migrate/stored-forms.ts, content/docs/deployment/stored-forms-upgrade.mdx, packages/metadata-protocol/src/protocol-stored-form-migration.test.ts, packages/objectql/src/protocol-stored-form-migration.test.ts
Security-touching: yes
Rule-change-verified: none

PR #38464, Part of #37111, PR 1 of 2. This is the delta on Contract review FAIL 7250799697 (at 1369ff38), and a full round on the new head. Read for it: the card body and its 13 comments, the three ruling records 7249158572, 7250977204 and 7250982640 in full, the PR body, its 17 files, the net diff against merge base f459c863, the delta from 1369ff38, and the check-runs on the head. Code outside the diff was read to judge the diff, not reviewed. The rest of the diff (the CLI tests, the rest pin, the checklist item, cli.mdx, meta.json, the changeset, handwritten-docs.json) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on the head: 61 runs, 44 success, 17 skipped, none failed, none pending. Lint & Repo Gates, TypeScript Type Check, Test Core (all 12 shards), Build Core, Build Docs, Check Changeset, Governed Surface Queue Guard, Test UI, Live E2E UI and Dogfood Regression Gate are success.

① Derived judgments

  • The CLI command os migrate stored-forms keeps its flags and its exit rule. It still has no --apply. Right.
  • Its --json census changes shape since 1369ff38: unread is gone; each plan gains untouched, alsoReadAt and, on a move, draftsLeftBehind; the destination gains the kind pair_form. Nothing released reads it yet, so this is still one widening. Right as a surface. One of its outcomes is wrong on this head: see M3.
  • @objectstack/metadata-protocol exports listStoredFormsOf and eleven StoredForm* types (StoredFormElsewhere is new). A widening. Right. planStoredForms, listStoredForms, storedFormPairFix, INTERNAL_AHEAD_OF_LINKED_ROW, orderedFormRowsAt and storedFormPlaces stay off the package index. Right.
  • The accept set of the form read does not change. protocol-form-reads.ts is byte-equal to 1369ff38; servedFormHolding is the first row of orderedFormRowsAt, the row it returned before. Right.
  • The start-up line for an unreadable body names the command. No behaviour changes. Right.
  • Nothing an author writes changes. No error code is added. Metadata-protocol: none is right.
  • The ADR now records four maintainer rulings: one more destination (the pair's own form item), drafts left and listed, the earlier per-package pair's text, and the internal form ahead of a linked row. It also states the per-row deletion and adds two pins. Right as attributed in D7; see N9 for three summaries.
  • Security: the ADR hunks, the page and the report teach which stored rows keep a public address closed, where a row may move, and which rows are never deleted. That is sharing behaviour the path name does not show. The line above reads yes. The PR already carries the security label.

② Semver level

The changeset is patch on @objectstack/metadata-protocol and @objectstack/cli. That matches what the diff publishes: a non-protocol widening ships patch (AGENTS.md, Post-Task 3). @objectstack/objectql and @objectstack/rest move by one test file each and ship dist only, so they owe no entry. Both declaration lines stand in the PR body and in the changeset. The Clause-②: line reads yes, and yes is right: a new command and new exports. Skills-docs: none is present and true.

③ Boundary flags

  • open_questions: the delta report 7251447223 carries none. The earlier one (drafts) is ruled: 7250982640, 「A 留下并提醒(推荐)」. The code, the report, the page and D7 follow it.
  • L1-a Q1 (the earlier per-package pair that holds the namespace): ruled, 7250982640, 「B 只改文字,不开卡」. The class stays administrator; the action and D7-c say no command on this release clears it. One report sentence still says otherwise: see S7.
  • The destination of a row bound to a package that ships no form of the name: ruled, 7250977204, 「B 搬进定制包(推荐)」. Built as pair_form. The two ruled kinds of row are not planned together: see M3.
  • A package-less row at several addresses (PR body: PR 2 owes the order of the moves): answered for the served row. alsoReadAt names it at each address, and it is removed at each or moved at each. Not answered for a row behind a removed row: see S6.
  • Owed by PR 2, as the PR body names them: the byte-equal pin for the pair_form move (the ruling record asks for it), N4 and N5. Accepted as carried.
  • The four surface differences (no method on protocol.ts, the engine test in packages/objectql, handwritten-docs.json, the ADR edit): accepted, as before.
  • The kernel reading: taken again on this head with the card's git grep. It finds packages/platform-objects/CHANGELOG.md and packages/plugins/plugin-auth/CHANGELOG.md, and no source. The kernel hold is empty.
  • Pre-dispatch notes 1 and 2 (7155769725): note 1 is S4, closed below. Note 2 is ruling 7249158572, carried.
  • A note for the seat, not a finding: the ruled pair_form destination drops the overrides declaration. If the base ships that name again later, the pair's own form no longer replaces the base's. That is inside the ruling's words (「B 搬进定制包(推荐)」, "with no overrides declaration"), and PR 2's pin should state it.
  • SQL push-down: no finding. The delta adds one read, the draft rows, and it pushes type and state down. No id list and no in-app join is added. The stored rows of step 3 are read whole because a container row's name is not the name its expansion writes.

④ Design judgment

The delta on FAIL 7250799697.

  • M1: closed. The environment address is added only when no address exists and no stored row of the name is bound to a package (planStoredForms, lines 550 to 551). The unread class is gone from the planner, the CLI and the page. The destination the earlier record sent to the maintainer is ruled: 7250977204, 「B 搬进定制包(推荐)」. The planner builds it (pairFormDestination), holds it at the ensure door, folds a package-less row behind it, and removes an internal one. The gap this fix leaves is M3.
  • M2: closed, for the served row. removable asks isInternal at every address the row is read at (lines 619 to 620), so a package-less row is removed at each or moved at each. Both directions are pinned. The half about a row behind a removed row is not closed by this. It is graded again as S6.
  • S1: closed. A pair's stored view override takes keptDestination (lines 591 to 601): its own pair, its stored basedOn, and no question to the ensure door. Pinned with a refusing door.
  • S2: closed. behind holds form rows only. A list row behind is untouched, and the report says it stays as stored. D7 says the same ("A list row behind a removed form is not part of it, and stays byte-equal").
  • S3: closed. A name a package ships as a form is planned where only a list is stored over it, and the lone list is left_in_place, served_no_form. A list at a name no package ships as a form is not named. Both pinned.
  • S4: closed. The unreadable refusal now reads "On this release both public doors answer for it as they do today; on the next major its links close". That is D7-c.
  • S5: closed. The Status line, "Decided by", TL;DR 10 (a sixth point), both paragraphs beside question 4, Consequences and the pins list carry the new kind and the record's own reading. Three small disagreements remain: N8, N9, N10.
  • N1: fixed (the twin is credited to the ruling record's reading). N2: fixed ("the read does not serve today"). N3: fixed (the slug is the kept body's). N4: carried to PR 2, named in the PR body. N5: carried to PR 2, named in the PR body. N6: fixed (the page's "left in place" row). N7: fixed (the report says why the internal form is not removed).

The ADR (hits).

  • The four quotations are byte-equal to the ruling records. Each ruling stands in D7 where it applies, and under "Decided by".
  • The first ruling is credited with the package-less row only, in D7-d, in the "Not counted" sentence, in the Status line and in TL;DR 10. The wider predicate is marked as this record's reading, open to correction. The first consumer agrees: INTERNAL_AHEAD_OF_LINKED_ROW.applies is as wide as the bullet.
  • D7-c agrees with ruling 7250982640: the class is unchanged, and the text says the hold stays until the pair is re-identified and no command on this release does that.
  • The drafts bullet agrees with the ruling and with the code: old-shape view drafts only, listed, with the publish-first warning; a move names the draft it leaves behind.
  • The new destination bullet agrees with the ruling's words. It does not hold against its first consumer in one case, which the bullet does not name either: see M3.

protocol-stored-form-migration.ts against D7 and the rulings.

  • M3 (must-fix) — the two kinds of row ruling 7250977204 names are planned apart, and the plan moves a body the read does not serve today.
    • The case: no package ships the name, and two stored rows hold a form of it: A, bound to a read-only package P; and C, in P's pair, declaring overrides.package = P. These are two of D7-d's three rows for a base, after the base stops shipping the form.
    • Today: A seats P's slot in the view merge (mergePackageAwareOverlay, every package a stored row is bound to is a slot). At that slot the served-row order tries the pair's declared override first, and isServedOverrideRowOf does not ask whether the base ships the name. So C is the row served at P, and at the pair's own slot. A is served nowhere. With no shipper of the name, the env-wide list drops neither slot.
    • The planner: bindingOf (line 432) sends C to the pair's own address when P ships no form. The admits filter (line 562) then keeps C out of P's address. P's address reads A alone and plans move to pair_form. The pair's address plans move of C to pair_form too. Where C sits in the App's pair, both land on one row, the same package and name, and neither plan names the other. Where C sits in an earlier per-package pair, A becomes a second form of the App's pair.
    • Why it fails: D7-d says the body kept is the one the served-row order serves today, the pair's override first, and "a body the read does not serve today is never served by the ceremony". Where C switches the form off or carries no link and A is open, both doors answer 404 today, and the plan makes A a served form.
    • The fix: read a pair's declared override at its base's address whenever a stored row seats that address, as orderedFormRowsAt already orders it without the filter. C is then the served row, A folds behind it, and one move goes to pair_form. Plan the pair's own address only when nothing seats the base's. Add the fixture, and one clause to D7's bullet. D7-d already decides the case, so no new ruling is needed.
  • S6 (should-fix) — a row behind a removed row can be the served row at another address, and the report still puts it under the removal. Take a row bound to a base with no link, internal, served ahead of a package-less form row with no link; a second read-only package ships the name with a link. At the first address the plan is remove with that row in behind. At the second the same row is move, because it stands over a linked base. The report prints "will be removed ... with the 1 form row(s) behind it", then "is also read ... where it is served and moves". The module header and the behind field say rows behind "go with its removal". D7-e and the card forbid the first half: no report lists for removal a row that stands over a linked base. Say that such a row is not removed with the form in front of it, and keep it out of the count.
  • The rest agrees with D7 and the rulings. The three-part internal test reads the link on or off (D7-a), reads the base at each address (D7-b), and never removes a form row. The body kept is the served one; a folded row carries a withdrawal and nothing else, to the kept body's own address. A hold repeats the door's refusal and classes its cause as D7-c lists them. hold and left_in_place change no door's answer. Drafts are old-shape view rows only.

stored-forms.ts (CLI).

  • S7 (should-fix) — the closing line reads "Remove each cause above on this release, then run the upgrade again", for every hold. Ruling 7250982640 (「B 只改文字,不开卡」) asks the report to stop saying the earlier pair's cause is removable on this release. D7-c says the precheck offers no other action for an App author's cause. The per-row action is right; this line contradicts it. Send the operator to the action printed for each row.
  • Otherwise it agrees with its docblock and with the census: read-only boot, exit 0 whenever the census ran, canSwitch in --json. The pair_form sentence, the drafts lines and the sentence for the ruled case follow the rulings. Its remove sentence carries S6.

protocol-form-reads.ts, index.ts. Agree. Unchanged in substance since 1369ff38.

stored-forms-upgrade.mdx. Agrees with the code, sentence by sentence, except N12. The clearing table is true at this head.

The two pin files. They hold what they assert. No fixture reaches M3 or S6. The pair_form test seeds its row where another package ships the name, and its pair-override test seeds no row bound to the base.

Nits.

  • N8 (nit), ADR pins: "six fixtures" heads a list of seven. The seventh, the pair_form pin, is not a fold fixture.
  • N9 (nit), ADR: the two paragraphs beside question 4 and the Consequences bullet credit "the ruling of 2026-11-29" with "an internal record form served ahead of a linked row". The ruling covers the package-less row; the rest is this record's reading, as D7-d says. They also call it a third kind, where D7-d counts it beside two ruled kinds and one of the record's own.
  • N10 (nit), ADR: D7-c keeps a stray "; The door's text" where a clause was cut. TL;DR 10's sixth bullet ends with a semicolon.
  • N11 (nit), ADR D7: "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, so no door serves it today. PR 2's byte-equal pin should seed that case too.
  • N12 (nit), page: "the server's start-up log names each such row" follows "On the release you are running". The start-up line exists on main and on the major, not on the pre-upgrade release.
  • N13 (nit): storedFormPairFix finds the earlier pair by a substring of the door's sentence, and no test asks the real door. The draft read through the host has no pin over the real protocol either. PR 2 can pin both.
  • N14 (nit): pairFormDestination holds when the base records no version, for a basedOn the pair_form item never declares.
  • N15 (nit): StoredFormDraft is named by two exported shapes and is not exported. The changeset says the shapes the census names are exported.

Implemented-by: claude/project-thread-zmwgyw
Reviewed-by: session_01FEkQ5nKeNC91jfN3AY3HKz

VERDICT: FAIL

…beside a bound row

Where no package ships a form of a name, a row bound to a read-only base and
a pair's declared override of that base were planned at two addresses, and
both could move to the pair's own form: the bound row's body, which the read
serves nowhere today, became a served form. The read serves the override at
the base's address whenever a stored row seats it, so the planner now reads
the served pair's overrides there: the override is the served row, the bound
row folds behind it, and one move goes to the pair the override stands in.
Another pair's override of the same base stays at its own pair's address,
where the read serves it.

A row behind a removed form that is the served row at another address is no
longer listed or counted under the removal: the plan names it apart
(servedElsewhere) and the report says it is not removed with the form in
front of it.

The report's closing line sends the operator to the action printed for each
hold, since not every cause can be removed on this release. StoredFormDraft
is exported with the other census shapes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nKeNC91jfN3AY3HKz
…our summaries

ADR-0159 D7's destination bullet now says what D7-d decides where a row
bound to a base that ships no form of the name stands beside a pair's
declared override of it: the override's body is the one kept, in the pair it
stands in, and the bound row folds into it. The clause is marked as D7-d's,
not the ruling's, and the second-pair half as this record's reading.

The pair-form pin is a pin of its own and no longer a seventh fold fixture.
The two paragraphs beside question 4 and the Consequences bullet credit the
ruling of 2026-11-29 with the package-less row only, and no longer call the
kind a third. A stray clause in D7-c and a trailing semicolon are fixed.

The operations page says the start-up log line is the next major's, and that
a row behind a removed form which another package serves is not removed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nKeNC91jfN3AY3HKz
…ipped base

The module header said a pair's override is read at its base beside a bound
row. Where two pairs of one base each hold an override, only the pair the
read serves at the base is read there; the other keeps its own address. The
header now says so, as the function's own docblock and the planner do.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nKeNC91jfN3AY3HKz
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nKeNC91jfN3AY3HKz
2026-11-29T09:00Z · Final green head declared for L1 and L2: 4c8f7dbbbf4614af945cc88eb0786311910f3298.

Contract-review-claim: session_01FEkQ5nKeNC91jfN3AY3HKz · head 4c8f7db · 2026-11-29T09:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB

席位核对 — ACCEPT · L1-b · area o5-ux · Head-sha 4c8f7dbbbf4614af945cc88eb0786311910f3298 · 2026-11-29T09:05Z

Delta review of abacf146..4c8f7dbb (three commits, 7 files +290/−32), answering L2 FAIL 7252114084, at TIER_DEFAULT. The design reading against ADR-0159 D7 is the isolated L2 delta at CONTRACT_REVIEW_TIER, which the card thread runs on this head. I did not start one.

Checklist (l1-face --pr 38464 at 4c8f7db: 1 flag, read below)

  • Changeset flag: @objectstack/objectql and @objectstack/rest. Across the whole PR each moves by one test file only (protocol-stored-form-migration.test.ts, public-form-two-type-withdrawal.test.ts), and neither ships. No entry is owed, as L1-a, FAIL ② and my record 7252045790 read it.
  • Scope: all 7 delta files were already in the PR and are on the claim's File surface: (7251908983). Shape: open draft → main, Part of #37111, PR 1 of 2. Clause-②: yes · Metadata-protocol: none. The changeset is unchanged, still patch on @objectstack/metadata-protocol and @objectstack/cli. The one new export, the type StoredFormDraft, is a widening the changeset already covers ("StoredFormCensus and the shapes it names").
  • Gates at this head: 44 success, 17 expected skip, 0 failed, 0 pending, mergeable_state clean.
  • Tier H is unchanged: GOVERNED docs/adr/**, the security label, and a card total over 3,000 lines.

My readings of the delta, at this head

  • Each FAIL item has a code answer and a named test.
    • M3: pairServedAtUnshippedBase reads, at an unshipped base's address, the override the served-row order serves first, but only while a stored row is bound to that base. The bound row is rebound behind it. standsIn keeps the destination in the pair the override already stands in, so the ensure door is not asked. The planner tests cover the override switching off, carrying no link, and already stored as form: in each case it is one plan at the base's address, the bound row is behind, nothing is carried, and holds: []. A withdrawal in the bound row is carried, with newlyClosed: false. A pair holding both a view and a form override folds into one plan. The App's pair and an earlier per-package pair each hold one: only the served one is read at the base, and the other keeps its own address. The engine test reads the real protocol first: the override's body is served under the base and under the pair, and the bound body nowhere. It then plans one move, with no write (snapshot equal).
    • S6: servedAtAnother moves a row behind a removed form out of behind and into servedElsewhere, while alsoReadAt still names where it moves. The test has its control: with no second shipping package, the same row is behind and there is no servedElsewhere. The report's remove sentence says the row is not removed with the removed form.
    • S7: the closing line no longer tells the operator to remove every cause on this release.
    • N15: StoredFormDraft is exported from the index. That closes my item 2 of 7252045790.
    • N12: the operations page now puts the start-up log line on the next major's server. I checked this against the tree: readUnreadableFormBodies is D6 rule 7, which runs on main and the major and not on the pre-upgrade release, so the page sentence is now true. The changeset's "now names the command" describes that same code and stays true.
    • Ablations named, with positive controls and restore proven: pairServedAtUnshippedBase answering no pair turns the 7 M3 tests red, and servedAtAnother false turns S6 red. The run claimed is 45/45, matching green Test Core at this head.
  • The ADR, sentence by sentence.
    • The destination bullet's new clause is marked as D7-d's ("the ruling's words do not reach it"), and the second-pair half is marked as this record's reading, open to correction. It does not claim ruling 7250977204 for either.
    • The pair_form pin is lifted out of the fold list. It now also states the case where both rows hold one name.
    • The question 4 paragraphs and the Consequences bullet now credit the ruling of 2026-11-29 only for a package-less linked row, and call the other bindings this record's reading. That scope is narrower than before, not wider.
    • Two punctuation fixes.
  • The page, sentence by sentence. The new remove-row sentence ("unless another package serves that row") matches servedAtAnother. "Another package" is exact here, because a name that a package ships has no environment address.
  • Item 1 of 7252045790 (the earlier-pair pin through the real door) is on the body's PR 2 list as N13, so it is carried. The body also adds the M3 arrangement through both doors, before and after --apply, to PR 2.

Nit (no head move): the page's moves row still says "Older rows of the same form fold into it". Under M3 the row that folds is the one the order serves second, not necessarily the older one. This is pre-existing wording. Fold it into PR 2's page edit.

Owed before the hand-off: the same-head L2 delta PASS at CONTRACT_REVIEW_TIER (④ against 7252114084), run by the card thread, and the dogfood battery from the landing head. Then the seat hands off (Tier H). #37111 stays open with pm:dispatched for PR 2.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nKeNC91jfN3AY3HKz
2026-11-29T09:18Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4c8f7dbbbf4614af945cc88eb0786311910f3298
Local-runs: none
Scope: docs/adr/0159-forms-are-their-own-metadata-type-public-forms-are-form-items-view-is-lists-only.md + packages/metadata-protocol/src/protocol-stored-form-migration.ts, packages/metadata-protocol/src/protocol-form-reads.ts, packages/metadata-protocol/src/index.ts, packages/cli/src/commands/migrate/stored-forms.ts, content/docs/deployment/stored-forms-upgrade.mdx, packages/metadata-protocol/src/protocol-stored-form-migration.test.ts, packages/objectql/src/protocol-stored-form-migration.test.ts
Security-touching: yes
Rule-change-verified: none

PR #38464, Part of #37111, PR 1 of 2. This is the delta on Contract review FAIL 7252114084 (at abacf146), and a full round on the new head. Read for it: the card body and its 14 comments, the three ruling records 7249158572, 7250977204 and 7250982640 in full, the dev report 7253452776, the PR body, its 17 files, the net diff against merge base f459c863, the delta from abacf146 (three commits, 7 files), and the check-runs on the head. Code outside the diff was read to judge the diff, not reviewed. The rest of the diff (the CLI tests, the rest pin, the checklist item, cli.mdx, meta.json, the changeset, handwritten-docs.json) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on the head: 61 runs, 44 success, 17 skipped, none failed, none pending. Lint & Repo Gates, TypeScript Type Check, Test Core (all 12 shards), Build Core, Build Docs, Check Changeset, Governed Surface Queue Guard, Test UI, Live E2E UI and Dogfood Regression Gate are success. Lint UI, Type Check UI and Build & E2E UI are skipped.

① Derived judgments

  • The CLI command os migrate stored-forms keeps its flags and its exit rule. It still has no --apply. Right.
  • Its --json census changes in one place since abacf146: a remove plan gains the optional servedElsewhere, and its behind no longer holds a row another address serves. Nothing released reads it yet, so this is still one widening. Right.
  • @objectstack/metadata-protocol exports listStoredFormsOf and twelve StoredForm* types (StoredFormDraft is new). A widening. Right. The changeset's sentence "StoredFormCensus and the shapes it names" is now true. planStoredForms, listStoredForms, storedFormPairFix, INTERNAL_AHEAD_OF_LINKED_ROW, orderedFormRowsAt and storedFormPlaces stay off the package index. Right.
  • The accept set of the form read does not change. protocol-form-reads.ts is byte-equal to abacf146; servedFormHolding is the first row of orderedFormRowsAt. Right.
  • The start-up line for an unreadable body names the command. No behaviour changes. Right.
  • Nothing an author writes changes. No error code is added. Metadata-protocol: none is right.
  • The ADR gains one clause in D7's destination bullet, moves the pair_form pin out of the fold fixtures and extends it, and corrects three summaries. The clause adds a second reading of this record, marked where it stands. The summaries do not carry it: see S8.
  • Security: the ADR hunks, the page and the report teach which stored rows keep a public address closed, where a row may move, and which rows are never deleted. That is sharing behaviour the path name does not show. The line above reads yes. The PR already carries the security label.

② Semver level

The changeset is patch on @objectstack/metadata-protocol and @objectstack/cli. That matches what the diff publishes: a non-protocol widening ships patch (AGENTS.md, Post-Task 3). @objectstack/objectql and @objectstack/rest move by one test file each and ship dist only, so they owe no entry. Both declaration lines stand in the PR body and in the changeset. The Clause-②: line reads yes, and yes is right: a new command and new exports. Skills-docs: none is present and true.

③ Boundary flags

  • open_questions: the dev report 7253452776 carries none. The earlier ones are ruled (7249158572, 7250977204, 7250982640), and the code, the report, the page and D7 follow each ruling's words.
  • The declared deviation on M3 (two pairs of one base each holding an override): it holds against the tree and against D7-d. The reading is under ④. D7 marks it as this record's reading; the record's summaries do not name it: see S8.
  • The other declared deviations (no merge of main, the PR body PATCH, the reused worktree, the stale derivation, the shared object store, the stray files and probes, the tests not re-run): process, and the seat's. None changes the tree read here. protocol-form-reads.ts is unchanged since abacf146, and Test Core is green on the head.
  • security_findings: withheld in the dev report: with the owner seat. Not judged in this record.
  • The dev's out-of-scope 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): carried on the card for PR 2, with N14. A pair the door creates is writable, so no stored row reaches it today. The PR body's PR 2 list does not name it; the seat adds it there.
  • L1-b items (7252045790): item 2 is closed (StoredFormDraft is exported). Item 1 is N13, carried.
  • Owed by PR 2, as the PR body names them: the byte-equal pin for the pair_form move with N11's seed, the M3 arrangement through both doors, N4, N5, N11, N13 and N14. Accepted as carried.
  • The four surface differences (no method on protocol.ts, the engine test in packages/objectql, handwritten-docs.json, the ADR edit): accepted, as before.
  • The kernel reading: taken again on this head's tree with the card's git grep. It finds packages/platform-objects/CHANGELOG.md and packages/plugins/plugin-auth/CHANGELOG.md, and no source. The kernel hold is empty.
  • Pre-dispatch notes 1 and 2 (7155769725): note 1 stays closed (the unreadable refusal and the page follow D7-c). Note 2 is ruling 7249158572, carried.
  • SQL push-down: no finding. This round adds no read. The census still reads whole row sets by type (and state for drafts), because a container row's name is not the name its expansion writes.

④ Design judgment

The delta on FAIL 7252114084.

  • M3: closed. The reading in the tree:
    • pairServedAtUnshippedBase (lines 490 to 500) answers only when a stored row of the name is bound to the base. It asks orderedFormRowsAt at the base with no filter, which is the read's own order, and returns the pair of the first row when that row is the base's declared override.
    • planStoredForms (lines 595 to 612) then re-reads every override that pair holds at the name at the base's address. The override is the served row, the bound row is behind it, and the plan is one move to pair_form in the pair the override stands in (standsIn, line 681). A stored form override there is keep. The ensure door is not asked.
    • The premise holds in the code outside the diff. mergePackageAwareOverlay seats a slot for every package a stored row is bound to. At that slot the pair's override is tried first, and isServedOverrideRowOf does not ask whether the base ships the name. With no shipper of the name, the env-wide list keeps both slots. So the override's body is served under the base and under the pair, and the bound row's body under neither. The base's per-package layer still reads the bound row, so a withdrawal it holds is carried and is not newly closed.
    • Seven planner tests and one engine test over the real read pin it. The fixture and the D7 clause the earlier record asked for are both there.
  • S6: closed. A row behind a removed form that is the served row at another address (servedAtAnother, lines 648 to 649) is kept out of behind and named in servedElsewhere (lines 713 to 720). The report says it is not removed with the form in front of it, and alsoReadAt says what the other address does with it. The module header, the behind field and the page say the same. Pinned, with a control.
  • S7: closed. The closing line reads "The upgrade would not switch: N row(s) hold it. Each is listed above with the action for its cause." It no longer says every cause is removable on this release.
  • M1, M2, S1, S2, S3, S4: the closures hold on this head. The environment address is still added only when no stored row of the name is bound to a package (lines 630 to 631). removable still asks every address the row is read at (lines 705 to 706). A pair's stored view override of a base that ships the form still takes keptDestination without the door. behind still holds form rows only. A lone list over a shipped form is still left_in_place. The unreadable refusal still follows D7-c.
  • S5: the closure holds for the first reading. The second reading this head adds is S8.
  • N8: fixed. The pair_form pin is a pin of its own, and "six fixtures" heads six.
  • N9: fixed. The two paragraphs beside question 4 and the Consequences bullet credit the ruling with the package-less row, and this record's reading with any other linked row.
  • N10: fixed. D7-c's stray clause and the semicolon in TL;DR 10 are gone.
  • N11: carried to PR 2, named in the PR body. The D7 sentence is unchanged.
  • N12: fixed. The start-up line is the next major's server's.
  • N13: carried to PR 2, named in the PR body.
  • N14: carried to PR 2, named in the PR body.
  • N15: fixed. StoredFormDraft is exported.
  • N4 and N5 of the first record stay carried to PR 2, named in the PR body.

One item outside this record.

  • M4 (must-fix) — a security item is with the owner seat.

The declared deviation: an override in each of two pairs of one base.

  • The tree: servedOverlayRowCandidates tries the App's pair before the earlier per-package pair. At the base's slot the merge serves the first hit, the App's pair's override. The earlier pair's override seats its own pair's slot, and with no shipper of the name the env-wide list keeps that slot. So the second override is served today, at its own pair's address.
  • D7-d keeps the body the read serves today, and ruling 7250977204's reading asks that the address answer byte-equal. Folding the second override behind the first would remove a body the doors serve today. Reading it at its own pair's address keeps both bodies where they are served. The deviation is the reading D7-d supports.
  • The planner does that: only the pair pairServedAtUnshippedBase returns is re-read at the base, and the other pair keeps its own address and its own pair_form. The tests pin the two variants the earlier record named (the override in the App's pair, the override in an earlier per-package pair) and the two-pair case.
  • At a base that still ships the form, a second pair's override folds behind the first, as before. That differs for a reason: with one shipper the env-wide list drops the pair's slot, so the fold removes no body the doors serve. See N16 for the one flag it gets wrong.

The ADR (hits).

  • The four quotations are byte-equal to the ruling records, in D7 and under "Decided by".
  • Ruling 7249158572 is credited with the package-less row only, in D7-d, in the "Not counted" sentence, in the Status line, in TL;DR 10, in both paragraphs beside question 4 and in Consequences. The wider predicate is marked as this record's reading. INTERNAL_AHEAD_OF_LINKED_ROW.applies is as wide as the bullet.
  • D7-c agrees with ruling 7250982640: the class is unchanged, and the text says no command on this release clears the earlier pair. The drafts bullet agrees with the same record and with the code.
  • The new clause in the destination bullet agrees with the tree, sentence by sentence: D7-d decides, the override's body is kept as the own form item of the pair it stands in, the bound row folds into it, the door is not asked, and a second pair's override keeps its own pair's address.
  • S8 (should-fix) — the record's summaries do not carry the reading this head adds. D7's destination bullet now ends "this record's reading, open to correction", for the second pair's override. The Status line still says "One reading of this record stands beside them, marked where it stands and named in TL;DR 10". TL;DR 10 still lists six points for the approver to accept or strike, and this one is not among them, so the list does not say what striking it does. D7-d still says "Only that reading is still open to correction". This is the same gap S5 named for the first reading. Name the second reading in the Status line and in TL;DR 10, with what striking it sends back; or state in D7 that it follows from D7-d and drop "open to correction".

protocol-stored-form-migration.ts against D7 and the rulings.

  • These readings hold on this head. The three-part internal test reads the link on or off (D7-a), reads the base at each address the row is read at (D7-b), and never removes a form row. A folded row carries a withdrawal and nothing else, to the kept body's own address. A hold repeats the door's refusal and classes its cause as D7-c lists them; the earlier pair's action says no command clears it. hold and left_in_place write nothing. Drafts are old-shape view rows only.

stored-forms.ts (CLI). It agrees with its docblock and with the census: read-only boot, exit 0 whenever the census ran, canSwitch in --json. The remove sentence and the closing line are the two changed this round, and both follow the census.

protocol-form-reads.ts, index.ts. Agree. The first is unchanged since abacf146. The second adds one type export.

stored-forms-upgrade.mdx. The two sentences changed this round agree with the code: a row behind a removed form goes with it unless another package serves it, and the start-up line belongs to the next major's server. The clearing table is true at this head.

The two pin files. They hold what they assert. The M3 tests seed the override switching the form off, carrying no link, and already a form row; a withdrawal in the bound row; a view and a form override in one pair; and both two-pair variants. The S6 test has its control. The engine test asserts the real read before it asserts the plan, and that the store is unchanged.

Nits.

  • N16 (nit): at a base that ships the form, a second pair's override that withdraws the form folds behind the first with newlyClosed: true. That pair's own per-package layer reads the row today, so the form is closed today and the report's "is open today" is not so. Same family as N4; PR 2 can take it with N4.
  • N17 (nit), ADR pins: the pair_form pin names one ablation, the destination. That ablation does not turn the "together at one name" half red. That half needs its own: the read of the override at the base's address.

Implemented-by: claude/project-thread-zmwgyw
Reviewed-by: session_01FEkQ5nKeNC91jfN3AY3HKz

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

2026-11-29T14:53Z · Closed as superseded by PR #38613 (same claim on #37111). The review records stay the base: contract review 7253682863.

Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… precheck of stored forms (objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#38661** (「A 拦住升级·同类全覆盖」, ruling record
[7265816895](objectstack-ai#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](objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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](objectstack-ai#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 objectstack-ai#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation security size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants