Skip to content

Commit 6a01e80

Browse files
committed
docs(metadata-protocol): upgrade, preview, apply; name every disposition and its step
The ADR-0087 entry and the changeset prescribe the order the release-timing ruling sets (upgrade, then the ceremony's preview with the deployment's boot flags, then --apply), state the window between the upgrade and --apply, name the five dispositions with the operator's step for each, and take "the preview lists no movable row" as the criterion. The refusal's rollback sentence names the door that restores a pre-move version (a declared save into the pair), and the skill paragraph names the ceremony and the refused package-less save, reset and rollback of a movable row. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5ni5yjiTswP6crgAkX
1 parent d71dd76 commit 6a01e80

7 files changed

Lines changed: 99 additions & 52 deletions

File tree

‎.changeset/28576-packageless-overlay-write-closed.md‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@
55
'@object-ui/app-shell': patch
66
---
77

8-
fix(metadata-protocol)!: a write naming no package onto an installed package's view, dashboard, report, translation or email template is refused, naming the base's `.custom` pair and `os migrate packageless-overlays`
8+
fix(metadata-protocol)!: a write naming no package onto an installed package's view, dashboard, report, translation or email template is refused where `os migrate packageless-overlays` can move its row, naming the base's `.custom` pair and the command
99

10-
Clause-②: yes (narrowing) — the metadata save, publish, delete and rollback doors refuse a write that names no package onto an item of the five overlay types an installed read-only package ships, which they accepted before as a package-unbound Setup row. Nothing is widened.
10+
Clause-②: yes (narrowing) — the metadata save, publish, delete and rollback doors refuse a write that names no package onto an item of the five overlay types that one installed read-only package ships, where the ceremony would classify the row (or the first write's body) `movable` and its move can succeed; they accepted it before as a package-unbound Setup row. Every row the ceremony lists and does not move keeps that write. Nothing is widened.
1111

12-
Metadata-protocol: narrowed (the `allowEnvironmentOverlay` flag of `view`, `dashboard`, `report`, `translation` and `email_template` no longer opens a package-less write onto a packaged item; it stays the predicate the migration ceremony and the read of an unmigrated row use)
12+
Metadata-protocol: narrowed (the `allowEnvironmentOverlay` flag of `view`, `dashboard`, `report`, `translation` and `email_template` no longer opens a package-less write onto a packaged item the ceremony can move; it stays the predicate the migration ceremony, the read of an unmigrated row and every row the ceremony leaves use)
1313

14-
Skills-docs: updated here — `skills/objectstack-platform/SKILL.md`'s ADR-0146 paragraph said "a package-unbound Setup row still wins over the base's until D11"; it now says such a row from before D11 wins until migrated and that D11 refuses new ones. The same paragraph drops "the base's is unchanged" after the export sentence, which "replaces the base's document whole" already implies, to stay under the bundle's token ceiling.
14+
Skills-docs: updated here — `skills/objectstack-platform/SKILL.md`'s ADR-0146 paragraph said "a package-unbound Setup row still wins over the base's until D11"; it now says such a row from before D11 wins over the base's until `os migrate packageless-overlays` moves it, and that its package-less save, reset and rollback are refused once the command can move it. To stay under the bundle's token ceiling, the same paragraph drops "the base's is unchanged" after the export sentence (which "replaces the base's document whole" already implies) and the aside that the other overridable types wait for their doors (the sentence already names the six types the read honours today).
1515

1616
<!-- adr-0087: registered packageless-overlay-write-closed -->
1717

1818
**BREAKING** write narrowing at the metadata doors (`@objectstack/metadata-protocol`), shipped as `minor` during the launch window.
1919

20-
**Run the ceremony before you upgrade.** On each deployment with Setup customizations of a package's items, run `os migrate packageless-overlays` (preview), then `os migrate packageless-overlays --apply`, on the release before this one (#28413 shipped the command). If you upgrade first, nothing breaks at the upgrade: every customization is still served as before. But each of them becomes read-only in Setup until the command moves it, because its package-less save, reset, publish and rollback are refused.
20+
**Upgrade, then run the ceremony.** The command ships in this release. On each deployment with Setup customizations of a package's items, upgrade, run `os migrate packageless-overlays` (preview) with the flags and environment the deployment boots with (`--preset` and `--dev` mean what they mean to `os serve`), then `os migrate packageless-overlays --apply`. Nothing breaks at the upgrade: between the upgrade and `--apply`, every customization is served as before, and the package-less save, reset, publish and rollback of one the command can move are refused, naming the command. Done when the preview lists no movable row.
21+
22+
The preview lists five dispositions; only `movable` rows are moved, and every other row keeps its package-less write:
23+
24+
- `movable`: `--apply` moves it into the pair. A move that ends `failed` keeps the row as it was; fix what the error names and re-run.
25+
- `multi_shipped` (several packages ship the name): delete it naming no package, then save it into the pair of the package it customizes if it is still wanted.
26+
- `no_pair` (the base's id forms no pair): nothing to do.
27+
- `foreign_declaration` (its `overrides` names another package): correct or remove the key with a save naming no package, then re-run.
28+
- `shadowed` (the pair already holds the item, and that row is served): nothing to do to keep the pair's; or restore the package original (`DELETE …?package=<base>.custom`) and re-run to move this one.
2129

2230
### Migration: FROM → TO
2331

@@ -37,8 +45,8 @@ PUT /api/v1/meta/view/account_list?package=com.acme.crm.custom
3745

3846
To restore the package original, FROM `DELETE /api/v1/meta/view/account_list` TO `DELETE /api/v1/meta/view/account_list?package=com.acme.crm.custom`. `basedOn` is the base's installed `manifest.version`. The pair is created by `os migrate packageless-overlays --apply`, or by Studio's Customize.
3947

40-
- **Now refused.** A save (draft or publish mode), a publish, a delete of the active item, or a rollback whose restored row is package-less, with no `?package=` (or an empty one), of a `view`, `dashboard`, `report`, `translation` or `email_template` that an installed read-only package ships. Each answers `403 NOT_OVERRIDABLE`, writes nothing, and its message names the item, the shipping package, the pair (`?package=<base>.custom`), the `overrides` declaration and `os migrate packageless-overlays`. Setup's form save and reset show that message as sent. The refusal comes before every gate that reads a stored row, so it is the same with or without `overrides` in the body.
41-
- **Still open.** Every write naming `?package=<base>.custom` (the pair's save, publish, delete and rollback, judged by the override write gate as before); a rollback of the pair's own declared row, which is judged as the pair's override; a write of a name no installed package ships (environment metadata); a write of a name whose only shipping packages have ids no `.custom` pair can be formed from (the ceremony lists those rows `no_pair` and cannot move them, so their write is not closed); and discarding a draft.
48+
- **Now refused.** A save (draft or publish mode), a publish, a delete of the active item, or a rollback whose restored row is package-less, with no `?package=` (or an empty one), of a `view`, `dashboard`, `report`, `translation` or `email_template` that exactly one installed read-only package ships, where the item's stored package-less row in that state (or, with none, the saved body) is one the ceremony classifies `movable`, the pair can be ensured (the base has a namespace and a SemVer version), and the override write gate admits that row into the pair. This covers an unmigrated `movable` row, and the first package-less write of an item the pair already holds (a moved one). Each answers `403 NOT_OVERRIDABLE`, writes nothing, and its message names the item, the shipping package, the pair (`?package=<base>.custom`), the `overrides` declaration and `os migrate packageless-overlays`; a rollback's message says to save a version from before the move into the pair, declaring it. The metadata item page shows that message as sent when its URL holds no `?package=`. The refusal comes before every gate that reads a stored row's lock, so it is the same with or without `overrides` in the body.
49+
- **Still open.** Every write naming `?package=<base>.custom` (the pair's save, publish, delete and rollback, judged by the override write gate as before); a rollback of the pair's own declared row, which is judged as the pair's override; a write of a name no installed package ships (environment metadata); and every package-less write the ceremony would not move, as before this release: a name several read-only packages ship (`multi_shipped`); a base whose id forms no pair (`no_pair`); a base whose pair cannot be ensured (no namespace, or a version that is not SemVer); a stored package-less row whose `overrides` names another package (`foreign_declaration`) or beside the pair's row of the item (`shadowed`; its package-less writes are addressed to the pair's row as before, so its package-less delete restores the package original); and an `email_template` locale the base does not ship (the pair refuses it, #28777; the ceremony's move of it is #28904). Discarding a draft stays open.
4250
- **Unchanged.** A package-less row stored before this release is still served exactly as before, by every read. The ceremony still moves it: it writes into the pair, never package-less.
4351
- **Studio.** The read-only item notice no longer links to the package-less Setup overlay (`@object-ui/app-shell`).
4452
- **Removed with it.** #28413's interim allowance, by which a package-less save that landed on a moved row kept that row's `overrides` block, is gone: such a save is refused like any other.

‎packages/metadata-protocol/src/protocol-packaged-base-refusal.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ export function packagelessOverlayWriteRefusal(
245245
const shipped = `ships in '${closed.base}'`;
246246
const pair = `'${closed.pair}' (?package=${closed.pair})`;
247247
const declared = `overrides: { package: '${closed.base}', basedOn }`;
248-
const rule = 'A write naming no package onto a packaged item is closed (ADR-0146 D11); '
249-
+ 'a package-less customization stored before it is still served until '
250-
+ `\`os migrate packageless-overlays\` moves it into '${closed.pair}'.`;
248+
const rule = 'A write naming no package is closed where `os migrate packageless-overlays` can move its row '
249+
+ `(ADR-0146 D11); a package-less row stored before it is served until that command moves it into '${closed.pair}'.`;
251250
const message = operation === 'rollback'
252251
? `${item} ${shipped}, and a rollback of its package-less row is closed (ADR-0146 D11): run `
253-
+ `\`os migrate packageless-overlays\` to move the row into ${pair}, then roll it back there.`
252+
+ `\`os migrate packageless-overlays\` to move the row into ${pair}; to restore a version from before `
253+
+ `the move, save that version's body there, declaring ${declared}.`
254254
: operation === 'delete'
255255
? `${item} ${shipped}: remove its customization from ${pair}. ${rule}`
256256
: `${item} ${shipped}: ${operation === 'publish' ? 'publish' : 'save'} it into ${pair}, declaring ${declared}. ${rule}`;

‎packages/metadata-protocol/src/protocol.ts‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21575,14 +21575,18 @@ export class ObjectStackProtocolImplementation implements
2157521575
//
2157621576
// [ADR-0146 D11] …and AHEAD of it, the package-less write onto a
2157721577
// packaged item, closed: an authoring save naming no package, of an
21578-
// item a code package ships, on one of the five overlay types, is
21579-
// refused naming the base's paired `.custom` and `os migrate
21580-
// packageless-overlays` ({@link packagelessOverlayWriteRefusal}). Ahead
21581-
// of the gate so the writer reads that fix, not the gate's "a row
21582-
// bound to no package carries `overrides`… rename" for the body Setup
21583-
// sends as it read it. Every other type's packaged item is sealed
21584-
// further down ({@link refusePackagedBaseOverride}). Registry reads
21585-
// only: #5706's lock gate stays the first store reader. The
21578+
// item a code package ships, on one of the five overlay types, whose
21579+
// row `os migrate packageless-overlays` would move (#28576 ruling 2:
21580+
// every row it leaves keeps this write), is refused naming the base's
21581+
// paired `.custom` and the ceremony
21582+
// ({@link packagelessOverlayWriteRefusal}). Ahead of the gate so the
21583+
// writer reads that fix, not the gate's "a row bound to no package
21584+
// carries `overrides`… rename" for the body Setup sends as it read
21585+
// it. Every other type's packaged item is sealed further down
21586+
// ({@link refusePackagedBaseOverride}). Registry reads first: the
21587+
// close's one store read (the item's rows) happens only for a name
21588+
// one read-only package ships with an ensurable pair, so #5706's lock
21589+
// gate stays the first store reader of every other name. The
2158621590
// server-stated rewrites (`source` set, `package-duplicate`) name the
2158721591
// row they rewrite and are not asked.
2158821592
//
@@ -29188,11 +29192,11 @@ export class ObjectStackProtocolImplementation implements
2918829192
// [ADR-0146 D11] The package-less removal of a packaged item's active
2918929193
// row, closed with the package-less write
2919029194
// ({@link packagelessOverlayWriteRefusal}): a delete naming no package,
29191-
// of an item a code package ships, on one of the five overlay types
29192-
// (Setup's "Reset overlay"). Its customization lives in the base's
29193-
// paired `.custom`, and `?package=<base>.custom` removes it there. On
29194-
// every topology, as the save door's is, and ahead of the `_lock`
29195-
// gate's store read.
29195+
// of an item a code package ships, on one of the five overlay types,
29196+
// whose row the ceremony would move (Setup's "Reset overlay"). Its
29197+
// customization lives in the base's paired `.custom` once moved, and
29198+
// `?package=<base>.custom` removes it there. On every topology, as
29199+
// the save door's is, and ahead of the `_lock` gate's store read.
2919629200
//
2919729201
// ⛔ Not a draft discard: it changes nothing any read serves, and it is
2919829202
// how a package-less draft stored before the close is cleared (the

‎packages/objectql/src/protocol-packageless-overlay-migration.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,28 @@ describe('[#28576] after the close: a package-less write onto a packaged item is
480480
expect(rows(VIEW)).toEqual([[PAIR, 'active']]);
481481
});
482482

483+
it('the rollback refusal\'s remedy holds: after the move, a version from before it is restored by saving its body into the pair, declaring the override', async () => {
484+
const { protocol, rows, rowOf } = await boot();
485+
await legacyRowWithHistory(protocol);
486+
const refused = await refusalOf((protocol as any).rollbackMetaItem({ type: 'view', name: VIEW, toVersion: 1 }));
487+
expectClosed(refused);
488+
expect(refused!.message).toContain("save that version's body there");
489+
expect((await migrate(protocol)).outcomes.map((o: any) => o.outcome)).toEqual(['moved']);
490+
// A rollback to that version in the pair restores an undeclared body,
491+
// which the override write gate refuses (D2), not the close…
492+
const inPair = await refusalOf((protocol as any).rollbackMetaItem({ type: 'view', name: VIEW, toVersion: 1 }));
493+
expect(inPair?.message).toContain('declares no override');
494+
expect(inPair?.message).not.toContain('os migrate packageless-overlays');
495+
// …so the sentence prescribes the save into the pair, which succeeds.
496+
await protocol.saveMetaItem({
497+
type: 'view', name: VIEW, packageId: PAIR,
498+
item: { ...listBody(VIEW, 'showcase_task', UNBOUND_COLUMNS), overrides: { package: BASE, basedOn: '1.2.0' } },
499+
} as any);
500+
expect(rows(VIEW)).toEqual([[PAIR, 'active']]);
501+
expect(isServedOverrideRowOf(rowOf(VIEW, PAIR) as any, BASE)).toBe(true);
502+
expect(columnsOf(await read(protocol))).toEqual(UNBOUND_COLUMNS);
503+
});
504+
483505
it('a rollback of the pair\'s own declared row is the pair\'s declared override, never an artifact override (a page)', async () => {
484506
const { engine, protocol, stores } = await boot();
485507
engine.registerApp({ id: BASE, name: 'showcase', version: '1.2.0', namespace: 'showcase', pages: [pageBody(PAGE, 'Home')] } as any);

0 commit comments

Comments
 (0)