feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805) - #14347

Merged
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence
Sep 2, 2026
Merged

feat(service-datasource,service-cluster): fan datasource record writes out to peer replicas so a deleted datasource stops draining every replica (#13805)#14347
os-sales merged 2 commits into
mainfrom
claude/issue-13805-driver-registry-cluster-convergence

Conversation

@claude

@claudeclaudeBot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes#13805

What this does

The ObjectQL driver registry had no cluster propagation in either direction: each replica filled it at boot from the shared datasource records and mutated it only for the writes it served. After DELETE /api/v1/datasources/:name only the replica that served the DELETE evicted the stuck driver (#13578's door, unchanged here); the other N-1 kept it — and /api/v1/ready kept answering 503 there — until restart. A create through one replica likewise had no pool anywhere else until restart.

Ruled shape (maintainer, 2026-09-01, director batch A — quoted verbatim in the card): the driver registry reuses the cluster-invalidation family #13331-A established; datasource writes (create and delete, symmetric) emit the signal through the same bridge shape; each replica converges by re-reading the shared datasource records; no second propagation mechanism. This PR builds exactly that and nothing beside it:

  • Symmetric publisher at the three write doors (packages/services/service-datasource/src/datasource-admin-service.ts): after createDatasource, updateDatasource and removeDatasource, DatasourceAdminService publishes the record's ADDRESS — { originNode, name } — on a new cluster channel datasource.mutated (DATASOURCE_MUTATION_CLUSTER_CHANNEL, payload ClusterDatasourceMutationPayload). Fire-and-forget; a publish failure never fails the write. migrateCredential does not publish (it leaves the live pool alone by design, on every replica alike). A delete-only broadcast was deliberately not built — the triage constraint on symmetry.
  • Peers converge from their OWN read of the SHARED record (datasource-admin-plugin.ts, new convergePool seam on DatasourceAdminServiceConfig): on receipt a replica re-reads the durable sys_metadata row for that name — the store its boot rehydration reads, NOT its per-replica metadata registry (which on the host-config boot has no cluster seam and is exactly the stale read a peer must not converge from) — and drives its pool through the seams it already owns: build what is missing, rebuild in place what changed (reregisterPool, keeping the old pool on failure exactly as the serving replica's update path does, datasource update never rebuilds its driver — already-registered short-circuits the reconfigure path, so the OLD pool stays live and the admin UI reports success #13804), evict what is gone (unregisterPool, the datasource DELETE does not evict the stuck driver from the data-engine driver registry — /ready keeps naming a datasource that no longer exists, recoverable only by process restart #13578 door), leave a matching pool untouched. The record each live pool was built from is remembered by the pool seams themselves (livePoolRecords), which is what makes a duplicate delivery a measured no-op and a stray name harmless: only pools this plugin built are ever touched, so a code-defined pool survives a stray signal. This answers the triage's third question — a replayed create is safe because receipt is convergence, not replay; no new idempotency machinery.
  • Attach seam mirrored from the shipped bridges: DatasourceAdminService.attachDatasourceMutationPubSub(pubsub, nodeId) — idempotent on the (pubsub, nodeId) pair, originNode loopback suppression, per-name ordered convergence, shaped after ObjectStackProtocolImplementation.attachMetadataMutationPubSub(). Only IPubSub from @objectstack/spec/contracts crosses it: @objectstack/service-datasource takes no dependency on the cluster service, and @objectstack/objectql is handed no bus (the layering line triage drew — measured: service-cluster depends on core + spec only; service-datasource on core/spec/types/drivers; neither on the other).
  • Third lane in MetadataClusterBridgePlugin (packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts): late-binds the seam at kernel:ready beside the metadata-service and protocol lanes, duck-typed on the datasource-admin service, guarded off the in-process memory driver from birth. A lane rather than a fourth plugin because that is how runtime: TS-config boot registers a 'metadata' service without attachClusterPubSub — cross-node invalidation disabled; new object gives OBJECT_NOT_FOUND on non-writing replicas, never heals #13331-A itself adopted the family (lane 2 was added to this plugin), it needs no Runtime wiring change, and it adds no exported symbol to service-cluster.

Not touched, per the card's constraints: the /api/v1/meta/datasource metadata registry (#13609 / #13405 — different sink; the peer's metadata registry is deliberately NOT written by convergence, pinned) and #13578's eviction primitive itself. Log levels follow the exemplars' sites one-for-one (debug for skips, info for the bridged/attached lines, warn for publish/converge failures, the exemplar's error for attach/detach exceptions); no new error sink.

Verification

Base: 909a4417 (origin/main at claim). Final head: 6be669f6. Dependency closure built in the worktree first (pnpm --filter '@objectstack/service-datasource^...' build, VERDICT command-exit 0), then both packages built.

  • pnpm --filter @objectstack/service-datasource typecheck at 6be669f6: exit 0, 0 error TS; tsc --listFiles counts the new test file once (its tsconfig includes tests).
  • pnpm --filter @objectstack/service-cluster exec tsc --noEmit: the package's single pre-existing error (src/memory/memory.contract.test.ts:26, untouched by this branch, on origin/main since skills(pm): give sweep disjunct ① the drain clauses the finding box already has #14152) and nothing else — its DEBT ledger count holds.
  • Tests at 6be669f6, both full suites under the shared verify lock (os-verify-lock.sh VERDICT command-exit 0): @objectstack/service-cluster 7 files / 105 tests passed; @objectstack/service-datasource 30 files / 635 tests passed.
    • New src/__tests__/datasource-cluster-convergence.test.ts (21 cases): two REAL DatasourceAdminServicePlugin boots over one shared sys_metadata store, own driver registries, joined by a remote-shaped bus. Arm B: DELETE on the writer evicts on the peer; create builds on the peer from the peer's own read; connectivity change rebuilds in place; active:false / active:true. Arm A controls (no attach): the identical DELETE leaves the peer's driver in place, the identical create leaves it pool-less. Payload address-only for all three doors (symmetric); duplicate delivery no-op by instance identity; label-only edit no churn; ordered convergence for a create chased by an update; stray signal touches nothing (code-defined pool survives); peer rebuild failure keeps the old pool; unreadable row is not spent as "gone"; publish failure never fails the write; detach; late-booting replica converges via rehydration; loopback; malformed payload; idempotent attach; no-convergePool host; migrateCredential does not publish.
    • metadata-cluster-bridge-plugin.test.ts gains 8 lane-3 cases: attaches on a cross-process driver and logs the "bridged datasource.mutated" line verbatim, independently of lanes 1 and 2; memory driver skips (in-process guard, nothing above debug); absent / bare service skip; no cluster service skips; throwing attach reported without taking the other lanes down; shutdown detaches lane 3 even when lane 2's detach throws.
  • Reverse verification (ablation, committed tree, direction declared in the test header): removed the publishDatasourceMutation call from removeDatasource via perl -0pi and PROVED it on disk (grep -c of the call: 2 → 1; marker: 0 → 1), ran the convergence file under the lock: exactly the two declared cases red — "Arm B — DELETE on the writer evicts the driver on the PEER" and the symmetric-payload case — 19 green (VERDICT command-exit 1). Restored with git checkout HEAD -- ABSOLUTE_PATH under a trap … EXIT INT TERM; restore proved by git hash-object equal to the HEAD: blob and git diff HEAD empty. No dist involved: the test imports the package's own src directly.
  • Gates derived from the real change set (node scripts/pm/dispatch-gates.mjs --commands, 42 commands, 35 families), every one run unlocked with the exit captured before any pipe. Green (exit 0): adr-0087-registration, changeset-no-major, ci-filter-parity, comment-mask-adoption, cross-package-test-inputs (both spellings), empty-changeset, keyed-text-bounds, plugin-teardown-shape, shard-attestation, tenant-audit-census, undeclared-dep-imports, docs-audit affected-docs + drift-comment, release-rehearsal-clone self-test, agent-test-spelling, bash32-floor, changeset-gate-self-tests, cli-command-ids, dispatcher-error-vocabulary, doc-authoring, engine-double-contract (the new test's findOne/update/delete doubles route through the metadata-core asserts and were recorded via the gate's own --write, +3 rows, 0 lost), entry-guard, logger-receiver-detach, objectql-double-limit, objectui-changeset, page-declaration-shape, parse-guard, pm-half-states, pnpm-filter-targets, published-files, query-options-erasure, slot-lookup, test-source-alias, type-check-coverage, type-source-resolution, watch-hint-literal, where-matcher, nul-bytes. NOT MEASURED locally (their own exit 3 / prerequisite text, not red): check:type-check-debt and check:dual-build-cjs-loads need the whole workspace built (the closure build alone took 4 minutes under the lock; the full one does not fit the container's foreground cap), check-test-completeness parses a CI vitest summary, scripts/pm/check-half-states.mjs is the PM patrol (network, timed out). CI runs all four.
  • ESLint, narrowed and measured: pnpm exec eslint --no-inline-config --format json over the 6 changed TypeScript files → 6 files, 0 errors, 0 warnings. Population evidence from the config itself: the only global ignores are NEVER_LINTED (node_modules/dist/build/.next/.turbo), none of which contain these paths; invariance: eslint.config.mjs states it never enables type-aware linting (no parserOptions.project, no typed rules) for any file, so this diff cannot move any untouched file's verdict.

Contract review (Clause ②)

New exported symbols, from git diff -U0 origin/main...HEAD | grep export: DATASOURCE_MUTATION_CLUSTER_CHANNEL, ClusterDatasourceMutationPayload (both from @objectstack/service-datasource), plus two public methods on the exported DatasourceAdminService class (attachDatasourceMutationPubSub / detachDatasourceMutationPubSub) and one optional key on the exported DatasourceAdminServiceConfig (convergePool). @objectstack/service-cluster exports nothing new (a lane, not a plugin). Changeset: minor for both packages.

Out of scope, filed unassigned: #14339 (docs: content/docs/kernel/cluster.mdx describes the invalidation family as metadata.changed only; metadata.mutated and datasource.mutated are undocumented — one docs-only change for the family, not a rider here).

Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8

Generated by Claude Code

🤖 Generated with Claude Code


Generated by Claude Code

…s out to peer replicas (#13805)
The ObjectQL driver registry had no cluster propagation in either direction:
each replica filled it at boot from the shared datasource records and mutated
it only for the writes it served, so after DELETE /api/v1/datasources/:name
only the serving replica evicted the stuck driver (#13578) and the other N-1
kept draining /api/v1/ready until restart.
Ruled shape (2026-09-01): the driver registry adopts the cluster-invalidation
family metadata.mutated established -- no second mechanism, no poll loop, no
delete-only broadcast. DatasourceAdminService publishes the record's ADDRESS
on datasource.mutated after create, update and delete (symmetric); peers
converge their live pool from their OWN read of the durable sys_metadata row
through the pool seams they already own (build / rebuild-in-place / evict /
leave alone). Only IPubSub from spec/contracts crosses the new attach seam;
service-datasource takes no cluster dependency and objectql is handed no bus.
MetadataClusterBridgePlugin late-binds the seam as a third independent lane,
guarded off the in-process memory driver like the other two.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…ow the stray-signal warn assertion
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
@github-actionsgithub-actionsBot added size/xl documentation Improvements or additions to documentation tests tooling labels Sep 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/wire-format.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/data-modeling/drivers.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))
  • content/docs/data-modeling/external-datasources.mdx(via DatasourceAdminServicePlugin (symbol, a top-level class), /api/v1/meta/datasource (route, a path literal in DatasourceAdminServicePlugin))
  • content/docs/deployment/backup-restore.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/self-hosting.mdx(via /api/v1/ready (route, a path literal on a changed line))
  • content/docs/deployment/validating-metadata.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/kernel/cluster.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class), originNode (symbol, a field of interface ClusterDatasourceMutationPayload))
  • content/docs/kernel/services-checklist.mdx(via MetadataClusterBridgePlugin (symbol, a top-level class))

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

  • content/docs/releases/v15.mdx(via /api/v1/meta/* (route, a path literal on a changed line))
  • content/docs/releases/v17.mdx(via /api/v1/datasources/:name (route, a path literal on a changed line))

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-datasource/src/index.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 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.

Coarse fallback — 4 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 72adb7fcb6b6f48b656047835ed3852f314d9de1packageMentionDocs.

Which tree this was computed on

This run read content/docs from 177460340ecec87f3d9c6271651f88fd10f89ad8 — the merge of head 6be669f67747210071d0d03fda58ef8b7921b537 into base 72adb7fcb6b6f48b656047835ed3852f314d9de1, 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 177460340ecec87f3d9c6271651f88fd10f89ad8 && git checkout 177460340ecec87f3d9c6271651f88fd10f89ad8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 72adb7fcb6b6f48b656047835ed3852f314d9de1 6be669f67747210071d0d03fda58ef8b7921b537 && git checkout -B drift-repro 72adb7fcb6b6f48b656047835ed3852f314d9de1 && git merge --no-ff 6be669f67747210071d0d03fda58ef8b7921b537
node scripts/docs-audit/affected-docs.mjs --json 72adb7fcb6b6f48b656047835ed3852f314d9de1

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

@os-salesClaude

Copy link
Copy Markdown
Collaborator

Landing provenance (PM seat, domain:services, session_01AUF1NoViznQK32gqpK8wS8)


Generated by Claude Code

@os-sales
os-sales added this pull request to the merge queueSep 2, 2026
Merged via the queue into main with commit ef8a4b9Sep 2, 2026
42 checks passed
@os-sales
os-sales deleted the claude/issue-13805-driver-registry-cluster-convergence branch September 2, 2026 03:39
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/xlteststooling

Projects

None yet

2 participants

@os-sales@claude