Repository navigation
test(service-automation): measure a connector definition published on one replica across two replicas (#27977) - #28010
Conversation
…ross two replicas Two kernels over one shared SQLite file and one shared bus, attached on lanes 2 and 4 the way MetadataClusterBridgePlugin attaches them. A definition published through the per-item door re-materializes on the publishing replica, and lane 2 delivers the mutation to the peer, but the peer's live instance does not follow until a metadata:reloaded on the peer. The gap is pinned as an expected failure; a control shows a reload on the peer converges it from its own read of the shared store. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cx4GVsYbtK2oE4scBf
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cx4GVsYbtK2oE4scBf
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Seat ACCEPT · PR #28010 · head
|
Requested by Elon · project thread
Fixes #27977
domain:server#3 · os-elon-musk · session_016WV4cx4GVsYbtK2oE4scBf
Clause-②: no
Metadata-protocol: none
维护者速读
connector-definition-cluster.test.ts,用两个内核(各自 ObjectQLPlugin 元数据协议 + 自动化插件)共享一个 SQLite 文件和一条总线,测量「在 A 上发布改过的连接器定义,B 会不会跟着重建」。不改任何运行时代码。flow,metadata:reloaded又只在本内核触发,所以 B 一直用旧定义,直到重载或重启。缺口以it.fails钉住,修复卡是 automation (cluster): a published connector definition change re-materialises only on the publishing replica; peers keep the old instance until reload #28002。files只发dist)。回滚即删掉这个文件。packages/services/service-automation/src/connector-definition-cluster.test.ts,it.fails那一例和其后的对照例。pnpm --filter @objectstack/service-automation exec vitest run src/connector-definition-cluster.test.ts,预期2 passed | 1 expected fail (3)。What changes
One new test file,
packages/services/service-automation/src/connector-definition-cluster.test.ts, built likeconnector-credential-cluster.test.ts(#27941): twoObjectKernelreplicas, each runningObjectQLPlugin's metadata protocol andAutomationServicePlugin, over ONE better-sqlite3 file both open, joined by a bus that delivers every publish to every subscriber (publisher included). Each replica is attached the wayMetadataClusterBridgePluginattaches it atkernel:ready: lane 2 (attachMetadataMutationPubSub) and lane 4 (attachConnectorCredentialPubSub). Lane 1 (metadata.changed) is not attached: it replays into aMetadataManager's caches, and the connector reconcile reads the ObjectQL registry and the protocol's execution view, never that manager.A definition change is published on A through the per-item door (a draft
saveMetaItem, thenpublishMetaItem), changingproviderConfig.endpointfrom V1 to V2.Measurement
metadata:reloadedafter the per-item publish)connector/NAMEinto B's mutation listenersexpected undefined to be 'https://v2.billing.example.test')metadata:reloadedon BCause, read from the code:
subscribeFlowMutationsinplugin.tsreturns early for any mutation whose type is notflow, andmetadata:reloadedis a kernel-local hook a peer never receives. So the gap is the trigger, not the store or the read. The lane choice for the fix belongs to #28002.Tests
connector-definition-cluster.test.ts:Tests 2 passed | 1 expected fail (3).it: A converges and lane 2 reaches B. This keeps theit.failsfrom passing on a broken harness.it.failsnaming automation (cluster): measure whether a published connector definition change materialises on every replica or only on the publishing one #27977 and automation (cluster): a published connector definition change re-materialises only on the publishing replica; peers keep the old instance until reload #28002: B converges with no reload on B. Its failure was read with the case temporarily run as a plainit: the one assertion that fails is B's last endpoint,undefinedinstead of V2.it: B holds no instance before the reload, and holds V2 after it.pnpm --filter @objectstack/service-automation test:Test Files 222 passed (222) · Tests 2832 passed | 1 expected fail (2833), lock VERDICT command-exit 0.pnpm --filter @objectstack/service-automation typecheck: lock VERDICT command-exit 0.Acceptance notes
saveMetaItemwith no mode, whatPUT /api/v1/meta/connector/:namecalls) does not re-materialize even on the writing replica. A stayed on V1 after saving V2, and its listeners heard the mutation. The seat recorded it on automation (cluster): a published connector definition change re-materialises only on the publishing replica; peers keep the old instance until reload #28002.skip-changeset): the package publishes onlydist. Afterpnpm --filter @objectstack/service-automation build,grepfor the test's names indistgave 0 hits, and the positive controlAutomationServicePlugingave 4 files.Verification
Head
022ad12c, base46943657.Derived gate families and lint
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 50 families over the 1 changed path. 49 exited 0.pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET: it needs every package'sdistin this worktree), so it is NOT MEASURED locally and CI runs it.check-plugin-teardown-shape --self-testexited 3 on the shallow clone and 0 aftergit fetch --unshallow.--ranreconciliation:50 derived, 49 run, 1 NOT-MEASURED, 0 UNRUN.pnpm lintexited 0.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses.main, one pull request.skip-changeset.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cx4GVsYbtK2oE4scBf