Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
215ad5a
feat(cli): os migrate stored-forms, the read-only census and precheck…
claude Nov 29, 2026
71cfe87
feat(metadata-protocol): record the maintainer's ruling on an interna…
claude Nov 29, 2026
4ee5369
fix(cli): keep the census beside the protocol facade
claude Nov 29, 2026
abe9109
docs(adr): attribute only the package-less case to the ruling
claude Nov 29, 2026
736ecd0
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 29, 2026
1369ff3
test(cli): declare os migrate stored-forms in the bootSchemaStack family
claude Nov 29, 2026
abacf14
fix(metadata-protocol): plan stored forms per row, and fold in three …
claude Nov 29, 2026
2331963
fix(metadata-protocol): read a pair's override at its unshipped base …
claude Nov 29, 2026
7994f27
docs(adr): state the override beside a bound row in D7, and correct f…
claude Nov 29, 2026
4c8f7db
docs(metadata-protocol): say which pair's override is read at an unsh…
claude Nov 29, 2026
84de858
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 29, 2026
3813f82
fix(metadata-protocol): the stored-form planner follows ADR-0159 D7 a…
claude Nov 29, 2026
2721dd5
fix(metadata-protocol): the stored-form planner reads a row at every …
claude Nov 29, 2026
0b861b3
test(objectql): the census over the real read for a row served at ano…
claude Nov 29, 2026
f02aab9
fix(metadata-protocol): the stored-form planner reads a row where the…
claude Nov 29, 2026
6fa9621
refactor(metadata-protocol): drop a clause the stored-form planner ca…
claude Nov 29, 2026
793f668
docs(adr-0159): D7 states the reach of ruling record 7250977204 in on…
claude Nov 29, 2026
7c786fd
fix(metadata-protocol): the stored-form planner reads a container's m…
claude Nov 29, 2026
04ffc85
docs(adr-0159): D7 and its pin say only what holds for a row served a…
claude Nov 29, 2026
9b318da
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 30, 2026
8a38a0b
fix(metadata-protocol): the stored-form check folds a row behind the …
claude Nov 30, 2026
e6c4880
docs(changeset): the stored-forms census names the contested pair slo…
claude Nov 30, 2026
79126e6
docs(adr): ADR-0159 D7 records the hold for a pair slot more than one…
claude Nov 30, 2026
dcb87dc
docs(adr): ADR-0159 D7's per-row deletion sentence names the hold bes…
claude Nov 30, 2026
a909cc2
fix(metadata-protocol): a row the read serves at two addresses of one…
claude Nov 30, 2026
d58359a
docs(adr): ADR-0159 dates the 2026-11-30 revision and states the hold…
claude Nov 30, 2026
34aaf95
fix(metadata-protocol): the two-address hold reads a base's App where…
claude Nov 30, 2026
5d073e6
fix(metadata-protocol): a row one address would remove and another se…
claude Nov 30, 2026
e956a57
docs(adr): ADR-0159 D7 says a removal asks every address that serves …
claude Nov 30, 2026
379a62b
fix(metadata-protocol): a row served at several addresses moves or go…
claude Nov 30, 2026
7294c1d
fix(metadata-protocol): the hold of a row served at packages of sever…
claude Nov 30, 2026
2871ae2
docs(adr): ADR-0159 D7 states the hold per stored row, over every add…
claude Nov 30, 2026
4d69b3f
fix(metadata-protocol): the pair's own row claims its slot, a held ro…
claude Nov 30, 2026
76581c1
docs(adr): ADR-0159 D7 takes the pair's own claim, the waiting hold a…
claude Nov 30, 2026
2484041
fix(metadata-protocol): a slot names its exit only for one row alone …
claude Nov 30, 2026
622c806
docs(adr): ADR-0159 D7 bounds the measured exit to a slot no other ro…
claude Nov 30, 2026
7e825b6
fix(metadata-protocol): the linked row behind an internal form left i…
claude Nov 30, 2026
53ddab6
docs(adr): ADR-0159 D7 marks the row kept behind a left-in-place form…
claude Nov 30, 2026
dd1ab29
fix(metadata-protocol): a row waits only on a hold taken for itself, …
claude Nov 30, 2026
91ab3f3
fix(metadata-protocol): a row kept beside an internal form left in pl…
claude Nov 30, 2026
de6086d
docs(adr): ADR-0159 D7 states the kept rows row-wide and drops the un…
claude Nov 30, 2026
944aa67
fix(metadata-protocol): the kept-row hold's action names the addresse…
claude Nov 30, 2026
24ab30a
docs(adr): ADR-0159 states the row-wide keeping wherever the seat's s…
claude Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/37111-stored-forms-census.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@objectstack/metadata-protocol': patch
'@objectstack/cli': patch
---

feat(cli): `os migrate stored-forms`, the read-only census and precheck of the stored-form ceremony (ADR-0159 D7)

Clause-②: yes
Metadata-protocol: none

The next protocol major stops reading the three old shapes of a form (a view container's `form`, a `formViews` entry, a `viewKind: 'form'` item). Its upgrade command moves the stored rows that still hold one, in the same run that switches to the major, all or nothing. `os migrate stored-forms` shows that outcome before the upgrade and writes nothing: for each form name at each package that can serve it, whether the row is kept, moved (into the base's paired `.custom` package as a declared override, into a writable package's own form row, or into the environment), folded into the served row, removed as an internal record form, or left in place; and whether the upgrade can switch, naming each row that holds it (its pair cannot be ensured, its form content cannot be read, or one slot of a paired `.custom` package is claimed by more than one move) with the action for its cause. A row bound to a read-only package that ships no form of its name moves into that package's paired `.custom` package as a form of its own. Old-shape drafts are listed: they are neither moved nor deleted, and cannot be published after the upgrade. A row read at several packages is named at each, and is removed only where it is an internal record form at every one of them; read at two packages of one App that would both move it, it holds the upgrade, since the App's `.custom` package holds one row of a form's name (as does a row that package already holds of the name, beside a row planned into it); read at several packages, of one App or several, that would not all move it or all remove it, it holds the upgrade at each of them; a row with a public link behind an internal form left in place holds the upgrade where another package would move it, and neither row is folded, moved or removed at any package (a plan that would do so holds); and a row that holds is folded into no other row. A withdrawal a folded row carries that no layer reads today is named newly closed.

`listStoredFormsOf(protocol)` answers the census over a protocol instance; it and its types are exported (`StoredFormCensus` and the shapes it names). The start-up message for a stored view whose form content cannot be read now names the command. `orderedFormRowsAt` is the served-row order the effective `form` read already used, now read by the census too; the read serves what it served.

The operations page is `content/docs/deployment/stored-forms-upgrade.mdx`.
2 changes: 2 additions & 0 deletions content/docs/deployment/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ written.
| `os migrate security-catalog-overlays --apply` | **Refuses** likewise — it deletes `sys_metadata` rows, and a live process saving metadata is exactly the collision |
| `os migrate packageless-overlays --apply` | **Refuses** likewise — it moves `sys_metadata` rows into each base's pair |
| `os migrate stored-references bind` | **Refuses** likewise — it writes one row's package column |
| `os migrate stored-forms` | Warns and continues — it is read-only |

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

Expand Down
1 change: 1 addition & 0 deletions content/docs/deployment/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"backup-restore",
"tenancy-modes",
"seed-tenancy-repair",
"stored-forms-upgrade",
"single-project-mode",
"marketplace-handbook",
"publish-and-preview",
Expand Down
94 changes: 94 additions & 0 deletions content/docs/deployment/stored-forms-upgrade.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: Check stored forms before the next major
navTitle: Stored Forms Check
description: What `os migrate stored-forms` reports about the forms your database still stores as views, what the upgrade to the next protocol major will do with each, and how to clear a row that holds the upgrade.
---

A form used to be stored as a view: a view container's `form`, a `formViews`
entry, or a view item with `viewKind: 'form'`. Forms are now their own
metadata type, and the next protocol major stops reading those three shapes.
Whatever your database still stores in them is moved by the major's upgrade
command, in the same run that switches to the major. The move and the switch
are all or nothing: if one stored row cannot be moved, the upgrade does not
switch, and the deployment stays on the release it is running.

`os migrate stored-forms` shows you that outcome before you upgrade. It writes
nothing, and it has no `--apply`: the move is reached only from the upgrade
command.

```bash
os migrate stored-forms
os migrate stored-forms --json
```

It composes the deployment the way `os serve` does, so pass the `--preset`
and `--dev` flags the deployment boots with, and `--database-url` (or
`$OS_DATABASE_URL`) for the database. The boot is read-only. The command exits
`0` whenever the check ran; `canSwitch` in the `--json` output says whether
the upgrade would switch.

## What it reports, per form

A form is reported at each package that can serve it: a read-only package
that ships it (an installed app, or a package your code provides), a writable
package of your own, or the environment itself when no package ships it.

| Outcome | What the upgrade does |
|---|---|
| **kept** | The form is already stored as a form. Older rows of the same form fold into it. |
| **moves** | The row moves to a form row, with its body as written: into the package's paired `.custom` package as a declared override for a read-only package, into the package itself for a writable one, or into the environment. An override already stored in a `.custom` package keeps its package and the version it is based on. A row bound to a read-only package that ships no form of that name, or an override of a package that ships none, moves into that package's `.custom` package as a form of its own, with no override declared; its public address answers as it does today. Where the server today serves such a row at one other package's address, it moves as a row of that package does, into that package's `.custom` package as a declared override. Older rows of the same form fold into it. |
| **will be removed** | The row is an internal record form: a create or edit form with no public link that no action opens, over nothing that has a link. New and Edit follow the object's field groups instead, and the report says whether the object declares any. A row bound to no package is read at every package that ships its form: it is removed only when it is an internal record form at each of them, and moves at each of them otherwise. An older row behind the removed one goes with it, unless another package serves that row: the report then names it as not removed, with what happens to it there. |
| **left in place** | Nothing moves. The row served for the name carries no form (a list stored over it, alone or with older form rows behind it), or an internal record form is served ahead of a row with a public link and is not removed because of it. Every row of the name stays as stored, and the address keeps answering as it does today. Where another package serves that row with a public link and would move it, the row holds the upgrade at every one of those packages instead: both rows stay. Both rows stay as stored at every other package too: where either stands behind a row another package would move or remove, that move or removal holds the upgrade instead of folding or removing it. When the row served is one whose form content cannot be read, the form waits on that row, which holds the upgrade (below). |
| **holds the upgrade** | The row cannot be moved. The report repeats the reason and the action. |

A list stored behind the row served for a form is not part of it: the upgrade
leaves it as stored, and the report says so. When a row is read at more than
one package, the report names it at each. Where the server today serves one
row at two packages' addresses of one app that would both move it, or two
rows would move into one slot of the app's `.custom` package (a row the
`.custom` package already holds of that name among them), each such row
holds the upgrade: a
`.custom` package holds one row of a form's name, so neither address can be
given a destination. Where the server serves one row at several packages,
of one app or of several, and those packages would not all move it or all
remove it (one moves or removes it, another leaves it in place or holds),
the row holds the upgrade at each of them too: moving or removing a row
takes it from every package that serves it. Nothing moves, and every
address keeps answering as it does today. The row is named once, with every
address it is read at. A row every package that serves it would remove is
removed, and one every package leaves in place is left in place. A row that
holds the upgrade is not folded into another row: where it stands behind a
row that moves, the report names it apart.

When several rows of one form are stored (an override in the `.custom`
package, a row bound to the package, a row bound to no package), the body
kept is the one served today. A folded row carries one thing: if it switched
the form off (its link kept, `enabled` or `allowAnonymous` set to `false`), the
kept form keeps its link and is switched off too. When the folded row was one
that nothing reads today, that closes a form that is open today. The report
marks it **NEWLY CLOSED**, with the kept form's address. Switch it on again in Setup after
the upgrade if it should stay open.

A row that declares a public link, or that stands over a form that declares
one, is never offered for deletion. Deleting such a row would open a form
that is closed today.

## Clearing a row that holds the upgrade

| Cause | Who can clear it | What to do |
|---|---|---|
| The paired `.custom` package cannot be created: another package sits under its id or holds its namespace, or the app that carries the package is not installed | The administrator | Make the fix the quoted refusal names on the release you are running, then run the check again. |
| A `.custom` package an earlier version created for one package of the app holds the namespace | No one, on this release | The row holds the upgrade until that package is re-identified as the app's `.custom` package (ADR-0146 D3, merge question 12), and no command on this release does that. The row keeps working as it does today meanwhile. |
| The app declares no namespace, or an invalid one; its version is not SemVer; or the package belongs to several apps and its namespace picks none | The app's author | The deployment stays on the release it is running until the app ships a version without the cause. The row keeps working as it does today meanwhile. |
| The package is a kernel package, which has no `.custom` package in this version | The platform maintainers | Report it before upgrading. |
| Two rows would land in one slot of an app's `.custom` package, or one row that several packages serve would not be treated alike by all of them | No one, on this release | No exit from it was measured: the deployment stays on the release it is running, and every address keeps answering as it does today. Where the row is read at two packages of one app that would both move it, the app shipping the form from one of those packages only lets it be read at that package alone. Where the row waits on another hold of its own, it takes that hold's row above. |
| The stored view's form content cannot be read | The administrator | Save the view again with its form content repaired (a `form` or `formViews` entry that is an object), then run the check again. On the release you are running, both public doors answer for the row as they do today. On the next major its links close, and that server's start-up log names each such row and points to this command. |

## Also listed

- **Drafts**: a draft view with form content in an old shape is neither moved
nor deleted. After the upgrade it cannot be published, so publish the drafts
you want to keep before upgrading. A form that moves names its draft, which
stays behind as stored.
- **Shared addresses**: a public address that two form names declare, such as
a retired form and the one that replaced it.
Loading
Loading