Repository navigation
feat(cloud-connection): the install door's declared-rename planner is reachable read-only on a kernel service - #31851
Conversation
…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>
…nel service Claude-Session: https://claude.ai/code/session_01ADHkmQ8n76QVvYSyAqeFeV Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 6 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 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
|
|
domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi 席位 ACCEPT · head
|
Requested by Steve · project thread
Fixes #31801
Clause-②: yes (widening: a new read-only kernel service surface and new root exports) — measured: on base
ad622d30no service answersmarketplace-install-rename-plannerand@objectstack/cloud-connectionexports none of the rename types; on head14baac4ethe install-local plugin registers the service ininit()(declared inprovidesServices) 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
维护者速读
marketplace-install-rename-planner暴露出来;安装接口和这个服务调用同一个函数,结果类型与服务契约从包根导出。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
marketplace-install-local-plugin.ts). The body of step 2c″'s planning (read theobjectqlengine, list the upgrade plan's type changes, callplanInstallDeclaredRenames) moves out ofevaluateDeclaredRenamesinto a privateplanDeclaredRenames(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.init()registersINSTALL_RENAME_PLANNER_SERVICE = 'marketplace-install-rename-planner'beside the install door (marketplace-install-local), andprovidesServicesdeclares 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 }.carrieshas the door'srenamesCarriedshape (object,table,from,to);refusalsis 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).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.index.ts):INSTALL_RENAME_PLANNER_SERVICE, and the typesInstallRenamePlanner,InstallRenamePlanRequest,InstallRenamePlan,InstallRenamePlannedCarry,InstallRenameCarry,InstallRenameRefusal,InstallRenameRefusalReason.planInstallDeclaredRenamesitself stays internal..changeset/31801-install-rename-planner-service.md,@objectstack/cloud-connectionpatch, 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 patternmarketplace-install-local), the constantINSTALL_RENAME_PLANNER_SERVICE(patternINSTALL_LOCAL_DOOR_SERVICE), the methodplan, 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'smountnow runs the plugin'sinit()too, with aregisterServicethat writes into the same service mapgetServicereads. It returnsplanner(), which resolves the service by name. No existingitchanged (forced test edits: none).carries: [{ object, table, from, to }]andrefusals: []; the driver was asked once with the door's live keys; then the door's install of the same version answersrenamesCarriedequal to the plan.installed: null): the same agreement.both_columns,destructive_type,outside_package,transport): the planner'srefusalsequal the door's 422details.refusalsword for word, andcarriesis empty.carryDeclaredRenames,reverseDeclaredRenames, the engine'sregisterandsyncSchemaswere never called.ObjectKernel(ObjectQLPlugin+MarketplaceInstallLocalPlugin+ a consumer plugin from outside the package): the consumer resolves the service by name in itsstart(), and the engine it booted with answers (no driver with rename members, so a pending rename istransport). Nothing is installed.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 fromsrc, so no rebuild or dist leg applies.plancarryInstallDeclaredRenames(p.tables, …))expected { …(2) } to deeply equal { …(2) }, the table lostcompany){ tables: [], refusals: [] }promise resolved "{ carries: [], refusals: [] }" instead of rejectingAcceptance notes
install-local-door-service.tsalready records for the door (cloud-connection: forward target_namespace on an unmanaged grant once the control plane reads it, and confirm the hosted environment kernel mounts install-local #31482). Where it is not mounted,getService('marketplace-install-rename-planner')throws, as for any absent service; cloud#3862 resolves it from the environment's kernel.mainmoved six commits after the base (ad622d30→3487ccc1), none touchingpackages/cloud-connection/**; not merged (standard order: merge only when main moves under the same file).packages/cloud-connection/src/marketplace-install-*,install-local-door-service.tsorindex.ts(35 open PRs read; cloud-connection: the in-environment install door forwards no version, so an environment user cannot install a named package version #31799 is an issue with no PR; The deploy command andos package publish --installshow the upgrade plan before installing — declared renames printed, undeclared renames and type changes stopped until--confirm-upgrade(epic cloud#3652 Q3) #30887's self-hosted half merged as feat(cli): show the upgrade plan before a self-hosted deploy — os deploy --dry-run, --json, and a terminal confirmation for an undeclared rename #31776).Verification
Head
14baac4e, basead622d30. Heavy runs throughscripts/pm/os-verify-lock.sh, eachVERDICT command-exit 0.pnpm --filter @objectstack/cloud-connection typecheckpnpm --filter @objectstack/cloud-connection testeslint --no-inline-config packages/cloud-connection(root config)node scripts/pm/dispatch-gates.mjs --commands→ 69 families, each run--ranreconcile: 69 run, 0 NOT-MEASURED, 0 UNRUNpnpm --filter @objectstack/dogfood test(afterturbo run build --filter='./packages/**', 81/81)Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintpasses (package scope).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code