instar 1.3.520 → 1.3.522

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 (49) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +119 -2
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +32 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/ReplicatedRecordEnvelope.d.ts +380 -0
  8. package/dist/core/ReplicatedRecordEnvelope.d.ts.map +1 -0
  9. package/dist/core/ReplicatedRecordEnvelope.js +464 -0
  10. package/dist/core/ReplicatedRecordEnvelope.js.map +1 -0
  11. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  12. package/dist/core/devGatedFeatures.js +6 -0
  13. package/dist/core/devGatedFeatures.js.map +1 -1
  14. package/dist/core/stateSyncConfig.d.ts +94 -0
  15. package/dist/core/stateSyncConfig.d.ts.map +1 -0
  16. package/dist/core/stateSyncConfig.js +126 -0
  17. package/dist/core/stateSyncConfig.js.map +1 -0
  18. package/dist/core/types.d.ts +76 -0
  19. package/dist/core/types.d.ts.map +1 -1
  20. package/dist/core/types.js.map +1 -1
  21. package/dist/monitoring/OrphanedWorkSentinel.d.ts +148 -0
  22. package/dist/monitoring/OrphanedWorkSentinel.d.ts.map +1 -0
  23. package/dist/monitoring/OrphanedWorkSentinel.js +177 -0
  24. package/dist/monitoring/OrphanedWorkSentinel.js.map +1 -0
  25. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  26. package/dist/monitoring/guardManifest.js +14 -0
  27. package/dist/monitoring/guardManifest.js.map +1 -1
  28. package/dist/monitoring/orphanedWorkGit.d.ts +30 -0
  29. package/dist/monitoring/orphanedWorkGit.d.ts.map +1 -0
  30. package/dist/monitoring/orphanedWorkGit.js +124 -0
  31. package/dist/monitoring/orphanedWorkGit.js.map +1 -0
  32. package/dist/server/AgentServer.d.ts +3 -0
  33. package/dist/server/AgentServer.d.ts.map +1 -1
  34. package/dist/server/AgentServer.js +1 -0
  35. package/dist/server/AgentServer.js.map +1 -1
  36. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  37. package/dist/server/CapabilityIndex.js +1 -0
  38. package/dist/server/CapabilityIndex.js.map +1 -1
  39. package/dist/server/routes.d.ts +3 -0
  40. package/dist/server/routes.d.ts.map +1 -1
  41. package/dist/server/routes.js +11 -0
  42. package/dist/server/routes.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/data/builtin-manifest.json +47 -47
  45. package/upgrades/1.3.521.md +69 -0
  46. package/upgrades/1.3.522.md +25 -0
  47. package/upgrades/side-effects/multi-machine-replicated-store-foundation-step2-journal-kind.md +104 -0
  48. package/upgrades/side-effects/orphaned-work-sentinel.md +40 -0
  49. package/upgrades/1.3.520.md +0 -50
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA4G7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAsBtD;;;;;;;;;;;;;;;;;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;AAm1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{ wireRegistrySync } from '../core/wireRegistrySync.js';
87
87
  import { assertSeamlessnessInvariants } from '../core/seamlessnessConfig.js';
88
+ import { assertStateSyncInvariants } from '../core/stateSyncConfig.js';
89
+ import { ReplicatedKindRegistry, checkPoolFlagCoherence } from '../core/ReplicatedRecordEnvelope.js';
88
90
  import { FencedLease } from '../core/FencedLease.js';
89
91
  import { GitLeaseStore } from '../core/GitLeaseStore.js';
90
92
  import { LocalLeaseStore } from '../core/LocalLeaseStore.js';
@@ -3271,6 +3273,38 @@ export async function startServer(options) {
3271
3273
  // that breaks the RPO bound) is REJECTED here with a clear message rather
3272
3274
  // than degrading silently. Default/absent config resolves to valid values.
3273
3275
  const seamlessness = assertSeamlessnessInvariants(config.multiMachine);
3276
+ // Replicated-store foundation (multi-machine-replicated-store-foundation §10.2)
3277
+ // — resolve + validate the FOUNDATION-LEVEL stateSync knobs at startup. An
3278
+ // out-of-range value (e.g. a maxDriftMs below the 60s floor that would start
3279
+ // quarantining ordinary NTP jitter, or a non-positive journal budget) is
3280
+ // REJECTED here with a clear message rather than silently coerced (§10.2:
3281
+ // "a bad config is REJECTED, not silently degraded"). Default/absent config
3282
+ // resolves to valid values. The per-store on-switches are dark by default and
3283
+ // not range-validated; with none on, the foundation is inert.
3284
+ const stateSync = assertStateSyncInvariants(config.multiMachine);
3285
+ void stateSync; // foundation knobs are consumed by the store PRs (WS2.1+)
3286
+ // The replicated-kind registry (Component 2). Ships EMPTY in this step — the
3287
+ // first concrete store (WS2.1) registers its kind onto it. Constructed here so
3288
+ // the substrate is wired and the per-store stateSyncReceive advert can be
3289
+ // self-reported from the set of registered+enabled stores (machinery presence,
3290
+ // never a hardcoded true). A machine advertises a store's receive capability
3291
+ // ONLY when that store's kind is registered here AND emission is enabled in
3292
+ // config — i.e. it can both validate AND apply that kind. With an empty
3293
+ // registry the advert is `{}` (non-participant for every store): the correct
3294
+ // single-machine / no-store-yet behavior (a strict no-op).
3295
+ const replicatedKindRegistry = new ReplicatedKindRegistry();
3296
+ const selfStateSyncReceive = () => {
3297
+ const out = {};
3298
+ const stores = config.multiMachine?.stateSync;
3299
+ for (const store of replicatedKindRegistry.stores()) {
3300
+ // Advertise the receive capability iff the machinery exists (kind
3301
+ // registered) AND the store is enabled here — so a peer never forwards a
3302
+ // kind we'd silently drop (the named skew-failure mode).
3303
+ if (stores?.[store]?.enabled === true)
3304
+ out[store] = true;
3305
+ }
3306
+ return out;
3307
+ };
3274
3308
  // Read local signing key for machine route authentication
3275
3309
  let localSigningKeyPem = '';
3276
3310
  if (coordinator.enabled && coordinator.identity) {
@@ -11615,6 +11649,49 @@ export async function startServer(options) {
11615
11649
  ? ' AgentWorktreeReaper enabled (stale-worktree reclaim — LIVE)'
11616
11650
  : ' AgentWorktreeReaper enabled (stale-worktree reclaim — dry-run, report only)'));
11617
11651
  }
11652
+ // ── OrphanedWorkSentinel (the silent-uncommitted-death backstop) ──────────
11653
+ // Detects agent worktrees with uncommitted work whose owning session is dead
11654
+ // + settled, records them durably, and raises ONE deduped agent-health notice
11655
+ // — the case the PromiseBeacon escalation ladder can't see (nothing registered
11656
+ // for the code itself). developmentAgent dark-feature gate: LIVE on a dev
11657
+ // agent, DARK on the fleet. Signal-only; start() no-ops when disabled.
11658
+ // GET /orphaned-work.
11659
+ const _orphanedWorkEnabled = resolveDevAgentGate(config.monitoring?.orphanedWorkSentinel?.enabled, config);
11660
+ let orphanedWorkSentinel;
11661
+ try {
11662
+ const { OrphanedWorkSentinel } = await import('../monitoring/OrphanedWorkSentinel.js');
11663
+ const { makeOrphanedWorkSentinelDeps } = await import('../monitoring/orphanedWorkGit.js');
11664
+ orphanedWorkSentinel = new OrphanedWorkSentinel(makeOrphanedWorkSentinelDeps({
11665
+ instarRepo: config.projectDir,
11666
+ worktreesDir: _agentWorktreesDir,
11667
+ stateDir: path.join(config.stateDir, 'state'),
11668
+ raiseAttention: telegram
11669
+ ? (event) => {
11670
+ const slug = event.path.split('/').filter(Boolean).pop() ?? 'worktree';
11671
+ void telegram.createAttentionItem({
11672
+ id: `orphaned-work:${slug}:${event.workSig}`,
11673
+ title: `Stranded work in worktree "${slug}"`,
11674
+ summary: 'A build/session died with uncommitted changes — revive the worktree to finish, or discard.',
11675
+ description: `Worktree ${event.path} (branch ${event.branch ?? 'detached'}) has uncommitted changes ` +
11676
+ `but its owning session is gone. The work is still on disk` +
11677
+ `${event.preserved ? ' and a preservation patch was written' : ''}. ` +
11678
+ `Open the worktree to finish + commit, or discard if no longer needed.`,
11679
+ category: 'agent-health',
11680
+ priority: 'NORMAL',
11681
+ sourceContext: `orphaned-work:${slug}`,
11682
+ });
11683
+ }
11684
+ : () => { },
11685
+ now: () => Date.now(),
11686
+ }), { ...config.monitoring?.orphanedWorkSentinel, enabled: _orphanedWorkEnabled });
11687
+ orphanedWorkSentinel.start();
11688
+ if (_orphanedWorkEnabled) {
11689
+ console.log(pc.green(' OrphanedWorkSentinel enabled (silent-uncommitted-death backstop — signal-only)'));
11690
+ }
11691
+ }
11692
+ catch (e) {
11693
+ console.error(' OrphanedWorkSentinel wiring failed (non-fatal):', e instanceof Error ? e.message : String(e));
11694
+ }
11618
11695
  // ── McpProcessReaper (RESPONSIBLE-RESOURCE-USAGE — MCP-leak fix, Option B) ──
11619
11696
  // Reaps leaked MCP-server children (playwright-mcp / mcp-remote / instar
11620
11697
  // stdio) whose owning session is dead/stale or fully orphaned. Killing a
@@ -12150,7 +12227,7 @@ export async function startServer(options) {
12150
12227
  // WS1.1 capability advertisement (spec invariant 5): a bounded
12151
12228
  // fixed-size summary, never an inventory. Reported live each
12152
12229
  // heartbeat so a queue going dark withdraws the capability.
12153
- seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink },
12230
+ seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink, stateSyncReceive: selfStateSyncReceive() },
12154
12231
  // Durable Inbound Message Queue §5.1: depth + oldest + tenure +
12155
12232
  // bounded top-K — the survivor's loss-SUSPECTED item, capped
12156
12233
  // re-placement arm, and supersede-dedupe key all read these.
@@ -12189,6 +12266,46 @@ export async function startServer(options) {
12189
12266
  const poolTimer = setInterval(refreshPool, 30_000);
12190
12267
  if (typeof poolTimer.unref === 'function')
12191
12268
  poolTimer.unref();
12269
+ // Boot-time pool-flag-coherence check (multi-machine-replicated-store-
12270
+ // foundation §4). For each LOCALLY-ENABLED replicated store, surface
12271
+ // ONCE (coalesced — never per-peer-per-tick) any peer that does NOT
12272
+ // advertise the matching stateSyncReceive capability: that peer would
12273
+ // SILENTLY DROP our kind (the journal applier drops unknown kinds), the
12274
+ // NAMED data-loss skew mode. Correct for N peers — checkPoolFlagCoherence
12275
+ // iterates ALL advertising peers. With an EMPTY registry (the Step-2
12276
+ // substrate-only state) this is a strict no-op (no registered stores →
12277
+ // empty verdict → nothing surfaced). The first concrete store (WS2.1)
12278
+ // registers its kind and this check starts doing real work automatically.
12279
+ let stateSyncCoherenceSurfaced = false;
12280
+ const checkStateSyncCoherence = () => {
12281
+ if (stateSyncCoherenceSurfaced)
12282
+ return;
12283
+ if (replicatedKindRegistry.size === 0)
12284
+ return; // no concrete store yet
12285
+ const peers = machinePoolRegistry
12286
+ .getCapacities()
12287
+ .filter((c) => c.machineId !== poolSelfId)
12288
+ .map((c) => ({
12289
+ machineId: c.machineId,
12290
+ online: c.online,
12291
+ stateSyncReceive: c.seamlessnessFlags?.stateSyncReceive,
12292
+ }));
12293
+ const stores = config.multiMachine?.stateSync;
12294
+ const verdict = checkPoolFlagCoherence(replicatedKindRegistry, stores, peers);
12295
+ if (verdict.mixedStores.length > 0) {
12296
+ // Surface ONCE (coalesced): one log line listing every mixed store.
12297
+ // A richer surface (one Attention item) is the store PR's to add;
12298
+ // the substrate guarantees the single, deduped detection here.
12299
+ stateSyncCoherenceSurfaced = true;
12300
+ console.log(pc.yellow(` [stateSync] pool-flag-coherence — mixed flag state across ${verdict.mixedStores.length} store(s):`));
12301
+ for (const line of verdict.summary)
12302
+ console.log(pc.yellow(` • ${line}`));
12303
+ }
12304
+ };
12305
+ checkStateSyncCoherence();
12306
+ const coherenceTimer = setInterval(checkStateSyncCoherence, 60_000);
12307
+ if (typeof coherenceTimer.unref === 'function')
12308
+ coherenceTimer.unref();
12192
12309
  }
12193
12310
  }
12194
12311
  }
@@ -14462,7 +14579,7 @@ export async function startServer(options) {
14462
14579
  carrier: _topicProfileCarrier,
14463
14580
  }
14464
14581
  : null;
14465
- 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, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, 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, localSigningKeyPem, leaseTransport, 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, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? 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, poolLink: _poolLink ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
14582
+ 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, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, 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, localSigningKeyPem, leaseTransport, 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, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? 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, poolLink: _poolLink ?? 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, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
14466
14583
  // wired before the server existed; from here on inbound binds use the
14467
14584
  // server's own store instance.
14468
14585
  _agentServerRef = server;