instar 1.3.658 → 1.3.659

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 (31) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +52 -0
  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 +14 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/SessionOwnershipRegistry.d.ts +14 -0
  8. package/dist/core/SessionOwnershipRegistry.d.ts.map +1 -1
  9. package/dist/core/SessionOwnershipRegistry.js +9 -0
  10. package/dist/core/SessionOwnershipRegistry.js.map +1 -1
  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/types.d.ts +22 -0
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/core/types.js.map +1 -1
  17. package/dist/monitoring/StrandedTopicSentinel.d.ts +102 -0
  18. package/dist/monitoring/StrandedTopicSentinel.d.ts.map +1 -0
  19. package/dist/monitoring/StrandedTopicSentinel.js +216 -0
  20. package/dist/monitoring/StrandedTopicSentinel.js.map +1 -0
  21. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  22. package/dist/monitoring/guardManifest.js +17 -0
  23. package/dist/monitoring/guardManifest.js.map +1 -1
  24. package/dist/monitoring/strandedTopicDecision.d.ts +96 -0
  25. package/dist/monitoring/strandedTopicDecision.d.ts.map +1 -0
  26. package/dist/monitoring/strandedTopicDecision.js +160 -0
  27. package/dist/monitoring/strandedTopicDecision.js.map +1 -0
  28. package/package.json +1 -1
  29. package/src/data/builtin-manifest.json +2 -2
  30. package/upgrades/1.3.659.md +29 -0
  31. package/upgrades/side-effects/stranded-inbound-self-heal.md +80 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":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A8B,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,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA67gBtE;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"}
@@ -18034,6 +18034,58 @@ export async function startServer(options) {
18034
18034
  carrier: _topicProfileCarrier,
18035
18035
  }
18036
18036
  : null;
18037
+ // ── StrandedTopicSentinel (stranded-inbound-self-heal) — PURE SIGNAL ──────
18038
+ // Detects a topic whose owner machine is online-by-heartbeat but unable to
18039
+ // serve (quota-walled or adapter-disconnected) while a healthy machine holds
18040
+ // the lease, so inbound is silently dead for that topic. Raises ONE
18041
+ // aggregated agent-health attention item per (owner-machine, stranding
18042
+ // window); MUTATES NOTHING (no ownership CAS, no pin write, no session kill).
18043
+ // developmentAgent dark-feature gate: LIVE on a dev agent, DARK on the fleet.
18044
+ // Lease-holder is the sole actor; single-machine = strict no-op. GET /guards.
18045
+ // Wired here (late) because it depends on machinePoolRegistry +
18046
+ // sessionOwnershipRegistry + _meshSelfId, all assigned during pool boot.
18047
+ const _strandedEnabled = resolveDevAgentGate(config.monitoring?.strandedTopicSentinel?.enabled, config);
18048
+ if (_strandedEnabled && machinePoolRegistry && sessionOwnershipRegistry) {
18049
+ try {
18050
+ const { StrandedTopicSentinel } = await import('../monitoring/StrandedTopicSentinel.js');
18051
+ const _ownReg = sessionOwnershipRegistry;
18052
+ const _poolReg = machinePoolRegistry;
18053
+ const _nickById = (id) => (_listPoolMachines?.() ?? []).find((m) => m.machineId === id)?.nickname ?? id;
18054
+ const strandedSentinel = new StrandedTopicSentinel({
18055
+ listOwnershipRecords: () => _ownReg.all(),
18056
+ listCapacities: () => _poolReg.getCapacities(),
18057
+ selfMachineId: () => _meshSelfId,
18058
+ holdsLease: () => (leaseCoordinatorRef ? leaseCoordinatorRef.holdsLease() : coordinator.holdsLease()),
18059
+ raiseAttention: (item) => {
18060
+ if (!telegram)
18061
+ return;
18062
+ void telegram.createAttentionItem({
18063
+ id: item.id,
18064
+ title: item.title,
18065
+ summary: item.summary,
18066
+ description: item.description,
18067
+ category: item.category,
18068
+ priority: item.priority,
18069
+ sourceContext: item.sourceContext,
18070
+ lane: item.lane,
18071
+ healthKey: item.healthKey,
18072
+ });
18073
+ },
18074
+ nicknameOf: _nickById,
18075
+ now: () => Date.now(),
18076
+ }, { ...config.monitoring?.strandedTopicSentinel, enabled: _strandedEnabled });
18077
+ strandedSentinel.start();
18078
+ guardRegistry.register('monitoring.strandedTopicSentinel.enabled', () => strandedSentinel.guardStatus());
18079
+ console.log(pc.green(' StrandedTopicSentinel enabled (online-but-unable-to-serve detector — pure signal)'));
18080
+ }
18081
+ catch (e) {
18082
+ // @silent-fallback-ok — optional dev-gated, pure-signal feature: a wiring
18083
+ // failure is logged (console.error, NOT silent) and is non-fatal BY DESIGN
18084
+ // — the monitoring sentinel must never crash server boot. Nothing to
18085
+ // degrade-report or fall back to; the server runs without the detector.
18086
+ console.error(' StrandedTopicSentinel wiring failed (non-fatal):', e instanceof Error ? e.message : String(e));
18087
+ }
18088
+ }
18037
18089
  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) {
18038
18090
  peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
18039
18091
  } if (peers.length === 0)