Repository navigation
Commit c665d05
<!-- 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
- .changeset
- content/docs
- api
- permissions
- protocol
- references
- docs/audits/2026-07-unknown-key-strictness-ledger.counts
- packages
- client/src
- metadata-protocol/src
- objectql/src
- qa/dogfood/test
- runtime/src
- domains
- spec
- api-surface
- authorable-surface
- declaration-map
- docs/references/api
- export-origins
- json-schema.manifest
- src
- api
- migrations/entries
- retired-defs
- semantic
- system
- scripts
- ui/packages
- app-shell/src/views
- metadata-admin
- studio-design
- i18n/src/namespaces/studio
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
0 commit comments