Skip to content

feat(runtime)!: retire POST /packages/:id/adopt-orphans and its two console entries (#38150 PR-B1) - #38364

Closed
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-j4n4b0
Closed

objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-j4n4b0

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Part of #38150. This is PR-B1, by the seat's ruling (b) on the PR-B split and claim amendment 4 (comment 7239673373): the server retirement of adopt-orphans and the two console entries that called it. PR-A1 (#38185, the move door) is merged. This PR lands after PR-A2, whose move-in confirm step is the console's replacement door, so no prerelease ships a console with no way to move loose items. PR-B2 (Studio ~org, the redirects to ?source=loose, the Q-f E classifier #38061, the ADR marks) follows A2.

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no skill under skills/** or .claude/skills/** names adopt-orphans, adoptOrphans or "Adopt loose items" (searched at this head)

Size: 3,123 lines (additions + deletions, generated files included: 358 added, 2,765 deleted, 75 files; git diff --numstat c091d28c8 1852bb898). This PR alone passes 3,000, and with A1's 1,947 the card stands at 5,070 (#38280's per-card line), so this PR is Tier H.

Metadata-protocol reading, measured. Removing ReassignOrphanedMetadataResponseSchema moves the api authorable-surface shard (packages/spec/authorable-surface/api.json loses its four api/ReassignOrphanedMetadataResponse:* keys), so the line is not none. The closed vocabulary has no removed; a removed key reads narrowed (AGENTS.md Post-Task Checklist step 3), which is what this PR declares. authorable-surface.base.json keeps the four lines: it mirrors the upstream anchor and is rewritten only by gen:authorable-surface-base from the git-resolved baseline.

维护者速读

What changes

Runtime. 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, and reassignOrphanedMetadata on the protocol handle type. The doc lists that named the door name move-in now. 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. Three imports that only the removed code read go with them. Comments in protocol-registry-hydration.ts, protocol-extension-field-suffix.ts and protocol-package-move-in.ts 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 (packages/spec/src/migrations/entries/retired-defs/19.api__ReassignOrphanedMetadataResponse.ts), as the manifest deletion gate requires, and its manifest line and shard keys are removed; api-surface, declaration-map, export-origins and the reference docs are regenerated. packages_orphan_adoption_unsupported leaves operation-message.ts (four locales). The ADR-0087 disposition is a registered semantic entry, 19.packages-adopt-orphans-door-retired.ts (surface, replacement, reason, acceptance).

Console. The Packages page's development face loses the "Adopt loose items" button, its dialog, handler and state (PackagesPage.tsx). Studio's 「⋯」 menu loses its adopt item (STUDIO_PACKAGE_MENU_ITEMS is five items). packageActions.tsx loses adoptLooseItems, adoptedText and AdoptLooseItemsDialog, and @object-ui/i18n's studio namespace loses the six engine.packages.detail.adopt* keys in en and zh (no other locale carried them). Neither entry is repointed: the seat ruled no interim pointer, and A2 brings the replacement.

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 (the move door asks the same wall and knowledge-source gates). Left as history, per the seat: the three spec 18.* semantic entries, content/docs/releases/v18/*, the consumed .changeset/pre/* entries, and the historical sentence in http-dispatcher.ts about the vetted org source.

Changeset. 38150-adopt-orphans-door-retired.md, !, BREAKING with the FROM → TO table and the one-line fix: @objectstack/spec major (the seat's level; pre mode admits it), metadata-protocol, runtime, client, @object-ui/app-shell and @object-ui/i18n patch.

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: …" (the move runs the save door itself)
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 no partial success exists on the move door: whole or nothing. 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 the move saves a draft through the save door's draft mode, whose own pins hold that a draft never reaches the runtime (ADR-0048)
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" (an object moved and put back is served at once), and package-first-authoring.dogfood.test.ts's D5 case, now 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 confirm step brings its own tests

Edited files:

  • protocol.extension-field-suffix.test.ts: section 4b (the adopt door's __c judge) removed; package-move-in.dogfood.test.ts "__c: …" pins it on the move door.
  • protocol.object-registry-write-through-spelling.test.ts: caller 6 removed from the trace, the call-site count goes 10 → 9, and its stored-plural case is removed.
  • protocol.view-expansion-reconcile-call-sites.test.ts: the reassignOrphanedMetadata route row removed.
  • protocol.view-container-reset-expansions.test.ts: readings A, B and control D (the adoption left overlays of packaged views where they were) removed, as the move door refuses those NOT_LOOSE; "the rebind moves the row's record" is kept and drives the rebind on the write-through directly, since the move door's undo rebinds the same way.
  • protocol.platform-store-system-opt-in.test.ts: the adoption's opt-in check becomes the move door's phase-0 read (a dry run: find, no update).
  • protocol-package-move-in.test.ts: two new cases, the platform record above and the three package-less spellings (null, '', sys_metadata) from the removed objectql lifecycle describe.
  • objectql: protocol-package-lifecycle.test.ts (the adoption describe removed), protocol-packageless-overlay-migration.test.ts (cli + metadata-protocol: os migrate moves package-less overlay rows into <base>.custom as declared overrides — the migration ceremony only (the close is N-16b) #28413 now a move-door dry run: the shipped name NOT_LOOSE, the environment row would_move), two comments.
  • runtime: the eight route tests above, each adopt-orphans row a move-in row with a body the strict schema admits. packages-write-actor-session.test.ts drops its row with no replacement: the move body is strict, so an actor key is refused 400 rather than ignored. package-duplicate-adopt-org-scope.integration.test.ts keeps its duplicate half and the measurement that a package-less save writes an env-wide row.
  • client: the adoptOrphans rows of packages-lifecycle.test.ts and return-type-precision.test.ts; unwrap-misfire.pin.test.ts pins MoveIntoPackageResponseSchema in place of the retired schema.
  • spec: the schema's describe in package-lifecycle.test.ts.
  • dogfood: wall-environment-metadata-refusal and wall-package-doors-refusal (refusals and operator / single controls on move-in, the controls as dry runs), authz-conformance.matrix.ts, package-first-authoring, and one new case in package-move-in.dogfood.test.ts: "the retired all-at-once door is gone: POST …/adopt-orphans answers 404 and moves nothing".
  • scripts/engine-double-contract.pinned.json: the deleted owner-judges file's two rows.
  • UI: StudioPackageMenu-37139.test.tsx (five items, no adopt case, the shared-action list), PackagesPage.moduleDisable-28118, .readOnlyActions-13157, .installedAppsUpdates-34722.

Verification

Local, on this branch, after a declaration build of ./packages/** and dogfood's dependencies:

suite result
@objectstack/metadata-protocol 380 files: 371 passed, 9 skipped; 23,610 tests passed, 45 skipped
@objectstack/objectql 641 files, 14,529 tests passed
@objectstack/runtime 659 files: 13,958 tests passed, 25 skipped
@objectstack/client 59 files, 828 tests passed
@objectstack/spec 1,006 files: 30,450 passed, 3 failed on the first run (the operation-message count, and the strictness-ledger counts twice). Fixed in 47bb4d28f, and the 128 tests of those files then passed
dogfood (the four touched files) 72 tests: 71 passed, 1 failed on the first run (D5 used the package id app.dogfood_adopt, which the id rule refuses). Fixed to app.dogfood-adopt, and package-first-authoring then passed 5 of 5
ui (pnpm --dir ui exec vitest run) 916 files: 10,663 tests passed, 14 skipped
check:generated 13 of 14 artifacts current on the first run; the strictness ledger was regenerated (gen:strictness-ledger) in 47bb4d28f

Derived gates. node scripts/pm/dispatch-gates.mjs --commands derives 149 families for this tree. At 47bb4d28f, 146 passed and 3 failed:

  • migrate-meta-engine-guidance: the semantic entry's reason named a tracker id. It is gone (1852bb898), the registry was regenerated and spec and cli rebuilt, and the test passes 3 of 3.
  • check:route-ledger-census: the ledger's generated census line said 158 rows. It says 157 now (--fix), and the check passes.
  • check:test-source-alias: four converted tests reached a dynamic source import inside a case. Each has a module-top side-effect import now, and the check passes. The three runtime files pass 150 of 150 tests and the UI file passes 8 of 8.

dispatch-gates --ran: 149 derived, 149 run, 0 NOT-MEASURED, 0 UNRUN.

The metadata-protocol line, measured. The diff of packages/spec/authorable-surface/api.json removes exactly the four api/ReassignOrphanedMetadataResponse:* keys (reassigned, reassignedCount, success, targetPackageId) and adds nothing. check-adr-0087-registration.mjs --base origin/main passes with the changeset's marker naming the registered entry.

Owed before landing

  • One CONTRACT_REVIEW_TIER review (the seat's).
  • A dogfood battery that starts with the landing head.
  • Tier H: Tesla's approval via os-zhuang.
  • PR-A2 merged first.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz

…le entries (#38150 PR-B1)

The all-at-once adoption of every loose item retires with every surface
that reached it: the route and its ledger row, the protocol method
`reassignOrphanedMetadata` (and `releaseAdoptedObjectOwner`, which only it
used), the client's `packages.adoptOrphans`, the spec's
`ReassignOrphanedMetadataResponseSchema` (registered as a retired def), the
`packages_orphan_adoption_unsupported` message, and the console's "Adopt
loose items" button and Studio menu item with their i18n keys. The move
door (`POST /packages/:id/move-in`) takes its place in every route table
pin, and the old door's own tests go with it.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…nd a valid dogfood package id after the retirement (#38150 PR-B1)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…ted route tests, and no tracker id in the semantic entry's guidance (#38150 PR-B1)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/client, @objectstack/metadata-protocol, @objectstack/runtime, @objectstack/spec, touching 39 documentable anchor(s). ⚠️ 7 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol-extension-field-suffix.ts, packages/metadata-protocol/src/protocol-package-move-in.ts, packages/spec/api-surface/api.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

31 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json ad3d04f020303056224651c052109c61c18db13d.

⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 7 changed file(s) yielded no anchor (packages/metadata-protocol/src/protocol-extension-field-suffix.ts, packages/metadata-protocol/src/protocol-package-move-in.ts, packages/spec/api-surface/api.json, …) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: responseSchema (7 routes)
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 187 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ad3d04f020303056224651c052109c61c18db13d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 014f68a6b729a0d0534723e2d956cc041939b6b9 — the merge of head 1852bb89833fada33631c7219a6d203b7b4c295e into base ad3d04f020303056224651c052109c61c18db13d, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 014f68a6b729a0d0534723e2d956cc041939b6b9 && git checkout 014f68a6b729a0d0534723e2d956cc041939b6b9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ad3d04f020303056224651c052109c61c18db13d 1852bb89833fada33631c7219a6d203b7b4c295e && git checkout -B drift-repro ad3d04f020303056224651c052109c61c18db13d && git merge --no-ff 1852bb89833fada33631c7219a6d203b7b4c295e

node scripts/docs-audit/affected-docs.mjs --json ad3d04f020303056224651c052109c61c18db13d

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ad3d04f020303056224651c052109c61c18db13d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Parked for ordering, by the seat's branch ruling for #38150: PR-B1 lands no earlier than PR-A2, so A2 takes the branch claude/project-thread-j4n4b0 first and this draft is closed.

PR-B1's head here is 1852bb898 (base main c091d28c8; commits 54bd49b4e, 1ce8e5851, 47bb4d28f, 1852bb898), still fetchable at refs/pull/38364/head. At that head: 3,123 lines (358 added, 2,765 deleted, 75 files), the 149 derived gates all run and passing, Metadata-protocol: narrowed. After PR-A2 merges, the branch restarts from main, these commits are cherry-picked, and PR-B1 opens as a new PR that names this one.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants