Skip to content

feat(cloud-connection)!: refuse marketplace install-local when replicas are declared on the Redis driver - #31712

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-cn42eu
Nov 9, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-cn42eu

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #31602

Maintainer ruling R6 on cloud#3814 (2026-11-08 14:16 UTC): 「多副本时拒绝」. Claim 6727409308 (domain:server#4, card-thread session_01ADHkmPnqZD15YnBkNbm1jJ).

Clause-②: yes (narrowing) — narrowed, measured on head 6f4c42d9 and, for base, by the ablation that removes the new guard (equivalent to main 5d1382a5 on these doors): with OS_CLUSTER_REPLICAS=3 (or OS_EXPECT_MULTI_NODE=true) and a composed cluster service on the redis driver, POST /api/v1/marketplace/install-local answered 200 with hotLoaded: true and wrote the ledger on base, and DELETE /api/v1/marketplace/install-local/:manifestId answered 200 and withdrew the package; on head both answer 409 MULTI_REPLICA_PACKAGE_CHANGE_REFUSED and nothing is written, registered or withdrawn. Every other topology is unchanged. Widened: two published faces gain members, ERROR_CODE_LEDGER (@objectstack/spec) registers MULTI_REPLICA_PACKAGE_CHANGE_REFUSED under @objectstack/cloud-connection (the ledger header's "Registering a new code" rule), and the @objectstack/service-cluster root exports declaresMultiReplicaOnRedis, composedClusterDriver, MULTI_REPLICA_CLUSTER_DRIVER and MULTI_REPLICA_PACKAGE_CHANGE_REFUSED; nothing is removed or renamed. This PR takes a CONTRACT_REVIEW_TIER review (PASS, 6728523407).
Metadata-protocol: none

Shared predicate (card item 4, for #31599): declaresMultiReplicaOnRedis(env, clusterDriver) in @objectstack/service-cluster (packages/services/service-cluster/src/multi-replica.ts), with composedClusterDriver(services) to read the driver from a kernel context and the code constant MULTI_REPLICA_PACKAGE_CHANGE_REFUSED. @objectstack/runtime already depends on @objectstack/service-cluster, so the runtime package doors import it from there.

维护者速读

  • 改了什么:部署声明了多副本(OS_CLUSTER_REPLICAS 大于 1 或 OS_EXPECT_MULTI_NODE=true)且集群驱动是 Redis 时,市场 install-local 的安装(POST)和卸载(DELETE)直接拒绝,返回 409 MULTI_REPLICA_PACKAGE_CHANGE_REFUSED,提示在维护窗口里跑安装脚本、再重启所有副本;不写账本、不热加载、不撤包。
  • 为什么改:这两个门只改处理请求的那一个副本(它自己 OS_HOME 下的账本和它自己的内核),其他副本永远看不到,而且每个副本启动时只读自己的账本,所以分叉是永久的。维护者 R6 裁决「多副本时拒绝」。
  • 风险与回滚:只在"声明多副本 + Redis 驱动"时生效;单节点、内存驱动、其他驱动、没有集群服务时字节不变,split-brain 守卫没动。回滚即 revert 本 PR。
  • 先看:packages/cloud-connection/src/marketplace-install-local-plugin.ts 的 refuseMultiReplicaPackageChange 及两个门里的调用点;packages/services/service-cluster/src/multi-replica.ts(共享谓词);error-code-ledger.zod.ts 新增的一行和一条 provenance 豁免。
  • 两分钟验证:pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-register-refusal.test.ts —— 预期 27 passed,其中 R6 一组 8 个(4 个拒绝、4 个对照)。
  • 需要你做的:无,席位落地(新错误码一行走 CONTRACT_REVIEW_TIER 复核)。

What changes

  • packages/services/service-cluster/src/multi-replica.ts (new) — the one condition every cloud#3814 card keys on: declaresMultiReplicaOnRedis(env, clusterDriver) = declaresMultiNode(env) (the split-brain guard's own reading, untouched) AND the driver is MULTI_REPLICA_CLUSTER_DRIVER ('redis'). composedClusterDriver(services) reads the composed cluster service's driver (the IClusterService.driver contract field) and never throws. MULTI_REPLICA_PACKAGE_CHANGE_REFUSED spells the code once, so every door refusing a package change under the condition answers the same code. Exported from the package root; unit pins in multi-replica.test.ts (new file: no harness exists for this module).
  • packages/cloud-connection/src/marketplace-install-local-plugin.ts — refuseMultiReplicaPackageChange(c, ctx, subject) answers 409 with the code and the recipe ("run the install script, then restart every replica"). Called in handleInstall right after requireInstallCapability (before the body is read, so before the cloud fetch, the ledger, manifest.register and syncSchemas) and in handleUninstall right after admission (before the ledger lookup, the guards and the withdrawal). The driver is read per request, where it is used. The grant path (installForGrant) calls handleInstall, so it is covered too.
  • packages/cloud-connection/src/connection-credential-ledger.ts — sharesCloudBindingCredential now delegates to declaresMultiReplicaOnRedis and CLOUD_BINDING_SHARED_CLUSTER_DRIVER aliases MULTI_REPLICA_CLUSTER_DRIVER: same answers (its suite is green unchanged), one predicate for the epic.
  • packages/spec/src/api/error-code-ledger.zod.ts — MULTI_REPLICA_PACKAGE_CHANGE_REFUSED registered under @objectstack/cloud-connection (the door), plus one PROVENANCE_WAIVERS entry for @objectstack/service-cluster (the shared constant one package over, the UNIQUE_SCOPE_CONFIRMATION_REQUIRED precedent). The claim's surface says "one row"; the waiver is the provenance gate's required companion for a constant defined one package over the door.
  • content/docs/references/api/{contract,automation-api,error-code-ledger}.mdx — regenerated (gen:schema && gen:docs) for the new enum member.
  • packages/cloud-connection/src/marketplace-install-local-register-refusal.test.ts — the shared real-engine install-local harness (AGENTS.md shared-harness rule): bootPlugin takes an optional clusterDriver that composes a cluster service; a new top-level describe pins the refusal. No existing test was changed.
  • .changeset/31602-install-local-multi-replica-refusal.md — patch for @objectstack/cloud-connection, @objectstack/service-cluster, @objectstack/spec; both declaration lines; adr-0087: not-required (no-migration-prescription); who sees it.

Tests

The new describe, on a real ObjectKernel + ObjectQLPlugin and a real on-disk ledger:

  • for each declaration (OS_CLUSTER_REPLICAS=3, OS_EXPECT_MULTI_NODE=true) on the redis driver: POST (inline branch and cloud branch) answers 409 MULTI_REPLICA_PACKAGE_CHANGE_REFUSED in the declared envelope, the ledger stays empty, the registry holds neither package, and the cloud leg is never fetched; DELETE of a package installed on a single node and rehydrated after a restart with replicas declared answers the same 409, the ledger still holds it and the registry still serves it;
  • CONTROLs, install then uninstall both 200 with the ledger and registry moving as before: a single node on redis, OS_CLUSTER_REPLICAS=1 on redis, declared replicas on the in-process driver (with the split-brain guard's escape hatch), declared replicas with no cluster service composed.

Acceptance notes

  • The recipe's wording. The message names the ruling's recipe verbatim ("run the install script, then restart every replica"). This repository has no deployment install script to point at by name; if the seat wants a concrete command, the wording is one line in refuseMultiReplicaPackageChange.
  • Dry run is refused too. POST with dryRun: true writes nothing, but the guard sits before the body is read, so it is refused like any install: its plan reads the serving replica's own ledger, which is the per-replica state the refusal is about.
  • Sibling doors not in this card. POST …/:manifestId/reseed and …/purge-sample-data write rows to the shared database (every replica sees them) and are not refused. The runtime package doors (create/ensure customization, enable, disable, runtime install/uninstall) are feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599, which imports this predicate.
  • A second reader of the same condition stays separate. @objectstack/service-cache (cache-service-plugin.ts) reads declaresMultiNode() plus its own driver check for the shared Redis cache; it is not moved onto the new predicate here.

Verification

All on 6f4c42d9 unless stated (the feature commits were cut on 5d1382a5; origin/main merged once at 03fed7a5, 5 commits, none in these packages; 6f4c42d9 adds only the regenerated references; head 485e8f99 changes only the changeset's prose, after the contract review: the Clause-②: line now reads yes (narrowing) and names both halves, and the Now bullet says a dry run is refused too. On 485e8f99 the changeset gates were re-run, each exit 0: check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, check:nul-bytes):

Suites (os-verify-lock, every VERDICT command-exit 0)
  • pnpm --filter @objectstack/service-cluster test + typecheck: 9 files / 120 tests (03fed7a5).
  • pnpm --filter @objectstack/cloud-connection test: 80 files / 1116 tests; typecheck exit 0 (03fed7a5).
  • pnpm --filter @objectstack/spec test: 822 files / 26034 passed, 1 todo; typecheck exit 0 (03fed7a5).
  • pnpm --filter @objectstack/dogfood test (full battery, narrowing arm): 440 passed, 3 skipped files / 3652 passed, 41 skipped tests (03fed7a5).
  • Lint (eslint --no-inline-config) on service-cluster, cloud-connection, spec sources: exit 0 each.
Ablation (negative pins)

scripts/ablation-replace.mjs on 51cac0fe (fix committed first), marker ABLATED_31602: the guard's condition || 'ABLATED_31602', so refuseMultiReplicaPackageChange always returns null (the base behaviour). The test file imports the plugin from src, so no rebuild leg. Result: 4 of 27 red — exactly the four refusal cases (POST and DELETE, both declarations), each expected 200 to be 409 with the base answer in the message ({"success":true,"data":{"manifestId":"com.acme.dispatch",…,"hotLoaded":true,…}} for POST; the withdrawal answer for DELETE); the four CONTROLs and the 19 existing cases green. Restored: blob 4f8e111f == HEAD, git diff HEAD empty.

Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 6f4c42d9: 120 families, each run and recorded with its exit code; --ran reconciliation: "120 derived famil(ies) accounted for — 120 run, 0 NOT-MEASURED". All 120 exit 0, among them check:error-code-provenance, check:error-code-casing, check:dispatcher-error-vocabulary, check:error-status-conformance, check:route-envelope, check:startup-registry-verdict, check:api-surface, check:generated and check:docs. A first pass on 03fed7a5 had check:docs red (the three references above were stale, now regenerated) and two exit-3 prerequisites (check:plugin-teardown-shape --self-test needed its pinned fixture commit fetched; check:dual-build-cjs-loads needed every package's dist, built with turbo run build --filter='./packages/**'); both are green on 6f4c42d9. pnpm --filter @objectstack/spec check:generated: exit 0.


Generated by Claude Code

… on the Redis driver

The marketplace install-local install and uninstall doors change only the
replica that serves the request (its own ledger, its own kernel). When the
deployment declares several replicas on the Redis cluster driver they now
refuse with MULTI_REPLICA_PACKAGE_CHANGE_REFUSED (409) and the
maintenance-window recipe, before anything is read or written. The
condition is the new shared predicate declaresMultiReplicaOnRedis in
@objectstack/service-cluster, which the cloud binding credential ledger
now delegates to as well.

Claude-Session: https://claude.ai/code/session_01ADHkmPnqZD15YnBkNbm1jJ
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmPnqZD15YnBkNbm1jJ
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 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cloud-connection, @objectstack/service-cluster, @objectstack/spec, touching 13 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/services/service-cluster/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.

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

  • content/docs/api/client-sdk.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/api/error-catalog.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/api/error-handling-server.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/kernel/contracts/data-engine.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))

⛔ 3 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/releases/v17/17-1.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))
  • content/docs/releases/v17/17-4.mdx (via ERROR_CODE_LEDGER (symbol, a top-level const object))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/services/service-cluster/src/index.ts) — pages documenting those are invisible to this run
  • 2 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 — 174 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 35a9c6941c18eb5597dedd8e27b518050851bdd5 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 35a9c6941c18eb5597dedd8e27b518050851bdd5

⚠️ 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 35a9c6941c18eb5597dedd8e27b518050851bdd5 → 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#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

Contract-review-claim: session_01ADHkmP8JJo4zF2sjTBRwnX · head 6f4c42d · 2026-11-08T23:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6f4c42d9bba8c2660eecdd7f4024485eac8a1448
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts + packages/cloud-connection/src/marketplace-install-local-plugin.ts, packages/services/service-cluster/src/multi-replica.ts, packages/services/service-cluster/src/index.ts, packages/cloud-connection/src/connection-credential-ledger.ts (the narrowing face: every non-prose path of the diff; the two test files were read as evidence, the changeset and the three regenerated content/docs/references/api/*.mdx are prose faces for the lane seat's ACCEPT)

Faces: schema (hits = the ledger) AND a declared narrowing (Clause-②: … (narrowing) on the PR body and the changeset). Inputs: card #31602 body and comments 6724399807 (triage), 6727409308 (claim), 6728360014 (os-dev-report, read as the dev's claim); PR #31712 body, file list (11 files) and the net diff against main at 3806a5ab (merge-base of the head); the check-runs on the head. The cloud repository is not readable from this session: R3 and R6 are judged as the card body quotes them verbatim.

① Derived judgments

  1. Narrowing — RIGHT. On a deployment where declaresMultiNode(process.env) holds (OS_CLUSTER_REPLICAS greater than 1, or OS_EXPECT_MULTI_NODE=true) and the composed cluster service's driver is redis, POST /api/v1/marketplace/install-local and DELETE /api/v1/marketplace/install-local/:manifestId answer 409 MULTI_REPLICA_PACKAGE_CHANGE_REFUSED. Read in the tree: handleInstall calls refuseMultiReplicaPackageChange after requireInstallCapability and before readJsonRequestBody; handleUninstall calls it after admission and before the manifestId parse and this.ledger.has. This is R6 「多副本时拒绝」 on exactly the two doors the card names, and R3's two conjuncts (declared replicas AND the Redis driver): a single node, OS_CLUSTER_REPLICAS=1, the in-process driver (escape hatch included), any other driver and no composed cluster service all return null from the guard and the doors run byte-identical to main.
  2. Derived from 1 — RIGHT, under-declared. Because the guard sits before the body is read, a dryRun: true POST, a malformed body, and the in-process InstallLocalDoor grant path (installForGrant, the door cloud-connection-plugin hands an unmanaged grant to) are all refused with the same 409. On the grant path the existing cloud-connection: an unmanaged grant that the install-local door refuses before the import leaves the control plane's grant row with no environment audit row #31481 audit hand-off records the refusal (grantRefusalEvent with the new code and 409) through the audit slot when one is composed: that is an audit row of the refusal, not a package change, and "nothing is written, registered or withdrawn" stays true for the ledger, the registry and the kernel. The changeset names "before the body … is read" but does not spell out the dry run (nit, ④.6).
  3. Accept-set widening — RIGHT in the tree, WRONG in the declaration. ERROR_CODE_LEDGER['@objectstack/cloud-connection'] gains MULTI_REPLICA_PACKAGE_CHANGE_REFUSED, so the closed ErrorCode union and ApiErrorSchema.code now parse one more member (+365 in the regenerated references). A new ledger code is a published-face widening by the repo's own rule (execution-duties: 「错误码已发布面 = ERROR_CODE_LEDGER/StandardErrorCode:新码恒 yes,无门亦然」). See ②.
  4. Public-surface widening — RIGHT in the tree, WRONG in the declaration. @objectstack/service-cluster's root gains four exports: MULTI_REPLICA_CLUSTER_DRIVER, MULTI_REPLICA_PACKAGE_CHANGE_REFUSED, declaresMultiReplicaOnRedis, composedClusterDriver. Card item 4 asks for exactly this (a named shared predicate feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599 can import), and packages/runtime/package.json already depends on @objectstack/service-cluster, so the runtime doors can import it without a new edge. @objectstack/cloud-connection's root is unchanged: CLOUD_BINDING_SHARED_CLUSTER_DRIVER keeps the literal type and value 'redis' through the alias.
  5. sharesCloudBindingCredential — RIGHT, no behaviour change. Before: declaresMultiNode(env) && clusterDriver?.trim() === 'redis'. After: declaresMultiReplicaOnRedis(env, clusterDriver), whose body is declaresMultiNode(env) && clusterDriver?.trim() === MULTI_REPLICA_CLUSTER_DRIVER with the constant 'redis'. Same expression, same two callers (chooseLedger in cloud-connection-plugin.ts with the composed service's driver, readCloudBindingCredentialBeforeBoot with OS_CLUSTER_DRIVER), same answer on every topology.
  6. Provenance — RIGHT. The waiver (package: service-cluster, code: MULTI_REPLICA_PACKAGE_CHANGE_REFUSED, registeredUnder: cloud-connection) holds in the gate's three directions on this head: the cloud-connection key lists the code; the ledger has no @objectstack/service-cluster owner key at all; the constdef stamp site is the constant's initializer in multi-replica.ts. The door's own stamp (code: MULTI_REPLICA_PACKAGE_CHANGE_REFUSED, an identifier) is in the gate's declared blind spot, which is the UNIQUE_SCOPE_CONFIRMATION_REQUIRED precedent's shape exactly. check:error-code-provenance runs in Lint · docs & code guards: success on the head.
  7. Error-status conformance — RIGHT. No scanned docs page publishes a status for this code (nor for its siblings UNIQUE_SCOPE_CONFIRMATION_REQUIRED, ACCESS_UPGRADE_CONFIRMATION_REQUIRED), so there is nothing to reconcile and no baseline row is owed; the ledger comment carries the 409.
  8. Unaffected — RIGHT. Boot rehydrate of the ledger, GET list, reseed-sample-data, purge-sample-data and the sample-data count door are not gated: the first reads, the rest write rows every replica shares. The split-brain guard is untouched (R3 「split-brain guard is never weakened」).

② Semver level

  • Changeset .changeset/31602-install-local-multi-replica-refusal.md: patch for @objectstack/cloud-connection, @objectstack/service-cluster, @objectstack/spec — correct: Metadata-protocol: none (no key a metadata author writes changes), and AGENTS.md step 3 ships a non-protocol narrowing as patch with the BREAKING banner and the ADR-0087 disposition. Both present; the adr-0087: not-required (no-migration-prescription) marker is right (nothing authorable is removed or renamed, nothing to migrate, no tombstone). Check Changeset: success.
  • Metadata-protocol: none — correct on PR body and changeset.
  • Clause-②: no (narrowing) — WRONG value, right arm (should-fix, ④.7). The diff narrows a published accept set (①.1) AND widens two published faces: a new ERROR_CODE_LEDGER member (①.3: 「新码恒 yes」) and four new exports of a published package (①.4: 「扩大公开面」). The grammar has the form for exactly this — clause2-line.mjs: 「yes (narrowing) — a diff that widens one surface and narrows another」 — and merged changesets in the ledger file's own history use it (the /api/v1/meta/:type closed query-set PR under ruling 6580261740, among others). The line should read Clause-②: yes (narrowing) — … naming both halves, on the PR body and the changeset. Consequence today: none on tier (the narrowing arm and the ledger path each already put the review at CONTRACT_REVIEW_TIER, and the arm is what check:adr-0087-registration and reviewFace read), but a wrong no is 「可审计的假申报」 (landing-operations) and the record cannot sign it as right. The seat's claim 6727409308 carries the same no (narrowing); the dev copied it.

③ Boundary flags

  • Author: PR user.login is objectstack-fleet[bot] — no login note owed. Implemented-by is the dev's branch per the claim (mode:thread, dev session session_01ADHkmPnqZD15YnBkNbm1jJ).
  • Dev deviation 1 (a PROVENANCE_WAIVERS entry beyond the claim's "one row"): accepted. The gate requires it for a constant defined one package over (①.6); it is the precedent's shape.
  • Dev deviation 2 (content/docs/references/api/*.mdx regenerated): accepted, generated output of the new enum member; check:generated is inside the green lint jobs.
  • Dev deviation 3 (suites run on 03fed7a5, the head adds only regenerated references): noted, not relied on. The head's own check-runs are the gate verdicts. At the time of this record: every Lint job, Type Check · source gates, Governed Surface Queue Guard, Check Changeset, Check PR Size, Spec property liveness, Dogfood Regression Gate, Build Docs, Build UI Deps are success; Test Core (1–8/8), Test UI (1–16/16), Type Check · workspace, Type Check · consumer gates, Type Check UI, Build Core, Build & E2E UI are still in_progress; nothing is failure. The landing precondition "every check green" is the seat's to read at enqueue time, not this record's.
  • Open question 1 (one code for the feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599 doors too?): A — one code. Card feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599 D1 itself asks for 「one stable error code」 and 「reuse the predicate … whichever lands second imports the first」; the ledger's own convention is one condition, one code (ANALYTICS_DATE_RANGE_UNRECOGNIZED, the FLOW_* family), and the client's branch is the same (do it in a maintenance window). Two consequences for feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599, stated here so they are not lost: (i) @objectstack/runtime then adds its OWN owner-key row for the code (the ledger rule 「a code emitted by several packages is listed once per emitting package」 — the provenance gate will not demand it, because an identifier stamp is in its blind spot, so the row is the dev's duty, not the gate's), not a second waiver; (ii) the service-cluster waiver's reason and the cloud-connection row comment then name both doors. The constant's jsdoc already says each door names its own recipe, which fits feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599's different recipe (「run the change on a single replica or through the CLI, then restart every replica」).
  • Open question 2 (keep R6's "run the install script"?): A — keep the ruling's words; nit, not a fix on this head. The audience of this refusal is the multi-replica deployment, which is the cloud repository's, and R6's recipe is that deployment's. Nothing in this repository is the script: os package install posts to this same door (packages/cli/src/commands/deploy.ts), so naming the CLI would point operators at a command the same refusal answers. When cloud names its script, a follow-up adjusts the one line in refuseMultiReplicaPackageChange. Recorded as an accepted deviation (④.8).
  • Open question 3 (refuse dry runs?): A — refuse, as implemented. R6 refuses the POST; the guard answering before the body is read is what makes "nothing read, nothing written" hold, and the plan a dry run computes is read from the serving replica's own ledger (answerUpgradeDryRun → this.ledger.read), the per-replica state the refusal exists for. Refusing at preview time also tells the Console's operator earlier than refusing at install time. The changeset should say so in one clause (nit, ④.6).
  • Out-of-scope notes (reseed/purge not refused; service-cache keeps its own declaresMultiNode + driver read): agreed, outside the card; no carrier filed by this record.

④ Design judgment

  1. packages/spec/src/api/error-code-ledger.zod.ts (hits) — holds. The row is under the door package (@objectstack/cloud-connection), the ledger's "the door, not the producer, names the wire vocabulary" rule; its comment states the status (409), the moment (after admission, before body/ledger) and the condition, and the tree agrees sentence by sentence (①.1). 409 is coherent with the rows it sits beside (UNIQUE_SCOPE_CONFIRMATION_REQUIRED, ACCESS_UPGRADE_CONFIRMATION_REQUIRED: a valid request refused by the deployment's state, beside RESOURCE_CONFLICT). The waiver matches ProvenanceWaiverSchema and the UNIQUE_SCOPE_CONFIRMATION_REQUIRED precedent one for one; its reason is accurate on this head ("Service-cluster ships no door"). First consumer: refuseMultiReplicaPackageChange's c.json(…, 409). No finding.
  2. packages/services/service-cluster/src/multi-replica.ts — holds. declaresMultiReplicaOnRedis is R3's conjunction and nothing more: "declared" is the split-brain guard's own declaresMultiNode (so the two readings cannot drift), "on Redis" is a trimmed equality with 'redis', the string ClusterServicePlugin registers and the Redis driver reports (service-cluster-redis redis.contract.test.ts pins cluster.driver === 'redis'). composedClusterDriver reads the IClusterService.driver contract field off the cluster slot, swallows the kernel's throw for an empty slot, and answers undefined for a non-string driver — never throws, so it can sit in a request path. Its parameter type { getService(name): T } is structurally satisfied by PluginContext.getService (packages/core/src/types.ts). The jsdoc's "a declaration over the in-process driver still refuses the boot" is true up to OS_ALLOW_MEMORY_CLUSTER_MULTINODE=true, which the predicate correctly treats as not Redis and the unit test pins. Tried to break it: a custom remote driver (nats, postgres) under declared replicas is NOT refused and can still diverge — that is R3's own bound (「接上 Redis 驱动」), recorded as the ruling's accepted consequence, not a finding. No finding.
  3. packages/services/service-cluster/src/index.ts — holds. Four named exports, [cloud#3814 R2/R3] comment; no type-only name is shipped as a value. No finding.
  4. packages/cloud-connection/src/marketplace-install-local-plugin.ts — holds. Guard placement agrees with the ledger comment and the changeset (①.1); the envelope is the sibling refusals' ({ success: false, error: { code, message } }, no data), which the new test holds against BaseResponseSchema, envelopeViolations and ApiErrorSchema; the driver is read per request where it is used, matching the module's own rule and chooseLedger's init-time read in the sibling plugin. The DELETE guard runs before the manifestId 400 and the 404, so an empty id or an unknown package under the condition answers 409 instead — within the declared "right after admission", and harmless (nothing to withdraw either way). The message names door, condition, consequence and recipe and ends with "Nothing was installed, uninstalled or written", true on both doors. No finding.
  5. packages/cloud-connection/src/connection-credential-ledger.ts — holds. Pure delegation (①.5); the exported constant keeps value and literal type; both callers unchanged; connection-credential-preboot.test.ts's topology table still describes the behaviour. No finding.
  6. Nit (prose face) — the changeset's "Now." bullet. Add one clause that a dryRun: true POST is refused as well (①.2, ③ Q3). No effect on correctness or the contract; fix on the prose face or leave as an accepted deviation.
  7. Should-fix (prose faces: PR body + changeset) — the Clause-② value. no (narrowing) → yes (narrowing) — … naming the narrowing (the two doors' 409) and the widening (the new ERROR_CODE_LEDGER member; the four @objectstack/service-cluster exports). Rationale in ②. No code moves; the arm, the BREAKING banner, the ADR-0087 marker and the patch level all stay. The seat's claim comment should be corrected additively alongside.
  8. Nit (accepted deviation) — "run the install script". R6's words, kept on purpose (③ Q2); follow-up when cloud names the script.

Tests, read as evidence only (lane seat's ACCEPT at TIER_DEFAULT): the new describe in marketplace-install-local-register-refusal.test.ts pins both declarations × both doors on a real engine with the cloud leg never fetched and the ledger/registry unmoved, plus the four CONTROL topologies R3 protects; multi-replica.test.ts pins the predicate's truth table and composedClusterDriver's never-throw. They match the contract the implementing files state.

Findings: 0 must-fix · 1 should-fix (④.7, prose faces only) · 2 nits (④.6, ④.8). The should-fix earns a delta review of its fix by this reviewer; a prose-only fix keeps this record under the Regen-provenance: exception.

Implemented-by: claude/project-thread-cn42eu
Reviewed-by: session_01ADHkmP8JJo4zF2sjTBRwnX

VERDICT: PASS

Stamped 2026-11-08T23:14Z.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 485e8f996ebce01c7fe008677117a7cdfa7ca355
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts + packages/cloud-connection/src/marketplace-install-local-plugin.ts, packages/services/service-cluster/src/multi-replica.ts, packages/services/service-cluster/src/index.ts, packages/cloud-connection/src/connection-credential-ledger.ts — unchanged bytes since 6f4c42d9; this is the DELTA review of record 6728523407's should-fix (④.7) and nit (④.6), by the same reviewer. Everything not restated here stands as 6728523407 wrote it.

Regen-provenance: 6728523407 · 6f4c42d9bba8c2660eecdd7f4024485eac8a1448 → 485e8f996ebce01c7fe008677117a7cdfa7ca355 · git diff --name-only 6f4c42d9 485e8f99 → .changeset/31602-install-local-multi-replica-refusal.md

① Derived judgments

  • Head move — prose face only, RIGHT. git diff --stat 6f4c42d9 485e8f99: one file, .changeset/31602-install-local-multi-replica-refusal.md, 2 insertions / 2 deletions; one commit, 485e8f99 chore(changeset): declare both halves of the Clause-2 line; note the refused dry run. No path under packages/**, content/** or any other face moved, so every derived judgment of 6728523407 ①.1–①.8 carries over byte-for-byte: the narrowing, the ledger row and waiver, the four service-cluster exports, the unchanged sharesCloudBindingCredential, provenance and status conformance. Nothing new is derived by a changeset's prose.
  • PR body — patched in place, RIGHT. The Clause-②: line now reads yes (narrowing) — narrowed, … Widened: … and names both halves; the Metadata-protocol: none line is unchanged; the Verification section states the head move and what it carries.

② Semver level

  • patch × 3, Metadata-protocol: none, the BREAKING banner and the adr-0087: not-required (no-migration-prescription) marker: unchanged, still right (6728523407 ②).
  • Clause-②: yes (narrowing) — narrowed: … Widened: … — RIGHT on both carriers (the should-fix is fixed). Value yes: the diff widens two published faces, and the line names exactly them — ERROR_CODE_LEDGER (@objectstack/spec) registering MULTI_REPLICA_PACKAGE_CHANGE_REFUSED under @objectstack/cloud-connection, and the @objectstack/service-cluster root exporting declaresMultiReplicaOnRedis, composedClusterDriver, MULTI_REPLICA_CLUSTER_DRIVER, MULTI_REPLICA_PACKAGE_CHANGE_REFUSED; "nothing is removed or renamed" is true in the tree. Arm (narrowing): the narrowed half is the same two-door 409 sentence as before, so reviewFace still reads the narrowing face and check:adr-0087-registration still reads the arm beside the marker. The form is clause2-line.mjs's own 「yes (narrowing) — a diff that widens one surface and narrows another」. Changeset body and PR body agree with each other and with the tree. The seat's claim 6727409308 was amended additively (6728528676, Clause-② value only) — the audit trail is consistent across claim, PR body and changeset.
  • Changeset gates on this head: Check Changeset has one success run recorded and a second still in_progress at record time (two triggers); the dev's local re-run is read as a claim, not evidence.

③ Boundary flags

  • Nit ④.6 (dry run) — fixed, RIGHT. The "Now." bullet gains: 「A POST with dryRun: true is refused too: the refusal comes before the body is read, and the preview reads the serving replica's own ledger.」 Both clauses agree with the tree: refuseMultiReplicaPackageChange runs before readJsonRequestBody in handleInstall, and answerUpgradeDryRun reads this.ledger.read(manifestId), the serving replica's own ledger. Closed.
  • Nit ④.8 ("run the install script") — left as the accepted deviation, as the record allowed; no change expected on this head.
  • New nit (prose face, PR body only; not a fix on this head): the widened half cites 「([Decision] Keep domain:devx and domain:server as separate lanes, or merge them? Measured load and boundary friction, 2026-11-08 #31424 rule 2)」 for the ledger registration; [Decision] Keep domain:devx and domain:server as separate lanes, or merge them? Measured load and boundary friction, 2026-11-08 #31424 is the devx/server lane decision, not the ledger rule. The rule is the ledger file's own header ("Registering a new code") and execution-duties 「新码恒 yes」. No effect on correctness or the contract; correct the citation whenever the PR body is next edited, or leave it.
  • Record carry-over. A head move that touches only a prose face keeps the original record under contract-review.md's exception (「只动散文面原记录续管,落 Regen-provenance: 行」); the Regen-provenance: line above names record 6728523407 and the two trees, and the reader re-runs the command itself.
  • Check-runs on 485e8f99 at record time: success — Governed Surface Queue Guard, PR-body guards, Check Changeset (both runs), Check PR Size, Check Documentation Links, Flag docs affected, Spec property liveness, every Lint job (ESLint; PM dispatch-gates; docs & code guards, which carries check:error-code-provenance; CI, release & engine gates; repo & tooling gates; the three scoped lints), Type Check · source gates, Type Check · debt ledger, Dogfood Regression Gate, Plan Test Core shards, Build Docs, Build UI Deps, Auto Label; in_progress — Test Core 1–8/8, Test UI 1–16/16, Type Check · workspace, Type Check · consumer gates, Type Check UI, Build Core, Build & E2E UI, Live E2E UI; no failure. On 6f4c42d9 the Lint & Type Check and CI workflow runs were CANCELLED at 23:17Z by the push of 485e8f99 (every red there is a cancelled shard or the aggregate Test UI / TypeScript Type Check job that completed in 4 seconds on top of cancelled shards — no step ran, no signature); that is not a red of the code and nothing to triage. "Every check green" on 485e8f99 is the seat's read at enqueue time.
  • Author remains objectstack-fleet[bot]; no login note owed.

④ Design judgment

No hits file and no implementing file moved between 6f4c42d9 and 485e8f99; the ④ of 6728523407 (items 1–5, each "holds", no finding) covers this head's identical bytes. Findings on this head: 0 must-fix · 0 should-fix · 2 nits (④.8 accepted deviation; the #31424 citation in the PR body). Nits alone end the round.

Implemented-by: claude/project-thread-cn42eu
Reviewed-by: session_01ADHkmP8JJo4zF2sjTBRwnX

VERDICT: PASS

Stamped 2026-11-08T23:25Z.

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

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

ACCEPT · PR #31712 · #31602 · 2026-11-09T00:07Z

Head-sha: 3a897d94bb3c952bfed2159a71348c54bdfd5eba

  • Contract review: PASS at CONTRACT_REVIEW_TIER. Record 6728523407 is on 6f4c42d9. Delta 6728638967 is on 485e8f99, from the same reviewer, and closes its one should-fix (the Clause-② value, now yes (narrowing)). Neither has a must-fix or an open should-fix.
  • Head move 485e8f99 → 3a897d94: this is a merge of origin/main only, with no rebase and no force. The seat re-derived it. The PR's net diff against its merge base, with index/@@ lines dropped, is byte-identical on both heads: sha256 91f84e7b…4016 from git diff 3806a5ab 485e8f99 and from git diff 35a9c694 3a897d94. That is 11 files, +329/-10. No reviewed face moved, so the record carries over unchanged.
  • Claim and surface: claim 6727409308, amended 6728528676 (Clause-② value only), covers every file in the diff. The PR body names both halves of the Clause-② line, and its ledger citation was corrected to the ledger header's "Registering a new code" rule. That fixes the delta's prose nit.
  • Gates on this head:
    • Check-runs: success 57, skipped 10, no failure, none in progress.
    • check-governed-merges --pr 31712: not governed (0 of 11 paths), +329/-10.
    • K = 1 (< 15), and mergeable_state is clean.
    • The dev re-ran these on 3a897d94: service-cluster (120), cloud-connection (1122) and spec (26081, 1 todo) test and typecheck. These spec checks all exit 0: check:error-code-provenance, check:error-code-casing, check:dispatcher-error-vocabulary, check:generated, check:docs and check:api-surface.
  • Landing: pr_ready and automerge_enable happen in this stroke. The card closes on merge (Fixes #31602). feat(runtime)!: refuse runtime package operations when multi-replica is declared (#3814 F3c, D1) #31599 then restarts from main on the same thread.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 9, 2026 00:07
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 9, 2026 00:07
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 8aaa69f Nov 9, 2026
68 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-cn42eu branch November 9, 2026 00:58
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.

feat(cloud-connection)!: refuse marketplace install-local when multi-replica is declared (#3814 R6)

1 participant