Skip to content

feat(cloud-connection): the install door's declared-rename planner is reachable read-only on a kernel service - #31851

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-2jr1fz
Nov 9, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-2jr1fz

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #31801

Clause-②: yes (widening: a new read-only kernel service surface and new root exports) — measured: on base ad622d30 no service answers marketplace-install-rename-planner and @objectstack/cloud-connection exports none of the rename types; on head 14baac4e the install-local plugin registers the service in init() (declared in providesServices) and the package root exports the service name, its contract and the result types. The install door answers every request as before (its 13 rename tests are untouched and green).
Metadata-protocol: none

维护者速读

  • 改了什么:本地安装接口里“声明了字段改名(renamedFrom)时,这次安装会搬哪些列、会拒绝哪些声明”的判断,现在以只读内核服务 marketplace-install-rename-planner 暴露出来;安装接口和这个服务调用同一个函数,结果类型与服务契约从包根导出。
  • 为什么改:云端托管安装要在写入前先问环境“这个改名能不能做”(cloud#3862),而且云端不能复制判断逻辑;原来这段逻辑只在安装接口内部可达。
  • 风险与回滚:纯新增只读面:服务不改列、不写账本、不持安装锁,读表失败时直接报错而不是答“没东西可搬”。安装接口行为不变(原有改名测试未改且全绿,dogfood 全量绿)。回滚即整体 revert。
  • 先看:① packages/cloud-connection/src/marketplace-install-local-plugin.ts 的 init()(服务注册)与新私有入口 planDeclaredRenames ② marketplace-install-declared-renames.ts 末尾的服务契约 ③ marketplace-install-local-declared-rename.test.ts 末尾新增的 describe。
  • 两分钟验证:pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-declared-rename.test.ts,预期 21 个测试全绿(其中 8 个是本次新增的服务对照用例)。
  • 需要你做的:无,席位落地。

What changes

  • One entry, two callers (marketplace-install-local-plugin.ts). The body of step 2c″'s planning (read the objectql engine, list the upgrade plan's type changes, call planInstallDeclaredRenames) moves out of evaluateDeclaredRenames into a private planDeclaredRenames(ctx, manifestId, converted, installed). The door's step 2c″ calls it exactly as before and keeps its own 422 / 503 answers; the new service calls the same method. There is no second copy of the rule.
  • The service (seam (b), a service of its own). init() registers INSTALL_RENAME_PLANNER_SERVICE = 'marketplace-install-rename-planner' beside the install door (marketplace-install-local), and providesServices declares both (ADR-0116). plan({ manifestId, incoming, installed }) converts both bodies forward as the door does (installed: null = fresh install; undefined = no readable body, every declaration taken as pending, as the door takes it) and answers { carries, refusals }. carries has the door's renamesCarried shape (object, table, from, to); refusals is the door's own list, with its reasons and words. It writes nothing and holds nothing; a table that cannot be read rejects the call (the door's 503).
  • Why not a member of the door's service (seam (a)): the door's service object is the install itself (install(request)). A reader resolving it to ask a read-only question would be handed the write. The hosted runtime resolves this new service by name and never sees the door.
  • Root exports (index.ts): INSTALL_RENAME_PLANNER_SERVICE, and the types InstallRenamePlanner, InstallRenamePlanRequest, InstallRenamePlan, InstallRenamePlannedCarry, InstallRenameCarry, InstallRenameRefusal, InstallRenameRefusalReason. planInstallDeclaredRenames itself stays internal.
  • Changeset .changeset/31801-install-rename-planner-service.md, @objectstack/cloud-connection patch, carrying both declaration lines.

New public names (the seat's call, see open questions in the report): the service name marketplace-install-rename-planner (house pattern marketplace-install-local), the constant INSTALL_RENAME_PLANNER_SERVICE (pattern INSTALL_LOCAL_DOOR_SERVICE), the method plan, and the four contract types above.

Tests

packages/cloud-connection/src/marketplace-install-local-declared-rename.test.ts (the door's shared rename harness) gains one top-level describe, 8 cases. The harness's mount now runs the plugin's init() too, with a registerService that writes into the same service map getService reads. It returns planner(), which resolves the service by name. No existing it changed (forced test edits: none).

  • A carry: the planner answers carries: [{ object, table, from, to }] and refusals: []; the driver was asked once with the door's live keys; then the door's install of the same version answers renamesCarried equal to the plan.
  • A fresh install (installed: null): the same agreement.
  • Four refusals (both_columns, destructive_type, outside_package, transport): the planner's refusals equal the door's 422 details.refusals word for word, and carries is empty.
  • A table that cannot be read: the call rejects; the door answers 503.
  • Writes nothing, on every case above: the driver's tables and the ledger directory are byte-equal before and after the planner call, and carryDeclaredRenames, reverseDeclaredRenames, the engine's register and syncSchemas were never called.
  • A real ObjectKernel (ObjectQLPlugin + MarketplaceInstallLocalPlugin + a consumer plugin from outside the package): the consumer resolves the service by name in its start(), and the engine it booted with answers (no driver with rename members, so a pending rename is transport). Nothing is installed.
  • CONTROL: the door's 13 existing rename tests are unchanged and green.
Ablations (each red, then restored: blob == HEAD, `git diff HEAD` empty)

Via node scripts/ablation-replace.mjs --file packages/cloud-connection/src/marketplace-install-local-plugin.ts --anchor 'const plan = await this.planDeclaredRenames(' …. The tests import the plugin from src, so no rebuild or dist leg applies.

Mutation in the service's plan Result
it also carries the planned tables (carryInstallDeclaredRenames(p.tables, …)) 2 failed / 19 passed: the carry and fresh-install cases (expected { …(2) } to deeply equal { …(2) }, the table lost company)
a failed table read is swallowed into { tables: [], refusals: [] } 1 failed / 20 passed: promise resolved "{ carries: [], refusals: [] }" instead of rejecting

Acceptance notes

Verification

Head 14baac4e, base ad622d30. Heavy runs through scripts/pm/os-verify-lock.sh, each VERDICT command-exit 0.

Run Result
pnpm --filter @objectstack/cloud-connection typecheck exit 0
pnpm --filter @objectstack/cloud-connection test 80 files, 1130 tests passed
eslint --no-inline-config packages/cloud-connection (root config) exit 0, no findings
node scripts/pm/dispatch-gates.mjs --commands → 69 families, each run 69/69 exit 0; --ran reconcile: 69 run, 0 NOT-MEASURED, 0 UNRUN
pnpm --filter @objectstack/dogfood test (after turbo run build --filter='./packages/**', 81/81) 441 files passed, 3 skipped; 3662 tests passed, 42 skipped

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (package scope).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

Generated by Claude Code

…ad-only on a kernel service

The install-local plugin registers marketplace-install-rename-planner beside
its install door: plan({ manifestId, incoming, installed }) answers the
carries and refusals the door's step 2c'' would, through the same entry
(planDeclaredRenames), and writes nothing. The result types and the service
contract are exported from the package root.

Claude-Session: https://claude.ai/code/session_01ADHkmQ8n76QVvYSyAqeFeV
Co-authored-by: Claude <noreply@anthropic.com>
…stall door and writes nothing

Claude-Session: https://claude.ai/code/session_01ADHkmQ8n76QVvYSyAqeFeV
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cloud-connection, touching 11 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/cloud-connection/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/deployment/cli.mdx (via MarketplaceInstallLocalPlugin (symbol, a top-level class), manifestId (symbol, a field of interface InstallRenamePlanRequest))
  • content/docs/deployment/marketplace-handbook.mdx (via manifestId (symbol, a field of interface InstallRenamePlanRequest))
  • content/docs/deployment/publish-and-preview.mdx (via manifestId (symbol, a field of interface InstallRenamePlanRequest))
  • content/docs/kernel/services-checklist.mdx (via providesServices (symbol, a field of class MarketplaceInstallLocalPlugin))
  • content/docs/plugins/anatomy.mdx (via providesServices (symbol, a field of class MarketplaceInstallLocalPlugin))
  • content/docs/protocol/kernel/lifecycle.mdx (via providesServices (symbol, a field of class MarketplaceInstallLocalPlugin))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/cloud-connection/src/index.ts) — pages documenting those are invisible to this run
  • 6 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 231 client-bound route-ledger rows — the other 166 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 166: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 107 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 3487ccc12a6ad00dc75450f3f8b29a8a0630701d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from aac9649ce726f7ca5a714be1f645543c145f61ba — the merge of head 14baac4e9c61209a287f3d9b25ae883062dc5ed2 into base 3487ccc12a6ad00dc75450f3f8b29a8a0630701d, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin aac9649ce726f7ca5a714be1f645543c145f61ba && git checkout aac9649ce726f7ca5a714be1f645543c145f61ba
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3487ccc12a6ad00dc75450f3f8b29a8a0630701d 14baac4e9c61209a287f3d9b25ae883062dc5ed2 && git checkout -B drift-repro 3487ccc12a6ad00dc75450f3f8b29a8a0630701d && git merge --no-ff 14baac4e9c61209a287f3d9b25ae883062dc5ed2

node scripts/docs-audit/affected-docs.mjs --json 3487ccc12a6ad00dc75450f3f8b29a8a0630701d

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3487ccc12a6ad00dc75450f3f8b29a8a0630701d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

席位 ACCEPT · head 14baac4e9c61209a287f3d9b25ae883062dc5ed2

#31801 (cloud#3862 prerequisite). Clause-②: yes (widening) / Metadata-protocol: none. The paths give no review face, so the seat reviewed it at TIER_DEFAULT. Not governed.

  • Seam (b) is accepted. MarketplaceInstallLocalPlugin.init() registers a separate read-only service, marketplace-install-rename-planner (INSTALL_RENAME_PLANNER_SERVICE). It is listed in providesServices beside the door's service, so a reader of the planner never holds the write door.
  • One implementation. The door and the service share the private planDeclaredRenames: the engine read, the typeChanges comparison and planInstallDeclaredRenames. There is no second copy. The service converts both published bodies forward, the way the door converts the incoming body. Pins show the door and the service agree on a carry and on a refusal, and that the call writes nothing.
  • Request shape accepted: the caller passes both bodies as published, and the service reads no ledger in this runtime. The cloud runtime holds both bodies, and a ledger read would bind the answer to this runtime's state.
  • Names (seat's call) accepted: marketplace-install-rename-planner, INSTALL_RENAME_PLANNER_SERVICE, InstallRenamePlanner / InstallRenamePlan / InstallRenamePlanRequest / InstallRenamePlannedCarry. The root exports also carry InstallRenameCarry, InstallRenameRefusal and InstallRenameRefusalReason.
  • Not measured: the hosted mount of the install-local plugin. Its carrier is cloud (cloud#3862 consumes the service); the seat notifies the cloud mailbox on landing.
  • Accepted deviations: no assignee or reviewer on the PR; Fixes sits after the attribution block; main is 6 commits ahead and does not touch cloud-connection.
  • Evidence: gates 69/69, 0 NOT-MEASURED. Package suite 80 files / 1130 tests. Dogfood package 441 / 3662 green. 8 new pins, 2 ablations red then restored, and the 13 existing door tests unchanged. The changeset is patch.

Landing: once CI is all green, check K, then relay pr_ready + automerge_enable.

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

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud-connection: expose the declared-rename install planner (planInstallDeclaredRenames) to a hosted control plane reading, through a kernel service

1 participant