Skip to content

feat(runtime): /ready reports cluster driver health when multi-replica is declared - #31711

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

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-niooue

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #31601

/ready reports the cluster driver's health on a deployment that declares multi-replica and runs the redis cluster driver: Redis unreachable answers 200 with status: 'degraded' and a cluster entry naming the driver unreachable (PM decision D4: never 503). Child of cloud epic #3814; Claim 6727414288 (domain:server#4, card-thread session_01ADHkmQwuHPnJPK768Mta39).

Clause-②: yes (widening) — measured on base 1a20cbc8 (the merge base; its http-dispatcher.ts restored under this PR's pins) and head ce30cfbf: on a declared multi-node redis deployment with Redis down, base answers 200 {"status":"ready","state":"running"} (expected { status: 'ready', state: 'running' } to deeply equal { status: 'degraded', …(2) }, the 200 assertion above it passing), head answers 200 {"status":"degraded","state":"running","cluster":{"driver":"redis","reachable":false,"reason":"ping-failed"}} (also with a live redis-server stopped, below). Every request keeps the status code base answered; the 200 body gains a cluster key and the degraded value of status only behind the declaration plus the redis driver. Nothing base accepted is refused.
Metadata-protocol: none

维护者速读

  • 改了什么:声明多副本(OS_EXPECT_MULTI_NODE=true 或 OS_CLUSTER_REPLICAS>1)且集群驱动是 redis 时,/ready 的 200 响应多一个 cluster 条目;Redis 不可达时 status 变为 degraded,仍是 200。
  • 为什么改:之前 Redis 停了,各副本的 /ready 一直是普通的 200,运维看不到集群已失去协调(锁、计数器、跨副本事件全失效)。不用 503 是 D4 的决定:所有副本同时失去 Redis,503 会把整个集群摘出负载均衡。
  • 风险与回滚:单节点、memory 驱动、没有 cluster 服务时 body 与状态码逐字节不变,也不会去 ping Redis;启动中/停机(SIGTERM)的 503 和主数据源 503 在探测前返回,不变。探测是一次 500ms 上限的 PING,缓存 1 秒。回滚即 revert 本 PR。
  • 先看:packages/runtime/src/http-dispatcher.ts(clusterReadiness() 与两个 200 分支)、packages/services/service-cluster/src/driver-health.ts、packages/runtime/src/http-dispatcher.ready.test.ts 新增的 describe。
  • 两分钟验证:pnpm --filter @objectstack/runtime exec vitest run src/http-dispatcher.ready.test.ts —— 预期 41 passed。
  • 需要你做的:无,席位落地。

What changes

  • packages/services/service-cluster/src/driver-health.ts (new) — probeClusterDriverHealth(cluster, driver, { timeoutMs }): reads the connection the driver offers (readClusterDriverConnection, the seam the shared cache already reads), sends one PING bounded by DEFAULT_CLUSTER_PROBE_TIMEOUT_MS (500 ms), and answers { driver, reachable: true } on PONG, or { driver, reachable: false, reason } with reason from a closed set: timeout, ping-failed, unexpected-reply, no-probe. Answers undefined when the cluster offers no connection for that driver (memory driver, no cluster). Never throws. The client's error text (it names the store's host and port) is never carried, because /ready answers anonymous callers. Exported from the package index with its types.
  • packages/runtime/src/http-dispatcher.ts — clusterReadiness(): applies only when declaresMultiNode(process.env) holds (the split-brain guard's predicate) AND the host kernel's cluster service offers a redis connection; memoized on the same 1 s TTL as the data-driver probe. It is consulted on the two 200 branches only, through withClusterReading(), which returns the body object as given when there is no reading. The booting/stopping 503 and the primary-datasource 503 return before it.
  • packages/runtime/src/http-dispatcher.ready.test.ts — new top-level describe in the existing /ready harness (no existing assertion edited): the card's four acceptance cases plus secondary-degraded beside Redis down, the primary 503 never probing Redis, the memo, and R3's "one half missing" cases (no declaration, OS_CLUSTER_REPLICAS=1, memory driver, no cluster service, a throwing lookup).
  • packages/services/service-cluster/src/driver-health.test.ts (new) — the probe's eight readings, including a late rejection after the timeout not leaking as unhandled.
  • .changeset/31601-ready-cluster-driver-health.md — @objectstack/runtime and @objectstack/service-cluster patch, both declaration lines, who sees it.

No test was forced to change.

Tests

On head 04ca432f (the merge of origin/main); the last commit ce30cfbf adds one collection-time import to the /ready test file (for check:test-source-alias), and that file was re-run on ce30cfbf: 41 passed.

Command Result
pnpm --filter @objectstack/runtime test 563 files, 9047 passed, 19 skipped
pnpm --filter @objectstack/runtime typecheck exit 0 (after building @objectstack/driver-turso, a devDependency outside the runtime closure: check:test-typecheck first read TS2307 on organization-ownership-boot-guard.turso-remote.kernel.test.ts, a missing dist, not this diff)
pnpm --filter @objectstack/service-cluster test / typecheck 9 files, 123 passed / exit 0
pnpm --filter @objectstack/service-cluster-redis test 3 files, 39 passed
pnpm exec eslint --no-inline-config packages/runtime / packages/services/service-cluster exit 0 / exit 0 (neither package has a lint script)
pnpm --filter @objectstack/dogfood test (lock) 04ca432f · VERDICT command-exit 0 · Test Files 440 passed, 3 skipped (443) · Tests 3652 passed, 41 skipped (3693). Not re-run on ce30cfbf: that commit touches only a runtime test file, which dogfood does not load.
Real Redis smoke: a live redis-server and the real ioredis driver behind /ready

A one-off script (not committed): defineCluster({ driver: 'redis', url }) from the built @objectstack/service-cluster-redis, the built HttpDispatcher, a fresh dispatcher per probe, a redis-server this run started and stopped.

OS_CLUSTER_REPLICAS=3
redis UP     : 200 {"status":"ready","state":"running","cluster":{"driver":"redis","reachable":true}} (21 ms)
redis-server stopped
redis DOWN #1: 200 {"status":"degraded","state":"running","cluster":{"driver":"redis","reachable":false,"reason":"ping-failed"}} (188 ms)
redis DOWN #2: 200 {"status":"degraded","state":"running","cluster":{"driver":"redis","reachable":false,"reason":"timeout"}} (501 ms)
redis BACK   : 200 {"status":"ready","state":"running","cluster":{"driver":"redis","reachable":true}} (2 ms)

no declaration (single node), same sequence
redis UP     : 200 {"status":"ready","state":"running"} (14 ms)
redis DOWN #1: 200 {"status":"ready","state":"running"} (1 ms)
redis DOWN #2: 200 {"status":"ready","state":"running"} (1 ms)
redis BACK   : 200 {"status":"ready","state":"running"} (1 ms)

The first probe after the stop reads ping-failed (ioredis gives up after maxRetriesPerRequest: 3); later ones read timeout (the client queues while reconnecting) and are bounded at 500 ms. Recovery needs no restart.

Ablations (each through scripts/ablation-replace.mjs; restore proven by blob == HEAD and an empty git diff HEAD)

The runtime test imports ./http-dispatcher.js from source and the service-cluster test imports ./driver-health.js from source, so no leg needed a rebuild or a dist preflight.

Leg Mutation Result
A1 R3 declaration half if (declaresMultiNode(…)) → if (true) red: 3 single-node pins (no declaration … no ping, OS_CLUSTER_REPLICAS=1, #13408 body, no cluster key)
A2 D4 not 503 unreachable store answers 503 Cluster unavailable red: Redis down: 200 — not 503 …
A3 SIGTERM / booting 503 probe the cluster before the kernel-state 503 and fold it into details red: all four kernel idle/initializing/stopping/stopped pins
A4 primary 503 probe the cluster on the primary-datasource drain branch red: … byte-identical 503, and never probes Redis (expected "vi.fn()" to not be called at all, but actually been called 1 times). The first attempt was refused by the tool (the replacement contained the anchor, anchor count 1 → 1) and ran no test; re-run with a different anchor.
A5 no-probe never healthy no-probe → reachable: true red: reads an offered client with no ping() as no-probe — never as healthy
A6 address never leaks nested: keep the client error, serve its message as reason red: both ping-failed pins (the closed-reason toEqual reds before the not.toContain('10.0.0.7') line is reached)

After the run: git diff HEAD empty, git status --porcelain clean apart from the then-uncommitted changeset.

Gates

Final round on head ce30cfbf: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 71 commands (change set: 6 paths vs merge base 1a20cbc84); every one ran once and exited 0. dispatch-gates --ran: 71 derived famil(ies) accounted for — 71 run, 0 NOT-MEASURED (exit 0).

An earlier round on 04ca432f read three non-zero exits, all cleared: check-plugin-teardown-shape --self-test exit 3 (its pinned fixture commit was absent from the shallow clone; fetched, then exit 0), check:dual-build-cjs-loads exit 3 (Run pnpm build first: dists outside the runtime closure; exit 0 after turbo run build --filter='./packages/**'), and check:test-source-alias exit 1 (the edited /ready test reaches a lazy @objectstack/metadata import; fixed in ce30cfbf with the collection-time import the gate prescribes).

The 71 commands and their exits on ce30cfb
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/check-tenant-audit-census.mjs :: exit 0
node scripts/check-tenant-audit-census.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:init-service-contract :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:package-naming :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:startup-registry-verdict :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm check:wildcard-fallthrough :: exit 0

Acceptance notes

  • F3a's seam. fix(cluster)!: a Redis outage must not crash replicas; resync caches on reconnect (#3814 F3a) #31596 (Redis disconnect without crashing, reconnect and resync; seat 1) was not merged and had no PR at the time of this card, so the probe pings the driver's offered connection itself, as the dispatch said. probeClusterDriverHealth lives in @objectstack/service-cluster beside readClusterDriverConnection so F3a can feed or replace it in one place; /ready only reads the ClusterDriverHealth shape.
  • Observed, not changed (F3a's ground): with Redis stopped, ioredis logs [ioredis] Unhandled error event: Error: connect ECONNREFUSED … on every reconnect attempt because the driver's client has no error listener. That is fix(cluster)!: a Redis outage must not crash replicas; resync caches on reconnect (#3814 F3a) #31596's subject; this diff adds no listener.
  • status: 'degraded' vs the availability: a datasource whose driver fails to start pins /api/v1/ready to 503 cluster-wide and is not evicted on delete — one bad tenant datasource drains every LB upstream #13408 secondary branch. A degraded SECONDARY datasource still answers status: 'ready' with a degraded object (unchanged, single node included). The cluster reading uses status: 'degraded' as the card and D4 specify. When both hold on a declared deployment, status is degraded and both entries are present. Unifying the two was out of scope (it would change a single-node body).
  • Docs not in the file surface. content/docs/protocol/kernel/lifecycle.mdx (the GET /ready block) and content/docs/deployment/self-hosting.mdx (the probe table) do not yet mention the cluster entry; the claim's file surface excludes content/docs/**, so this is left to the seat.
  • No published schema. /ready's body has no schema in packages/spec (searched before the first edit), so nothing in the spec moves.
  • The README "multi-node unsupported" line and the split-brain guard are untouched (R3).

Generated by Claude Code

… on a declared multi-node deployment

A declared multi-node deployment (OS_EXPECT_MULTI_NODE / OS_CLUSTER_REPLICAS>1)
on the redis cluster driver now carries a cluster entry on /ready's 200 body;
an unreachable store answers 200 status degraded, never 503. Single-node
bodies, the booting/stopping 503 and the primary-datasource 503 are unchanged.

Claude-Session: https://claude.ai/code/session_01ADHkmQwuHPnJPK768Mta39
Co-authored-by: Claude <noreply@anthropic.com>
…de redis deployment

Claude-Session: https://claude.ai/code/session_01ADHkmQwuHPnJPK768Mta39
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 2 package(s): @objectstack/runtime, @objectstack/service-cluster, touching 14 documentable anchor(s).

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

  • content/docs/api/client-sdk.mdx (via automation.trigger (sdk, the route ledger binds it to POST /automation/trigger/:name, selected by route anchor /trigger/:name))
  • content/docs/api/environment-routing.mdx (via HttpDispatcher (symbol, a top-level class))
  • content/docs/api/plugin-endpoints.mdx (via /trigger/:name (route, bridged from symbol timeoutMs — its route source's handler names it))
  • content/docs/automation/flows.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/automation/hook-bodies.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/automation/jobs.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/automation/webhooks.mdx (via HttpDispatcher (symbol, a top-level class), timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/data-modeling/virtual-objects.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/deployment/environment-variables.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/kernel/cluster.mdx (via HttpDispatcher (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via HttpDispatcher (symbol, a top-level class))
  • content/docs/protocol/kernel/lifecycle.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))

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

  • content/docs/releases/v16.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/releases/v17/17-0.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/releases/v17/17-3.mdx (via automation.trigger (sdk, the route ledger binds it to POST /automation/trigger/:name, selected by route anchor /trigger/:name), /trigger/:name (route, bridged from symbol timeoutMs — its route source's handler names it))
  • content/docs/releases/v17/17-4.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/releases/v17/17-5.mdx (via HttpDispatcher (symbol, a top-level class), timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/releases/v17/17-7.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))
  • content/docs/releases/v18/18-0.mdx (via timeoutMs (symbol, a field of interface ProbeClusterDriverHealthOptions))

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
  • 3 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 — 31 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 b126c13065db29c80996efc7e0527a40f651c923 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json b126c13065db29c80996efc7e0527a40f651c923

⚠️ 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 b126c13065db29c80996efc7e0527a40f651c923 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions github-actions Bot added size/l and removed size/m labels Nov 8, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

Contract review

Served-tier: TIER_DEFAULT
Head-sha: eddeda2669372f860f711f81681ac43cc5e62bbc
Local-runs: none

The face is the Clause-②: yes (widening) declaration alone. No published schema and no governed path are in the tree, and no narrowing is declared. Inputs: card #31601 (body, comments, claim 6727414288, amendment 6728245404, os-dev-report 6728231834), the PR's file list and net diff against main, and the check-runs on this head.

① Derived judgments

  • GET /ready 200 body, declared multi-node on the redis driver: the body gains cluster: { driver, reachable, reason? }. With the store reachable status stays 'ready'; unreachable gives status: 'degraded' and still 200 (PM decision D4). This is a widening of the response on that topology only. Right.
  • Gate: clusterReadiness reads only when declaresMultiNode(process.env) (the predicate the split-brain guard and the shared cache already read) AND probeClusterDriverHealth(cluster, 'redis') finds a redis connection. Otherwise it answers undefined, and withClusterReading returns the same body object. Both halves of approvals: 审批请求行不暴露节点的 lockRecord,客户端只能假定「有 pending 就是锁死」 #3814 R3 hold. Right.
  • Single node, memory driver, no cluster service: byte-identical body and status; the store is never probed. Right, pinned.
  • 503 paths: the booting/stopping 503 and the primary-datasource 503 return before clusterReadiness is consulted. Unchanged. Right.
  • availability: a datasource whose driver fails to start pins /api/v1/ready to 503 cluster-wide and is not evicted on delete — one bad tenant datasource drains every LB upstream #13408 secondary-datasource branch: keeps its degraded: { drivers, primaryDatasource } object and gains the cluster entry. status turns 'degraded' only when the store is unreachable. Right (seat ruling in 6728245404).
  • Disclosure: reason is a closed set (timeout, ping-failed, unexpected-reply, no-probe). The client's error text, which names host and port, never reaches the anonymous body. Right.
  • Cost: one PING raced against a 500 ms unref'd timer; a late rejection is observed, not unhandled. Memoized 1 s, including the "not applicable" answer. Right.
  • New public names in @objectstack/service-cluster: probeClusterDriverHealth, DEFAULT_CLUSTER_PROBE_TIMEOUT_MS and three types. Additive. Names are the seat's call and are kept (6728245404). Right.

② Semver level

The changeset puts @objectstack/runtime and @objectstack/service-cluster at patch, with Clause-②: yes (widening) and Metadata-protocol: none. The change is an additive response field on one topology plus an additive export. Patch matches the repo's practice for additive server surface. @objectstack/runtime already depends on @objectstack/service-cluster (workspace:*), so no manifest change is needed. Right.

③ Boundary flags

  • Open question 1 (export names and the cluster key): kept.
  • Open question 2 ('ready' for the healthy declared case): kept.
  • Open question 3 (the availability: a datasource whose driver fails to start pins /api/v1/ready to 503 cluster-wide and is not evicted on delete — one bad tenant datasource drains every LB upstream #13408 branch status): kept as built.
  • Docs: the amendment added content/docs/protocol/kernel/lifecycle.mdx and content/docs/deployment/self-hosting.mdx. Read sentence by sentence against the code, both agree:
    • the two 200 shapes;
    • 200 not 503, with D4's reason;
    • the closed reason set;
    • no address in the body;
    • 500 ms PING cached about 1 s;
    • consulted only on the 200 paths;
    • single node / memory / no cluster unchanged and never probed;
    • OS_CLUSTER_DRIVER alone is not a declaration, which matches declaresMultiNode.
  • Dev deviations: driver-turso built for the runtime typecheck; a mistaken OS_SKIP_DTS build was stopped and rebuilt with DTS before the final gates; ablation A4 was re-run after a tool refusal; dogfood ran on 04ca432f, and the later commits only touch a test file and docs. None changes the judgment. CI on this head is the gate verdict.

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

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-steve · session_01ADHkmP8JJo4zF2sjTBRwnX

ACCEPT · PR #31711 · #31601 · 2026-11-08T23:20Z

Head-sha: eddeda2669372f860f711f81681ac43cc5e62bbc

  • Contract review: PASS at TIER_DEFAULT on this head, 6728568993. The face is the Clause-②: yes (widening) declaration alone: no published schema, no governed path, no narrowing. The seat's own record, adopted.
  • Rulings (claim amendment 6728245404):
  • Surface: claim 6727414288 as amended by 6728245404 covers every file in the diff.
  • Prose faces (TIER_DEFAULT): the changeset and the two docs pages (lifecycle.mdx, self-hosting.mdx) were checked sentence by sentence in 6728568993 ③.
  • Gates on this head: check-runs success 38, skipped 14, no failure, none in progress. check-governed-merges --pr 31711: not governed, +525/-4 (Tier S). K = 12 (< 15), mergeable_state clean. Dev: 102/102 derived gate families exit 0 on this head; dogfood 3652 green on 04ca432f (later commits are a test file and docs).
  • Landing: pr_ready + automerge_enable in this stroke. Card closes on merge (Fixes #31601).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 23:20
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 23:21
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 00205e1 Nov 9, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-niooue branch November 9, 2026 00:37
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/l 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(runtime): /ready reports cluster driver health when multi-replica is declared (#3814)

1 participant