Skip to content

Commit d02c99e

Browse files
docs(spec): the unmanaged-install data door comment names the seed copy #30808 added (#31504)
<!-- claude-projects-attribution: {"github_login":"marchtian"} --> _Requested by **田騏** · [project thread](https://claude.ai/code/project/chan_01VmuUhXU9SSUzqJYyXSmYSi?thread=cmsg_01VmuUhXU9SSUzqJYyXSmYSi7C6yU7FGfMPUfvLt3HYbkq)_ Fixes #31427 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么:** 只改 `packages/spec/src/kernel/unmanaged-install.ts` 里 `data: 'door'` 那一行上方的注释(2 行换成 6 行);处置值、类型、测试都不动。 - **为什么改:** 旧注释说「种子数据不是元数据,元数据副本带不走它们」。非托管安装加了 `seedSampleData` 开关后,副本会把每个种子数据集作为环境里的 `seed` 元数据项写进 base,这句话已经不对。新注释写明由安装门决定:要样例数据时,`importUnmanagedPackage` 把它们复制成 `seed` 项(即副本的种子回执),门再据此载入数据行;不要时不复制,包里有种子数据时应答以 `seeded.mode: 'skipped'` 说明。 - **风险与回滚:** 没有运行时风险。该文件不在 spec 包的发布面(包只发运 `src/**/*.zod.ts`),回滚即还原这段注释。 - **先看:** `packages/spec/src/kernel/unmanaged-install.ts` 的 `// ── The install door's ──` 小节(约第 111–118 行)。 - **两分钟验证:** `git diff origin/main --stat` 只列出这一个文件,`+6 / -2`,全是注释行。 - **需要你做的:** 无,席位落地。 ## What changes The comment on the `data: 'door'` row of `UNMANAGED_INSTALL_KEY_DISPOSITIONS` said a metadata copy cannot carry seed datasets. Since #30808 (PR #31398, `1ff99441d8`) that is false. The new text says the door, not the import, decides what happens to them, using the names the implementation on `main` uses: - asked for the sample data (`seedSampleData: true` on `POST /marketplace/install-local`), the door has the `importUnmanagedPackage` verb copy each dataset into the base as one environment `seed` item (`UNMANAGED_SEED_TYPE`), the copy's seed receipt, and loads the rows from it; - not asked, nothing is copied, and when the package declares datasets the door's answer says so (`seeded.mode: 'skipped'`). The disposition stays `'door'`. No type, value or test changes. ## Tests None added: the diff is a comment. Spec typecheck and lint on the file are listed under Verification. ## Acceptance notes - `skip-changeset`: the file is not a `*.zod.ts`, and the spec package publishes `src/**/*.zod.ts` only, so nothing published changes. - Names measured on `main` at `c65599fa`: `seedSampleData` (`packages/cloud-connection/src/marketplace-install-local-plugin.ts`), the verb's door-stated `seedData` and `UNMANAGED_SEED_TYPE = 'seed'` (`packages/metadata-protocol/src/package-unmanaged-install.ts`), and the skipped answer `seeded: { mode: 'skipped', reason }` (the same plugin file). ## Verification Local gates, measured on this branch (gates at `cb136d4896`, the comment commit; then `origin/main` merged as `2163119f0a`, which adds no change of this PR's own): - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 68 commands for this diff. All 68 ran and exit 0. Four first answered exit 3 (PREREQUISITE NOT MET: an unbuilt workspace and a shallow clone) and were rerun green after `git fetch --unshallow` and `pnpm build` (exit 0): `check-plugin-teardown-shape --self-test`, `@objectstack/lint check:doc-formula-expressions`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`. - `dispatch-gates --ran`: `68 derived famil(ies) accounted for`, exit 0. - `pnpm --filter @objectstack/spec run typecheck` :: exit 0. `pnpm --filter @objectstack/spec exec eslint src/kernel/unmanaged-install.ts` :: exit 0. - After the merge: spec `build && gen:schema && gen:docs` :: exit 0, no tree change; `pnpm --filter @objectstack/spec run check:generated` :: exit 0 (14 artifacts current). - `git diff origin/main --stat`: `packages/spec/src/kernel/unmanaged-install.ts | 8 ++++++--`, comment lines only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017ihL2cCLnFWgFEuZvjguSF <!-- signed: domain:spec#4 · marchtian · session_017ihL2eAG5J8aqAyPZif4BJ --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 58f66b9 commit d02c99e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/spec/src/kernel/unmanaged-install.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ export const UNMANAGED_INSTALL_KEY_DISPOSITIONS: Readonly<Record<string, Unmanag
109109
translations: 'converted',
110110

111111
// ── The install door's ──
112-
// Seed datasets are data, never metadata items, so a copy of the metadata
113-
// cannot carry them; the door states what it did with them.
112+
// [#30808] The door, not the import, decides what happens to the seed
113+
// datasets. Asked for the sample data (`seedSampleData: true`), the door
114+
// has the `importUnmanagedPackage` verb copy each dataset into the base as
115+
// one environment `seed` item, the copy's seed receipt, and loads the rows
116+
// from it. Not asked, nothing is copied, and when the package declares any
117+
// the door's answer says so (`seeded.mode: 'skipped'`).
114118
data: 'door',
115119
// Read by the door to judge the requested mode; the base is the
116120
// environment's own package and makes no promise about how it installs.

0 commit comments

Comments
 (0)