Skip to content

feat(runtime): POST /packages/:id/move-in moves a selection of loose items into a package, each through the save door - #38185

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/project-thread-j4n4b0
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/project-thread-j4n4b0

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#3 · os-tesla · session_01L9qibyHmxFV4bTFZ5BKnUz

Requested by Tesla · project thread

Part of #38150. This is PR-A1 of three, by the seat's claim (comment 7234216673): the server door. PR-A2 (the console's "Loose" filter, selection bar, picker and Setup → Packages banner) follows once #38149 merges, and PR-B (the retirement of adopt-orphans and the Studio ~org entry, the PR that carries #37468 to done) follows after both. A1 and B ship in the same release.

Clause-②: yes (widening)
Metadata-protocol: added — the five new @objectstack/spec/api MoveIntoPackage* schemas enter the api authorable-surface shard (23 keys); no metadata key an author writes is added
Skills-docs: none — no skill under skills/** teaches adopt-orphans or loose items; this door is an admin operation whose console entry lands in PR-A2, and the objectstack-platform passage on package-less Setup rows covers overlays of shipped items, which this door refuses NOT_LOOSE

维护者速读

  • 用户能看到什么变化:用户暂时看不到变化。服务端新增一个「移入软件包」接口,可以按勾选把一个、几个或全部散落项移进某个软件包;控制台的入口在下一个合并请求里做。
  • 为什么做:属于 App Studio 改版专题,代替原来「一次全收」的收编散落项接口。它关掉旧接口实测出的三个缺陷:能收编进没安装的软件包、对象没有前缀也能收进去、流程和数据集要重启才换地址。
  • 出错会怎样:整批要么全部移入,要么全部退回原处(存储和运行中的服务都退回),被拒时逐项说明原因;退回本身失败时答 500 并点名没退回的项。新接口没有调用方,有问题可以直接撤回,旧接口原样保留。
  • 要你做什么:无。

What changes

Route. POST /api/v1/packages/:id/move-in (packages/runtime/src/domains/packages.ts, mounted in dispatcher-plugin.ts, ledger row in route-ledger.ts).

  • The body is { items: [{ type, name, member? }], dryRun? }, parsed with MoveIntoPackageRequestSchema (strict). A body it refuses answers 400, naming the member, and nothing moves. The query set is closed and empty.
  • Gates are the package write doors': requireManageMetadata, the wall, the knowledge-source gate on the target, the no-query refusal, requireWritablePackage.
  • Each selected item's type is judged as a /meta write of that type before anything is read or written: metaTypeWriteRefusal (403 PERMISSION_DENIED for a datasource without manage_platform_settings and a knowledge_source without manage_knowledge_sources). A selected knowledge source is also admitted for its new author as its /meta save admits one (authoredKnowledgeSourceRefusal, read off the stored body; its own status and code).
  • A body the schema refuses answers 400 VALIDATION_ERROR. A refused move answers 422. The first refusal's code is in error.code, and error.details holds the whole answer (outcome: 'refused' and every item's refusal), so the card's "answers 422 WRITABLE_PACKAGE_REQUIRED" holds and a caller can read every refusal. A move or a dry run answers 200 with MoveIntoPackageResponseSchema as data. A failure that is not a refusal answers a 500 fault (see Protocol).

Spec (packages/spec/src/api/package-lifecycle.zod.ts). New: MoveIntoPackageItemSchema, MoveIntoPackageRequestSchema, MoveIntoPackageMovedItemSchema, MoveIntoPackageRefusedItemSchema, MoveIntoPackageResponseSchema, and their input and Parsed types. The five baselines (api-surface, authorable-surface, declaration-map, export-origins, json-schema.manifest), the reference docs and the strictness-ledger counts are regenerated. operation-message.ts gains packages_move_in_unsupported in four locales.

Protocol (packages/metadata-protocol/src/protocol-package-move-in.ts, a new facet; protocol.ts delegates to it; the facet reaches the delete door through the host's existing facade.deleteMetaItem).

  • Phase 0, judge and write nothing. A dry run answers here and calls no door: the doors' side effects in the running process (the mutation projector, the mutation signal, the registry write-through) are not covered by a store rollback. So would_move is phase 0's judgement, and a save-door judge that runs only on the real move can still refuse an item a dry run passed.
    • Only an item bound to no package is loose. A .custom pair item and an overlay of a shipped item are refused NOT_LOOSE.
    • The target is checked with the save door's own predicates: uninstalledNamedBaseRefusal (A1) and isWritablePackage.
    • An object is checked with the save door's object judges: objectNamespacePrefixViolation (A2), objectNamespaceObjectNameClash (child K), classifyObjectContribution with overlayPackageMismatchError (owner), and judgeExtensionFieldSuffix (__c).
    • The set rule (ADR-0150 D3 (a)) reads each moved body with collectReferenceHits over REFERENCE_SITES, reversed. A bare name of a package-scoped type that names a loose item the selection leaves behind, and that no package in the target's reach holds (resolveCallerPackageAddress), is refused REFERENCE_LEFT_BEHIND with references.
  • Phase 1, objects. Each object goes out through the delete door (dropStorage: false, so the table and its records stay; parentVersion names the version phase 0 read, so a save that lands in between answers 409 METADATA_CONFLICT instead of being lost) and into the target through the save door. This runs outside the transaction (measured below): the object's save syncs its storage, and that DDL waits forever on the lock a SQLite transaction holds. publishPackageDrafts defers the same DDL past its transaction for the same reason. A later refusal undoes the objects, newest first: the target row is deleted, the loose row is put back (intent: 'runtime-only'), and the registry, the mutation projector and the mutation signal are run again at the package-less address.
  • Phase 2, everything else. Each other item goes through the same delete and save doors, and the package commit is recorded (operation: 'apply', with a message naming the move). All of it runs in one engine.transaction(). Any refusal rolls it back, and for every step the rollback removed the process is put back too: the registry is written through at the package-less address, and the projector and the signal run at the target's address as deleted and at the package-less one as restored. On an engine that cannot roll back (engineCanRollBack), each step is undone instead, as phase 1's objects are.
  • What a stopped move answers. A door's refusal (a 4xx) is the item's refusal, its code and sentence filtered as publishPackageDrafts filters them (clientFacingFailureCode, clientFacingFailureText); one with no code of its own is MOVE_FAILED. A failure that is not a refusal, and a failed package commit, answer a 500 fault, every item loose as before. An undo that fails answers a 500 naming each item that did not go back, never refused.
  • ensureOverlayIndex() runs before the transaction, as in publishPackageDrafts (measured below).
  • The answer lists each moved item's states. For a package-scoped type it also gives environmentAddress → qualifiedAddress, and for a tool, skill, agent or object-less action it gives aiFaceName before and after.
  • The 2,250-line save method is not split, and reassignOrphanedMetadata is not touched.

SDK. client.packages.moveIn(id, request) (packages/client/src/index.ts). It resolves the answer for moved and would_move; a refusal, a refused dry run included, rejects with the first item's code as code and the whole answer as details.

Changeset. 38150-move-into-package-door.md: @objectstack/spec at minor (claim amendment: the new schemas enter the api authorable-surface shard); metadata-protocol, runtime and client at patch.

System-context register (content/docs/permissions/system-context.mdx). The route's three isSystem reads (the engine's own call skips the per-item type gate and the knowledge-source author admission) are owned by rows 46 and 55, whose text now names the move-in door, and the generated register is rewritten.

Error codes. NOT_LOOSE, REFERENCE_LEFT_BEHIND and MOVE_FAILED are registered under @objectstack/metadata-protocol in error-code-ledger.zod.ts.

Tests

  • packages/qa/dogfood/test/package-move-in.dogfood.test.ts, new, 20 tests. It runs on a CRM stack through this route and parses every payload with the response schema. The loose rows are a fixture: inserted with the system context and served by a second boot on the same database file, so the tests stay green once package-less creates close.
    • 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's three regressions:
      • A1: a move into com.probe.ghost answers 422 WRITABLE_PACKAGE_REQUIRED.
      • A2: probe_widget into namespace zeta answers 422 NAMESPACE_PREFIX.
      • A3: right after a move, GET /automation/zeta/probe_loose_flow and GET /meta/dataset/probe_env_ds?callerPackage=com.probe.zeta answer 200.
    • The set test: a report alone is refused, naming its loose dataset; the report, the dataset, the dataset's object and a flow move together.
    • One test per object judge: child K (zeta_custom, NAMESPACE_CONFLICT), owner (OBJECT_OVERLAY_PACKAGE_MISMATCH), and __c (VALIDATION_ERROR). The permission-set owner judge (VALIDATION_ERROR) gets one too.
    • A .custom pair item and a served overlay are refused NOT_LOOSE.
    • Whole or nothing: an object moved before a refused permission set is put back loose and served again.
    • dryRun answers would_move, writes nothing, and leaves the flow served loose: _env/NAME answers 200 and zeta/NAME does not, read again after the engine has followed every signal.
    • A refused move puts the process back: a flow moved inside the rolled-back transaction answers the same way, and a loose permission set moved before the refusal still grants manage_metadata to its holder (/auth/me/permissions).
    • The type gate: a member without manage_metadata is refused 403 PERMISSION_DENIED; a member holding only manage_metadata (a loose fixture set) is refused 403 PERMISSION_DENIED naming manage_platform_settings for a datasource and manage_knowledge_sources for a knowledge_source; the admin moving a loose knowledge source on this stack, which runs no knowledge service, is refused 503 SERVICE_UNAVAILABLE by the author admission. Each asserts the row stays loose.
    • The _env address is measured.
    • A body the schema refuses answers 400 VALIDATION_ERROR.
    • Every refusal test asserts that the stored rows are unchanged.
  • packages/spec/src/api/package-lifecycle.test.ts: two new describe blocks for the request and response schemas. They cover accepted and refused shapes, and the answers are captured from the dogfood run.
  • packages/metadata-protocol/src/protocol-package-move-in.test.ts, new, 7 tests on a stub host, for what a booted stack cannot stage on request: a dry run calls no door, projector or signal; each delete passes parentVersion from the stored checksum, and the delete door's 409 becomes the item's METADATA_CONFLICT; after a rollback every touched item is written back through the registry at the package-less address and the projector and signal run deleted-at-target then restored-loose; a 4xx with no code is MOVE_FAILED with its declared sentence; a store fault answers 500 INTERNAL_ERROR without its raw text; a failed package commit is a fault of the commit; a failed undo answers 500 naming the item.
  • packages/client/src/packages-lifecycle.test.ts (moveIn hits POST …/move-in with the body, and a 422 rejects with code, httpStatus and the whole answer in details), and return-type-precision.test.ts (moveIn returns MoveIntoPackageResponse).

Acceptance notes

  • Set test, against the card's wording. The card says "a flow alone, when it reads a loose dataset". No flow property references a dataset: the derived reference index lists the dataset's referrers as dashboard, object, report, translation and view. So a report stands in for the flow.
  • The _env address, measured on this door. After a move, GET /automation/_env/probe_loose_flow answers 409 RESOURCE_CONFLICT: "is not held by the environment, which the address names exactly (ADR-0150 D5): it is held by package "com.probe.zeta". Address it by its holder." details.candidates holds that one package. The bare name and zeta/probe_loose_flow answer 200, and the bare read serves _packageId: com.probe.zeta. The automation engine follows the save's change event asynchronously: one run read 200 on the first request after the move, so the test waits for the 409. The confirm text in PR-A2 says what was measured here, not the old door's "stops resolving at the next boot".
  • Objects outside the transaction, measured. On a file-backed SQLite stack, deleteMetaItem followed by saveMetaItem of an object into a package, inside engine.transaction(), never answered: the delete took 13 ms and the save was still pending at 8 s. The same pair outside the transaction answered in about 200 ms. A flow inside the transaction answered in about 200 ms.
  • Index setup before the transaction, measured. When a fresh boot's first metadata write was a move, the transaction never answered. Once a save had run outside a transaction, the same move answered in about 170 ms. ensureOverlayIndex() now runs first, as publishPackageDrafts does.
  • A dataset that reads a loose object is allowed. Objects are not package-scoped, so a dataset moved into zeta while its object stays loose saves (measured). The set rule covers the ADR-0150 package-scoped types only.
  • The host kernel heals the registry on its own. The dogfood stack is a host kernel, where the registry write-through also runs the hydrator, so the dogfood process-state tests stay green with the projector and signal replay removed (measured, ablation below). The stub-host tests are what pin the replay itself.
  • Status of a whole refusal. The card asked for 422. The answer is 422 with the save door's code for the first refusal, including VALIDATION_ERROR, which the save door itself answers as 400. Each item's own code is kept in error.details.refused.

Verification

Two minutes:

pnpm --filter @objectstack/metadata-protocol --filter @objectstack/runtime build
cd packages/qa/dogfood && npx vitest run test/package-move-in.dogfood.test.ts

Expected: 20 passed.

Read first, by risk:

  1. protocol-package-move-in.ts, the phase 1, phase 2 and undo blocks: the object half of the "whole or nothing" promise is an undo, not a rollback.
  2. protocol-package-move-in.ts, the set rule: reversing collectReferenceHits over REFERENCE_SITES.byTarget.
  3. domains/packages.ts, the move-in block: the per-item type gate and the knowledge-source author admission, and the 422 envelope that carries the whole answer in details.
  4. protocol-package-move-in.ts, restoreAfterRollback, replayRestored and the catch block: what a stopped move answers and what it puts back.
Local readings at 0d0078f (rework round 1, main f19350b merged)
  • package-move-in.dogfood.test.ts: 20 passed, after a full pnpm exec turbo run build --filter='./packages/**' --filter='@objectstack/dogfood^...' with declarations (83 tasks).
  • packages/metadata-protocol full suite: 23610 passed, 2 failed at 61d7ebc (the projector and signal call-site censuses, now 9 each with the move-in replays); both files 27 passed at 7ab2d91. protocol-package-move-in.test.ts: 7 passed.
  • packages/runtime full suite: 660 files, 13962 passed; --project repo: 1519 passed. packages/client: 829 passed. packages/spec src/api and src/system: 5016 passed. pnpm --filter @objectstack/spec check:generated exit 0 after gen:docs.
  • Typecheck exit 0: @objectstack/metadata-protocol, @objectstack/runtime (tsc --noEmit).
  • Ablations through scripts/ablation-replace.mjs, each restored blob == HEAD:
    • The route's per-item type gate disabled: 2 dogfood tests failed (the datasource and knowledge-source 403s), 18 passed.
    • replayRestored made a no-op: the dogfood suite stays 20 passed (the host kernel's registry heal, see Acceptance notes); protocol-package-move-in.test.ts 3 failed (rollback replay, fault replay, undo replay).
  • After merging main f19350b (one conflict: main moved the duplicate door's knowledge-service lookup into resolveKnowledgeServiceForSave; the move-in admission now uses it too), at 0d0078f with a full declarations build: metadata-protocol 23628 passed, runtime 13965 passed, client 829, spec src/api + src/system 5017, check:generated and check:system-context-census exit 0, dogfood 20 passed, runtime tsc --noEmit exit 0.
  • Round-0 ablations (set rule, ensureOverlayIndex, the 422 branch) touch code this round did not change.
  • dispatch-gates --ran at 0d0078f: 124 derived, 124 run, every exit 0, 0 NOT-MEASURED. CI at 7ab2d91 was red on two lint gates (check:system-context-census, check:test-source-alias); 23ca501 fixed both. CI at 0d0078f: 60 success, 10 skipped, 0 failed; mergeable clean.

Generated by Claude Code

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

55 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 e2a0e90025059d066dff4b067a8b70d23bca2680.

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

What this run could not see
  • 5 changed file(s) yielded no anchor (packages/spec/api-surface/api.json, packages/spec/authorable-surface/api.json, packages/spec/declaration-map/api.json, …) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: responseSchema (7 routes)
  • 7 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 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; 125 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 e2a0e90025059d066dff4b067a8b70d23bca2680 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7cde5584a37f01dc2d21af54148972d36bd5e7d5 — the merge of head 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4 into base e2a0e90025059d066dff4b067a8b70d23bca2680, 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 7cde5584a37f01dc2d21af54148972d36bd5e7d5 && git checkout 7cde5584a37f01dc2d21af54148972d36bd5e7d5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e2a0e90025059d066dff4b067a8b70d23bca2680 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4 && git checkout -B drift-repro e2a0e90025059d066dff4b067a8b70d23bca2680 && git merge --no-ff 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4

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

⚠️ 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 e2a0e90025059d066dff4b067a8b70d23bca2680 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added 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
…edger census reads 158 rows (#38150)

The move door reaches deleteMetaItem through the host facade, its class
stub carries no docblock (the facet's header is its contract), and the
retiring door's docblock folds its namespace-prefix paragraph into a line
that names its replacement.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…ledger (#38150)

NOT_LOOSE, REFERENCE_LEFT_BEHIND and MOVE_FAILED are stamped by
moveIntoPackage and reach the wire in error.code and error.details.refused,
so they join @objectstack/metadata-protocol's ledger row, as the dispatcher
error-code vocabulary guard directs. The reference pages are regenerated.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Check Changeset is red on 56df8b4 because of one line. The five new MoveIntoPackage* schemas move packages/spec/authorable-surface/api.json by 23 keys, and the changeset still declares Metadata-protocol: none.

The fix is Metadata-protocol: added with @objectstack/spec at minor. Seat 3 accepted that amendment at 06:19Z. The edit is waiting on the maintainer's word in the card thread before it is pushed. The other red runs on 7fa55cf and a976ac3 are cancelled lanes from superseded heads.


Generated by Claude Code

…m amendment (#38150)

The five MoveIntoPackage* schemas enter the api authorable-surface shard
(23 keys), which Check Changeset reads as an added metadata-protocol change.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…the member that puts the row; both write censuses record it (#38150)

undoLanded now calls applyRegistryWriteThrough right after its repo.put,
so the stored-row write census reads the write and its route in one
member. The write-through caller census counts ten sites, traced.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Type Check · workspace is red on 650b2b0 because of the runner, not this diff. The runner received a shutdown signal mid-job (job 140905040116), and the connector-slack and hono typechecks exited 137. No error TS line is in the log. The lane needs a re-run, which this session cannot trigger.


Generated by Claude Code

…the registry-question producers (#38150)

It re-saves stored loose rows, bodies unchanged, into one package: body-only.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3777fbcfe0ffefa186a20219258ddf415cdc0987
Local-runs: none
Scope: packages/spec/src/api/package-lifecycle.zod.ts, packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/system/operation-message.ts + packages/metadata-protocol/src/protocol-package-move-in.ts, packages/metadata-protocol/src/protocol.ts, packages/metadata-protocol/src/registry-question.ts, packages/runtime/src/domains/packages.ts, packages/runtime/src/dispatcher-plugin.ts, packages/runtime/src/route-ledger.ts, packages/client/src/index.ts
Security-touching: yes
Rule-change-verified: none

PR #38185 (PR-A1 of card #38150), net diff against main, 29 files. Inputs read: the card body and its three comments (claim 7234216673, amendment 7235221791, os-dev-report 7236694275), the PR body, the diff, and the check-runs on this head. Nothing was built or run; every finding below is from reading the head tree, and each says which code it rests on. packages/qa/dogfood/test/package-move-in.dogfood.test.ts and the spec and client tests were read as evidence only. The rest of the diff (tests, generated baselines, reference docs, the changeset prose) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs on the head: 70 runs, all completed: 60 success, 10 skipped, 0 failed, none pending. Among the successes: Check Changeset, Dogfood Regression Gate, Type Check (workspace, source gates, consumer gates, debt ledger, UI), Test Core 1 to 10, Lint and Repo Gates, Governed Surface Queue Guard, Spec property liveness, Build Docs. Skipped: Queue verdict, Borrowed queue verdict, Lint UI, UI Published Artifacts, Temporal Conformance, Dogfood Verify CLI, the sharded Dogfood matrix placeholder, Packed-tarball smoke, 18.x upgrade harness, Schedule gate.

① Derived judgments

  • MoveIntoPackageItemSchema, MoveIntoPackageRequestSchema (both .strict(), items min 1, dryRun optional): right. The route parses the body with the request schema and answers 400 on a miss; the spec test pins empty selection, unknown key, missing name and a smuggled packageId.
  • MoveIntoPackageMovedItemSchema, MoveIntoPackageRefusedItemSchema, MoveIntoPackageResponseSchema (response .strict(), outcome a closed enum of three): right as shapes. Two of their sentences are not true of the code, see M2, S1 and N3.
  • Error codes NOT_LOOSE, REFERENCE_LEFT_BEHIND, MOVE_FAILED under @objectstack/metadata-protocol: right, each is emitted by protocol-package-move-in.ts and nowhere else. WRITABLE_PACKAGE_REQUIRED, NAMESPACE_PREFIX, NAMESPACE_CONFLICT, OBJECT_OVERLAY_PACKAGE_MISMATCH, ITEM_LOCKED and METADATA_CONFLICT were already ledgered under the same owner; VALIDATION_ERROR is a standard code. Wrong in one respect: the door can also put an unledgered code on the wire, see S2.
  • packages_move_in_unsupported in four locales: right; it is the key catalogNotImplemented is called with, and the census test moves 37 to 38.
  • Route POST /packages/:id/move-in, its mount and its ledger row (disposition: 'sdk', packages.moveIn, both schemas named, census 157 to 158): right. The row's note misstates the transaction, see N1.
  • Client packages.moveIn(id, request) returning MoveIntoPackageResponse: the method and its wire shape are right; its jsdoc is wrong about how a refusal arrives, see S4.
  • Protocol method moveIntoPackage and the registry-question.ts producer row (saveMetaItem, 1 call, body-only): right, the facet has exactly one host.saveMetaItem call site.
  • Refusal status: the route answers 422 for every refusal with the first item's code in error.code, including VALIDATION_ERROR, which the save door answers 400. Accepted: the card asks for 422, errors.zod.ts already derives VALIDATION_ERROR for an unlisted 4xx, and each item keeps its own code in error.details.refused.

② Semver level

Clause-②: yes (widening) holds: the diff only adds (five schemas and their types, three ledger codes, one message key, one route, one SDK method, one protocol method) and removes or narrows nothing; adopt-orphans is untouched. Metadata-protocol: added with @objectstack/spec at minor matches the claim amendment 7235221791 and the moved authorable-surface/api.json shard; Check Changeset is green on the head. @objectstack/metadata-protocol, @objectstack/runtime and @objectstack/client at patch follow the amendment and the precedent it cites; a new public SDK method at patch is the seat's ruled grade, not re-ruled here.

③ Boundary flags

  • The os-dev-report carries open_questions: [], security_findings: none, out_of_scope_findings: []. security_findings: none does not hold, see M1.
  • PR body, "a report stands in for the flow" in the set test: accepted. REFERENCE_SITES is the reader, and the card's wording was an example, not a ruled fixture.
  • PR body, "a dataset that reads a loose object is allowed": accepted. Objects are not a package-scoped type, and the ruling names ADR-0150 D3 (a) only.
  • PR body, objects outside the transaction and ensureOverlayIndex() first: accepted as measured facts and as the shape publishPackageDrafts takes; what follows from them is judged in ④.
  • PR body says protocol-host.ts gains deleteMetaItem. No such file is in the diff; the facet calls host.facade.deleteMetaItem. The body's account is not the tree; no finding on the tree.
  • Who may call the route, as the brief asks: a caller holding manage_metadata (or the engine's own call), not walled (refuseWalledCatalogPackageWrite), holding manage_knowledge_sources only when the TARGET package already holds a knowledge source, with an empty query and a target isWritablePackage accepts. The protocol then refuses an uninstalled target. Whether such a caller can move an item it could not otherwise write: yes, see M1.
  • SQL push-down: phase 0 reads every sys_metadata row with where: {} and filters package-less rows in the application, on every call including each dry run. No reason is given in the diff. See N2.
  • For the seat, not a finding on this head: the package commit records every moved item existedBefore: false. By the revert door's own rule a revert of the move commit removes the items from the package; it does not put them back loose. PR-A2's confirm text or PR-B should say so, see N4.

④ Design judgment

Hits files.

packages/spec/src/api/package-lifecycle.zod.ts, against ruling 7184753035 question 3 and its first consumer (the route, then PR-A2's confirm step). The selection shape, the per-item refusal with its own code, references for the set rule and the address fields answer the ruling. Three sentences are not true of the implementation: "dryRun: true answers the same judgement and writes nothing" (M2, N3), "refused: at least one item is refused, so nothing moved" (M2, S1), and environmentAddress "present for a type addressed by package" (absent when the target declares no namespace, N6).

packages/spec/src/api/error-code-ledger.zod.ts: the three rows are placed and worded correctly, each with its 422. MOVE_FAILED is described as "a refusal the save or delete door threw without a code of its own"; in the code it is also what a store fault with no string code becomes (S2).

packages/spec/src/system/operation-message.ts: holds; one key, four locales, used by the route.

Implementing files, tried against the brief's breaks.

M1 (must-fix) — the door writes capability-gated types for a caller who lacks the capability. domains/packages.ts asks refuseKnowledgeSourcePackageWrite about the target package only (packageId: id, reach drafts and items). The items the door actually deletes and saves are the selection, and nothing judges their types. META_TYPE_WRITE_CAPABILITIES (packages/rest/src/meta-item-read-gate.ts) gates every /meta write of knowledge_source on manage_knowledge_sources and of datasource on manage_platform_settings, and the /meta save also asks authoredKnowledgeSourceRefusal; all of these are asked at the transports, none inside protocol.saveMetaItem or deleteMetaItem. So a caller holding manage_metadata alone can select a loose knowledge source or a loose datasource and have the door remove it and create it again under the package, with the caller as actor, as long as the target holds no knowledge source yet. The gate's own docblock states the rule this breaks: where a package door does to a knowledge source what a /meta write would, it asks the capability that write asks. For a datasource the delete door's awaited projector also evicts and rebuilds the live pool (datasource-admin-plugin.ts, applyMetadataDoorWrite). The old door has the same gap; the card's "gates as adopt-orphans has them" does not license carrying it onto a new public route that takes a named selection. Fix shape: judge each selected item's type with metaTypeWriteRefusal (and the knowledge-source author admission) before the protocol call, refuse whole, and pin 403 with code and status for both types and for a caller without manage_metadata. No test in the diff asserts any 403 on this route.

M2 (must-fix) — "writes nothing" and "nothing moved" hold for the store, not for the running process. Phase 2 and every dry run call the real delete and save doors inside the transaction. Those doors run two things no rollback reaches: the awaited mutation projector (runMutationProjector) and the mutation signal (emitMetadataMutation, protocol-diff-delete-load.ts and the save door). After the rollback restoreRegistry calls applyRegistryWriteThrough only, and undoLanded does the same; neither re-runs the projector nor raises the signal at the restored address. By reading:

  • permission and position (plugin-security/src/security-catalog-echo.ts): the delete drops the loose echo slot and the save registers an echo stamped _packageId of the target. On an environment kernel applyRegistryWriteThrough returns before the hydrator, so the echo is the only copy the catalog reads. After a dry run the catalog serves the set as the target's; after a refusal that falls between a set's delete and its save (the dogfood permission-set owner case is exactly that) the set has no echo, which that module documents as "grants nothing" until it is saved again or the kernel restarts.
  • datasource: a refusal after the delete and before the save leaves the metadata slot unregistered and the pool evicted, with the row restored underneath.
  • flow: the automation plugin queues a re-read on each signal (service-automation/src/plugin.ts, syncMutatedFlows). The last signal is raised before the rollback and none follows it, so which state the engine arms depends on whether its read lands before or after restoreRegistry. The dry-run test cannot tell: it asserts GET /automation/probe_dry_flow is 200, which is true under either holder.
    The dogfood stack is a host kernel, where the registry heal covers the first case, so the suite is green without proving the claim. Fix shape: after a rollback or an undo, re-run the projector and raise the signal for every touched item at its restored address (or keep both out of a transaction that will not commit), and pin it: after a dry run and after a refused move, _env/NAME still answers 200 and NAMESPACE/NAME does not, and a loose permission set still resolves.

S1 (should-fix) — the answer is not true when the undo fails. undoLanded catches every failure, logs it with console.error, and the door still answers outcome: 'refused', moved: [], which the route words as "Nothing was moved". The log line itself says the item "may now be stored in neither place, or in the target, although the answer says nothing moved". This is the object half on every engine, not only on one that cannot roll back. The inner catch around the target-side deleteMetaItem also reads every failure as "the save never wrote it"; a delete refused for another reason leaves the target row stored, the loose row is then put back beside it, and nothing is logged. publishPackageDrafts has the same log-only habit, but there it is confined to engines without rollback and the published schema does not promise the opposite. Fix shape: carry the items the undo could not restore into the answer (or answer 500), and tell a missing target row apart from a failed delete.

S2 (should-fix) — a thrown fault reaches the wire as a refusal with the thrower's own code and text. refusalOf copies any string err.code and err.message; the route promotes the first one to error.code at 422 and repeats the message. buildApiError does not filter by the ledger, so a driver or store fault mid-phase answers 422 with a code such as the driver's own in error.code and its raw text in error.message and error.details.refused. publishPackageDrafts closed exactly this with clientFacingFailureCode and clientFacingFailureText. A failure of recordPackageCommit is also blamed on items[0], because current is cleared by then. Fix shape: filter code and text as the publish door does, answer a non-refusal fault as a fault, and pin MOVE_FAILED with code and status; no test reaches it today.

S3 (should-fix) — a write between phase 0 and the item's delete is lost. Bodies are read once in phase 0, outside any transaction; moveItem deletes with no parentVersion (last write wins) and saves the phase-0 body. A save of a selected loose item that lands in between is removed by the delete and the stale body is what the package receives, with no conflict. Phase 1 widens the window: objects run one by one outside the transaction, each with DDL. Fix shape: pass the row's version from the snapshot as parentVersion to the delete door so the race answers METADATA_CONFLICT, or re-read each row inside the write.

S4 (should-fix) — packages/client/src/index.ts jsdoc says the answer's outcome is "moved, or refused with every refused item's own code". The route answers a refusal as HTTP 422 and the client's fetch throws on a non-2xx, so moveIn never returns outcome: 'refused'; the refusal is a thrown error whose details is the answer. This holds for a refused dry run too. The first consumer is PR-A2's confirm step, which must catch. Fix the sentence, and have the client test show the thrown shape.

The other breaks tried, and what the code answers:

  • A failure mid-phase 2 on an engine that rolls back: the store is restored, the registry is healed for the non-object items, and phase 1's objects are undone newest first. Real for the store; see M2 for the rest. The dogfood "whole or nothing" case pins the object coming back loose and served.
  • A failure mid-phase 1: landed holds the half-moved object, the undo's target-side delete finds nothing, and the loose row is put back. Holds.
  • A process stop between phase 1 and phase 2, or during the undo: the objects stay in the target, the rest stay loose, and no commit records it. Nothing journals the object half. Each row is individually valid and a second call completes the rest (the object is then NOT_LOOSE and must be dropped from the selection). Inherent in an undo; named here so nobody reads the door as crash-atomic. N4.
  • A partial selection across objects and non-objects: a dataset or view may move while its object stays loose and the reverse; neither is refused, by the D3 (a) reading above. Holds as ruled.
  • An item that is not loose: a row bound to any package (a .custom pair item among them) is not in looseRows and is refused NOT_LOOSE; a package-less row over a shipped item is refused by isArtifactBacked. Both pinned with code and 422.
  • The target: uninstalled is refused by uninstalledNamedBaseRefusal (pinned, 422 WRITABLE_PACKAGE_REQUIRED); a code or platform package is refused by the route's requireWritablePackage before the body is parsed; a disabled package and a .custom pair as target are whatever the save and delete doors answer per item, which is the ruled design. None of the last three is pinned on this route (N5).
  • Addressing: environmentAddress, qualifiedAddress and aiFaceName are derived, not measured per item, and agree with the measured 409 on _env/NAME. A stored reference that spells _env/NAME in an item left behind is not judged by the set rule and stops resolving; the ruling asks for D3 (a) only.
  • The set rule: collectReferenceHits over REFERENCE_SITES.byTarget filtered by the moved item's type, against active loose rows of package-scoped types outside the selection, minus names a package in the target's reach holds. Holds; the ablation the dev reports matches the code path.

Nits (no effect on correctness or the contract):

  • N1: the route-ledger.ts note says every item goes through both doors "inside one transaction"; objects do not.
  • N2: phase 0's where: {} read of all of sys_metadata with bodies; the package-less filter and the selected names could be pushed down. Inherited from the old door, no reason stated. Follow-up card.
  • N3: a dry run judges an object by four phase-0 judges, never by the save door, so would_move can be followed by a real refusal of a stored object the full save refuses. The facet header says so; the schema's "the same judgement" does not.
  • N4: revert of the move commit removes the moved items rather than un-moving them, and a stop between phases leaves moved objects with no commit. Follow-up for PR-A2's confirm text or PR-B.
  • N5: tests do not assert the code on the 400 answer, and do not pin a read-only, disabled or .custom target on this route.
  • N6: environmentAddress and qualifiedAddress are omitted when the target declares no namespace; a draft's references are not set-judged when the item also has an active row; a bundled item's other members stay loose when one member moves.

M1 and M2 are must-fix; S1 to S4 each earn a delta review of their fix.

Implemented-by: claude/project-thread-j4n4b0
Reviewed-by: session_01L9qibwsYQqi3TBx2SFE978

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

L1-b, the seat's L1 thread for zone o3-studio · 2026-11-28T08:49Z

席位核对 — L1 REWORK @ 3777fbcfe0ffefa186a20219258ddf415cdc0987

Verdict: REWORK (round 1). The at-tier contract review 7236830081 is FAIL on this head (tier verified on the reviewer's transcript): M1, M2 must-fix; S1–S4 should-fix. Each is spelled out there with its fix shape; this comment does not restate them. The L1 items below are in addition.

Owed this round

  1. M1, M2, S1, S2, S3, S4 of record 7236830081. M1 was confirmed at packages/runtime/src/domains/packages.ts lines 4076–4094: the move-in block asks refuseKnowledgeSourcePackageWrite about the target id only, and nothing judges the selected items' types against META_TYPE_WRITE_CAPABILITIES (datasource → manage_platform_settings, knowledge_source → manage_knowledge_sources).
  2. Refusal tests assert code and status (ADR-0112). Add 403 pins for M1 (a caller without manage_knowledge_sources selecting a loose knowledge source, one without manage_platform_settings selecting a datasource, one without manage_metadata). Add the code on the 400 schema-refusal answer (N5), and a MOVE_FAILED pin for S2.
  3. Changeset and schema prose follow the fix. At this head the changeset's "Whole or nothing: … Nothing is written" and "dryRun: true … writes nothing" are not true of the running process (M2), and "nothing moved" is not true when the undo fails (S1). Rewrite them to what the fixed code does. The same goes for the schema describes the record names (N3) and the route-ledger.ts note (N1).
  4. Body prose. The body says protocol-host.ts gains deleteMetaItem, but no such file is in the diff (the facet calls host.facade.deleteMetaItem). Correct the sentence.

Read at this head (stands)

  • Shape (l1-face.mjs --pr 38185): draft, base main, Part of #38150 (PR-A1 of three, by claim 7234216673), no closing keyword, no release path, every published package touched has a changeset entry, Skills-docs: none — … now on the body (the seat's patch).
  • Checks: 60 success, 10 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are success.
  • Accepted as measured: objects outside the transaction and ensureOverlayIndex() first (the dev's deadlock readings and ablations), the report standing in for the flow in the set test, and 422 for a whole refusal with each item's code in details.refused.

For the seat

  • Security-touching: yes in the record (M1). Whether to add the security label is the seat's call.
  • Nits N2 (phase 0 reads all of sys_metadata with no push-down, inherited) and N4 (a revert of the move commit removes the items instead of putting them back loose, and there is no journal across phases). Both go to the filing gate, or N4 can go to PR-A2's confirm text and PR-B.
  • Part of #38150: pm:dispatched stays on the card at landing (rule B). Read K before enqueue: the branch was 26 behind main at this read.

Next: the fixed head goes to the same reviewer for a delta L2 on M1–M2 and S1–S4, and to this thread for the L1 delta.

…ype, calls no door on a dry run, and puts the process back when a move stops (#38150)

- Each selected item's type is judged as a write of that type before
  anything is read or written (403 with its code), and a selected
  knowledge source is admitted for its new author as its save admits one.
- A dry run answers the judgement made before any door runs and calls no
  door.
- After a rollback or an undo, the registry, the mutation projector and the
  mutation signal run again at both addresses, so a refused move leaves
  every item served loose, as before.
- An undo that fails answers a 500 naming the items that did not go back.
  A failure that is not a refusal, or a failed package commit, answers a
  500 fault; a door's refusal keeps its code and sentence, filtered as the
  publish door filters them, and one with no code is MOVE_FAILED.
- Each delete names the version the judgement read, so a save in between
  answers METADATA_CONFLICT.
- client.packages.moveIn documents and tests that a refusal rejects with
  the code and the whole answer in details.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…move-in door's two replays (#38150)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…caller reads are owned in the system-context register; the projector census pays the lint load at collection (#38150)

The per-item type gate and the knowledge-source author admission on the
move-in door are named by the rows that own their bypass (46 and 55), and
the register is regenerated. The projector call-site test, edited here,
imports @objectstack/lint at module top as its sibling emit test does.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…into claude/project-thread-j4n4b0

# Conflicts:
#	packages/runtime/src/domains/packages.ts
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4
Local-runs: none
Scope: packages/spec/src/api/package-lifecycle.zod.ts, packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/system/operation-message.ts + packages/metadata-protocol/src/protocol-package-move-in.ts, packages/metadata-protocol/src/protocol.ts, packages/metadata-protocol/src/registry-question.ts, packages/runtime/src/domains/packages.ts, packages/runtime/src/dispatcher-plugin.ts, packages/runtime/src/route-ledger.ts, packages/client/src/index.ts
Security-touching: yes
Rule-change-verified: none

Delta review of PR #38185 on the head that answers the FAIL record on 3777fbcfe0ffefa186a20219258ddf415cdc0987 (PR comment 7236830081). Read: the delta 3777fbcf..0d0078fc, claim amendment 2 (7238710652), the PR body as it stands, and the check-runs on this head. Nothing was built or run.

The delta splits in two. The dev's own work is three linear commits, 61d7ebc5, 7ab2d914 and 23ca5017 (14 files). The head itself is a merge of main f19350b4 (392 files), judged only for its conflict resolution. There is one conflict, in packages/runtime/src/domains/packages.ts: the move-in author admission now resolves the knowledge service through resolveKnowledgeServiceForSave(deps, _context), the helper main introduced and the /meta save in domains/meta.ts uses with the same arguments. The resolution is right. Of the other scope files the merge touches only packages/client/src/index.ts, in an unrelated i18n comment.

Check-runs on the head: 74 runs, all completed: 62 success, 12 skipped, 0 failed, none pending. mergeable_state reads clean now. The unstable reading at 11:41Z was runs still in progress; which ones cannot be told after the fact, and none ended red. Skipped: Queue verdict, Borrowed queue verdict, Check PR Size, Auto Label, Lint UI, UI Published Artifacts, Temporal Conformance, Dogfood Verify CLI, the sharded Dogfood matrix placeholder, Packed-tarball smoke, 18.x upgrade harness, Schedule gate.

① Derived judgments

  • No schema member, error code, message key, route or SDK signature is added or removed by the delta. The delta changes sentences in package-lifecycle.zod.ts (the request doc, dryRun, environmentAddress, outcome, the response describe), the client jsdoc, the ledger note and the changeset prose, and the regenerated reference page follows.
  • New answers on the route, each right: 403 PERMISSION_DENIED (standard code) for a selected datasource or knowledge_source whose capability the caller lacks; the knowledge-source author admission's own status and code; 503 SERVICE_UNAVAILABLE when a selected knowledge source cannot be read or no knowledge service is mounted; 500 for a fault or an incomplete undo, with a code kept only when the catalogue holds it.
  • dryRun now answers phase 0 alone. Right, and the schema, the client jsdoc, the ledger note and the changeset all say so in the same words.

② Semver level

Unchanged and still right: Clause-②: yes (widening), Metadata-protocol: added, @objectstack/spec minor, the other three patch. The delta publishes nothing new; Check Changeset is green on the head. Amendment 2 adds file surface only (the system-context doc page, two call-site census tests, one test import), each forced by a census gate, and none of it is in the reviewed scope.

③ Boundary flags

  • For the seat: the claim (7234216673) ruled that "a dry run takes the same path and always rolls back". The dev answered M2 by making a dry run phase 0 only, which the first record offered as one of two fix shapes. The published text was changed to match, so the contract is honest; the seat's ruling is what moved, and the seat accepts or re-rules it. Its cost is N7.
  • The os-dev account of the fixes was read as data and checked against the tree; every claim in it holds.
  • SQL push-down: unchanged, N2 of the first record stands as a follow-up.
  • Environment kernel: the replay was judged by reading, since the dogfood stack is a host kernel. After a rollback restoreAfterRollback runs outside the transaction, once the store is restored; replayRestored runs the projector as deleted at the target's address and then as the restored state at the package-less address. The security echo and the datasource projector both re-read the store at the address they are handed, so the target slot is dropped and the loose slot registered whatever the registry holds. The flow sync re-reads on the signal raised after the restore, and its queue is serial, so the last read is of the restored state. Holds on both kernels by reading.

④ Design judgment

M1: closed. domains/packages.ts asks metaTypeWriteRefusal('POST', item.type, caller) for every selected item before the protocol is resolved, and authoredKnowledgeSourceRefusal for every selected knowledge source, read off its stored body, before the protocol call. The type fold is the one the protocol uses (canonicalMetaType is canonicalMetaUrlType). Dogfood pins 403 PERMISSION_DENIED with status and code for a caller without manage_metadata, for a datasource and for a knowledge_source, and 503 SERVICE_UNAVAILABLE for the admission; each asserts the stored row unchanged.

M2: closed. A dry run returns after phase 0 and calls no door; the facet unit test asserts no delete, save, commit, write-through, projector or signal. After a rollback every step the transaction removed gets the registry write-through, the projector and the signal at both addresses, including a step whose delete ran and whose save threw. After an undo the same replay runs at the package-less address. Dogfood pins that after a dry run and after a refused move the flow answers at _env/NAME and not at NAMESPACE/NAME, and stays so, and that a loose permission set moved before a refusal still grants.

S1: closed. undoLanded returns the steps it could not undo, and the door then throws a 500 fault naming them instead of answering refused. The target-side delete is no longer wrapped in its own catch: a failure stops that step before the loose row is put back. The delete door answers a success with nothing removed when no row is bound to the target, so a step whose save never wrote is still undone. Pinned in the facet test.

S2: closed. refusalOf filters code and text with clientFacingFailureCode and clientFacingFailureText; a throw that declares no client refusal is a 500 fault, never an item's refusal; a failed commit is named as the commit's. Pinned: MOVE_FAILED, the 500 with INTERNAL_ERROR and no driver text, and the commit case.

S3: closed. Each delete names the version phase 0 read (receiptVersion of the row's checksum), and a write in between is refused METADATA_CONFLICT. Pinned in the facet test. A row stored with no checksum is still last write wins, N8.

S4: closed. The client jsdoc says a refusal, a refused dry run included, is thrown with the first item's code and the whole answer in details; the client test shows the thrown shape with code, status and details.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract):

  • N7: phase 0 asks the object judges and the set rule only. The permission-set owner judge the card's item 9 lists is a pure function and is not asked there, so a dry run answers would_move for a set the real move refuses (cleanly, whole or nothing). The published text names exactly which judges a dry run runs. Follow-up, with the seat's word on the dry-run ruling above.
  • N8: the version pin needs a stored checksum; a row without one (the dogfood fixture rows among them) moves unpinned.
  • N9: the author admission reads the served item, so a knowledge source stored as a draft only is not admitted before its draft row is re-saved; the caller still needs manage_knowledge_sources. The admission's own refusal (status and code from authoredKnowledgeSourceRefusal) is pinned only through the no-service 503.
  • From the first record: N1 is fixed in the ledger note, N3 is answered by the new dry-run text, the 400 answer now asserts its code, and the namespace half of N6 is worded in the schema. N2, N4, the rest of N5 (a read-only, disabled or .custom target is not pinned on this route) and the rest of N6 stand as follow-ups.

Implemented-by: claude/project-thread-j4n4b0
Reviewed-by: session_01L9qibwsYQqi3TBx2SFE978

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

L1-b, the seat's L1 thread for zone o3-studio · 2026-11-28T11:48Z

席位核对 — L1 delta ACCEPT @ 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4

Verdict: ACCEPT, answering REWORK 7236842082 at 3777fbcf. The L2 delta at CONTRACT_REVIEW_TIER is PASS (7238780160): M1, M2 and S1–S4 are closed, with no new must-fix or should-fix.

Read at this head

  • Shape (l1-face.mjs --pr 38185, CLEAN): draft, base main, Part of #38150 (PR-A1 of three, so Part of is right), 33 files, +1918/−29, no release path. The changeset covers all four published packages, and the declarations are unchanged: Clause-②: yes (widening), Metadata-protocol: added. The Skills-docs: none line is still true, because no skill teaches adopt-orphans or loose items.
  • The delta, split. The dev's own work is 61d7ebc5, 7ab2d914 and 23ca5017 (14 files). The head is a merge of main f19350b4 with one conflict, resolved through resolveKnowledgeServiceForSave, which is the helper the /meta save uses.
  • Claim against the surface. Amendment 2 (7238710652) covers every path the delta adds: content/docs/permissions/system-context.mdx, the two call-site census tests, and the @objectstack/lint import. No breach.
  • Census tests are not weakened. Both counts go from 7 to 9, and each comment names the two new call sites (replayRestored: once at the target's address as deleted, once at the package-less address as restored). A count that follows real new sites is a re-point, not a loosening.
  • Rejection tests assert code and status (ADR-0112).
    • The new 403s (no manage_metadata, a datasource, a knowledge_source) assert status 403, PERMISSION_DENIED and the capability named in the message, and that the stored row is unchanged.
    • The 503 for the knowledge-source admission asserts SERVICE_UNAVAILABLE.
    • Each refused move goes through refusedAnswer, which asserts 422, error.code equal to the first refusal's code, and outcome: 'refused' with moved: [].
    • The 400 now asserts VALIDATION_ERROR.
    • The facet test pins METADATA_CONFLICT, MOVE_FAILED, the 500 with INTERNAL_ERROR and no driver text, the commit fault, and the undo that fails.
    • My REWORK extras are all met.
  • Changeset, schema and doc sentences, read in person. The "nothing is written" prose on a refusal is gone everywhere. It now says what had moved is moved back, with the registry and signal replayed at both addresses. A dry run is described as phase 0 alone, calling no door. That reading matches the code, and the changeset, package-lifecycle.zod.ts, the client jsdoc, the route-ledger note and the regenerated reference page all say it in the same words. The two system-context rows (~46, ~55) name the move-in door's capability asks truly.
  • PR body. The wrong protocol-host.ts sentence is gone, and the local readings are pinned to 0d0078fc.
  • Checks: 62 success, 12 expected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check are success. mergeable_state is clean now. The earlier unstable was runs still in progress; none ended red.

For the seat to rule

  • The dry-run ruling moved. The claim (7234216673) said "a dry run takes the same path and always rolls back". The dev answered M2 with the other fix shape the first L2 record offered: a dry run is phase 0 only. The published text says so honestly. The seat accepts this or re-rules it. Its cost is N7: a dry run does not ask the permission-set owner judge, so it can answer would_move for a set the real move refuses, cleanly and whole.
  • Follow-ups to the filing gate, not owed by this PR:
    • N7, with the ruling above.
    • N2, SQL push-down.
    • N4.
    • The rest of N5: a read-only, disabled or .custom target is not pinned on this route.
    • The rest of N6.
    • N8: a row without a checksum moves unpinned.
    • N9: the admission's own refusal is pinned only through the 503.

Before landing

No governed path, and the diff is under 3000 lines, so Tier H is not owed. The seat lands it on this ACCEPT at this head, once it has given its word on the dry-run ruling.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T11:53Z · zone o3-studio (seat card thread, #38150 PR-A1)
Head-sha: 0d0078fc5cc74d45e21ecdead14fcfb0598d72f4

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 11:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit d95948d Nov 28, 2026
75 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-j4n4b0 branch November 28, 2026 12:59
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…l }} holes written with spaces, as the Console does (objectstack-ai#38275)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoJ9d2Ay3ahgdHpDaETT43do)_

Fixes objectstack-ai#38266
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: none — skills/objectstack-i18n already teaches the
double-brace {{variable}} form; the spaced form is tolerated to match
the Console and the server t(), not a new form to teach

## 维护者速读
-
部署方在翻译里覆盖校验报错或操作报错(导入失败、重复记录等)时,占位符写成花括号内带空格的形式,服务端返回的报错现在会填上值;以前用户直接看到花括号。
- 替写翻译的搭建者解决:同一句翻译在控制台正常,在服务端报错里露出花括号;与服务端翻译替换修复(同族的另一张卡)用同一条规则。
- 只改报错文案的填值规则,平台自带的报错文案一字不变;出问题最多是某句覆盖报错填值不对,可以直接撤回。
- 无

## What changes
- `packages/spec/src/system/validation-message.ts`:
`interpolateValidationMessage` matches `{{`, optional whitespace, a
word, optional whitespace, `}}` (`/\{\{\s*(\w+)\s*\}\}/g`, the same
pattern as the two server `t()` in objectstack-ai#38265). A placeholder with no value
is still written back exactly as matched, spaces included; single braces
(`{name}`) are still not a placeholder. The function docblock and the
module's `## Interpolation` section say so.
- `packages/spec/src/system/operation-message.ts`: docblock only; it
shares the interpolator.
- Both renderers' override paths (`renderValidationMessage`,
`renderOperationMessage`) and built-in paths go through this one
function, so both catalogs change together.
- Changeset: `@objectstack/spec` minor (`Metadata-protocol: semantic`:
in a deployment's override translation, `{{ label }}` now means a
placeholder instead of literal text).

Not changed: core and service-i18n (objectstack-ai#38265), ui, locale packs, HotCRM,
skills. Signature unchanged, so `api-surface` / `export-origins` do not
move.

## Tests
- `validation-message.test.ts`: the five spellings on
`interpolateValidationMessage` and on the `renderValidationMessage`
override path, plus `{{ label }} is needed` rendering `Qty is needed`.
- `operation-message.test.ts`: `{{ field }} taken` rendering `Email
taken` on the `renderOperationMessage` override path, plus the five
spellings.
- `validation-message.override-once.test.ts`: the fake translator
follows the same `\s*` pattern (it models `FileI18nAdapter.t`), and a
new case pins that a written VALUE containing `{{ label }}` is still
printed as written (one pass, no re-expansion).

Five spellings through each renderer's override path (params `{ name:
'Ada' }`; Console column measured with i18next 26.4.0 on the objectstack-ai#38092
card):

| Template | Console | main c06dac7, both renderers | this PR, both
renderers |
|:--|:--|:--|:--|
| `Hi {{name}}!` | `Hi Ada!` | `Hi Ada!` | `Hi Ada!` |
| `Hi {{ name }}!` | `Hi Ada!` | `Hi {{ name }}!` | `Hi Ada!` |
| tab and two spaces | `Hi Ada!` | as written | `Hi Ada!` |
| `Hi {name}!` | `Hi {name}!` | `Hi {name}!` | `Hi {name}!` |
| `Hi {{ missing }}!` | `Hi {{ missing }}!` | `Hi {{ missing }}!` | `Hi
{{ missing }}!` |

## Acceptance notes
- Premise measured on `origin/main` `c06dac7c` before any edit: a
`validation.field.required` override `{{ label }} is needed` rendered as
written, and an `errors.duplicate_record_field` override `{{ field }}
taken` rendered as written.
- Built-in catalogs byte-for-byte unchanged: every key of every locale
in `BUILTIN_VALIDATION_MESSAGES` and `BUILTIN_OPERATION_MESSAGES`,
rendered once with every placeholder filled and once with none, 1176
lines, sha256 `0ac2410a…68657ca` before and after (`cmp` identical). No
built-in template carries a spaced hole.
- Every caller of `interpolateValidationMessage` is inside
`packages/spec` (the two renderers); other packages call only the
renderers.
- One widening, nothing narrowed: every string that rendered before
renders the same, except that a spaced hole with a value is now filled.
- Pre-existing gap, left as is on both sides: the Console's i18next also
fills dotted paths (`{{a.b}}`) and format suffixes (`{{x, number}}`),
which this interpolator and the two server `t()` in objectstack-ai#38265 still read as
literal text (the name stays `\w+`); per the seat's ruling on the objectstack-ai#38265
contract review (7238665113), neither card widens it, so all three
server interpolators handle it the same way.

## Verification
- Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/system/validation-message.test.ts
src/system/operation-message.test.ts
src/system/validation-message.override-once.test.ts` shows 3 files, 163
passed.
- Read first: `interpolateValidationMessage` in `validation-message.ts`
(the one changed line), then the new spaced-value case in
`validation-message.override-once.test.ts`.

<details><summary>Local readings at 89321cb</summary>

- The three suites above: Test Files 3 passed, Tests 163 passed.
- Ablation through `scripts/ablation-replace.mjs` (pattern reverted to
`/\{\{(\w+)\}\}/g`, tests run on `src`, no dist in the path): 8 failed
(spaced and tab spellings on both renderers and on the function, and
`Qty is needed`), 155 passed; restore blob `965a5ad4` == HEAD. The new
spaced-value case in `override-once` stays green under the ablation by
design: it pins one pass, which holds with either pattern.
- `overlap-check.mjs` VERDICT clean exit 0 against origin/main e2a0e90
(shares two files with objectstack-ai#38185, merges cleanly).
- `pnpm --filter @objectstack/spec build` (dts on), `typecheck`: VERDICT
command-exit 0; `pnpm --filter @objectstack/spec test`: Test Files 911
passed (911), Tests 28869 passed, 1 todo.
- `dispatch-gates --ran` (`gates-ran-89321cb5.list`): 87 derived, 87
run, 0 NOT MEASURED, 0 unrun. Three first exited 3 for a missing build
(`check:doc-formula-expressions`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`) and exited 0 after the packages turbo build.
- PR check-runs on 89321cb: 58 success, 11 skipped, 0 failed. Report:
objectstack-ai#38266 comment 7238709250.
</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibwBjX6kCcDLzx2jrwn)_

<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibwBjX6kCcDLzx2jrwn -->

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…s it varies by Accept-Language (objectstack-ai#38274)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao2nxJ1WFfhVcttSAtWX2GTp)_

Fixes objectstack-ai#38123
repo:objectstack#3 · os-tesla · session_01L9qibxRYWXrA8r7F5oJ2mH

Clause-②: no
Metadata-protocol: none

## 维护者速读
- 用户看不到变化:调度器各模块自己接住错误后返回的提示本来就按请求语言给出,现在响应头也写明它随请求语言变化,和上一张卡修好的那几条出口一致。
- 属于界面多语言这条线,替用多种语言访问同一部署的用户解决:缓存可能把一种语言的错误提示交给说另一种语言的人。
- 只多一个响应头,状态码、错误码和正文都不变;不带提示文字的错误应答不加;有问题可以直接撤回。
- 无

## What changes
- `packages/runtime/src/dispatcher-plugin.ts`, `sendResultBase`'s
`response` arm: when `answerVariesByLanguage(result.response.body)`
(`@objectstack/types`, landed with objectstack-ai#38114) is true, it writes
`res.header('Vary', ['Accept-Language'])`. That is the contract's
multi-value form, which the hosts append. It is written after the
route's own headers, so nothing after it can replace it.
- `packages/adapters/hono/src/index.ts`, `createHonoApp`'s `toResponse`,
`response` arm: the same question of the body, answered with
`c.header('Vary', 'Accept-Language', { append: true })`, after the
dispatcher's own headers.
- `packages/types/src/localized-answer-vary.ts`: docblock only. Its "Who
asks" list now names the two returning exits beside the three throwing
ones. No new export.
- Changeset: `@objectstack/runtime`, `@objectstack/hono`,
`@objectstack/types` patch.

## Why
A shared cache in front of the server must never hand a user an error
message in someone else's language, so every localized error answer says
it varies by `Accept-Language`. The rule sits on the exits rather than
in `errorFromThrown`: objectstack-ai#38114 put the rule on the three exits that answer
a THROW. An answer a dispatcher domain catches and composes itself is
RETURNED as `{ handled: true, response }` and leaves only through these
two exits, which until now wrote nothing but `response.headers`. Per the
claim (route A, bounded in-place widening of the same defect class), the
one exit rule covers every producer of a returned `userMessage`, each
named here:
- `HttpDispatcher.errorFromThrown`, the card's own case (for example
`POST /automation/_record-starts`, whose catch hands over the `/data`
read's localized `recordNotFoundError`);
- `deps.error` carrying a `userMessage` (ruling B′ on objectstack-ai#24914): the
automation resume door's and trigger door's `400 FLOW_FAILED`;
- the `/actions` door's `apiErrorResponse` (`action-dispatch.ts`,
`actionsDoorAnswerOf`);
- the dispatch foot's marked `PERMISSION_DENIED` 403
(`http-dispatcher.ts`, `declaredUserMessage`).

## Tests
Each pin goes into the existing harness file for its exit, as a
top-level `describe`:
-
`packages/runtime/src/dispatcher-plugin.declared-user-message.test.ts`,
`[objectstack-ai#38123] the dispatcher RETURNED exit`. Every case drives a REAL route
mounted by `createDispatcherPlugin` and reads the fake response's header
writes:
- `errorFromThrown`: `POST /api/v1/automation/_record-starts`, with the
`/data` read throwing the real `recordNotFoundError(object, id,
context)`. For `en`, `zh-CN` and `ja-JP` callers: 404
`RECORD_NOT_FOUND`, the `userMessage` in that language, exactly one
`Vary` write of `['Accept-Language']`, and it is the last header
written. Control: the same route's unmarked `400 VALIDATION_FAILED`
writes no `Vary`.
- the resume door (`deps.error` with a `userMessage`), the trigger door
and the `/actions` door: `400 FLOW_FAILED` from a scripted engine whose
result carries an app hook's mark. Marked: the mark on the wire and one
`Vary` write, last. Control: the unmarked result writes no `Vary`.
- the dispatch foot: a marked `PERMISSION_DENIED` 403 gets the `Vary`
write; the unmarked one does not.
- `packages/adapters/hono/src/hono-response-header-array.test.ts` (the
`toResponse` header harness), `[objectstack-ai#38123] the returned answer`. One row
per producer above, with the nested ADR-0112 body that producer
composes, written out because this package's `@objectstack/runtime` is a
stub: marked ⇒ `Vary: Accept-Language`, unmarked ⇒ no `Vary`. Appended,
not set: a route's own `Vary: Accept-Encoding` keeps its token beside
`Accept-Language`, and with CORS on, `Origin` keeps its place.

<details><summary>Readings (base origin/main bd5407e, head
e6eed88)</summary>

- Before the change, through the real mounted `POST
/api/v1/automation/_record-starts` (probe in the card's pre-claim
report): `404 RECORD_NOT_FOUND`, `userMessage` in en / zh-CN / ja-JP,
and the only header written was `X-Request-Id`. No `Vary`.
- Ablation through `scripts/ablation-replace.mjs` on the committed fix,
deleting one exit's line, then restoring it; each restore was checked as
`blob == HEAD` with an empty `git diff HEAD`. Both suites import their
exit from source.
- runtime: `Tests 7 failed | 28 passed (35)`. The seven marked rows of
the new describe failed (three languages, three flow doors, the foot
403), and every control passed.
- hono: `Tests 6 failed | 7 passed (13)`. The four marked producer rows
and the two "appended" rows failed, and every control passed.
- Package suites, each `pnpm --filter PKG test` under the verify lock,
exit 0:
  - types: 42 files, 963 tests.
  - hono: 14 files, 272 tests.
  - runtime: 655 files, 12455 passed and 25 skipped.
- `typecheck` exit 0 on types, hono and runtime.
- `eslint --no-inline-config` exit 0 on the five touched `.ts` files.
- Derived local gate set at `e6eed882`: `dispatch-gates --ran`
reconciles 71 derived, 70 run with `exit 0`, 1 NOT MEASURED, 0 unrun.
The NOT MEASURED one is `check:dual-build-cjs-loads`, which exited 3
(PREREQUISITE NOT MET): it reads every package's `dist/`, and this tree
built only the runtime and hono closures. CI's `Lint & Repo Gates` runs
it. `check-plugin-teardown-shape --self-test` needed its fixture commit
fetched into the shallow clone, then exited 0.
- `overlap-check` before the first push was not run; it was run right
after it on e6eed88: clean against origin/main and against objectstack-ai#38185, the
one open PR sharing `dispatcher-plugin.ts`.
</details>

## Acceptance notes
- Correction to the pre-claim report: `mcp.ts` is not one of these
producers. Its `deps.error` with a `userMessage` (`resumeDoorError`)
answers `dispatchActionResume`, the kernel's in-process host API
(`action-dispatch.ts`), not an HTTP route, so no response header
applies.
- No dedupe of the token. No producer today returns both a `userMessage`
body and its own `Vary: Accept-Language` header:
`localizedNotImplemented` localizes `message`, not `userMessage`, and
the `/meta` reads that set the header answer success bodies. `Vary` is a
list, so a repeated token is harmless.
- The hono pins live in `hono-response-header-array.test.ts`, the
`toResponse` header harness, rather than
`hono-thrown-message-disclosure.test.ts`, which the claim named: that
file pins `thrownJson`, the throw arm, and this change is the returned
arm.

## Verification
Read first, by risk:
1. `packages/runtime/src/dispatcher-plugin.ts`: the end of
`sendResultBase`'s `response` arm (the exit `os dev` serves for every
dispatcher-mounted route).
2. `packages/adapters/hono/src/index.ts`: `toResponse`'s `response` arm.

Two-minute check: `pnpm --filter @objectstack/runtime exec vitest run
src/dispatcher-plugin.declared-user-message.test.ts` shows 35 passing.
Delete the `res.header('Vary', …)` line in `sendResultBase` and the same
command shows 7 failing.

## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic
(not touched).
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; lint passes on the touched files.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L9qibxRYWXrA8r7F5oJ2mH

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibxRYWXrA8r7F5oJ2mH)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…d move them into a package; the Packages page counts them (objectstack-ai#38150 PR-A2) (objectstack-ai#38389)

repo:objectstack#3 · os-tesla · session_01L9qibyHmxFV4bTFZ5BKnUz

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoLMbEWhC18gy3jFR6wzDkuz)_

Part of objectstack-ai#38150. This is PR-A2, the console's half of the move door, by
the seat's claim (comment 7234216673) and its branch ruling of 16:02Z:
PR-A1 (objectstack-ai#38185, the server door) is merged, and objectstack-ai#38149 (objectstack-ai#38204, the
package ask this PR reuses) merged at 16:01Z. PR-B1 (the retirement of
`adopt-orphans` and its two console entries, parked as objectstack-ai#38364 at head
`1852bb898`) lands after this PR, 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 objectstack-ai#38061, the ADR marks) follows.

Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none — no skill under `skills/**` or `.claude/skills/**`
teaches the console's lists or loose items; the `objectstack-platform`
passage on package-less Setup rows is about overlays of shipped items,
which are not loose (searched at this head)

**Size: 1,380 lines** (additions + deletions, generated files included:
1,369 added, 11 deleted, 15 files; `git diff --numstat eef1cbf
be8e0d5`, base main `eef1cbfe4`). With A1's 1,947 and B1's 3,123 the
card is past 3,000 (objectstack-ai#38280's per-card line), so this PR is Tier H.

## 维护者速读

-
用户能看到什么变化:在应用工作室的跨软件包列表(`/studio/~all/metadata/<类型>`)里,来源下拉多了「散落项」。选它后,有编辑权限的人可以逐行勾选或全选,点「移入软件包…」,选好软件包后先看一次试运行:每一项移入后地址怎么变,或者为什么被拒。确认后整批移入。设置的「软件包」页上会提示「有
N 个散落项,不属于任何软件包」,按类型列出,点进去就是那种类型的散落项列表。
- 为什么做:App Studio 改版专题(objectstack-ai#38150)。你裁定散落项原地保留,由一个按勾选移动的入口负责移入。服务端接口已在 A1
合并,这个 PR 做控制台入口。
-
出错会怎样:只改控制台。移入整批进行,要么全部移入,要么一项不动;被拒时逐项给出服务端原话。最坏情况是横幅计数不准,或某个入口不显示,可以直接撤回。
- 要你做什么:这张卡总行数超过 3000 行,属于 Tier H,需要你经 os-zhuang 批准。

## What changes

**The "Loose" source value** (`metadataListState.ts`,
`ResourceListPage.tsx`, `useListOrderedNames.ts`).
- `?source=loose` joins the list's address state. On the cross-package
leg (`allLeg`: an area host with no package, outside the environment
scope) the list offers it, as "Loose (N)" in both the Studio and the
Setup toolbars.
- A row is loose by `isPackageLessItem` on its served `_packageId`
(absent, `''`, or the `sys_metadata` sentinel), the card's "never
`classifyProvenance`": that classifier also files a `.custom` pair item
and a served overlay as runtime, so "Modified and new" holds them and
"Loose" does not.
- The row reader gains an optional `loose` member. Absent, as on a
package's own leg, `source=loose` reads as every source, the way an
unoffered filter does. The detail's ‹ › order reads the same member, so
prev and next agree with the list.

**Select and move** (`ResourceListPage.tsx`, `looseMove.ts`,
`LooseMoveDialog.tsx`).
- Under "Loose", a person who may author (`useCanAuthorMetadata`, and
not walled) gets a select column first in the table and a selection bar
above it: "Select all (N)" over the rows the filter shows, the count
selected, and "Move into package…". A reader who may not author sees the
loose rows with no select box and no bar.
- "Move into package…" opens objectstack-ai#38149's ask with nothing pre-selected,
with the move's own question and explanation (`PackageCreateAsk` takes
an optional `title` and `description`; the create's are unchanged). "New
package…" in the ask works as it does for a create.
- The confirm step asks the door's dry run (`POST
/api/v1/packages/:id/move-in` with `dryRun: true`) and draws its answer:
- `would_move`: each item, `(draft only)` where only a draft moves, the
address change (`_env/NAME` → `NAMESPACE/NAME`) and the AI face name
change where the door reports them. Two notes follow. The first is the
dry-run caveat: some save checks run only on the real move, and if one
refuses, nothing moves. The second is L2's N4 (record 7236830081):
reverting the move's package commit takes the items out of the package
and does not make them loose again.
- `refused`: each refused item with the door's own code and sentence.
For `REFERENCE_LEFT_BEHIND`, "Add the loose items they use and check
again" adds the `references` to the selection, which may be of other
types, and asks the dry run again.
- Move makes the real call. A refusal there is drawn as "The move was
refused, and nothing moved". `moved` closes the dialog, says "Moved into
PACKAGE: N." and re-reads the list.
- The door's 422 arrives as a thrown envelope. `moveLooseItems` resolves
it as the door's answer (`error.details` with `outcome: 'refused'`), and
every other failure throws with the server's sentence, which the dialog
draws with Try again.

**The Packages page banner** (`LooseItemsBanner.tsx`,
`PackagesPage.tsx`).
- "N items belong to no package", drawn on both faces for a person who
may author, while N is above zero. Each type with loose items is listed
as a link to its "Loose" list,
`/studio/~all/metadata/TYPE?source=loose`. That is the acceptance's
"from the Setup → Packages banner, a person reaches a flow's Loose list
in the UI, with no typed address".
- **The count's cost, measured.** No new server read. One `GET
/meta/:type` per type that takes a runtime write (`allowRuntimeCreate`
or `allowEnvironmentOverlay`; a type that takes none holds no loose
item), with the type's own hide hook applied, the same rows its list
counts. On the showcase boot that is 30 of the 40 served types, and the
30 reads in parallel took 366 ms. A type whose read fails is named as
not counted, never folded into a smaller total.
- The count is keyed on the types it reads and reaches the client
through a ref. A first version keyed it on the client's identity, and
the PackagesPage tests' per-call mock client then looped the effect and
hung the app-shell suite.

**i18n.** 31 keys in `@object-ui/i18n`'s studio namespace, en and zh:
`engine.list.sourceFilter.loose`, `engine.looseMove.*`,
`engine.looseItems.*`. No other locale carries the studio namespace.

**Changeset.** `38150-move-loose-items-console.md`:
`@object-ui/app-shell` and `@object-ui/i18n` patch, `Clause-②: yes
(widening)`, `Metadata-protocol: none`, as objectstack-ai#38204 declared for the same
kind of console widening.

## Tests

New, each with its control:

| file | pins |
|:--|:--|
| `ResourceListPage.looseMove-38150.test.tsx` (7) | `?source=loose` on
`~all` lists exactly the package-less rows (none, `''`, `sys_metadata`),
never a `.custom` pair item or an overlay; with no filter every row is
listed. The select column and bar appear for an author, not for a reader
who may not author. Select all → the ask opens with nothing picked and
the move's question → the dry run carries the three items, `dryRun:
true` → the confirm names the package by its name and shows the address
change → Move resends the same items without `dryRun`. One row selected
moves that row alone. A package's own leg ignores `?source=loose` and
draws no selection. |
| `LooseMoveDialog-38150.test.tsx` (5) | The address change, the caveat
and the undo note, then Move. `REFERENCE_LEFT_BEHIND` offers to add the
dataset, the next check carries it, and Move moves both. A refusal with
no `references` offers nothing to add. A refusal on the real move reads
as nothing moved, and `onMoved` is not called. A failure that is not an
answer shows its sentence and Try again. |
| `looseMove-38150.test.ts` (8) | The `source=loose` codec round-trips,
and an unknown value reads as all. `loose` keeps package-less rows where
`runtime` also keeps the `.custom` row. With no `loose` member every row
is kept. The 422 resolves as the answer; a 403 throws the server's
sentence; the body carries `dryRun` only on a dry run. References are
added once each. |
| `LooseItemsBanner-38150.test.tsx` (5) | Per-type counts and links
(`/studio/~all/metadata/flow?source=loose`). A type with no runtime
write, and `package`, are not read. A failed read is named. Nothing is
drawn or read for a non-author, and nothing is drawn at zero. |

**Ablation.** With the list's `loose` reader set to `row.source ===
'runtime'` (the classifier the card forbids), two cases of
`ResourceListPage.looseMove-38150` go red: the exact-rows case and the
select-all move (its dry run then carried the pair item and the
overlay). Restored, 7 of 7 pass.

## Verification

Local, on this branch, after a declaration build of `./packages/**` and
`@object-ui/app-shell`'s dependencies:

- `@object-ui/app-shell` and `@object-ui/i18n` (`pnpm --dir ui exec
vitest run packages/app-shell packages/i18n`), before the merge of main:
2,570 files, 2,569 passed and 1 skipped; 25,917 tests passed and 22
skipped. After the two display fixes, the touched files (every
`ResourceListPage*`, the four new files, `PackageCreateAsk*`, all of
`packages/i18n`) passed: 132 files, 2,048 tests passed and 13 skipped.
After the merge of main and the collection imports, the four new files
pass 25 of 25.
- `@object-ui/app-shell` `type-check` (`tsc --noEmit` and `tsc -p
tsconfig.test.json`) passes after the merge of main. The first run
failed on `looseMove-38150.test.ts`'s untyped `vi.fn` tuple, and that
was fixed.
- **Derived gates.** `node scripts/pm/dispatch-gates.mjs --commands`
derives 39 families for this tree, the same 39 before and after the
merge of main. 38 passed on the first run. `check:test-source-alias`
failed on three of the new test files, which reached `celAuthoring`'s
dynamic `@objectstack/lint` import through `packageActions.tsx`. Each
now has the module-top import, and the gate passes. After the merge, the
four gates that read the diff against `origin/main`
(`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check:test-source-alias`) and
`check:undeclared-dep-imports` and `check:type-check-coverage` were run
again and pass. `dispatch-gates --ran`: 39 derived, 39 run, 0
NOT-MEASURED.
- `overlap-check.mjs` before the first push: `origin/main` conflicted in
`ResourceListPage.tsx` (the lucide import, beside objectstack-ai#38357's `X`) and
`metadataListState.ts` (beside objectstack-ai#38357's `targetObject` filter). Both are
resolved in the merge, keeping both sides. objectstack-ai#38318 shares the two i18n
files and merges cleanly.

## Walkthrough (a real stack)

At `c27f9ab24` (the two display fixes in; the merge of main after it
touches neither surface), `pnpm console:build`, then the showcase booted
with `objectstack dev --ui --seed-admin` on a fresh database. Through
the API: an installed writable package `com.probe.zeta` (name Zeta,
namespace `zeta`), two loose flows (`probe_loose_flow`,
`probe_loose_flow2`) and a loose object `probe_widget`, each saved with
no package. Then, in the browser (Playwright, 1400×900):

1. Setup → Packages (`?face=admin`) draws "4 items belong to no package"
with Flow (2), Object (1), Datasource (1). The datasource is the
showcase's own loose row.
2. Flow (2) opens `/_console/studio/~all/metadata/flow?source=loose`:
two rows, the select column, "Select all (2)".
3. Select all, then Move into package…: the ask, Zeta picked by hand.
4. The confirm, "Move into Zeta": each flow `_env/probe_loose_flow` →
`zeta/probe_loose_flow`, the caveat and the undo note.
5. Move: the dialog closes and the list is re-read. The API then reads
both flows `_packageId: com.probe.zeta`, `GET
/meta/flow/zeta/probe_loose_flow` answers 200 and `GET
/meta/flow/_env/probe_loose_flow` 409, with no restart.
6. The object list's Loose value, `probe_widget` into Zeta: refused
`NAMESPACE_PREFIX`, "Object 'probe_widget' is missing the package
namespace prefix. Rename it to 'zeta_probe_widget' (namespace =
'zeta').", Move disabled.
7. Back on Setup → Packages: "2 items belong to no package", Object (1)
and Datasource (1).

Screenshots, at device scale 2: in the project files under
`card-38150/a2-walkthrough/`, `1-packages-banner.png` …
`7-banner-after.png`.

## Owed before landing

- One CONTRACT_REVIEW_TIER review (the seat's).
- Tier H: Tesla's approval via os-zhuang.
- PR-B1 lands after this PR, restarted on a new PR from `1852bb898`'s
commits.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…and an item of a package you can write reads New in the Studio list (objectstack-ai#38150 PR-B2) (objectstack-ai#38598)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Jianguo** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbYYVoMKNg2bko9Bx8v783A8)_

Fixes objectstack-ai#38150

This is PR-B2, the last PR of the card: the retirement of Studio's
package-less scope (`/studio/~org`) with its redirects, the Studio
list's Source classifier, and the ADR marks. PR-A1 (objectstack-ai#38185), PR-A2
(objectstack-ai#38389) and PR-B1 (objectstack-ai#38545) are merged. It continues the branch
`claude/project-thread-kf5k6i` of the seat whose account ran out (five
commits, head `2a3c6e8f5b`, no PR was open on it): this branch starts at
that head, every commit was read, and main is merged in.

Two cards ride on this one and are named here without a closing keyword,
because their threads carry no claim naming this branch: the
Source-badge card objectstack-ai#38061 (its ruling note names this PR as its carrier)
and the old door's defect card objectstack-ai#37468 (the card text gives it to PR-B).
The seat finishes both at landing.

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no file under `skills/**`, `.claude/skills/**` or
`content/docs/**` names the `~org` scope, "Organization flows" or any of
the nine keys (`git grep` at this head)

**Size: 2,937 lines** (1,697 added, 1,240 deleted, 82 files; `git diff
--shortstat origin/main...HEAD` at `85939f9c`, merge base `301417669`).
With PR-A1's 1,947, PR-A2's 1,380 and PR-B1's 3,387 the card stands at
**9,651**. The card total is over 3,000 and the diff edits
`docs/adr/**`, so this PR is Tier H.

## 维护者速读

- 用户能看到什么变化:Studio 左侧菜单里的「组织流程」入口没有了,旧网址仍能打开并转到跨软件包列表的「散落项」流程列表;在 App
Studio 列表里,自己建的软件包里的项,来源从「系统自带」改成「新建」,筛选和上一条、下一条跟着一致。
- 为什么做:这是 App Studio 改版专题第 4
阶段的收尾,你已裁定散落项原地保留、改用「勾选后移入软件包」来移动,旧入口随新入口上线一起下线;来源标签按你对决策稿的回答改。
-
出错会怎样:只有打开旧网址或看这个列表的人会碰到,最坏是老书签落在列表上而不是原来的流程页,或某一行的来源标签显示不对;不动任何数据,可以整体撤回。
- 要你做什么:这次改动带架构决定记录的标注,整张卡累计也超过 3000 行,需要你本人批准,请审批。

## What changes

**The scope is retired, its addresses answer.**
`studio-design/studioOrgScopeRetired.ts` is the one owner of the retired
segment (`RETIRED_ORG_SCOPE_SEGMENT`) and of where its addresses land
(`retiredOrgScopeTarget`): every `/studio/~org/…` address lands on
`/studio/~all/metadata/flow?source=loose`, the list the Setup → Packages
banner links to. The list's search (`q`) and sort (`sort`) are carried
and every other query key is dropped, `source=runtime` included. Four
places answer an old address with it: `StudioDesignSurface` (before
anything of the surface mounts), `studioPillarRedirectModel.ts` (the
scope's root and its old pillar deep links), `metadataArea.ts` (the
scope's leg of the area, and a `?package=~org` link on another leg), and
the console's `StudioRoute.tsx` (two route rows that answer the segment
ahead of the package routes).

**What leaves with it.** The menu's "Organization flows" row and its
`orgFlows` entry kind; the area's `orgScope` mode; the top-left Changes
row (`StudioScopePendingRow`) and the package-less batch publish behind
it (`studioSurfacePublish.ts` publishes a package only now; the changes
sheet is mounted on a package only); the `scope` prop of the package
switcher; the scope helpers in `studioScope.ts` (`studioOrgScopePath`,
`STUDIO_ORG_SCOPE_SEGMENT`, `STUDIO_ORG_SCOPE_TYPE`,
`STUDIO_ORG_SCOPE_SOURCE`, `isStudioOrgScope`, `isOrgScopeDraft`),
`orgScopeFlowOf` and `orgScopeAreaRedirect`. `AutomationsPillar` takes a
package id, never `null`. `studioScope.ts` keeps what the Loose list
reads: `isPackageLessItem`, `isPackageLessDraft`, and
`packageLessItemPath` (an item of no package opens its page at
`/studio/~all/metadata/TYPE/NAME`).

**Who lands where now.** A person who may enter Studio but not Setup →
Packages, with no recent package, lands on the Loose list of flows
(`studioEntryFallbackPath`, `newPackageDoorPath`); the "package not
found" page's way out reads "Open loose flows" (「打开散落的流程」) and opens the
same list. A package-less flow the app's command palette finds opens its
item page. A draft of no package is published by Home's "Publish all",
or published or discarded on its own page.

**The Studio list's Source (the classifier, card What 7).**
`metadata-admin/studioListSource.ts`: `studioSourceKind` takes a third,
required fact, whether the row's package is one the author can write,
read from the package list's `writable` verdict
(`useWritablePackageIds`, the request the other readers of that list
share). Order: the customization mark, then the package verdict, then
the provenance. `ResourceListPage.tsx` passes it to the badge, the
source filter and its counts, and the badge's tooltip;
`useListOrderedNames.ts` passes it to the detail page's previous / next
order and waits for the package list only while the order is narrowed by
source. Setup's list is untouched: it asks for no verdict and reads the
provenance as served.

**i18n (the narrowing).** Nine keys leave the `studio` namespace of
`@object-ui/i18n`, in `en` and `zh`: `engine.studio.menu.orgFlows`,
`engine.studio.pkg.orgScope`, `engine.studio.org.name`,
`engine.studio.org.hint`, `engine.studio.org.description`,
`engine.studio.org.none`, `engine.studio.publishedAllFlows`,
`engine.studio.publishedAllFlowsOne`, `engine.studio.changes`.
`engine.studio.notFound.allMetadata` keeps its key and changes its text.
`@object-ui/app-shell` is private; its barrel exports
`RETIRED_ORG_SCOPE_SEGMENT` and `retiredOrgScopeTarget` where it
exported `STUDIO_ORG_SCOPE_SEGMENT` and `studioOrgScopePath`.

**ADR marks (governed, card What 9).** ADR-0084: nine passages that name
the scope are struck through and left legible (the "organization's own
flows" row of "Entries that are not a type", the no-fold sentence, the
first example of the sorting rule's third test, the second sentence of
item 3 of the 2026-11-25 silent-points list, the fourth top-bar-homes
row with its 2026-11-27 note, the sentence that kept the entry until the
door shipped, and two items of the 2026-11-26 silent-points list), with
notes dated 2026-11-29 that name the card and the ruling record (comment
7184753035, question 3); the note under "Organization-level content"
says the move door shipped, where it opens from, what retired with the
scope (the menu row, the scope's list, its flow page, its Changes row
and the batch publish behind that row), where a flow of no package opens
now, where `~org` addresses land, and that the bulk adopt retired in a
change of its own (objectstack-ai#38545). ADR-0070: the status line, a pointer at
TL;DR item 5, and a dated note under D5 ("move into a base" is the
move-in door; the bulk assignment to a default base is superseded; rows
never moved stay legal). No heading anchor changes.

**Changeset and checklist.**
`.changeset/38150-studio-org-entry-retired.md`: `@object-ui/app-shell`,
`@object-ui/console` and `@object-ui/i18n` patch, BREAKING with the nine
keys, the two export renames as a FROM → TO table and the one-line fix,
and the ADR-0087 `not-required` marker.
`docs/qa/platform-checklist/FOLLOW-UPS.md` gains one section naming the
five checklist items that still describe the retired scope.

## Each removed assertion, and what pins its rule now

Renamed cases (same assertion, the target address or the words changed
with the retirement) are not listed: `StudioRoute.test.tsx`,
`StudioRoute.recentPackage-11863`, `CommandPalette.studioScope-11863`,
`HomePage.noAgentsBuildChip-26614`, `SidebarAppMenu-36112`,
`StudioDesignSurface.notFound-26708`, `StudioEntryRedirect.test.tsx`,
`studioInterfacesRetired.test.ts`, `studioPillarRedirectModel.test.ts`,
`studioMenuModel.test.ts` (its `~org` rows leave the `it.each` tables;
the `~all` rows stay), `StudioMenu.test.tsx` and
`StudioMenu.overview-37454` (the last two drop their `~org` row the same
way). The others now expect `/studio/~all/metadata/flow?source=loose`
where they expected the scope.

| file | removed | what pins the rule now, or why it retired |
|:--|:--|:--|
| `studioScope.test.ts` | "the reserved segment cannot name a package"
(the spec manifest-id rule, the sanitizer) and "is told apart from a
package segment" | moved with the segment to
`studioOrgScopeRetired.test.ts`: "the retired segment stays reserved: it
can name no package", the same three cases on
`RETIRED_ORG_SCOPE_SEGMENT` and `isRetiredOrgScope` |
| `studioScope.test.ts` | `studioOrgScopePath`: "lands on the scope's
flow list…", "opens a flow full-screen on its address…" | the builder is
removed. The addresses it built are the inputs of
`studioOrgScopeRetired.test.ts` "the old addresses, read by the
redirects that answer them" (root and `/automations`; list, flow and
flow history; a `?package=~org` link). Where a package-less item opens
is `packageLessItemPath`, pinned in two new cases of the same file |
| `studioScope.test.ts` | "the scope reviews package-less FLOW drafts
only" (`isOrgScopeDraft`) | the predicate retired with the Changes row
it fed; nothing reads it. `isPackageLessDraft` keeps its case |
| `automationsPillarRedirect.test.ts` | "the package-less scope lands on
its own leg, with no package and its source filter once" | the scope's
`/automations` never reaches this mapping: `studioPillarRedirect`
answers it first. Pinned in `studioPillarRedirectModel.test.ts` ("the
table covers every retired pillar segment, on a package and on the
retired package-less scope") and `studioOrgScopeRetired.test.ts` |
| `metadataArea.test.ts` | "`orgScopeFlowOf` names the package-less
scope's flow…" | the function is removed (the area draws no scope flow).
The rewritten case beside it pins the replacement: "a flow of the
retired scope lands on the list, not on the flow, and the list keeps no
tab" |
| `AutomationsPillar.newSimilar-28567` | "the package-less scope draws
no menu" | the flow designer is a package's now (`packageId` is a
string) and the scope draws no page; the redirect is pinned in
`StudioDesignSurface.packageLessFlows-11553` |
| `StudioTopLeft-37456` | "~org with drafts pending: a Changes row…" and
its control "none passed: no Changes row" | replaced by "no scope draws
a Changes row": `it.each` over a package and no package, expanded and as
a rail |
| `StudioDesignSurface.publishCount-11807` | the four package-less
publish toasts (two drafts, one draft named by label, several named in
the description, none pending) | the batch publish they read is removed.
Replaced by "its old address, with package-less drafts pending, lands on
the Loose list: no publish door, nothing sent, no toast". The package
cases of the file are untouched |
| `StudioDesignSurface.packageLessFlows-11553` | the scope's own page:
lists its flows, offers no create, its empty-list guidance, its page
chrome | replaced by "every address of the retired package-less scope
lands on the Loose list of flows" (a redirect table, the kept search and
sort, the list holding the clone and none of a package's flows, with a
control without the filter, and an empty Loose list) and "the Loose list
is the retired scope's page" (the row opens the item page; no menu row,
no Changes row, no changes sheet, no page under `~org`) |
| `StudioDesignSurface.packageLessFlows-11553` | "opens it editable, and
an edit saves a draft bound to no package", and the "editable" half of
two entries: "the measured link, through the showcase pillar: lands on
the package-less scope, the clone open and editable" and "from that
read-only package, a switch into the package-less scope opens it
editable" | the scope's flow page is retired, and the door the ruling
keeps open for that save (comment 7184753035, question 2) is the clone's
item page on the cross-package leg. Pinned by the new "the item page
opens writable, and an edit saved there writes a draft naming no
package", run over two entries, the page's own address and a read-only
package's address that names the clone: the designer's add controls are
drawn and Save waits only for an edit; the save is `mode: 'draft'` with
no `packageId`, and the item's own publish that follows names none
either. It sits in the describe "a package-less flow is edited, and its
draft published or discarded, from its item page" |
| `StudioDesignSurface.packageLessFlows-11553` | "the package-less scope
reviews and publishes exactly its own drafts": the Changes row count,
the sheet and its filter, "publishes each package-less flow draft by
reference, and nothing through the package batch door" | the row, the
sheet and the batch are removed. A package-less draft's two publish
paths are pinned by two new cases of "a package-less flow is edited, and
its draft published or discarded, from its item page" (Publish and
Discard on the item page name no package) and by the unchanged
`usePublishAllDrafts.refusal-11922` ("records the batch's health and
goes on to the package-less drafts") for Home's Publish all |
| `StudioDesignSurface.packageLessFlows-11553` | deep links: "in the
package-less scope: the named flow, though another is listed first",
"the measured miss: the package-less page, a link naming a packaged
flow", "an empty scope lands on its list" | the scope has no page to
miss on. "the measured link, through the showcase pillar" now lands on
the clone's item page on the cross-package leg, and "the package's own
address naming the clone lands there too" is new; "a package page's
miss" stays |

## Acceptance notes

- **Takeover.** Kept as built: the five commits of
`claude/project-thread-kf5k6i` (`db6e4a61`, `94ca83cb`, `51d85a2c`,
`31121663`, `2a3c6e8f`), read hunk by hunk. Added here: the merge of
main (`c03f1772`, clean, eight files auto-merged, PR-B1 among main's
commits) and one comment-only commit (`5fcf89b5`): eleven files of the
Studio surface still described the retired scope as a place a person can
be (the palette surface's doc, four notes in `studio-design`, six test
headers or titles). No behaviour changes in it.
- **Rework round 1** (L2 record 7257159073, FAIL on `5fcf89b5`; L1
record 7257170665, REWORK). Three commits, no product code in them.
**M1**, `c2ffeaa7`: `ui/e2e/studio-left-menu-36899.spec.ts` still waited
for the fold's Automation group, whose one row on that package was the
retired entry; the loop reads `system` and `security`, the Automation
group is asserted absent, and the line names the card. **S1**,
`90713851` and `85939f9c`: the item-page case of the table above. **N1
and N2**, `90713851`: ADR-0084's sorting rule (third test) and item 3 of
the 2026-11-25 silent-points list are marked, and the note under
"Organization-level content" lists the scope's flow page. **N4 is left
as it is**: narrowing `sourceNarrowed` in `useListOrderedNames.ts` moves
product code for one request and a short wait on the Loose list's
previous / next, with no wrong order, and would owe the battery again;
it fits the follow-up card the seat files for N3. **N3** is the seat's
to file. The delta contract review of `85939f9c` is record 7257925349
(PASS: M1, S1, N1 and N2 closed), and the seat's record 7257936891
accepts the head.
- **File surface.** All 82 changed files are inside the claimed surface.
One, `ui/e2e/studio-left-menu-36899.spec.ts`, is admitted by claim
amendment 7257086821 (one hunk). The other 81 are inside claim amendment
2 (comment 7253593955): 58 under `studio-design/`, 5 under
`metadata-admin/`, the console's `StudioRoute.tsx` and four of its
tests, `CommandPalette.tsx` and its `~org` test, `index.ts`,
`README.md`, three tests pinning `~org` under `console/home`, `layout`
and `views/setup`, the two studio catalogues, the two ADRs, the
changeset, and `FOLLOW-UPS.md`.
- **Clause-②, measured as the amendment asks.** The nine keys are in the
published `@object-ui/i18n@19.0.0-next.2`
(`dist/namespaces/studio/en.js` and `zh.js`, each key in both files;
read from the registry tarball) and in no file of the `dist` built at
this head, where two kept keys (`engine.studio.notFound.allMetadata`,
`engine.list.source.new`) are in both files. Published keys leave, so
the line stands.
- **Card acceptance, PR-B under Q-f = E.** "On
`/studio/~all/metadata/flow` the authored package's flow reads 新建 and a
code-shipped flow still reads 系统自带":
`ResourceListPage.authoredPackageSource-38150` "the authored package's
flow reads New; the code-shipped flow still reads System-shipped" and
"draws the Chinese words for the two". "The Studio filter and prev/next
agree with the badge": the three cases under "the source filter and ‹ ›
agree with the badge". The ablation is below. "`/studio/~org/…`
redirects": the redirect tables in `studioOrgScopeRetired.test.ts`,
`StudioDesignSurface.packageLessFlows-11553` and the console's
`StudioRoute.metadataArea-28561`.
- **Premise check of What 7.** No non-test `source=runtime` address
remains: `git grep` for it over `ui/packages`, `ui/apps` and `packages`,
tests and changelogs excluded, has zero hits at this head.
- **"Rechecked in PR-B".** From the Setup → Packages banner a person
reaches the flow's Loose list: the banner's link and every `~org`
address are one address, pinned by "is the Loose list of flows, the
address the Setup → Packages banner links to". A package-less flow draft
is published from its item page (two new cases) and from Home's Publish
all (unchanged `usePublishAllDrafts.refusal-11922`), and an edit of a
loose flow is saved in place from that page (the two-entry case). This
recheck is at the test level. A console walkthrough in a browser was not
run for this PR: NOT MEASURED, reason: the card asks the walkthrough of
PR-A, and nothing here adds a screen.
- **Left alone, outside the claimed surface.** Comments that still name
the scope in `preview/DraftChangesPanel.tsx` (two) and three test titles
beside it, in
`ui/packages/i18n/src/__tests__/confirmNoteSeparate-11591.test.ts`, and
in `metadata-admin/metadataAreaHost.ts`, whose `emptyListHint` option
has no producer left while `ResourceListPage.tsx` still reads it. Named
in the report for the seat.
- **Same-version rule.** PR-B1 merged at 2026-11-29T11:44Z and is
unreleased; the open Version Packages PR is objectstack-ai#38192. This PR has to merge
before that one does. Nothing on the dev side blocks it; it waits on the
reviews below.

## Verification

Files to read first, by risk:
1. `ui/packages/app-shell/src/views/metadata-admin/studioListSource.ts`,
with its two readers in `ResourceListPage.tsx` (`studioKindOf`, the
badge tooltip) and `useListOrderedNames.ts`: the one behaviour change
that is not a removal. The risk hunk is the order in `studioSourceKind`
(mark, then package verdict, then provenance) and the `loading` wait in
the previous / next order.
2.
`ui/packages/app-shell/src/views/studio-design/studioOrgScopeRetired.ts`
and the four places that answer an old address with it
(`StudioDesignSurface.tsx` line 130, `studioPillarRedirectModel.ts`,
`metadataArea.ts`, the console's `StudioRoute.tsx`): what a retired
address keeps and drops.
3. `docs/adr/0084-application-builder-information-architecture.md` and
`docs/adr/0070-package-first-authoring.md`: the governed text. Struck
lines and dated notes only.

Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/studioOrgScopeRetired.test.ts
packages/app-shell/src/views/metadata-admin/ResourceListPage.authoredPackageSource-38150.test.tsx`.
Expect two files and 25 tests to pass; the second file's first describe
is the classifier's truth table.

<details><summary>Suites and type checks (local; heads named per
row)</summary>

| run | head | result |
|:--|:--|:--|
| workspace build, `turbo run build` without the docs app, under the
verify lock | `c03f1772` | 123 tasks, 123 successful; lock VERDICT
command-exit 0 |
| 714 UI test files under the lock: all of `studio-design/`, `chrome/`,
`views/setup/`, `console/home/`, `preview/` and `packages/i18n/`, every
test that imports a changed module or names `ResourceListPage`,
`StudioDesignSurface`, `StudioMetadataArea` or `DraftChangesPanel`, and
the console's `StudioRoute*` tests | `c03f1772` | Test Files 714 passed
(714); Tests 7,423 passed, 13 skipped (7,436); lock VERDICT command-exit
0 |
| the ten files the comment commit or an ablation touched, again |
`5fcf89b5` | Test Files 10 passed (10); Tests 181 passed (181); lock
VERDICT command-exit 0 |
| `type-check` of `@object-ui/app-shell`, `@object-ui/console`,
`@object-ui/i18n` (each covers its test files) | `5fcf89b5` | all three
executed, none from cache; lock VERDICT command-exit 0 |
| `eslint` on the changed files of the three packages (69, 5 and 2
files) | `5fcf89b5` | 0 errors |

The full `@object-ui/app-shell` suite (2,470 files) was not run: NOT
MEASURED locally, reason: the dev contract keeps a card to the affected
files; CI's Test UI shards run all of it. `5fcf89b5` changes comments
and one test title, so the 714-file reading at `c03f1772` stands for it.
The rework changes one of those 714 files, run whole again at `85939f9c`
(the rework block below).

</details>

<details><summary>Ablations</summary>

Both through `scripts/ablation-replace.mjs`, the implementation
committed first, each restored and proven (blob equals HEAD, `git diff
HEAD` empty).

- **The classifier.** Deleted `if (inWritablePackage) return 'new';`
from `studioListSource.ts` (anchor 1 → 0, blob `187ff2023a0e` →
`cb5b1ba68bdc`), then ran
`ResourceListPage.authoredPackageSource-38150`: 9 failed, 5 passed (14).
Red: the truth-table case (`expected 'system' to be 'new'`), the badge
in en and zh, the tooltip, the two filter cases, the previous / next
case, the authored package's own leg, and the control "a package the
list does not name, and no package at all, read as before" (it fails in
the shared settle step, which waits for the authored row to read New;
its own two assertions do not read the deleted line). Green: "only a
package list that was read names a writable package", the two
unreadable-package-list controls, and the two Setup controls.
- **The surface's redirect guard.** Deleted the `isRetiredOrgScope` line
of `StudioDesignSurface.tsx` (anchor 1 → 0, blob `77a97116460c` →
`e3360209ed14`), then ran `StudioDesignSurface.packageLessFlows-11553`,
`StudioPackageOverview-37454` and
`StudioDesignSurface.publishCount-11807`: 3 failed, 93 passed (96). Red:
the redirect-table row for the scope's area address with extra query
keys, "draws no menu row for the retired scope, no Changes row, no
changes sheet, and no page under `~org`", and "~org/overview redirects
to the Loose list of flows (the surface alone: its own guard)". The
other rows stay green because the pillar redirect answers them first,
which is the two-door shape the tests name.

</details>

<details><summary>Derived gates and the lanes the derivation does not
list</summary>

`node scripts/pm/dispatch-gates.mjs --commands` (no paths; 81 paths
against merge base `301417669`): 49 commands, the same 49 at `c03f1772`
and at `5fcf89b5`. Run at `5fcf89b5`, each recorded with its exit code:
all 49 exit 0. `--ran`: "49 derived, 49 run, 0 NOT-MEASURED, 0 UNRUN".
With the Playwright spec added the derivation is the same 49 (read at
`c2ffeaa7`); what was run again after the rework is in the rework block
below. The body gates among them (`check-changeset-no-major`,
`check-adr-0087-registration`, `check-closing-keyword-parity`) read this
body through a local event file; `check-partof-closing-keyword` read it
too: exit 0, and `--body` binds one closing declaration, the card's.

Not in the derived list, run by hand at `5fcf89b5`:

- 19 gates of CI's Type Check UI and Lint UI lanes, each `pnpm --dir ui
run NAME`: `check:i18n-keys`, `check:i18n-drift`,
`check:unreferenced-sources`, `check:self-import`, `check:phantom-deps`,
`check:esm-specifiers`, `check:spec-symbols`,
`check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:test-path-roots`,
`check:control-bytes`, `check:shell-escape-residue`, `docs:check-links`,
`check:doc-fences`, `check:doc-types`, `check:handler-key-reads`,
`check:metadata-write-doors`, `check:doc-example-readers`: all exit 0.
- `pnpm check:changeset-fixed`, `pnpm check:i18n-stale-fill`, `pnpm
check:published-readme-exports`, `pnpm check:pm-governed-prose`, `node
scripts/docs-audit/check-affected-docs.mjs`: exit 0. `node
scripts/check-platform-checklist.mjs --changed-from origin/main`: OK, 2
anchors judged, 0 lost.
- NOT MEASURED locally: `check-single-claim-paths` and
`check-closing-target-claim` (both need the pull request's number). CI's
`PR-body guards (claim · duplicate · Part-of · single-writer path)`
concluded success on `5fcf89b5`.

</details>

<details><summary>Rework round 1 (heads `c2ffeaa7`, `90713851`,
`85939f9c`)</summary>

| run | head | result |
|:--|:--|:--|
| CI's red, reproduced: `pnpm exec playwright test
e2e/studio-left-menu-36899.spec.ts --project=chromium` from `ui/` |
`5fcf89b5` | 1 failed, 3 passed: `studio-menu-advanced-group-automation`
not found at line 225, as in CI's `Build & E2E UI` |
| the same command with the fix | `c2ffeaa7` | 4 passed |
| `StudioDesignSurface.packageLessFlows-11553.test.tsx`, whole file,
under the verify lock | `85939f9c` | Test Files 1 passed (1); Tests 36
passed (36); lock VERDICT command-exit 0 |
| `type-check` of `@object-ui/app-shell` (covers the test file) |
`85939f9c` | executed, not from cache; lock VERDICT command-exit 0 |
| `pnpm --dir ui exec vitest run scripts/` under the lock | `85939f9c` |
Test Files 172 passed, 2 skipped (174); Tests 5,159 passed, 2 skipped
(5,161); lock VERDICT command-exit 0 |
| `eslint` on the spec and on the test file | `85939f9c` | 0 errors |

Two ablations of the new case at `85939f9c`, through
`scripts/ablation-replace.mjs`, each restored and proven (blob equals
HEAD, `git diff HEAD` empty); the case's two entries go red in both:

- **Writable.** In `ResourceEditPage.tsx`, `const hostReadOnly =
!!areaHost?.readOnly;` replaced by `const hostReadOnly = !!areaHost;`
(anchor 1 → 0, blob `fdd7af7db791` → `cc814ee1e002`): 2 failed, `Unable
to find an element by: [data-testid="resource-save"]`.
- **No package on the save.** In the same file the save's options were
given `packageId: 'com.example.ablation'` (anchor 1 → 0, blob
`fdd7af7db791` → `931a9d527629`): 2 failed, `expected { force: false,
…(2) } to not have property "packageId"`.

Gates run again, each recorded with its exit code. At `90713851`, the 29
that read the ADR text or test sources, all exit 0:
`check-adr-0087-registration`, `check-adr-links`, `check:adr-anchors`,
`check:adr-index`, `check:adr-symbol-anchors`,
`check:closed-ceremony-text`, `check:doc-authoring`,
`check:pm-prior-rulings`, `check:pm-governed-merges`,
`check:platform-checklist`, `check:nul-bytes`,
`check-comment-mask-corpus`, `check:test-source-alias`,
`check:cross-package-test-inputs`, `check:undeclared-dep-imports`,
`check:skill-identifier-liveness`, `check:pm-governed-prose`,
`docs-audit/check-affected-docs`, `check-changeset-no-major`,
`check-empty-changeset`, and from `ui`: `check:control-bytes`,
`check:test-path-roots`, `check:shell-escape-residue`,
`check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `docs:check-links`, `check:doc-fences`,
`check:doc-types`. At `85939f9c`, which changes the test file alone, the
12 of them that read test sources again: all exit 0. The other derived
gates read nothing these commits change, so their run at `5fcf89b5`
stands; they were not run again.

</details>

<details><summary>Dogfood battery</summary>

Full battery at the landing head `85939f9c` (os-dev report 7258471243),
`pnpm --filter @objectstack/dogfood test` under the verify lock (no
shard, no path), after the workspace build at the same head (123 tasks
successful, 121 of them restored from turbo's local cache): lock VERDICT
command-exit 0 (held 1,888 s); Test Files 495 passed, 3 skipped (498);
Tests 4,187 passed, 68 skipped (4,255); no failure.

The same battery before the rework, at `5fcf89b5` (os-dev report
7256902761): lock VERDICT command-exit 0 (held 1,828 s), the same
counts. The three rework commits change a Playwright spec, one vitest
file and ADR text, and no product code.

</details>

## Owed before landing

- The maintainer's approval (Tier H: `docs/adr/**`, the narrowing, the
card total).
- The same version as PR-B1: this PR merges before the open Version
Packages PR, objectstack-ai#38192.
- The two cards named at the top, finished by the seat at landing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QsR2jUba5JFq1ejCZ7Gxpk

<!-- signed: repo:objectstack#1 · zhuangjianguo ·
session_01QsR2jUba5JFq1ejCZ7Gxpk -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… notes across three records) (objectstack-ai#38809)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBHuLciv5hYVYUu4pypDP48J)_

Fixes objectstack-ai#38438

Clause-②: no
Metadata-protocol: none

This pull request carries the card's last four rows. The first seven
landed with the first pull request of this card, objectstack-ai#38774, merged
2026-11-30.

## 维护者速读

- 用户能看到什么变化:用户无感;只在三份设计记录里补了四条带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。
- 为什么做:属于「每周设计记录修订」滚动清单(11 月 29 日这一周);上一张合并请求已带走七行,这次补齐剩下四行,这份清单就此收口。
- 出错会怎样:最坏是某条说明写得不准,照着设计记录干活的人会被带偏;纯文档、只增不删,可以直接撤回,不影响任何功能。
- 要你做什么:请审这四条说明并批准一次(设计记录须由你本人批)。

## What changes

Three ADR files gain four notes dated 2026-12-01. Every diff line is an
addition: 43 lines added, 0 removed. No original decision text is
rewritten, and no decision changes. Each note follows the note
convention its own record already uses, and each says that the passage
it is read with is left as written.

Each row's "what is true now" was read against the code on `main` before
its note was written. All four rows hold. Where a row's wording did not
match the tree, the note says what `main` does; the last column says so
and the list under the table gives the detail.

| ADR · section | Was (the record's words) | Now (what the note records)
| Source PR | Row on the card · result |
|:---|:---|:---|:---|:---|
| ADR-0161 · Consequences, the bullet "A stored fingerprint and recipe
hash are the only index state the service relies on" | "The service
keeps none of its own" | The service keeps a sync state for each source:
its last build, and the record syncs that failed and are not yet
repaired. Where the knowledge plugin can keep it, it is one durable
record per source; otherwise the last build is kept in the process and
failed syncs are not counted. Whether an index is due for a build is
still read from the stored fingerprint and recipe hash, so the bullet's
first sentence stands for that decision. The K8 note of 2026-11-28
already names this state | objectstack-ai#38307 | Card body row · **written, corrected
to the tree** (the in-process case) |
| ADR-0161 · K7, the components table, row "Split algorithm version" |
"a constant the splitter exports; it changes when the splitter gives
different passages for the same text and settings" | The version is kept
per split strategy, and the fingerprint reads the entry for the strategy
the source resolves to. A change to one strategy's passages starts a new
generation only for the sources that resolve to it. The single exported
constant is retired, with no alias | objectstack-ai#38375, objectstack-ai#38452 | Card body row ·
**written, corrected to the tree** (no version value is written) |
| ADR-0085 · the note of 2026-11-27, and the note of 2026-11-30 under it
| "Neither key is in the spec yet", and in the later note "The second
half stands: `fieldTabs` is not in the spec" | `fieldTabs` is in the
spec, an optional list of `{ key, groups }` entries on `ObjectSchema`,
so both keys are built. The parse refuses a group the object does not
declare, a group two tabs name, a group that places a related list, and
a repeated `key`. The tabs are drawn on every tier of the standard
record page: the full page, the side preview and a phone. Only the
standard record page reads the key, and an object extension does not
carry it | objectstack-ai#38742 | 7282251133 · **written** |
| ADR-0084 · the table "What the amendment replaces", row "Entries that
are not a type", and three sentences that count four entries | "The
organization's own flows retire when the door that moves loose items
ships."; "The menu also holds four entries that open no type's list";
"Of the four entries that are not a type, the cross-package directory is
to leave the menu"; "The four entries that are not a type are 高级 on a
package" | The door has shipped and the flows have retired, the entry
and the package-less scope it opened alike. Four changes carried it,
each named with what it did. The three sentences count the rows of the
table under "Entries that are not a type" as it was first written. The
note names the entries of a package's menu that open no type's list
today: 概览 Overview, the default sharing overview, Diagnostics and 全部类型
All types | objectstack-ai#38185, objectstack-ai#38389, objectstack-ai#38545, objectstack-ai#38598 | 7283216315 · **written,
corrected to the tree** (names and no count; a third sentence; the
change that built the door) |

Every prerequisite of the four rows is merged on `main`: objectstack-ai#38307, objectstack-ai#38375,
objectstack-ai#38452, objectstack-ai#38742, objectstack-ai#38185, objectstack-ai#38389, objectstack-ai#38545 and objectstack-ai#38598, and objectstack-ai#38679 and
objectstack-ai#38401, which two of the notes point back to. The newest comment on the
card when this was opened is the claim amendment, 7296007044; a row
added after it is not in this pull request.

### Where a note differs from its row

- **ADR-0161, Consequences.** The row says the service keeps a sync
state per source. On the tree that state is a durable record only where
the knowledge plugin can keep it, with its object registered and a data
engine bound. Otherwise the last build is kept in the process and failed
syncs are not counted. The note says both. It also says what the row
asks for: the stored fingerprint and recipe hash are still what a build
is decided from, at boot and on reload alike.
- **ADR-0161, K7.** The row says no fingerprint value moves. That is
true of the change that brought the table in, and the note says so in
those terms. It is not true of every entry since: one strategy's entry
has been raised on `main` for a change to its own passages. So the note
writes no version value, and says that an entry raised since was raised
for its own strategy.
- **ADR-0161, the header.** This record lists every dated note in its
header, one "Amended" line each. The two notes add two such lines, the
seventh and the eighth. That is the record's own convention and it is
why the file gains 17 lines for two notes.
- **ADR-0085.** The first pull request of this card wrote a note dated
2026-11-30 that says "The second half stands". That sentence was true
for one day. The new note is placed under it and names both sentences it
is read with; neither older note is edited. It does not repeat what the
2026-11-30 note says of `pinOverview`. The three tiers are read from the
code: the list of field tabs is built with no regard to the tier. No
test names the three tiers one by one.
- **ADR-0084.** The row asks for the entry count as it now stands. The
note names the entries and writes no number, since a count in a record
goes stale with the next entry. The row names two sentences that count
four entries with no note beside them: the one that opens "Entries that
are not a type", and "Of the four entries that are not a type, the
cross-package directory is to leave the menu", in the note of 2026-11-26
under "The two tiers". The note reads both. It also reads a third, which
the row does not name and which has no note either: "The four entries
that are not a type are 高级 on a package", under the same heading, quoted
as it renders (the record links part of it). So the note says three. As
first pushed, the note said two and left out the sentence the row asks
about; the contract review found it, and `128528c5` corrects the note.
The row names three pull requests. The note names four and says which
did which part: the door itself was built by objectstack-ai#38185. The note stays in
step with the two ADR-0084 notes of the first pull request, which it
does not touch.

## Tests

Docs only. No package source is touched, so no package test and no type
check is owed for the change. No tested behaviour changed, so there is
no ablation.

Checked on the committed text:

- Each phrase a note quotes from its ADR is in that file as it stands on
`main`. A script compared them. One quotation, in the ADR-0084 note,
reads as the sentence renders.
- Each path a note cites exists on the tree, and each of the seven
symbols a note anchors is a declaration in the file named. `pnpm
check:adr-symbol-anchors` judges the same and is green.
- A probe on the spec source: `ObjectSchema` accepts `fieldTabs` with a
declared group. It refuses a group the object does not declare, a group
two tabs name, and a repeated `key`. `ObjectExtensionSchema` refuses
`fieldTabs` as an unrecognised key, with its guidance.
-
`ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts`
reads ADR-0084's type table from disk. It was run under the verify lock
on the final commit `128528c5`: `Test Files 1 passed (1)`, `Tests 21
passed (21)`. It read the same on `808e249f`, the first commit of the
notes.

The local gate set is the `dispatch-gates --commands` derivation for
this change set, 21 commands, run on the final commit `128528c5`. Each
exit code was captured before any pipe. Reconciliation: `Run
reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN`. The same
21 were derived and run on `808e249f` and on `f7bae5cfb`, with the same
result. On `128528c5` the derivation warns that the branch is one commit
behind `main` and that one file it derives from changed there. The
branch does not merge `main` again while this pull request is open and
mergeable, so the list was derived a second time on a throwaway tree of
`main` (`d97aaaea9a`) plus this branch: the same 21 commands, and no
warning.

<details><summary>ADR gates on 128528c (all exit 0)</summary>

| Command | Exit | Verdict line |
|:---|:---|:---|
| `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4606
anchors across 165 records resolve — 1726 symbol (1697 declaration, 29
literal)`, 0 line anchors survive. Seven of the symbol anchors are new
with this change. |
| `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1284
relative link destination(s) under docs/adr/ resolve` |
| `node scripts/check-adr-links.mjs --self-test` | 0 | |
| `pnpm check:adr-anchors` | 0 | `check-adr-anchors: OK (135 anchored
file(s), every governing ADR still referenced` |
| `pnpm check:adr-index` | 0 | `adr-index --report: OK —
docs/adr/README.md is current, every record parsed` |
| `pnpm check:doc-authoring` | 0 | |
| `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 29077 text
file(s)`, no raw control bytes |
| `pnpm check:closed-ceremony-text` | 0 | |
| `pnpm check:pm-governed-merges` | 0 | |
| `pnpm --filter @objectstack/lint run check:doc-formula-expressions` |
0 | run after building the build closure of `@objectstack/lint` under
the verify lock |

</details>

<details><summary>The other derived families on 128528c (all exit
0)</summary>

`node scripts/check-closing-keyword-parity.mjs` and its `--self-test`,
`node scripts/check-comment-mask-corpus.mjs` (`24511 files, 0 disagree,
0 unparseable`), `node scripts/ci/plan-test-core-shards.mjs
--self-test`, `pnpm check:ci-filter-parity`, `pnpm
check:cross-package-test-inputs`, `pnpm check:driver-memory-census`,
`pnpm check:gitlink-declared`, `pnpm check:pm-prior-rulings`, `pnpm
check:refd-timer-probe`, `pnpm check:watch-hint-literal`.

Before the last push: `node scripts/check-commit-card-trailers.mjs
--range origin/main..HEAD` exit 0, three commit messages, no card
relation and no model identifier in the trailer pair.

</details>

<details><summary>The overlap check answers exit 1 against one open pull
request, objectstack-ai#38812; the reading is below</summary>

`node scripts/pm/overlap-check.mjs` on `128528c5`:

- Against `main` (`d97aaaea9a`): `origin/main: merges cleanly`.
- Against the open pull request objectstack-ai#38812 (a draft opened after this one,
head `f3cd7dba76`, one file, 17 lines added to ADR-0161): `VERDICT
overlap exit 1`, with the conflict named in the ADR-0161 file. No other
open pull request shares a file with this branch.

What the conflict is made of, measured on the two heads:

- Both add to the header list of dated notes in ADR-0161, at the same
place, under its sixth line. This branch adds two lines, "a seventh
dated note" and "an eighth dated note". objectstack-ai#38812 adds one line, and it
also says "a seventh dated note".
- That is the only conflict hunk. The notes themselves sit apart and
merge: this branch's under K7 and under Consequences, the other's under
K8 with a cross-reference at K1.

So this overlap is real, and it is more than text: the two pull requests
number their notes from the same count. Whichever lands second has to
merge `main`, keep all three header lines, and renumber its own. See the
acceptance notes.

An earlier reading, on `f7bae5cfb`, answered 1 against the approvals
trunk, objectstack-ai#38497. That pull request has since ended without a merge
(2026-12-01T01:02Z), and the check no longer lists it.

</details>

Not run locally: the repository test project behind `test:repo`, and
every package suite. CI runs them on the pull request and on the merge
group. Every other family CI runs is read from this pull request's check
runs, not re-run here.

## Acceptance notes

- **Changeset.** None, and the pull request carries `skip-changeset`.
`docs/adr/**` ships in no package.
- **Governed surface.** `docs/adr/**` lands on the maintainer's
approval. This pull request stays a draft; the seat arranges the review
at the tier this surface owes and hands it over.
- **Why this one ends the card.** The card says it ends when its pull
request merges. Seven rows landed with the first pull request and these
four are the rest, so every row is carried. The card is open and is not
waiting on a decision.
- **Claim binding.** The claim amendment, 7296007044, names this branch
on a line spelled `Branch (round 2):`, which the guard "The card this PR
closes must claim this branch" does not read. The seat restated the
claim in the shape the guard reads (comment 7296908473 on the card), and
the guard is green on this pull request.
- **Landing order against objectstack-ai#38812.** Both pull requests add header lines
to ADR-0161 at the same place, and both call their note the seventh; the
overlap check answers 1 for that file. Whichever lands second merges
`main`, keeps all three header lines and renumbers its own. If this one
lands second, its two lines become the eighth and the ninth. If objectstack-ai#38812
lands second, its line becomes the ninth. The seats set the order: this
pull request first, by claim stamp (seat 2's `Notify: serial · objectstack-ai#38676
behind objectstack-ai#38438`, mailbox objectstack-ai#38766 comment 7297489558); objectstack-ai#38812 renumbers its
line after this lands.
- **Seen and left alone.** Outside the four rows, and not changed here.
- ADR-0084's table "What the amendment replaces" has a row on the
cross-package directory that says "In force until it moves". The
amendment of 2026-11-26 moved that entry to Setup, and the menu model on
this tree has no entry kind for it. A candidate row for the next weekly
card.
- The items the first pull request of this card listed under this
heading stand as listed there.

## Verification

### Read first

1.
`docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md`,
the note of 2026-12-01 under the list of Consequences. The highest-risk
hunk: it says a sentence of the record no longer describes `main`, and
it draws the line between the state a build is decided from and the
state that only reports. Check the sentence pair "Where the knowledge
plugin can keep it" and "Otherwise", and the bullet "What decides a
build is unchanged".
2. `docs/adr/0084-application-builder-information-architecture.md`, the
amendment of 2026-12-01 under the table "What the amendment replaces".
It says which of four pull requests did which part, it names the three
sentences that count four entries, and it names a package's menu entries
where the record counts them. Check the four attributions, the three
quoted sentences and the four names.
3. `docs/adr/0085-object-semantic-roles-over-surface-hint-blocks.md`,
the note of 2026-12-01. It answers a sentence that the note of the day
before wrote, and its claim of three tiers is read from code with no
test that names them. Check the tier sentence and the list of what the
parse refuses.

### Two-minute check

Run `git diff --numstat origin/main...HEAD` on this branch. Expect three
rows under `docs/adr/`, each with `0` in the removed column, and 43
added lines in total (2, 24 and 17). Then run `pnpm
check:adr-symbol-anchors` and expect exit 0 with a line that contains
`anchors across 165 records resolve`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzhPdWmTd47Fi2bKYZS)_

<!-- signed: repo:objectstack@os-support-ai · os-support-ai ·
session_01WGufzhPdWmTd47Fi2bKYZS -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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