Skip to content

packages: adopt-orphans skips the save door's judges — it adopts into an uninstalled package id, leaves an unprefixed object unsaveable (422 NAMESPACE_PREFIX), and moves flows and datasets only after a restart #37468

Backlog

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4

Filing gate: ① product defect with a measured reach, found by the #37453 investigation (os-dev report comment 7184476778, readings A1–A3). Source: fleet. Sub-issue of #37424 (phase 4: it is the door the loose-item clean-up runs through).
Grade: area:package · Bug · p2 · severity Broken (an adopted item can no longer be saved) on an admin-only door; reach: public HTTP door POST /api/v1/packages/:id/adopt-orphans (and the ⋯ menu's 「收编散落项」), measured once each on origin/main a46efa8 by a local dogfood probe · evidence: measured.
Reader: area ux-37424 (seat repo:objectstack#5), an os-dev subagent — after the maintainer answers question 3 on #37424 (whether this all-or-nothing door stays or a per-item move door replaces it); the fix shape follows that answer.
Dedupe: adopt-orphans → 66 hits; same family, all closed: #24813 (writability), #28776 / #28735 (prefix and owner judges for fields), #23646 / #23690 (registry write-through). None covers the three cases below.

维护者速读

What (measured; full readings in comment 7184476778 on #37453)

  1. Uninstalled id. POST /api/v1/packages/com.probe.ghost/adopt-orphans answers 200 reassignedCount 1; GET /packages/com.probe.ghost answers 404; the next bare PUT /meta/flow/... answers 422 WRITABLE_PACKAGE_REQUIRED (the row inherits a binding to a package that does not exist). packages/runtime/src/domains/packages.ts ~3725–3737 notes that an id nothing installed passes requireWritablePackage; packages/metadata-protocol/src/protocol-package-commits.ts reassignOrphanedMetadata (~872–1060) has no installed check, while the save door refuses a named base that is not installed (protocol-package-scope.ts ~102–139).
  2. Unprefixed object. Adopting a package-less object probe_widget into namespace zeta answers 200; then PUT /meta/object/probe_widget, with ?package= or bare, answers 422 NAMESPACE_PREFIX. reassignOrphanedMetadata judges owner, permission set and __c, not objectNamespacePrefixViolation (protocol-save-door-refusals.ts ~967) or the child-K rule.
  3. Registry write-through. Right after a 200 adoption, GET /automation/zeta/probe_loose_flow answers 404 and GET /meta/dataset/probe_env_ds?callerPackage=com.probe.zeta answers 409 until a restart; protocol-package-commits.ts ~990–998 writes through only view and object.

Acceptance

  • Whatever door moves a package-less item into a package runs the save door's judges for the target (installed writable base, namespace prefix, child K, the ADR-0150 D3 (a) report of references left behind) and refuses with the save door's codes; each case above has a regression test red before, green after.
  • An adopted flow / dataset (and every type the boot registers) answers at its new address without a restart.

Governing text: docs/adr/0070-package-first-authoring.md (D5), docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md.

Activity

  1. added
    bug
    priority:p2
    pm:queue
    domain:server
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4

    Fix shape ruled (2026-11-26T06:45Z): #37424 question 3 is answered C (record on #37424, posted alongside this comment): a new "move into package" door that takes a selection and runs the save door's judges replaces adopt-orphans, which retires with the Studio ~org entry. This card closes with that door's PR (the three cases as regression tests, the old route and both menu entries removed); ⛔ do not patch reassignOrphanedMetadata in place. Phase 4 of #37424; not dispatched before that phase's cards are cut.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:package · domain:server · Bug · priority:p2 · pm:queue · size M; rationale: the admin-only adopt-orphans door skips the save judges, so an adopted item can end up unsaveable. Measured, but on an admin door, so p2 as filed. The fix shape waits on the maintainer's answer to question 3 on #37424, so the reader should not start before that answer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:packagebugdomain:serverpm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions