Skip to content

Commit c665d05

Browse files
feat(runtime)!: retire POST /packages/:id/adopt-orphans and its two console entries (#38150 PR-B1) (#38545)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XMRkgb3gwbVL5znx9yxJb7x)_ Part of #38150. This is PR-B1: the server retirement of `adopt-orphans` and the two console entries that called it. It replaces closed draft #38364, whose four commits are cherry-picked here onto main after PR-A2 (#38389, merged as `ea82c96212`), plus the conflict resolution, the re-measured generated outputs and A2's L1 nit N1. PR-B2 (Studio `~org`, the redirects to `?source=loose`, the classifier #38061, the ADR marks) follows. This PR does not close the card. Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: none (no file under `skills/**` or `.claude/skills/**` names `adopt-orphans`, `adoptOrphans` or "Adopt loose items"; searched at `37aae5aa1`) **Size: 3,387 lines** (additions + deletions, generated files included: 586 added, 2,801 deleted, 79 files; `git diff --numstat origin/main...HEAD` at `37aae5aa1`, merge base `dccf836a8`). With A1's 1,947 and A2's 1,380 the card stands at **6,714**. This PR alone passes 3,000, so it is Tier H. **Metadata-protocol, measured on this head.** `packages/spec/authorable-surface/api.json` loses exactly the four `api/ReassignOrphanedMetadataResponse:*` keys (`reassigned`, `reassignedCount`, `success`, `targetPackageId`) and gains nothing, so the shard moves and the line is `narrowed` (the closed vocabulary has no `removed`). `authorable-surface.base.json` is untouched: only `gen:authorable-surface-base` writes it. ## 维护者速读 - 用户能看到什么变化:软件包页的「收编散落项」按钮和 Studio「⋯」菜单里的同名项去掉了,旧的一次性收编接口改答 404;散落项改用上一个已合并的改动里的「勾选后移入软件包」。移入成功的提示现在写软件包名称,不再写编号。 - 为什么做:App Studio 改版专题的第二步。旧接口一次把全环境的散落项都收进一个包,不走保存时的检查,实测会收进没安装的包、收进前缀不对的对象。 - 出错会怎样:本改动只删东西,外加一处提示文字;出问题最多是某处还引用已删的入口,可以整体撤回。调用旧接口的脚本会收到 404,需要改用新的移入接口。 - 要你做什么:这张卡总行数超过 3000 行,属于需要你本人批准的一档,请审批。 ## Deliberate correction One pending release note, not added by this PR, was made false by it and is corrected in the same stroke: `.changeset/37958-studio-overview-full.md`, line 16. `check-empty-changeset` stays red on it by design (DELIBERATE CORRECTION class); the dispatching seat confirms it by its own record, and the file is not restored. - Before: "- The ⋯ menu keeps "Edit package info", "Duplicate as a new package", "Adopt loose items" and "Manage in Setup…"." - After: "- The ⋯ menu keeps "Edit package info", "Duplicate as a new package" and "Manage in Setup…"." ## What changes **Runtime.** The attribution docblock above `resolvePackageWriteActor` no longer says a body `actor` is ignored on `move-in`: there the strict body refuses it 400 and nothing moves (comment only). The `POST /packages/:id/adopt-orphans` block leaves `packages/runtime/src/domains/packages.ts`, with its mount in `dispatcher-plugin.ts`, its row in `route-ledger.ts` (the census line goes to 157 rows), and `reassignOrphanedMetadata` on the protocol handle type. The route answers 404 (pinned on a booted stack, below). **Protocol.** `ObjectStackProtocolImplementation#reassignOrphanedMetadata` and its facet body in `protocol-package-commits.ts` are removed, and so is `releaseAdoptedObjectOwner` (its only caller was the adoption): the class member, the host entry in `protocol-host.ts`, and the body in `protocol-object-owner.ts`. Comments that named the old door now name the move door, or say it retired. **SDK.** `client.packages.adoptOrphans` is removed from `@objectstack/client`. **Spec.** `ReassignOrphanedMetadataResponseSchema` and its two types leave `package-lifecycle.zod.ts`. The def is registered in `RETIRED_DEFS_BY_MAJOR` (`retired-defs/19.api__ReassignOrphanedMetadataResponse.ts`); its manifest line and shard keys are removed; `api-surface`, `declaration-map`, `export-origins` and the reference docs are regenerated on this base (the reference index now counts 1,741 schemas, 528 in API; main moved the per-module reference page to `packages/spec/docs/references/api/package-lifecycle.md`). `packages_orphan_adoption_unsupported` leaves `operation-message.ts` (four locales). The ADR-0087 disposition is the registered semantic entry `19.packages-adopt-orphans-door-retired.ts`. **Console.** The Packages page's development face loses the "Adopt loose items" button, its dialog, handler and state (`PackagesPage.tsx`); A2's loose-items banner stays as merged. Studio's 「⋯」 menu loses its `adopt` item: on this base (after objectstack#37958 moved Export and the revert to the overview page) `STUDIO_PACKAGE_MENU_ITEMS` is three items, `edit`, `duplicate`, `manage`. With the adoption gone the menu changes nothing a package holds, so its `onChanged` prop and its `run` helper go too, and `StudioDesignSurface` no longer passes `onChanged` to it (`onPackageChanged` still feeds the overview page). `packageActions.tsx` loses `adoptLooseItems`, `adoptedText` and `AdoptLooseItemsDialog`; `@object-ui/i18n`'s studio namespace loses the six `engine.packages.detail.adopt*` keys in en and zh. A2's `engine.looseMove.*` keys are untouched. **N1 (A2's L1 nit).** The move-in success toast filled `{package}` with `answer.targetPackageId` while the confirm title used the package name. `ResourceListPage.tsx` now passes the label the dialog was opened on (`looseMove.target.label`), which is already the id when the package list could not be read. **Docs.** `content/docs/api/metadata-api.mdx`, `protocol/knowledge.mdx` and the system-context register's row 55b name `move-in` where they listed `adopt-orphans`. Left as history: the three spec `18.*` semantic entries, `content/docs/releases/v18/*`, the consumed `.changeset/pre/*` entries, and the historical sentence in `http-dispatcher.ts`. **Changeset.** `38150-adopt-orphans-door-retired.md`, BREAKING with the FROM → TO table and the one-line fix: `@objectstack/spec` major (pre mode), metadata-protocol, runtime, client, `@object-ui/app-shell` and `@object-ui/i18n` patch. One sentence changed from #38364: the console's move door is now named as "the move-in confirm step on Studio's cross-package list (`?source=loose`), which ships in the same release" (A2 landed first, so "the next change" was no longer true). ## Each removed assertion, and what pins its rule now Deleted files (the old door's own tests): | removed | what it pinned | now pinned by | |:--|:--|:--| | `metadata-protocol/…/protocol.adopt-orphans-owner-judges.test.ts` | the adoption asked the object-owner and permission-set-owner judges | `package-move-in.dogfood.test.ts`: "the object owner: … refused with the save door's mismatch" and "the permission-set owner: …" | | `metadata-protocol/…/protocol.adopt-orphans-platform-record.test.ts` | the platform's own record is not adopted | new facet case in `protocol-package-move-in.test.ts`: "the platform's own record is not loose: refused NOT_LOOSE …", with its control | | `metadata-protocol/…/protocol.reassign-orphans-durability.test.ts` | a refused rebind was logged once while the door answered success | the move door has no partial success; `protocol-package-move-in.test.ts` pins the fault (500, nothing moved) and the failed undo (500 naming what did not go back) | | `objectql/…/protocol-adopt-orphans-draft-view-registry.test.ts` | an adopted draft view reached no registry, before, after and at the next boot; a draft beside an active row served the active body | through `moveIntoPackage`: `package-move-in.dogfood.test.ts` (booted CRM stack) "#23690: a loose DRAFT view moves as the target's draft, and the registry serves nothing before or after", "#23690: a draft beside an active row of the same view: the active body is served at the target, never the draft" and "#23690: at the next boot the moved draft is still served nowhere, and the pair still serves its active body"; and `protocol-package-move-in.test.ts` "a loose DRAFT moves as a draft: saved into the target in draft mode, never published, and answered states [draft]" and "a draft beside an active row: … states [active, draft]" (with an active-only control) | | `objectql/…/protocol-adopt-orphans-object-registry.test.ts` | the registry owner followed an adopted object | `package-move-in.dogfood.test.ts` A3 and "whole or nothing", and `package-first-authoring.dogfood.test.ts`'s D5 case, driven through `moveIntoPackage` | | `runtime/…/packages-adopt-orphans-readonly.test.ts` | the door's gates and their order | the `move-in` rows that replace `adopt-orphans` in the runtime route tables (capability gate, read-only remedy, walled refusal, knowledge-source gate, closed query, vetted org source, partial-host 501 and its message key) | | `ui/…/PackagesPage.adoptLooseItems-13339.test.tsx` | the console's Adopt dialog | the entry is removed; A2's `LooseMoveDialog-38150` and `ResourceListPage.looseMove-38150` pin the replacement | Edited files, as in #38364 (metadata-protocol, objectql, runtime, client, spec, dogfood, `scripts/engine-double-contract.pinned.json`), with these changes at this head: - `packages-write-actor-session.test.ts`: its `adopt-orphans` row (a body naming another user, a body naming no one, a system context) is replaced by a `move-in` describe: a signed-in caller's move, and its dry run, hand the protocol the session user as `actor`; CONTROL: a system context sends no actor; a body `actor` (another user, or the session user itself) answers 400 `Invalid move-in body` naming the key, and the protocol is never called. - `StudioPackageMenu-37139.test.tsx`: three items (`edit`, `duplicate`, `manage`) in en and zh-CN, not five; the read-only case greys Edit and Duplicate; the adopt action case and the adopt rows of the one-copy list are removed; the guard that no surface spells the `/adopt-orphans` door stays. - `StudioPackageOverview-37454.test.tsx` (added on main by objectstack#37958 after #38364 was built): the menu pin lists three rows, no adopt row. - `ResourceListPage.looseMove-38150.test.tsx` (N1): "the success toast names the package by its name, as the confirm title does", and its control "when the package list cannot be read the confirm and the toast both fall back to the id". - `package-move-in.dogfood.test.ts`: "the retired all-at-once door is gone: POST …/adopt-orphans answers 404 and moves nothing", and the three #23690 cases above. - Comments that named the retired entry as live: `protocol.ts` (the object-owner import line) and `package-duplicate-adopt-org-scope.integration.test.ts` (two docblocks). ## Acceptance notes - `overlap-check.mjs` at `37aae5aa1`: clean against main; one textual overlap with open #38541 in `content/docs/references/index.mdx` (generated; whichever lands second regenerates it with `gen:docs`). The overlap with #38527 read at the previous head no longer shows. - The claim on #38150 (7251650149) names the branch `claude/project-thread-j4n4b0` (A2's). This PR is on `claude/project-thread-pf8r6c`, the branch the seat's dispatch for this thread named. ## Verification Files to read first, by risk: 1. `ui/packages/app-shell/src/views/studio-design/StudioPackageMenu.tsx`: the conflict with objectstack#37958 resolved to three rows, with `onChanged` and `run` removed. 1a. `packages/qa/dogfood/test/package-move-in.dogfood.test.ts`: the #23690 cases and their state fixture (draft rows inserted at the first boot). 2. `packages/runtime/src/domains/packages.ts` and `route-ledger.ts`: the route block and its ledger row. 3. `ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx`: N1's label hunk. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioPackageMenu-37139.test.tsx packages/app-shell/src/views/metadata-admin/ResourceListPage.looseMove-38150.test.tsx`. Expect both files to pass, and the menu case to list three items. <details><summary>Suites (local; the package suites ran on the tree before the A2 merge commit `6742ce449`, the spec suite again after it; UI and gates at the heads named)</summary> | suite | result | |:--|:--| | `@objectstack/client` test | 59 files, 828 tests passed | | `@objectstack/spec` test | 913 files, 28,889 passed, 1 todo | | `@objectstack/metadata-protocol` test | 372 passed, 9 skipped files; 23,629 tests passed, 45 skipped | | `@objectstack/objectql` test | 640 files, 14,530 tests passed | | `@objectstack/runtime` test | 655 files, 12,481 passed, 25 skipped | | typecheck: client, spec, metadata-protocol, objectql, runtime | each lock VERDICT command-exit 0 | | UI touched files + `ui/packages/i18n` (8 named files + the i18n dir) | 117 files, 1,988 passed, 13 skipped | | full `@object-ui/app-shell` suite at `6742ce449` | 2,464 files: 2,462 passed, 1 skipped, 1 failed: `StudioPackageOverview-37454` "the ⋯ menu holds … adopt loose items …" (a main pin of the removed row). Fixed in `c9c49d97e`; that file and `StudioPackageMenu-37139` then 2 files, 71 tests passed | | `@object-ui/app-shell` and `@object-ui/i18n` type-check | lock VERDICT command-exit 0 | | `@objectstack/spec check:generated` after the A2 merge | all 14 artifacts current | | `check-platform-checklist --changed-from origin/main` | OK, 54 anchors judged, 0 lost | </details> <details><summary>Round 1 (review FAIL at `c9c49d97e`, M1 and M2), at `448cffe6f` and `37aae5aa1`</summary> - `packages-write-actor-session.test.ts` + `package-duplicate-adopt-org-scope.integration.test.ts`: 2 files, 25 tests passed. Ablation (`scripts/ablation-replace.mjs`, `resolvePackageWriteActor(_context)` before `protocol.moveIntoPackage` replaced by `undefined`, anchor 1 → 0): "a signed-in caller's move hands the protocol the session user" and "so does a dry run" failed, 2 failed and 20 passed (the system-context control and the 400 cases green); restored, blob equals HEAD. - `protocol-package-move-in.test.ts`: 11 passed. `Type Check · workspace` was red at `448cffe6f` on this file's new draft case (TS2532 / TS2493 on the commit read); `37aae5aa1` types it, and `pnpm --filter @objectstack/metadata-protocol run typecheck` (its `tsc` lists this file) and `@objectstack/runtime` typecheck exit 0, the file 11 of 11. Ablation (`mode: state === 'active' ? 'publish' : 'draft'` → `mode: 'publish'`): both draft cases failed, 2 failed and 9 passed; restored, blob equals HEAD. - `package-move-in.dogfood.test.ts`: 24 passed. Ablation of the same line on the built output (mutation held, `@objectstack/metadata-protocol` rebuilt, `ablation-dist-preflight.mjs` found the marker in `dist/`): all three #23690 cases failed, 3 failed and 21 passed. Restored, rebuilt, preflight `--absent` clean, the file 24 of 24 again. - Derived gates for this round's seven paths (`dispatch-gates.mjs --commands PATHS`): 78 families, 77 exit 0, and `check-empty-changeset` exit 1 on the DELIBERATE CORRECTION above (expected). `--ran`: "78 derived, 78 run, 0 NOT-MEASURED, 0 UNRUN". `check-nul-bytes`: exit 0. </details> <details><summary>N1 ablation</summary> `scripts/ablation-replace.mjs` replaced `looseMove?.target.label ?? answer.targetPackageId` with `answer.targetPackageId` (anchor 1 → 0, blob `90937804f355` → `ed3e458acb2a`): "the success toast names the package by its name" failed (`expected "vi.fn()" to be called with arguments: [ 'Moved into Alpha: 1.' ]`), 1 failed and 8 passed, the control among the passing. Restored: blob equals HEAD, `git diff HEAD` empty. </details> <details><summary>Derived gates</summary> `node scripts/pm/dispatch-gates.mjs --commands` (no paths, change set from the merge base `dccf836a8`): 149 families. All 149 exit 0. Five first answered 99 or 3 (two vitest families queued behind the app-shell suite; `check:skill-examples`, `check:dual-build-cjs-loads`, `check:published-readme-exports` needed `client-react`, `studio` and `scenarios` built) and passed on the re-run after that build. `--ran`: "149 derived, 149 run, 0 NOT-MEASURED, 0 UNRUN". The commands re-derived at `c9c49d97e` give the same 149. </details> <details><summary>Dogfood battery</summary> Full battery at head `448cffe6f`, `pnpm --filter @objectstack/dogfood test` under the verify lock (no shard, no path): lock VERDICT command-exit 0; Test Files 495 passed, 3 skipped (498); Tests 4,187 passed, 68 skipped (4,255); no failure. `37aae5aa1` after it changes one line of a metadata-protocol unit test's typing, which no dogfood file reaches. (The battery at `c9c49d97e`: 495 / 4,184 passed.) </details> ## Owed before landing - CONTRACT_REVIEW_TIER L2 (the seat's). - A dogfood battery from the landing head. - Maintainer approval (Tier H). - Ships in the same version as PR-B2 (seat rule): after approval this PR is not enqueued until B2 is approved too; both enqueue together, with no Version Packages merge between them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5pc3eJbLUEYRBLjxn5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 53a5506 commit c665d05

79 files changed

Lines changed: 586 additions & 2801 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/37958-studio-overview-full.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A package's 概览 Overview in App Studio is now the full page.
1313
- **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.
1414
- **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.
1515
- 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.
16-
- The ⋯ menu keeps "Edit package info", "Duplicate as a new package", "Adopt loose items" and "Manage in Setup…".
16+
- The ⋯ menu keeps "Edit package info", "Duplicate as a new package" and "Manage in Setup…".
1717
- **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.
1818
- 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.
1919
- **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.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
'@objectstack/spec': major
3+
'@objectstack/metadata-protocol': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/client': patch
6+
'@object-ui/app-shell': patch
7+
'@object-ui/i18n': patch
8+
---
9+
10+
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`
11+
12+
Clause-②: no (narrowing)
13+
Metadata-protocol: narrowed
14+
15+
<!-- adr-0087: registered packages-adopt-orphans-door-retired -->
16+
17+
**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.
18+
19+
What is removed:
20+
21+
- the route `POST /api/v1/packages/:id/adopt-orphans` (it answers `404` now), and its route-ledger row;
22+
- the client method `packages.adoptOrphans(id)` of `@objectstack/client`;
23+
- the protocol method `reassignOrphanedMetadata` of `@objectstack/metadata-protocol`'s `ObjectStackProtocolImplementation`;
24+
- `ReassignOrphanedMetadataResponseSchema` and its `ReassignOrphanedMetadataResponse` / `ReassignOrphanedMetadataResponseParsed` types from `@objectstack/spec/api`, and the published JSON schema `api/ReassignOrphanedMetadataResponse.json`;
25+
- the operation-message key `packages_orphan_adoption_unsupported` (four locales);
26+
- 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.
27+
28+
How to move:
29+
30+
| before | after |
31+
|:--|:--|
32+
| `POST /api/v1/packages/:id/adopt-orphans` | `POST /api/v1/packages/:id/move-in` with `{ "items": [{ "type": "flow", "name": "…" }, …] }` |
33+
| `client.packages.adoptOrphans(id)` | `client.packages.moveIn(id, { items })` |
34+
| `protocol.reassignOrphanedMetadata({ targetPackageId })` | `protocol.moveIntoPackage({ targetPackageId, items })` |
35+
| `ReassignOrphanedMetadataResponseSchema` | `MoveIntoPackageResponseSchema` |
36+
37+
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.

‎content/docs/api/metadata-api.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Under a `group` or `isolated` tenancy posture every `/packages` write is the
174174
platform operator's (ADR-0131 D12 items 7–8, D11): install (`POST /packages`),
175175
the manifest `PATCH`, enable, disable, publish, `publish-drafts`,
176176
`discard-drafts`, `revert`, `rollback`, `commits/:commitId/revert`, `duplicate`,
177-
`adopt-orphans` and this delete. Any other caller, a `manage_metadata` holder
177+
`move-in` and this delete. Any other caller, a `manage_metadata` holder
178178
inside one organization included, is refused `403 PERMISSION_DENIED` naming the
179179
posture, before anything is read or written, whatever the package carries.
180180
Reads are unchanged. Under `single` every `manage_metadata` holder writes as

‎content/docs/permissions/system-context.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ One of the largest consumers of the flag;
213213
| 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` |
214214
| 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` |
215215
| 56 | Activation write / authoring refusals do not fire | runtime | Get: activation artifacts writable and authorable without the activation-authoring capability | `refuseUngrantedActivationWrite`, `refuseUngrantedActivationAuthoring` |
216-
| 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` |
216+
| 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` |
217217
| 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` |
218218
| 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` |
219219
| 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` |

‎content/docs/protocol/knowledge.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ and the MCP draft door:
237237
imply it. Over MCP it is the human's own grant that is read, never the
238238
agent's. The package doors ask it too: every write to an existing package
239239
that holds a knowledge source (enable, disable, publish, publish-drafts,
240-
discard-drafts, the commit revert, rollback, revert, adopt-orphans,
240+
discard-drafts, the commit revert, rollback, revert, move-in,
241241
duplicate, the manifest update and delete) needs the capability, and is
242242
refused `403` naming it otherwise. A package that holds none is written as
243243
before. Two doors are not asked. Installing a package is one: a packaged

0 commit comments

Comments
 (0)