instar 1.3.719 → 1.3.720

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +213 -31
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/CoherenceJournal.d.ts.map +1 -1
  5. package/dist/core/CoherenceJournal.js +9 -1
  6. package/dist/core/CoherenceJournal.js.map +1 -1
  7. package/dist/core/CoherenceJournalReader.d.ts +56 -0
  8. package/dist/core/CoherenceJournalReader.d.ts.map +1 -1
  9. package/dist/core/CoherenceJournalReader.js +148 -0
  10. package/dist/core/CoherenceJournalReader.js.map +1 -1
  11. package/dist/core/LeaseAcquisitionTrigger.d.ts +35 -0
  12. package/dist/core/LeaseAcquisitionTrigger.d.ts.map +1 -0
  13. package/dist/core/LeaseAcquisitionTrigger.js +53 -0
  14. package/dist/core/LeaseAcquisitionTrigger.js.map +1 -0
  15. package/dist/core/OwnershipReconciler.d.ts +106 -2
  16. package/dist/core/OwnershipReconciler.d.ts.map +1 -1
  17. package/dist/core/OwnershipReconciler.js +265 -12
  18. package/dist/core/OwnershipReconciler.js.map +1 -1
  19. package/dist/core/PlacementExecutor.d.ts +14 -1
  20. package/dist/core/PlacementExecutor.d.ts.map +1 -1
  21. package/dist/core/PlacementExecutor.js +17 -2
  22. package/dist/core/PlacementExecutor.js.map +1 -1
  23. package/dist/core/PostUpdateMigrator.d.ts +5 -3
  24. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  25. package/dist/core/PostUpdateMigrator.js +33 -7
  26. package/dist/core/PostUpdateMigrator.js.map +1 -1
  27. package/dist/core/SustainedOnlineTracker.d.ts +47 -0
  28. package/dist/core/SustainedOnlineTracker.d.ts.map +1 -0
  29. package/dist/core/SustainedOnlineTracker.js +67 -0
  30. package/dist/core/SustainedOnlineTracker.js.map +1 -0
  31. package/dist/core/TopicPinFoldView.d.ts +138 -0
  32. package/dist/core/TopicPinFoldView.d.ts.map +1 -0
  33. package/dist/core/TopicPinFoldView.js +235 -0
  34. package/dist/core/TopicPinFoldView.js.map +1 -0
  35. package/dist/core/TopicPinMutation.d.ts +46 -0
  36. package/dist/core/TopicPinMutation.d.ts.map +1 -0
  37. package/dist/core/TopicPinMutation.js +66 -0
  38. package/dist/core/TopicPinMutation.js.map +1 -0
  39. package/dist/core/TopicPinReplicatedStore.d.ts +3 -0
  40. package/dist/core/TopicPinReplicatedStore.d.ts.map +1 -1
  41. package/dist/core/TopicPinReplicatedStore.js +5 -0
  42. package/dist/core/TopicPinReplicatedStore.js.map +1 -1
  43. package/dist/core/TopicPinSkewQuarantine.d.ts +44 -0
  44. package/dist/core/TopicPinSkewQuarantine.d.ts.map +1 -0
  45. package/dist/core/TopicPinSkewQuarantine.js +136 -0
  46. package/dist/core/TopicPinSkewQuarantine.js.map +1 -0
  47. package/dist/core/TopicPlacementPinStore.d.ts +29 -2
  48. package/dist/core/TopicPlacementPinStore.d.ts.map +1 -1
  49. package/dist/core/TopicPlacementPinStore.js +23 -5
  50. package/dist/core/TopicPlacementPinStore.js.map +1 -1
  51. package/dist/core/types.d.ts +29 -2
  52. package/dist/core/types.d.ts.map +1 -1
  53. package/dist/core/types.js.map +1 -1
  54. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  55. package/dist/monitoring/guardManifest.js +46 -0
  56. package/dist/monitoring/guardManifest.js.map +1 -1
  57. package/dist/scaffold/templates.d.ts.map +1 -1
  58. package/dist/scaffold/templates.js +1 -0
  59. package/dist/scaffold/templates.js.map +1 -1
  60. package/dist/server/AgentServer.d.ts +4 -0
  61. package/dist/server/AgentServer.d.ts.map +1 -1
  62. package/dist/server/AgentServer.js +2 -0
  63. package/dist/server/AgentServer.js.map +1 -1
  64. package/dist/server/routes.d.ts +6 -0
  65. package/dist/server/routes.d.ts.map +1 -1
  66. package/dist/server/routes.js +160 -15
  67. package/dist/server/routes.js.map +1 -1
  68. package/package.json +1 -1
  69. package/src/data/builtin-manifest.json +64 -64
  70. package/src/data/state-coherence-registry.json +18 -0
  71. package/src/scaffold/templates.ts +1 -0
  72. package/upgrades/1.3.720.md +125 -0
  73. package/upgrades/side-effects/u4-1-pin-persistence.md +49 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+CH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAyBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA6H7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAw+CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CAijBN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAstjBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+CH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAyBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA6H7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAi/CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CAijBN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAi3jBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -550,6 +550,15 @@ let _listPoolMachines = null;
550
550
  let _deliverMandateToMachine = null;
551
551
  /** Multi-Machine Session Pool §L4: per-topic placement pin store ("move this to <nickname>"). */
552
552
  let _topicPinStore = null;
553
+ /** U4.1 §2C: the sticky durable skew-quarantine set (routes + the fold's gate). */
554
+ let _topicPinSkewQuarantine = null;
555
+ /** U4.1 §2C: the answer-complete pin fold view (advisory read + placement seeding). */
556
+ let _topicPinFoldView = null;
557
+ /** U4.1 §2D: placement-seeding resolver (local pin ⊕ fold winner by HLC). Late-bound
558
+ * in the ws13 block; null ⇒ local-pin-only seeding (today's behavior). */
559
+ let _pinPlacementMetadata = null;
560
+ /** U4.1 §2E: sustained-online gate shared by the reconciler + the hard-pin placement path. */
561
+ let _ws13SustainedOnline = null;
553
562
  /** Cross-machine secret-sync (spec Phase 4): route-facing handle (push lever + read-only status). */
554
563
  let _secretSyncHandle = null;
555
564
  /** Pool Dashboard Streaming (POOL-DASHBOARD-STREAM-SPEC §2.3): shared single-use
@@ -2029,7 +2038,7 @@ getAttentionTopicId) {
2029
2038
  messageId: String(msg.id),
2030
2039
  payload: text,
2031
2040
  senderEnvelope: { userId: telegramUserId || undefined, firstName: pipeline.sender.firstName },
2032
- topicMetadata: _topicPinStore?.asTopicMetadata(String(topicId)),
2041
+ topicMetadata: _pinPlacementMetadata ? _pinPlacementMetadata(String(topicId)) : _topicPinStore?.asTopicMetadata(String(topicId)), // U4.1 §2D: local pin ⊕ fold winner by HLC
2033
2042
  }, 'ordering-behind-queued');
2034
2043
  if (ord.result === 'queued' || ord.result === 'already-queued') {
2035
2044
  console.log(`[inbound-queue] topic ${topicId} msg ${msg.id} queued behind existing entries (ordering)`);
@@ -2046,7 +2055,7 @@ getAttentionTopicId) {
2046
2055
  sessionKey: String(topicId),
2047
2056
  messageId: String(msg.id),
2048
2057
  payload: text,
2049
- topicMetadata: _topicPinStore?.asTopicMetadata(String(topicId)),
2058
+ topicMetadata: _pinPlacementMetadata ? _pinPlacementMetadata(String(topicId)) : _topicPinStore?.asTopicMetadata(String(topicId)), // U4.1 §2D: local pin ⊕ fold winner by HLC
2050
2059
  // §2.2: sender identity captured at ingress, persisted with custody.
2051
2060
  senderEnvelope: { userId: telegramUserId || undefined, firstName: pipeline.sender.firstName },
2052
2061
  });
@@ -2288,7 +2297,7 @@ getAttentionTopicId) {
2288
2297
  messageId: dmsg.messageId,
2289
2298
  payload: dmsg.payload,
2290
2299
  topicMetadata: dmsg.topicMetadata
2291
- ?? _topicPinStore?.asTopicMetadata(dmsg.sessionKey),
2300
+ ?? (_pinPlacementMetadata ? _pinPlacementMetadata(dmsg.sessionKey) : _topicPinStore?.asTopicMetadata(dmsg.sessionKey)), // U4.1 §2D
2292
2301
  senderEnvelope: dmsg.senderEnvelope,
2293
2302
  });
2294
2303
  // silent-loss-refusal-conservation §2.A — forwardToOwner no longer masquerades
@@ -7023,7 +7032,7 @@ export async function startServer(options) {
7023
7032
  sessionKey: routingKey,
7024
7033
  messageId: String(message.id),
7025
7034
  payload: message.content,
7026
- topicMetadata: _topicPinStore?.asTopicMetadata(routingKey),
7035
+ topicMetadata: _pinPlacementMetadata ? _pinPlacementMetadata(routingKey) : _topicPinStore?.asTopicMetadata(routingKey), // U4.1 §2D: local pin ⊕ fold winner by HLC
7027
7036
  senderEnvelope: {
7028
7037
  userId: message.metadata?.slackUserId || undefined,
7029
7038
  firstName: message.metadata?.senderName || undefined,
@@ -16556,12 +16565,111 @@ export async function startServer(options) {
16556
16565
  if (ownReg) {
16557
16566
  const ws13Cfg = () => (config.multiMachine?.seamlessness ?? {});
16558
16567
  const { OwnershipReconciler } = await import('../core/OwnershipReconciler.js');
16559
- // Fix #2 advisory-pin read: the merged replicated `topic-pin-record` view (HLC-ordered)
16560
- // the reconciler consults so the OWNING machine sees a pin set on another machine.
16561
- const { mergeUnionToPins, compareHlc, TOPIC_PIN_RECORD_KIND } = await import('../core/TopicPinReplicatedStore.js');
16562
16568
  const { CoherenceJournalReader: PinAdvReader } = await import('../core/CoherenceJournalReader.js');
16563
16569
  const pinAdvisoryReader = new PinAdvReader({ stateDir: config.stateDir });
16564
16570
  const { mergeUnionToClaimAnnotations, TOPIC_CLAIM_ANNOTATION_KIND, TOPIC_CLAIM_ANNOTATION_STORE_KEY, buildClaimAnnotationPut, deriveClaimAnnotationRecordKey } = await import('../core/TopicClaimAnnotationStore.js');
16571
+ // ── U4.1 §2C — the answer-complete, skew-gated pin fold ────────────────
16572
+ // Replaces the query({kind:'topic-pin-record', limit:2000}) tail read that
16573
+ // READER_MAX_LIMIT silently clamped to the newest 500 entries (a long-
16574
+ // untouched topic's winning record fell out of the window as other topics
16575
+ // churned — defect 4's read half). Boot = full-stream fold (own + every
16576
+ // peer replica, active + archives); each later refresh re-scans only
16577
+ // appended bytes (offset-tracked). Future-skewed record HLCs are excluded
16578
+ // at the FOLD (the SOLE skew authority, R-r3-1 — an applier-door refusal
16579
+ // would suspect-halt the peer's whole stream) and quarantined STICKILY +
16580
+ // DURABLY (R-r3-2) beside the pin store.
16581
+ const { TopicPinSkewQuarantine } = await import('../core/TopicPinSkewQuarantine.js');
16582
+ const { TopicPinFoldView } = await import('../core/TopicPinFoldView.js');
16583
+ const { SustainedOnlineTracker } = await import('../core/SustainedOnlineTracker.js');
16584
+ const autoSessionsMod = await import('../core/AutonomousSessions.js');
16585
+ const pinSkewQuarantine = new TopicPinSkewQuarantine({
16586
+ /* state-registry: topic-pin-skew-quarantine */
16587
+ filePath: path.join(config.stateDir, 'session-pool', 'topic-pin-skew-quarantine.json'),
16588
+ onCorrupt: (aside, error) => {
16589
+ try {
16590
+ _meshAttentionRaise?.({
16591
+ id: 'u41:pin-corrupt:topic-pin-skew-quarantine.json',
16592
+ title: 'Pin skew-quarantine file was corrupt — quarantined aside',
16593
+ body: `The sticky pin skew-quarantine set could not be parsed and was preserved aside at ${aside} (${error}). It restarted empty; still-skewed records re-quarantine on the next fold. Poison records minted during the gap could re-enter comparisons — review the aside file.`,
16594
+ priority: 'medium',
16595
+ sourceContext: 'ws13-pin-persistence',
16596
+ });
16597
+ }
16598
+ catch { /* escalation is observability */ }
16599
+ },
16600
+ });
16601
+ _topicPinSkewQuarantine = pinSkewQuarantine;
16602
+ const pinFoldView = new TopicPinFoldView({
16603
+ reader: pinAdvisoryReader,
16604
+ quarantine: pinSkewQuarantine,
16605
+ selfNode: () => _meshSelfId, // late-bound — resolves by first fold
16606
+ foldMaxBytes: () => {
16607
+ const v = ws13Cfg().ws13FoldMaxBytes;
16608
+ return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : 64 * 1024 * 1024;
16609
+ },
16610
+ onSkewQuarantined: (rec) => {
16611
+ try {
16612
+ _meshAttentionRaise?.({
16613
+ id: `u41:pin-hlc-skew:${rec.origin || 'unknown-origin'}`,
16614
+ title: `Pin record from ${rec.origin || 'an unknown machine'} quarantined for clock skew`,
16615
+ body: `A replicated topic-pin record (topic ${rec.key}) carries an HLC stamped ${new Date(rec.hlc.physical).toISOString()} — future-skewed beyond the drift ceiling. It is EXCLUDED from pin resolution (stickily, immune to clock progress) but kept on disk for diagnosis; check ${rec.origin}'s clock/NTP. Acknowledging this notice does NOT re-admit the record — re-admission is the explicit POST /pool/pin-quarantine/readmit action. A newer honest pin/unpin for the topic supersedes it automatically.`,
16616
+ priority: 'medium',
16617
+ sourceContext: 'ws13-pin-persistence',
16618
+ });
16619
+ }
16620
+ catch { /* escalation is observability */ }
16621
+ },
16622
+ onFoldTruncated: (unfolded) => {
16623
+ try {
16624
+ const ranges = unfolded.slice(0, 8).map((u) => `${path.basename(u.file)}[${u.fromByte}..${u.toByte}]`).join(', ');
16625
+ _meshAttentionRaise?.({
16626
+ id: 'u41:pin-fold-truncated',
16627
+ title: 'Pin fold exceeded its byte budget — NEWEST-FIRST truncation engaged',
16628
+ body: `The topic-pin-record fold breached ws13FoldMaxBytes and folded newest-first up to the budget. UNFOLDED ranges: ${ranges}${unfolded.length > 8 ? ` (+${unfolded.length - 8} more)` : ''}. Older pin records are temporarily invisible to pin resolution. Raise ws13FoldMaxBytes or investigate pin-event volume (per-key rewrite-compaction at rotation is the tracked follow-up).`,
16629
+ priority: 'high',
16630
+ sourceContext: 'ws13-pin-persistence',
16631
+ });
16632
+ }
16633
+ catch { /* escalation is observability */ }
16634
+ },
16635
+ log: (m) => console.log(pc.dim(` ${m}`)),
16636
+ });
16637
+ _topicPinFoldView = pinFoldView;
16638
+ // U4.1 §2E — sustained-online hysteresis (fed on every reconcile tick).
16639
+ const sustainedTracker = new SustainedOnlineTracker();
16640
+ // U4.2 R-r2-5a (named prerequisite fix): Case C's staleness feed is the
16641
+ // ROUTER/OBSERVER-stamped arrival time (routerReceivedAt), NEVER the
16642
+ // machine's self-reported wall clock — MachinePoolRegistry's own §L2
16643
+ // header forbids the self-reported input ("a fast-clocked machine must
16644
+ // not appear fresher than it is"). Shared by the reconciler's machines()
16645
+ // dep AND the sustained-online tracker feed (one view, one truth).
16646
+ const ws13Machines = () => {
16647
+ try {
16648
+ return (machinePoolRegistry?.getCapacities() ?? []).map((c) => ({
16649
+ machineId: c.machineId,
16650
+ online: !!c.online,
16651
+ lastSeenMs: c.routerReceivedAt ? Date.parse(c.routerReceivedAt) || 0 : 0,
16652
+ }));
16653
+ }
16654
+ catch {
16655
+ return []; /* @silent-fallback-ok — no pool view → module's single-machine strict no-op */
16656
+ }
16657
+ };
16658
+ _ws13SustainedOnline = (machineId) => sustainedTracker.sustainedOnline(machineId, ws13Cfg().ws13SustainedOnlineMs ?? 120_000);
16659
+ // §2D placement seeding: local pin ⊕ fold winner resolved by HLC (a stale
16660
+ // local pin never masks a fresher replicated move-intent or tombstone).
16661
+ _pinPlacementMetadata = (sessionKey) => {
16662
+ const localMeta = _topicPinStore?.asTopicMetadata(sessionKey);
16663
+ try {
16664
+ if (!resolveDevAgentGate(ws13Cfg().ws13PinReplicate, config))
16665
+ return localMeta;
16666
+ pinFoldView.refresh();
16667
+ return pinFoldView.effectiveTopicMetadata(sessionKey, _topicPinStore?.get(sessionKey) ?? null);
16668
+ }
16669
+ catch {
16670
+ return localMeta; /* @silent-fallback-ok — a fold fault degrades to local-pin-only seeding (today's behavior) */
16671
+ }
16672
+ };
16565
16673
  const reconciler = new OwnershipReconciler({
16566
16674
  // DEV-AGENT DARK GATE (operator directive 2026-06-13, topic 13481):
16567
16675
  // read ws13Reconcile through resolveDevAgentGate so the reconcile loop
@@ -16574,17 +16682,19 @@ export async function startServer(options) {
16574
16682
  dryRun: () => ws13Cfg().ws13DryRun !== false,
16575
16683
  selfMachineId: () => _meshSelfId, // late-bound (assigned ~950 lines below) — read at tick time
16576
16684
  pinStore: () => _topicPinStore, // late-bound (assigned ~2200 lines below) — read at tick time
16577
- // Fix #2: the merged ADVISORY replicated pins (HLC-ordered). Gated by
16578
- // ws13PinReplicate (resolves LIVE on a dev agent / DARK on the fleet) so a
16579
- // dark/single-machine agent reads no advisory pins (today's behavior).
16685
+ // Fix #2, redesigned by U4.1 §2C: the merged ADVISORY replicated pins now
16686
+ // come from the ANSWER-COMPLETE fold view (boot full-stream fold +
16687
+ // incremental offset tail + sticky skew gate) instead of the clamped
16688
+ // newest-500 tail read. Gated by ws13PinReplicate (resolves LIVE on a dev
16689
+ // agent / DARK on the fleet) so a dark/single-machine agent reads no
16690
+ // advisory pins (today's behavior).
16580
16691
  advisoryPins: () => {
16581
16692
  try {
16582
16693
  if (!resolveDevAgentGate(ws13Cfg().ws13PinReplicate, config))
16583
16694
  return new Map();
16584
- const res = pinAdvisoryReader.query({ kind: TOPIC_PIN_RECORD_KIND, limit: 2000 });
16585
- const merged = mergeUnionToPins(res.entries.map((e) => ({ data: e.data, origin: typeof e.data.origin === 'string' ? e.data.origin : '' })), compareHlc);
16695
+ pinFoldView.refresh(); // boot = full fold; later ticks = appended bytes only
16586
16696
  const out = new Map();
16587
- for (const [topic, p] of merged)
16697
+ for (const [topic, p] of pinFoldView.pins())
16588
16698
  out.set(topic, { preferredMachine: p.preferredMachine, hlc: p.hlc });
16589
16699
  return out;
16590
16700
  }
@@ -16593,23 +16703,37 @@ export async function startServer(options) {
16593
16703
  }
16594
16704
  },
16595
16705
  ownership: ownReg,
16596
- machines: () => {
16706
+ machines: ws13Machines,
16707
+ // U4.1 §2E (R-r2-2): pin-driven actuation toward a machine requires it
16708
+ // SUSTAINED-online (ws13SustainedOnlineMs) — an offline/flapping pinned
16709
+ // target yields `pending`, never a transfer→abort churn loop.
16710
+ sustainedOnline: (machineId) => _ws13SustainedOnline ? _ws13SustainedOnline(machineId) : true,
16711
+ // U4.1 §2E (iii): a LIVE autonomous run defers pin-driven moves
16712
+ // indefinitely (no safe-point deadline override; the aged-pending
16713
+ // attention item is the bounded escape).
16714
+ hasLiveAutonomousRun: (sessionKey) => {
16597
16715
  try {
16598
- // U4.2 R-r2-5a (named prerequisite fix): Case C's staleness feed is the
16599
- // ROUTER/OBSERVER-stamped arrival time (routerReceivedAt), NEVER the
16600
- // machine's self-reported wall clock — MachinePoolRegistry's own §L2
16601
- // header forbids the self-reported input ("a fast-clocked machine must
16602
- // not appear fresher than it is").
16603
- return (machinePoolRegistry?.getCapacities() ?? []).map((c) => ({
16604
- machineId: c.machineId,
16605
- online: !!c.online,
16606
- lastSeenMs: c.routerReceivedAt ? Date.parse(c.routerReceivedAt) || 0 : 0,
16607
- }));
16716
+ return !!autoSessionsMod.listAutonomousJobs(config.stateDir)
16717
+ .find((j) => j.topic === sessionKey && j.active && !j.paused);
16608
16718
  }
16609
16719
  catch {
16610
- return []; /* @silent-fallback-ok — no pool view module's single-machine strict no-op */
16720
+ return false; /* @silent-fallback-ok — unreadable run registry reads as no live run; the busy/safe-point gates still apply */
16611
16721
  }
16612
16722
  },
16723
+ // U4.1 §2.G knobs (restart to apply — the documented norm).
16724
+ ...(typeof ws13Cfg().ws13DebounceMs === 'number' ? { debounceMs: ws13Cfg().ws13DebounceMs } : {}),
16725
+ ...(typeof ws13Cfg().ws13TransferDeadlineMs === 'number' ? { transferDeadlineMs: ws13Cfg().ws13TransferDeadlineMs } : {}),
16726
+ ...(typeof ws13Cfg().ws13MaxMovesPerTick === 'number' ? { maxMovesPerTick: ws13Cfg().ws13MaxMovesPerTick } : {}),
16727
+ ...(typeof ws13Cfg().ws13DivergedWindowMs === 'number' ? { divergedWindowMs: ws13Cfg().ws13DivergedWindowMs } : {}),
16728
+ ...(typeof ws13Cfg().ws13PendingPinMaxAgeMs === 'number' ? { pendingPinMaxAgeMs: ws13Cfg().ws13PendingPinMaxAgeMs } : {}),
16729
+ // U4.1 §2D/§2E — P17 escalation (pin-diverged / pin-pending-aged), one
16730
+ // deduped item per episode via the shared mesh-attention seam (late-bound).
16731
+ raiseAttention: (item) => {
16732
+ try {
16733
+ _meshAttentionRaise?.(item);
16734
+ }
16735
+ catch { /* attention raise is best-effort; the reconciler log already recorded the state */ }
16736
+ },
16613
16737
  staleOwnerEngine: () => _staleOwnerEngine,
16614
16738
  claimSuspensions: (_sorClaimSuspensionsRead = () => {
16615
16739
  try {
@@ -16801,19 +16925,41 @@ export async function startServer(options) {
16801
16925
  logger: (m) => console.log(pc.dim(` ${m}`)),
16802
16926
  });
16803
16927
  }
16928
+ // U4.1 §2A — GuardRegistry self-registration (the manifest's
16929
+ // `expectRuntime: true` honesty clause: the entry declares a runtime
16930
+ // report ONLY because this registration exists).
16931
+ try {
16932
+ guardRegistry.register('multiMachine.seamlessness.ws13Reconcile', () => reconciler.guardStatus());
16933
+ }
16934
+ catch { /* registration is observability — never gates boot */ }
16804
16935
  const tickMs = Math.max(5000, ws13Cfg().ws13TickMs ?? 30000);
16805
- const ws13Timer = setInterval(() => {
16936
+ const runWs13Tick = (trigger) => {
16806
16937
  try {
16938
+ sustainedTracker.observe(ws13Machines()); // feed the §2E hysteresis every tick
16807
16939
  const rep = reconciler.tick();
16808
16940
  if (!rep.skipped && (rep.transfers || rep.claims || rep.forceClaims || rep.adoptions)) {
16809
- console.log(pc.dim(` [OwnershipReconciler] tick: t=${rep.transfers} c=${rep.claims} f=${rep.forceClaims} a=${rep.adoptions}${rep.dryRun ? ' (dry-run)' : ''}`));
16941
+ console.log(pc.dim(` [OwnershipReconciler] ${trigger} tick: t=${rep.transfers} c=${rep.claims} f=${rep.forceClaims} a=${rep.adoptions}${rep.dryRun ? ' (dry-run)' : ''}`));
16810
16942
  }
16811
16943
  }
16812
16944
  catch (err) {
16813
16945
  console.error('[OwnershipReconciler] tick failed:', err instanceof Error ? err.message : String(err));
16814
16946
  }
16815
- }, tickMs);
16947
+ };
16948
+ const ws13Timer = setInterval(() => runWs13Tick('cadence'), tickMs);
16816
16949
  ws13Timer.unref?.();
16950
+ // U4.1 §2D — becoming placement router (lease acquisition or boot)
16951
+ // triggers ONE immediate reconciler tick: replay is a reconciler INPUT,
16952
+ // never a second transfer-initiating pass. Epoch-fenced inside the
16953
+ // trigger: it fires only while we STILL hold the lease at fire time (a
16954
+ // stale router's tick initiates nothing — and every action inside is
16955
+ // CAS-fenced by the ownership registry).
16956
+ const { LeaseAcquisitionTrigger } = await import('../core/LeaseAcquisitionTrigger.js');
16957
+ const ws13AcquisitionTrigger = new LeaseAcquisitionTrigger({
16958
+ holdsLease: () => (leaseCoordinatorRef ? leaseCoordinatorRef.holdsLease() : coordinator.holdsLease()),
16959
+ onAcquired: () => runWs13Tick('lease-acquired'),
16960
+ });
16961
+ const ws13LeaseWatch = setInterval(() => ws13AcquisitionTrigger.poll(), 5000);
16962
+ ws13LeaseWatch.unref?.();
16817
16963
  }
16818
16964
  // ── Transfer fix §7.2: OwnershipApplier ─────────────────────────────────
16819
16965
  // Materialize durable local ownership from the REPLICATED placement journal
@@ -18647,7 +18793,11 @@ export async function startServer(options) {
18647
18793
  });
18648
18794
  _sessionRouter = new routerMod.SessionRouter({
18649
18795
  selfMachineId: meshSelfId,
18650
- placement: new placeMod.PlacementExecutor(),
18796
+ placement: new placeMod.PlacementExecutor(undefined, {
18797
+ // U4.1 §2E (i): hard-pin fulfilment requires the pinned machine
18798
+ // SUSTAINED-online (late-bound; absent/boot window ⇒ plain-online).
18799
+ sustainedOnline: (m) => (_ws13SustainedOnline ? _ws13SustainedOnline(m) : true),
18800
+ }),
18651
18801
  // Placement must consult the breaker too: a message re-placed OFF a
18652
18802
  // suspect owner must not be placed right back ONTO it. Suspect
18653
18803
  // machines are filtered from the candidate set UNLESS that would
@@ -19232,10 +19382,26 @@ export async function startServer(options) {
19232
19382
  const transferMod = await import('../core/TransferByNickname.js');
19233
19383
  const autonomousSessionsModule = await import('../core/AutonomousSessions.js');
19234
19384
  const pinMod = await import('../core/TopicPlacementPinStore.js');
19385
+ const pinMutationMod = await import('../core/TopicPinMutation.js');
19235
19386
  const relocSetMod = await import('../core/RelocationNicknameSet.js');
19236
19387
  const nickAssignMod = await import('../core/NicknameAssigner.js');
19237
19388
  _topicPinStore = new pinMod.TopicPlacementPinStore({
19238
19389
  filePath: path.join(config.stateDir, 'session-pool', 'topic-pins.json'),
19390
+ // U4.1 §2C (fixes defect 3): a corrupt pin file quarantines ASIDE +
19391
+ // raises ONE deduped item — never the old silent wipe-and-persist
19392
+ // (success-shaped total loss of operator placement intent).
19393
+ onCorrupt: (aside, error) => {
19394
+ try {
19395
+ _meshAttentionRaise?.({
19396
+ id: 'u41:pin-corrupt:topic-pins.json',
19397
+ title: 'Topic pin store was corrupt — quarantined aside, pins reset to unknown',
19398
+ body: `The authoritative local pin store (topic-pins.json) could not be parsed and was preserved aside at ${aside} (${error}). Placement pins are UNKNOWN until re-pinned — review the aside file to recover the operator's pins, then re-pin via POST /pool/transfer.`,
19399
+ priority: 'high',
19400
+ sourceContext: 'ws13-pin-persistence',
19401
+ });
19402
+ }
19403
+ catch { /* escalation is observability — never gates the load */ }
19404
+ },
19239
19405
  });
19240
19406
  // Authoritative resolver for THIS machine's OWN nickname. Guarantees a topic
19241
19407
  // can always be moved BACK to the machine currently handling it, even when the
@@ -19318,7 +19484,23 @@ export async function startServer(options) {
19318
19484
  }, sessionKey);
19319
19485
  if (plan.action === 'transfer' || plan.action === 'noop') {
19320
19486
  const target = plan.targetMachine;
19321
- _topicPinStore.set(sessionKey, target, plan.setPin ?? true);
19487
+ // U4.1 §2B one-HLC funnel + §2F pinnedBy: this arm executes the
19488
+ // OPERATOR's direct authed Telegram command — provenance resolves
19489
+ // from the topic's auto-bound VERIFIED operator when one exists
19490
+ // (never a content name), else the agent surface. The funnel mints
19491
+ // ONE HLC stamping both the replicated PUT and the local set().
19492
+ const nlBoundOperator = (() => {
19493
+ try {
19494
+ const op = _agentServerRef?.getTopicOperatorStore()?.getOperator(sessionKey) ?? null;
19495
+ return op && op.uid
19496
+ ? { kind: 'operator', platform: String(op.platform || 'telegram'), uid: op.uid }
19497
+ : null;
19498
+ }
19499
+ catch {
19500
+ return null; /* @silent-fallback-ok — an unreadable binding degrades to agent provenance, never a blocked pin */
19501
+ }
19502
+ })();
19503
+ pinMutationMod.setPinWithOneHlc({ pinStore: _topicPinStore, emitter: replicatedRecordEmitter ?? null }, sessionKey, target, plan.setPin ?? true, nlBoundOperator ?? { kind: 'agent', sessionRef: 'nickname-relocation' });
19322
19504
  // If THIS machine actively owns the topic, release so the next message re-places to the pin.
19323
19505
  try {
19324
19506
  if (ownReg.ownerOf(sessionKey) === meshSelfId) {
@@ -19632,7 +19814,7 @@ export async function startServer(options) {
19632
19814
  const server = new AgentServer({ config, sessionManager, state, scheduler, telegram, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, cartographer: cartographer ?? undefined, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, subscriptionPool, accountFollowMePeerViews: async () => { const nickById = new Map((_listPoolMachines?.() ?? []).map((m) => [m.machineId, m.nickname ?? m.machineId])); let peers = (_resolvePeerUrls?.() ?? []).map((p) => ({ machineId: p.machineId, nickname: nickById.get(p.machineId) ?? p.machineId, url: p.url })); if (peers.length === 0) {
19633
19815
  peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
19634
19816
  } if (peers.length === 0)
19635
- return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
19817
+ return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
19636
19818
  // wired before the server existed; from here on inbound binds use the
19637
19819
  // server's own store instance.
19638
19820
  _agentServerRef = server;