Skip to content

Commit 6d9e82d

Browse files
committed
fix(runtime)!: adopt-orphans refuses a read-only package with 422 WRITABLE_PACKAGE_REQUIRED
POST /packages/:id/adopt-orphans now asks requireWritablePackage (the ADR-0070 D2 predicate isWritablePackage) after the capability gate and the walled refusal and before the protocol is resolved, the order its sibling write arms use. reassignOrphanedMetadata asks no writability question of its own, so the door bound the environment's package-less items into a code-booted, marketplace, system- or cloud-scoped package at 200. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9c77155 commit 6d9e82d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎packages/runtime/src/domains/packages.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,16 @@ export async function handlePackagesRequest(deps: DomainHandlerDeps, path: strin
21412141
// [ADR-0131 D12 items 7–8] Under a wall, the platform operator's.
21422142
const walled = await refuseWalledCatalogPackageWrite(deps, _context, `Adopting orphaned metadata into package "${id}"`);
21432143
if (walled) return walled;
2144+
// [#24813] ADR-0070 D2: a package the deployment ships is not a
2145+
// base, so nothing is adopted into it. `reassignOrphanedMetadata`
2146+
// asks no writability question and rebinds every package-less row
2147+
// to whatever id it is handed, so this door refuses with the answer
2148+
// install-overwrite, disable, publish, revert, the manifest PATCH
2149+
// and delete give. Asked BEFORE the protocol is resolved, so a
2150+
// read-only id answers 422 whether or not this deployment can
2151+
// adopt. An id nothing installed is writable by the predicate's own
2152+
// rule, so it still reaches the protocol.
2153+
const readOnly = requireWritablePackage(deps, qlService, id, 'adopt items into'); if (readOnly) return readOnly;
21442154
const protocol = await resolveProtocol(deps, _context);
21452155
if (!protocol || typeof protocol.reassignOrphanedMetadata !== 'function') {
21462156
return { handled: true, response: deps.error('Orphan adoption not supported', 501) };

0 commit comments

Comments
 (0)