Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ec1ef8a
feat(app-shell): select loose items on Studio's cross-package list an…
claude Nov 28, 2026
c27f9ab
fix(app-shell): the move's confirm names the package by its name, and…
claude Nov 28, 2026
35bc82c
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 28, 2026
0a06ccc
test(app-shell): the new loose-move tests pay the source's dynamic li…
claude Nov 28, 2026
be8e0d5
fix(app-shell): the loose select box stops the row's click itself, no…
claude Nov 28, 2026
7e700f0
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 29, 2026
262647f
Merge remote-tracking branch 'origin/main' into b1/pf8r6c
claude Nov 29, 2026
095c0a0
feat(runtime)!: retire POST /packages/:id/adopt-orphans and its conso…
claude Nov 28, 2026
9a0c60f
chore(spec): regenerate the api-surface baseline after the retired de…
claude Nov 28, 2026
ed90c4f
test: the operation-message key count, the strictness-ledger counts a…
claude Nov 28, 2026
da3826b
test: the route-ledger census, module-top source loads for the conver…
claude Nov 28, 2026
f138aa6
fix(app-shell): the loose-move success toast names the package as the…
claude Nov 29, 2026
cd38265
chore(spec): regenerate the reference index on this base after the re…
claude Nov 29, 2026
6742ce4
Merge remote-tracking branch 'origin/main' into b1/pf8r6c
claude Nov 29, 2026
c9c49d9
test(app-shell): the overview's menu pin holds three rows after the a…
claude Nov 29, 2026
bc68f2a
test(runtime): the move door hands the protocol the session user and …
claude Nov 29, 2026
6d60d88
test(metadata-protocol, dogfood): a loose draft moved into a package …
claude Nov 29, 2026
448cffe
docs: comments and the 37958 changeset no longer name the retired ado…
claude Nov 29, 2026
37aae5a
test(metadata-protocol): type the draft case's commit read (#38150 PR…
claude Nov 29, 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
2 changes: 1 addition & 1 deletion .changeset/37958-studio-overview-full.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
Expand All @@ -13,7 +13,7 @@
- **Export** is a button of the page header and has left the ⋯ menu. On a read-only package that has customizations (a `.custom` package paired with it), the button reads "Export customizations of NAME" (「导出 NAME 的定制」) and downloads that `.custom` package; the read-only package itself is no longer exported from this page. On any other package it reads "Export" and downloads the package, as before.
- **Publish history** is a third tab (`?tab=history`): the package's publishes, newest first, each with what it was, when, how many items and who published it, by the user's name where the user directory has one. "Revert to last publish" is on this tab with the confirmation it always had, and has left the ⋯ menu. An entry has no revert of its own here.
- On a read-only package with customizations, the history and the revert act on the `.custom` package, the same one Pending and Publish act on. The revert is greyed only where nothing can be published (a read-only package with no customizations) or nothing is pending, and it says which.
- The ⋯ menu keeps "Edit package info", "Duplicate as a new package", "Adopt loose items" and "Manage in Setup…".
- The ⋯ menu keeps "Edit package info", "Duplicate as a new package" and "Manage in Setup…".
- **Opening a package lands on 概览.** The address `/studio/<package>` and App Studio's return to the package last opened now open `/studio/<package>/overview`; both opened the object list before. `/studio/<package>/data` still opens the object list, and the other retired addresses keep their redirects.
- The 「全部类型」 All types page says what is switched off beside what is customized: "3 customized · 2 switched off on HotCRM" (「HotCRM 已定制 3 项 · 已停用 2 项」). With nothing switched off the line is unchanged.
- **Read-only reasons reach keyboard and screen-reader users.** The lock beside a read-only package's name in the package switcher is named by the reason, and the switcher button is described by it, in the collapsed column too. On a read-only package with nothing to publish, the Pending tab is described by the same reason and says it in words when opened.
Expand Down
37 changes: 37 additions & 0 deletions .changeset/38150-adopt-orphans-door-retired.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
'@objectstack/spec': major
'@objectstack/metadata-protocol': patch
'@objectstack/runtime': patch
'@objectstack/client': patch
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

feat(runtime)!: `POST /api/v1/packages/:id/adopt-orphans` is retired; loose items move by an explicit selection through `POST /api/v1/packages/:id/move-in`

Clause-②: no (narrowing)
Metadata-protocol: narrowed

<!-- adr-0087: registered packages-adopt-orphans-door-retired -->

**BREAKING.** The all-at-once adoption of every loose (package-less) item into one package is gone, with every surface that reached it. It rebound rows with a bare storage update and asked none of the save door's questions, so it could adopt into a package nothing installed, adopt an object its target's namespace prefix refuses, and leave the runtime serving the old address until a restart (#37468). ADR-0084's amendment of 2026-11-26 replaces it with one door that moves a selection, each item through the save door: `POST /api/v1/packages/:id/move-in`, shipped in the same release.

What is removed:

- the route `POST /api/v1/packages/:id/adopt-orphans` (it answers `404` now), and its route-ledger row;
- the client method `packages.adoptOrphans(id)` of `@objectstack/client`;
- the protocol method `reassignOrphanedMetadata` of `@objectstack/metadata-protocol`'s `ObjectStackProtocolImplementation`;
- `ReassignOrphanedMetadataResponseSchema` and its `ReassignOrphanedMetadataResponse` / `ReassignOrphanedMetadataResponseParsed` types from `@objectstack/spec/api`, and the published JSON schema `api/ReassignOrphanedMetadataResponse.json`;
- the operation-message key `packages_orphan_adoption_unsupported` (four locales);
- in the console, the Packages page's "Adopt loose items" button and its dialog, and the matching item of Studio's 「⋯」 package menu, with the `engine.packages.detail.adopt*` keys of `@object-ui/i18n`'s studio namespace (`adoptOrphans`, `adopting`, `adoptTitle`, `adoptDescription`, `adoptedOne`, `adoptedOther`). The console's door to move loose items is the move-in confirm step on Studio's cross-package list (`?source=loose`), which ships in the same release.

How to move:

| before | after |
|:--|:--|
| `POST /api/v1/packages/:id/adopt-orphans` | `POST /api/v1/packages/:id/move-in` with `{ "items": [{ "type": "flow", "name": "…" }, …] }` |
| `client.packages.adoptOrphans(id)` | `client.packages.moveIn(id, { items })` |
| `protocol.reassignOrphanedMetadata({ targetPackageId })` | `protocol.moveIntoPackage({ targetPackageId, items })` |
| `ReassignOrphanedMetadataResponseSchema` | `MoveIntoPackageResponseSchema` |

The fix in one line: name the loose items to move; to move them all, list them and pass every one. The move is whole or nothing, and `dryRun: true` answers what it would do without writing.
2 changes: 1 addition & 1 deletion content/docs/api/metadata-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Under a `group` or `isolated` tenancy posture every `/packages` write is the
platform operator's (ADR-0131 D12 items 7–8, D11): install (`POST /packages`),
the manifest `PATCH`, enable, disable, publish, `publish-drafts`,
`discard-drafts`, `revert`, `rollback`, `commits/:commitId/revert`, `duplicate`,
`adopt-orphans` and this delete. Any other caller, a `manage_metadata` holder
`move-in` and this delete. Any other caller, a `manage_metadata` holder
inside one organization included, is refused `403 PERMISSION_DENIED` naming the
posture, before anything is read or written, whatever the package carries.
Reads are unchanged. Under `single` every `manage_metadata` holder writes as
Expand Down
2 changes: 1 addition & 1 deletion content/docs/permissions/system-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ One of the largest consumers of the flag;
| 54 | Package REST route capability gate bypassed | rest | Get: a marketplace publish over REST (`POST /packages/publish`, the one route the REST registrar mounts since #14503) without `manage_metadata`; the package read cohort (`studio.access` / `setup.access`) is enforced by the dispatcher `/packages` domain's own read gate, where the reads are served | `refusePackageRequest` |
| 55 | Package domain capability gates bypassed | runtime | Get: package management and package-inventory reads without the capability; and a write to a package that holds a knowledge source (the twelve doors that write an existing package) without `manage_knowledge_sources` beside it (ADR-0161 K4); and, on the move-in door, a selected `datasource` or `knowledge_source` moved without the capability its `/meta` write asks (`manage_platform_settings`, `manage_knowledge_sources`) | `requireManageMetadata`, `requireReadCapability`, `refuseKnowledgeSourcePackageWrite`, `handlePackagesRequest` |
| 56 | Activation write / authoring refusals do not fire | runtime | Get: activation artifacts writable and authorable without the activation-authoring capability | `refuseUngrantedActivationWrite`, `refuseUngrantedActivationAuthoring` |
| 55b | Walled environment-metadata refusal does not fire | metadata-core, rest, runtime | Get: under `isolated` / `group`, a write of the environment's metadata, of any type, at the `/meta` write doors (save, reset, publish, rollback) and `POST /meta/_migrate-stored` on both transports, at every `/packages` write door (create, the manifest `PATCH`, enable, disable, publish, `publish-drafts`, `discard-drafts`, `revert`, `rollback`, `commits/:commitId/revert`, `duplicate`, `adopt-orphans`, delete), at the `/automation` definition writes (create, update, delete, clone), at the permission-set clone door, at the import of a remote table as an object (the REST import route and the MCP `import_object` tool), at the open MCP server's draft save and discard (`save_metadata_draft`, `delete_metadata_draft`), and at the refresh of a federated datasource's cached catalog. Every other caller below the platform-operator rung is refused `403` there (ADR-0131 D3, D12 items 7–8, D11), because one organization's write would change what every organization resolves. The seeders, the package door and migrations write the environment's metadata this way. Under `single` the refusal is inert for every caller | `walledCatalogWriteVerdict`, `walledCatalogRefusal`, `refuseWalledCatalogPackageWrite`, `refuseWalledFlowDefinitionWrite`, `registerExternalDatasourceRoutes`, `federationService`, `openWriter` |
| 55b | Walled environment-metadata refusal does not fire | metadata-core, rest, runtime | Get: under `isolated` / `group`, a write of the environment's metadata, of any type, at the `/meta` write doors (save, reset, publish, rollback) and `POST /meta/_migrate-stored` on both transports, at every `/packages` write door (create, the manifest `PATCH`, enable, disable, publish, `publish-drafts`, `discard-drafts`, `revert`, `rollback`, `commits/:commitId/revert`, `duplicate`, `move-in`, delete), at the `/automation` definition writes (create, update, delete, clone), at the permission-set clone door, at the import of a remote table as an object (the REST import route and the MCP `import_object` tool), at the open MCP server's draft save and discard (`save_metadata_draft`, `delete_metadata_draft`), and at the refresh of a federated datasource's cached catalog. Every other caller below the platform-operator rung is refused `403` there (ADR-0131 D3, D12 items 7–8, D11), because one organization's write would change what every organization resolves. The seeders, the package door and migrations write the environment's metadata this way. Under `single` the refusal is inert for every caller | `walledCatalogWriteVerdict`, `walledCatalogRefusal`, `refuseWalledCatalogPackageWrite`, `refuseWalledFlowDefinitionWrite`, `registerExternalDatasourceRoutes`, `federationService`, `openWriter` |
| 57 | Automation run-state read, flow-authoring write, the paused-run caller gate (screen read and resume), the two operator run-lifecycle writes, and the elevated self-triggered start, the AI-service-account elevated start and the start-record check at every door that starts a flow by name all pass | runtime | Get: run state, flow writes, a paused run's screen and its resume with no grant and without being the run's starter — and cancelling or restoring a suspension without the platform-operator rung. The screen read and the resume ask one predicate, so this is one bypass for both. The lifecycle bypass is the in-process owner's door: plugin-approvals' revise-window recall (ADR-0044) cancels on behalf of a decision it already authorized and recorded. And starting a flow declared `runAs: 'system'` whose type is self-triggered (`autolaunched`, `record_change`, `schedule`) through any door that starts a flow by name — the trigger route, an action of `type: 'flow'` (REST `/actions` and the MCP `run_action` bridge) and a declared endpoint of `type: 'flow'` — which every other caller, the guest principal included, is refused `403 PERMISSION_DENIED` (the maintainer's rulings, letters B and A) — and starting, through the same doors, a flow whose `requiredPermissions` the caller does not hold (ruling record 6377848497, letter A) — and starting, through the same doors, a flow declared `runAs: 'system'` as an AI service account (an agent acting for itself, with no `onBehalfOf`) where the action's `ai.exposed: true` opt-in is not in hand, which that account is refused `403 PERMISSION_DENIED` (ADR-0151 Non-goals, ruling record 6812617393, letter C; a trigger route and a declared endpoint carry no opt-in, so there it is always refused, and the refusal names the action door that admits it). And starting, through the same doors, a flow on a record key the caller's own scope does not deliver, which every other caller is refused with the action door's `404 RECORD_NOT_FOUND` before the run exists (and `400 VALIDATION_FAILED` for a key that is not one id, or for an elevated start that names no object). The three doors ask one check, so this is one bypass for all of them, and it is the in-process caller's, such as a job: inbound HTTP never carries the flag | `mayReadRunState`, `refuseUngrantedFlowWrite`, `isRunStarterOrRunStateReader`, `refuseUngrantedRunLifecycleWrite`, `flowStartRefusal`, `refuseUnreadableFlowStartRecords` |
| 57b | Connector credential door's capability and posture gates pass | runtime | Get: listing, setting and clearing the environment's stored connector credentials (`/automation/connectors/credential-refs`) without `manage_metadata`, and under the `group` / `isolated` postures, where the door refuses every other caller `403 PERMISSION_DENIED` naming the posture, the platform operator included, because the store is environment-level. The bypass is the in-process caller's: inbound HTTP never carries the flag. Get nothing more about the value: no answer of this door carries it | `refuseUngrantedConnectorCredentialAccess`, `refuseWalledConnectorCredentialAccess` |
| 57c | Connector connection door's capability gate passes | runtime | Get: reading, beginning, completing (the OAuth callback) and revoking an organization's connection of an `oauth2` `authorization_code` connector instance (`/automation/connectors/:name/connection`, `/automation/connectors/oauth/callback`, ADR-0143 D5) without `manage_metadata`. No posture refuses it: a connection belongs to its organization. The bypass is the in-process caller's: inbound HTTP never carries the flag. Get nothing more: no answer of this door carries a token, and the callback's `state` is still bound to the user and organization that began the connect | `refuseUngrantedConnectorConnectionAccess` |
Expand Down
2 changes: 1 addition & 1 deletion content/docs/protocol/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ and the MCP draft door:
imply it. Over MCP it is the human's own grant that is read, never the
agent's. The package doors ask it too: every write to an existing package
that holds a knowledge source (enable, disable, publish, publish-drafts,
discard-drafts, the commit revert, rollback, revert, adopt-orphans,
discard-drafts, the commit revert, rollback, revert, move-in,
duplicate, the manifest update and delete) needs the capability, and is
refused `403` naming it otherwise. A package that holds none is written as
before. Two doors are not asked. Installing a package is one: a packaged
Expand Down
Loading
Loading