Repository navigation
feat(runtime): POST /packages/:id/move-in moves a selection of loose items into a package, each through the save door - #38185
Conversation
…mas (#38150) Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
…od (#38150) Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
…undo; the move door's dogfood (#38150) Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 55 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 21 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 187 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # 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
|
…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>
|
Check Changeset is red on 56df8b4 because of one line. The five new The fix is Generated by Claude Code |
…supported (#38150) Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
…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>
|
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>
…prose (#38150) Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978 Contract reviewServed-tier: PR #38185 (PR-A1 of card #38150), net diff against 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
② Semver level
③ Boundary flags
④ Design judgmentHits files.
Implementing files, tried against the brief's breaks. M1 (must-fix) — the door writes capability-gated types for a caller who lacks the capability. 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 (
S1 (should-fix) — the answer is not true when the undo fails. S2 (should-fix) — a thrown fault reaches the wire as a refusal with the thrower's own code and text. 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; S4 (should-fix) — The other breaks tried, and what the code answers:
Nits (no effect on correctness or the contract):
M1 and M2 are must-fix; S1 to S4 each earn a delta review of their fix. Implemented-by: VERDICT: FAIL |
|
repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978 L1-b, the seat's L1 thread for zone o3-studio · 2026-11-28T08:49Z 席位核对 — L1 REWORK @
|
…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
|
repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978 Contract reviewServed-tier: Delta review of PR #38185 on the head that answers the FAIL record on The delta splits in two. The dev's own work is three linear commits, Check-runs on the head: 74 runs, all completed: 62 success, 12 skipped, 0 failed, none pending. ① Derived judgments
② Semver levelUnchanged and still right: ③ Boundary flags
④ Design judgmentM1: closed. 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 S1: closed. S2: closed. S3: closed. Each delete names the version phase 0 read ( 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 No must-fix, no should-fix. Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
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 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T11:53Z · zone
|
…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>
…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>
…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>
…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>
… 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>
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-orphansand the Studio~orgentry, 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/apiMoveIntoPackage* schemas enter theapiauthorable-surface shard (23 keys); no metadata key an author writes is addedSkills-docs: none — no skill under
skills/**teachesadopt-orphansor loose items; this door is an admin operation whose console entry lands in PR-A2, and theobjectstack-platformpassage on package-less Setup rows covers overlays of shipped items, which this door refusesNOT_LOOSE维护者速读
What changes
Route.
POST /api/v1/packages/:id/move-in(packages/runtime/src/domains/packages.ts, mounted indispatcher-plugin.ts, ledger row inroute-ledger.ts).{ items: [{ type, name, member? }], dryRun? }, parsed withMoveIntoPackageRequestSchema(strict). A body it refuses answers 400, naming the member, and nothing moves. The query set is closed and empty.requireManageMetadata, the wall, the knowledge-source gate on the target, the no-query refusal,requireWritablePackage./metawrite of that type before anything is read or written:metaTypeWriteRefusal(403PERMISSION_DENIEDfor adatasourcewithoutmanage_platform_settingsand aknowledge_sourcewithoutmanage_knowledge_sources). A selected knowledge source is also admitted for its new author as its/metasave admits one (authoredKnowledgeSourceRefusal, read off the stored body; its own status and code).VALIDATION_ERROR. A refused move answers 422. The first refusal's code is inerror.code, anderror.detailsholds the whole answer (outcome: 'refused'and every item's refusal), so the card's "answers422 WRITABLE_PACKAGE_REQUIRED" holds and a caller can read every refusal. A move or a dry run answers 200 withMoveIntoPackageResponseSchemaasdata. 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 andParsedtypes. 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.tsgainspackages_move_in_unsupportedin four locales.Protocol (
packages/metadata-protocol/src/protocol-package-move-in.ts, a new facet;protocol.tsdelegates to it; the facet reaches the delete door through the host's existingfacade.deleteMetaItem).would_moveis 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..custompair item and an overlay of a shipped item are refusedNOT_LOOSE.uninstalledNamedBaseRefusal(A1) andisWritablePackage.objectNamespacePrefixViolation(A2),objectNamespaceObjectNameClash(child K),classifyObjectContributionwithoverlayPackageMismatchError(owner), andjudgeExtensionFieldSuffix(__c).collectReferenceHitsoverREFERENCE_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 refusedREFERENCE_LEFT_BEHINDwithreferences.dropStorage: false, so the table and its records stay;parentVersionnames the version phase 0 read, so a save that lands in between answers409 METADATA_CONFLICTinstead 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.publishPackageDraftsdefers 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.operation: 'apply', with a message naming the move). All of it runs in oneengine.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.publishPackageDraftsfilters them (clientFacingFailureCode,clientFacingFailureText); one with no code of its own isMOVE_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, neverrefused.ensureOverlayIndex()runs before the transaction, as inpublishPackageDrafts(measured below).environmentAddress→qualifiedAddress, and for a tool, skill, agent or object-less action it givesaiFaceNamebefore and after.reassignOrphanedMetadatais not touched.SDK.
client.packages.moveIn(id, request)(packages/client/src/index.ts). It resolves the answer formovedandwould_move; a refusal, a refused dry run included, rejects with the first item's code ascodeand the whole answer asdetails.Changeset.
38150-move-into-package-door.md:@objectstack/specat minor (claim amendment: the new schemas enter theapiauthorable-surface shard); metadata-protocol, runtime and client at patch.System-context register (
content/docs/permissions/system-context.mdx). The route's threeisSystemreads (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_BEHINDandMOVE_FAILEDare registered under@objectstack/metadata-protocolinerror-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.com.probe.ghostanswers422 WRITABLE_PACKAGE_REQUIRED.probe_widgetinto namespacezetaanswers422 NAMESPACE_PREFIX.GET /automation/zeta/probe_loose_flowandGET /meta/dataset/probe_env_ds?callerPackage=com.probe.zetaanswer 200.zeta_custom,NAMESPACE_CONFLICT), owner (OBJECT_OVERLAY_PACKAGE_MISMATCH), and__c(VALIDATION_ERROR). The permission-set owner judge (VALIDATION_ERROR) gets one too..custompair item and a served overlay are refusedNOT_LOOSE.dryRunanswerswould_move, writes nothing, and leaves the flow served loose:_env/NAMEanswers 200 andzeta/NAMEdoes not, read again after the engine has followed every signal.manage_metadatato its holder (/auth/me/permissions).manage_metadatais refused 403PERMISSION_DENIED; a member holding onlymanage_metadata(a loose fixture set) is refused 403PERMISSION_DENIEDnamingmanage_platform_settingsfor adatasourceandmanage_knowledge_sourcesfor aknowledge_source; the admin moving a loose knowledge source on this stack, which runs no knowledge service, is refused 503SERVICE_UNAVAILABLEby the author admission. Each asserts the row stays loose._envaddress is measured.VALIDATION_ERROR.packages/spec/src/api/package-lifecycle.test.ts: two newdescribeblocks 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 passesparentVersionfrom the stored checksum, and the delete door's 409 becomes the item'sMETADATA_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 isMOVE_FAILEDwith its declared sentence; a store fault answers 500INTERNAL_ERRORwithout 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(moveInhitsPOST …/move-inwith the body, and a 422 rejects withcode,httpStatusand the whole answer indetails), andreturn-type-precision.test.ts(moveInreturnsMoveIntoPackageResponse).Acceptance notes
_envaddress, measured on this door. After a move,GET /automation/_env/probe_loose_flowanswers409 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.candidatesholds that one package. The bare name andzeta/probe_loose_flowanswer 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".deleteMetaItemfollowed bysaveMetaItemof an object into a package, insideengine.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.ensureOverlayIndex()now runs first, aspublishPackageDraftsdoes.zetawhile its object stays loose saves (measured). The set rule covers the ADR-0150 package-scoped types only.VALIDATION_ERROR, which the save door itself answers as 400. Each item's own code is kept inerror.details.refused.Verification
Two minutes:
Expected: 20 passed.
Read first, by risk:
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.protocol-package-move-in.ts, the set rule: reversingcollectReferenceHitsoverREFERENCE_SITES.byTarget.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 indetails.protocol-package-move-in.ts,restoreAfterRollback,replayRestoredand 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 fullpnpm exec turbo run build --filter='./packages/**' --filter='@objectstack/dogfood^...'with declarations (83 tasks).packages/metadata-protocolfull 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/runtimefull suite: 660 files, 13962 passed;--project repo: 1519 passed.packages/client: 829 passed.packages/specsrc/apiandsrc/system: 5016 passed.pnpm --filter @objectstack/spec check:generatedexit 0 aftergen:docs.@objectstack/metadata-protocol,@objectstack/runtime(tsc --noEmit).scripts/ablation-replace.mjs, each restored blob == HEAD:replayRestoredmade a no-op: the dogfood suite stays 20 passed (the host kernel's registry heal, see Acceptance notes);protocol-package-move-in.test.ts3 failed (rollback replay, fault replay, undo replay).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, specsrc/api+src/system5017,check:generatedandcheck:system-context-censusexit 0, dogfood 20 passed, runtimetsc --noEmitexit 0.ensureOverlayIndex, the 422 branch) touch code this round did not change.dispatch-gates --ranat 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