You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 61d7ebc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(metadata-protocol,runtime): the move-in door judges each item's type, calls no door on a dry run, and puts the process back when a move stops (#38150)
- Each selected item's type is judged as a write of that type before
anything is read or written (403 with its code), and a selected
knowledge source is admitted for its new author as its save admits one.
- A dry run answers the judgement made before any door runs and calls no
door.
- After a rollback or an undo, the registry, the mutation projector and the
mutation signal run again at both addresses, so a refused move leaves
every item served loose, as before.
- An undo that fails answers a 500 naming the items that did not go back.
A failure that is not a refusal, or a failed package commit, answers a
500 fault; a door's refusal keeps its code and sentence, filtered as the
publish door filters them, and one with no code is MOVE_FAILED.
- Each delete names the version the judgement read, so a save in between
answers METADATA_CONFLICT.
- client.packages.moveIn documents and tests that a refusal rejects with
the code and the whole answer in details.
Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/38150-move-into-package-door.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,11 @@ What a move does:
18
18
- The target is judged by the save door's own predicates: an uninstalled package is refused `422 WRITABLE_PACKAGE_REQUIRED`, and a package the deployment ships is refused as every package write door refuses it.
19
19
- An object is judged against the target by the save door's object judges: the namespace prefix (`NAMESPACE_PREFIX`), the namespace clash (`NAMESPACE_CONFLICT`), the package that owns the name (`OBJECT_OVERLAY_PACKAGE_MISMATCH`) and the `__c` reservation.
20
20
- The selection is judged as a set (ADR-0150 D3 (a)): a moved item that names a loose item of a package-scoped type the selection leaves behind is refused `REFERENCE_LEFT_BEHIND`, with the names in `references`.
21
-
- Then every item goes through the delete door (storage kept) and the save door into the target, so every other save-door judge runs too, and each type writes through to the registry at once: a moved flow and dataset are read at the package's address with no restart. Items other than objects and the package commit (`operation: 'apply'`) run in one transaction. Objects move just before it, outside it, because an object's save syncs its storage, and that DDL waits forever on the lock a SQLite transaction holds. A later refusal undoes them.
22
-
- Whole or nothing: any refusal answers `422` with the first item's code in `error.code` and the whole answer (`outcome: 'refused'`, every item's refusal) in `error.details`. Nothing is written.
23
-
-`dryRun: true` answers `outcome: 'would_move'` with what each item's addresses become, and writes nothing.
21
+
- Each selected item's type is judged as a write of that type: moving a `datasource` needs the platform-settings capability and moving a `knowledge_source` needs the knowledge-source capability and passes that source's own admission, as saving one does (`403`).
22
+
- Then every item goes through the delete door (storage kept, naming the version the judgement read, so a save in between answers `409 METADATA_CONFLICT`) and the save door into the target, so every other save-door judge runs too, and each type writes through to the registry at once: a moved flow and dataset are read at the package's address with no restart. Items other than objects and the package commit (`operation: 'apply'`) run in one transaction. Objects move just before it, outside it, because an object's save syncs its storage, and that DDL waits forever on the lock a SQLite transaction holds. A later refusal undoes them.
23
+
- Whole or nothing: any refusal answers `422` with the first item's code in `error.code` and the whole answer (`outcome: 'refused'`, every item's refusal) in `error.details`. What had moved is moved back, with the registry and the mutation signal replayed at both addresses, so every item is loose and resolves as before. A failure that is not a refusal answers `500`, every item loose as before; if moving an item back fails, the `500` names the items that did not go back.
24
+
-`dryRun: true` answers `outcome: 'would_move'` with what each item's addresses become from the judgement made before any door runs (loose, target, the object judges, the set). It calls no door and writes nothing, so a save-door judge that runs only on the real move can still refuse an item a dry run passed.
25
+
-`client.packages.moveIn` resolves the answer for `moved` and `would_move`. A refusal, a refused dry run included, rejects with the first item's code as `code` and the whole answer as `details`.
24
26
25
27
Measured on this door: after a move, `_env/NAME` answers `409 RESOURCE_CONFLICT` naming the package that now holds the item, and the bare name and `NAMESPACE/NAME` answer `200`.
Copy file name to clipboardExpand all lines: content/docs/references/api/package-lifecycle.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -342,7 +342,7 @@ A navigation item another installed package contributes to an app the base owns,
342
342
|**name**|`string`| ✅ | Name of the moved item; a move never renames. |
343
343
|**member**|`string`| optional | The bundle member moved, for a bundled type. |
344
344
|**states**|`Enum<'active' \| 'draft'>[]`| ✅ | Which of the item's rows moved: its published row, its pending draft, or both. |
345
-
|**environmentAddress**|`string`| optional | The environment-qualified address the item answered at before the move (`_env/NAME`), present for a type addressed by package (ADR-0150 D5). After the move it no longer resolves: the item answers at `qualifiedAddress` and, while it is the only holder of its name, at its bare name. |
345
+
|**environmentAddress**|`string`| optional | The environment-qualified address the item answered at before the move (`_env/NAME`), present for a type addressed by package (ADR-0150 D5) when the target package declares a namespace. After the move it no longer resolves: the item answers at `qualifiedAddress` and, while it is the only holder of its name, at its bare name. |
346
346
|**qualifiedAddress**|`string`| optional | The package-qualified address the item answers at after the move (`NAMESPACE/NAME`), present beside `environmentAddress`. |
347
347
|**aiFaceName**|`{ before: string; after: string }`| optional | The AI face name change (ADR-0150 D6), present for a tool, skill, agent or object-less action whose face the move changes. |
348
348
@@ -388,7 +388,7 @@ Body of `POST /packages/:id/move-in`: the selection of loose items to move into
388
388
| Property | Type | Required | Description |
389
389
| :--- | :--- | :--- | :--- |
390
390
|**items**|`{ type: string; name: string; member?: string }[]`| ✅ | The loose items to move: one, several, or every loose item of a type, across types. Each names an item bound to no package; an item a package holds, a customization pair item and an overlay of a shipped item are not loose and are refused. Listed once each. |
391
-
|**dryRun**|`boolean`| optional |Judge the move and answer what it would do, writing nothing. Omitted or false, the move is made. |
391
+
|**dryRun**|`boolean`| optional |Answer what the move would do from the judgement made before any door runs (loose, target, the object judges, the set), calling no door and writing nothing. A save-door judge runs only on the real move, so it can still refuse an item a dry run passed. Omitted or false, the move is made. |
@@ -403,13 +403,13 @@ Body of `POST /packages/:id/move-in`: the selection of loose items to move into
403
403
404
404
## MoveIntoPackageResponse
405
405
406
-
Answer of the move door: what moved (or would move) and what each moved item's addresses become, or every refusal with nothing moved.
406
+
Answer of the move door: what moved (or would move) and what each moved item's addresses become, or every refusal with every item left loose.
407
407
408
408
### Properties
409
409
410
410
| Property | Type | Required | Description |
411
411
| :--- | :--- | :--- | :--- |
412
-
|**outcome**|`Enum<'moved' \| 'would_move' \| 'refused'>`| ✅ |`moved`: every item moved. `would_move`: a dry run that would move every item; nothing was written. `refused`: at least one item is refused, so nothing moved. |
412
+
|**outcome**|`Enum<'moved' \| 'would_move' \| 'refused'>`| ✅ |`moved`: every item moved. `would_move`: a dry run whose judgement passed every item; no door ran and nothing was written. `refused`: at least one item is refused, so what had moved was moved back and every item is loose, as before. |
413
413
|**targetPackageId**|`string`| ✅ | The package the items move into. |
414
414
|**moved**|`{ type: string; name: string; member?: string; states: Enum<'active' \| 'draft'>[]; … }[]`| ✅ | Every item, with what the move changes in its addresses. Empty on `refused`. |
415
415
|**refused**|`{ type: string; name: string; member?: string; code: string; … }[]`| ✅ | Every refused item, each with its own code. Empty unless `outcome` is `refused`. |
@@ -423,7 +423,7 @@ Answer of the move door: what moved (or would move) and what each moved item's a
423
423
|**name**|`string`| ✅ | Name of the moved item; a move never renames. |
424
424
|**member**|`string`| optional | The bundle member moved, for a bundled type. |
425
425
|**states**|`Enum<'active' \| 'draft'>[]`| ✅ | Which of the item's rows moved: its published row, its pending draft, or both. |
426
-
|**environmentAddress**|`string`| optional | The environment-qualified address the item answered at before the move (`_env/NAME`), present for a type addressed by package (ADR-0150 D5). After the move it no longer resolves: the item answers at `qualifiedAddress` and, while it is the only holder of its name, at its bare name. |
426
+
|**environmentAddress**|`string`| optional | The environment-qualified address the item answered at before the move (`_env/NAME`), present for a type addressed by package (ADR-0150 D5) when the target package declares a namespace. After the move it no longer resolves: the item answers at `qualifiedAddress` and, while it is the only holder of its name, at its bare name. |
427
427
|**qualifiedAddress**|`string`| optional | The package-qualified address the item answers at after the move (`NAMESPACE/NAME`), present beside `environmentAddress`. |
428
428
|**aiFaceName**|`{ before: string; after: string }`| optional | The AI face name change (ADR-0150 D6), present for a tool, skill, agent or object-less action whose face the move changes. |
0 commit comments