instar 1.3.800 → 1.3.801

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 (78) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +63 -1
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/BackupManager.d.ts.map +1 -1
  5. package/dist/core/BackupManager.js +8 -0
  6. package/dist/core/BackupManager.js.map +1 -1
  7. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  8. package/dist/core/PostUpdateMigrator.js +18 -0
  9. package/dist/core/PostUpdateMigrator.js.map +1 -1
  10. package/dist/core/ProactiveSwapMonitor.d.ts +10 -0
  11. package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
  12. package/dist/core/ProactiveSwapMonitor.js +39 -0
  13. package/dist/core/ProactiveSwapMonitor.js.map +1 -1
  14. package/dist/core/SessionManager.d.ts +5 -0
  15. package/dist/core/SessionManager.d.ts.map +1 -1
  16. package/dist/core/SessionManager.js +28 -0
  17. package/dist/core/SessionManager.js.map +1 -1
  18. package/dist/core/machineCoherenceManifest.d.ts +10 -0
  19. package/dist/core/machineCoherenceManifest.d.ts.map +1 -1
  20. package/dist/core/machineCoherenceManifest.js +58 -0
  21. package/dist/core/machineCoherenceManifest.js.map +1 -1
  22. package/dist/core/types.d.ts +31 -0
  23. package/dist/core/types.d.ts.map +1 -1
  24. package/dist/core/types.js.map +1 -1
  25. package/dist/monitoring/ExternalHogScanTick.d.ts +9 -0
  26. package/dist/monitoring/ExternalHogScanTick.d.ts.map +1 -1
  27. package/dist/monitoring/ExternalHogScanTick.js +29 -0
  28. package/dist/monitoring/ExternalHogScanTick.js.map +1 -1
  29. package/dist/monitoring/PromiseBeacon.d.ts +6 -0
  30. package/dist/monitoring/PromiseBeacon.d.ts.map +1 -1
  31. package/dist/monitoring/PromiseBeacon.js +42 -6
  32. package/dist/monitoring/PromiseBeacon.js.map +1 -1
  33. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  34. package/dist/monitoring/guardManifest.js +31 -0
  35. package/dist/monitoring/guardManifest.js.map +1 -1
  36. package/dist/monitoring/guardPosture.d.ts.map +1 -1
  37. package/dist/monitoring/guardPosture.js +22 -0
  38. package/dist/monitoring/guardPosture.js.map +1 -1
  39. package/dist/monitoring/selfaction/anchor.d.ts +82 -0
  40. package/dist/monitoring/selfaction/anchor.d.ts.map +1 -0
  41. package/dist/monitoring/selfaction/anchor.js +113 -0
  42. package/dist/monitoring/selfaction/anchor.js.map +1 -0
  43. package/dist/monitoring/selfaction/governor.d.ts +242 -0
  44. package/dist/monitoring/selfaction/governor.d.ts.map +1 -0
  45. package/dist/monitoring/selfaction/governor.js +1475 -0
  46. package/dist/monitoring/selfaction/governor.js.map +1 -0
  47. package/dist/monitoring/selfaction/policies.d.ts +86 -0
  48. package/dist/monitoring/selfaction/policies.d.ts.map +1 -0
  49. package/dist/monitoring/selfaction/policies.js +339 -0
  50. package/dist/monitoring/selfaction/policies.js.map +1 -0
  51. package/dist/monitoring/selfaction/types.d.ts +208 -0
  52. package/dist/monitoring/selfaction/types.d.ts.map +1 -0
  53. package/dist/monitoring/selfaction/types.js +11 -0
  54. package/dist/monitoring/selfaction/types.js.map +1 -0
  55. package/dist/scaffold/templates.d.ts.map +1 -1
  56. package/dist/scaffold/templates.js +6 -0
  57. package/dist/scaffold/templates.js.map +1 -1
  58. package/dist/server/AgentServer.d.ts.map +1 -1
  59. package/dist/server/AgentServer.js +6 -0
  60. package/dist/server/AgentServer.js.map +1 -1
  61. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  62. package/dist/server/CapabilityIndex.js +9 -0
  63. package/dist/server/CapabilityIndex.js.map +1 -1
  64. package/dist/server/routes.d.ts +4 -0
  65. package/dist/server/routes.d.ts.map +1 -1
  66. package/dist/server/routes.js +186 -0
  67. package/dist/server/routes.js.map +1 -1
  68. package/dist/testing/selfActionRegistry.d.ts +16 -0
  69. package/dist/testing/selfActionRegistry.d.ts.map +1 -1
  70. package/dist/testing/selfActionRegistry.js +16 -0
  71. package/dist/testing/selfActionRegistry.js.map +1 -1
  72. package/package.json +2 -2
  73. package/scripts/lint-emit-without-admit.js +303 -0
  74. package/src/data/builtin-manifest.json +66 -66
  75. package/src/data/state-coherence-registry.json +1296 -1241
  76. package/src/scaffold/templates.ts +6 -0
  77. package/upgrades/1.3.801.md +38 -0
  78. package/upgrades/side-effects/self-action-governor.md +111 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwDH,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,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,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;AAgmDD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,oBAAoB,GAAG,IAAI,GACxC;IACD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,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AAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -16745,6 +16745,60 @@ export async function startServer(options) {
16745
16745
  });
16746
16746
  }
16747
16747
  // ── OrphanedWorkSentinel (the silent-uncommitted-death backstop) ──────────
16748
+ // ── SelfActionGovernor (unified-self-action-backpressure Increment B) ──
16749
+ // ONE in-process admission chokepoint every registered self-triggered
16750
+ // action rides (age-kill, external-hog kill, proactive swap, beacon
16751
+ // notify/liveness). Ships OBSERVE-ONLY on every class, fleet-wide (FD1):
16752
+ // admit() records would-deny verdicts and always allows; the per-class
16753
+ // enforce flip is the operator's later action. INIT-ONCE process-global
16754
+ // anchor; emergencyDisable is read LIVE (PATCH /config applies with no
16755
+ // restart). Construction is guarded — a failure leaves the module-level
16756
+ // governor uninitialized (disabled-passthrough admits), never a dead boot.
16757
+ let _selfActionGovernor;
16758
+ try {
16759
+ const { initSelfActionGovernor } = await import('../monitoring/selfaction/governor.js');
16760
+ _selfActionGovernor = initSelfActionGovernor({
16761
+ stateDir: config.stateDir,
16762
+ readEmergencyDisable: () => liveConfig.get('intelligence.selfActionGovernor.emergencyDisable', config.intelligence?.selfActionGovernor?.emergencyDisable ?? false) === true,
16763
+ readClassesConfig: () => liveConfig.get('intelligence.selfActionGovernor.classes', (config.intelligence?.selfActionGovernor?.classes ?? undefined)),
16764
+ // Census discipline (spec SC6-1): governor-owned, sampled OFF the hot
16765
+ // path (the governor's own slow tick), INDEPENDENT of any governed
16766
+ // controller's candidate enumeration — the STATE-store read, never the
16767
+ // reaper's own listRunningSessions.
16768
+ readCensus: () => ({
16769
+ value: state.listSessions({ status: 'running' }).length,
16770
+ asOf: Date.now(),
16771
+ confidence: 'high',
16772
+ }),
16773
+ configuredSessionCap: () => config.sessions?.maxSessions,
16774
+ // FD9 level gate input: the REGISTERED machine count (not online peers).
16775
+ registeredMachineCount: () => Math.max(1, machinePoolRegistry?.getCapacities().length ?? 1),
16776
+ emitAttention: (item) => {
16777
+ void telegram?.createAttentionItem({
16778
+ id: item.id,
16779
+ title: item.title,
16780
+ summary: item.body.slice(0, 160),
16781
+ description: item.body,
16782
+ category: 'self-action-governor',
16783
+ priority: item.priority,
16784
+ sourceContext: item.sourceContext,
16785
+ });
16786
+ },
16787
+ });
16788
+ guardRegistry.register('intelligence.selfActionGovernor.enabled', () => _selfActionGovernor.guardRuntimeStatus());
16789
+ console.log(pc.dim(' SelfActionGovernor initialized (observe-only — unified self-action backpressure)'));
16790
+ }
16791
+ catch (err) {
16792
+ console.error('[self-action-governor] init failed (admits pass through this boot):', err instanceof Error ? err.message : String(err));
16793
+ _selfActionGovernor = undefined;
16794
+ DegradationReporter.getInstance().report({
16795
+ feature: 'SelfActionGovernor',
16796
+ primary: 'self-action admission chokepoint (observe-only would-deny measurement)',
16797
+ fallback: 'governor uninitialized for this boot — every admit resolves disabled-passthrough (allow)',
16798
+ reason: `init failed: ${err instanceof Error ? err.message : String(err)}`,
16799
+ impact: 'Self-action would-deny telemetry is not collected this boot; the retrofitted emit paths behave exactly as before (observe mode never blocks anyway).',
16800
+ });
16801
+ }
16748
16802
  // Detects agent worktrees with uncommitted work whose owning session is dead
16749
16803
  // + settled, records them durably, and raises ONE deduped agent-health notice
16750
16804
  // — the case the PromiseBeacon escalation ladder can't see (nothing registered
@@ -17506,7 +17560,15 @@ export async function startServer(options) {
17506
17560
  ...(() => {
17507
17561
  try {
17508
17562
  return {
17509
- coherenceAdvert: buildCoherenceAdvert({ boot: config, liveGet: (path, fallback) => liveConfig.get(path, fallback) }, { instarVersion: ProcessIntegrity.getInstance()?.runningVersion ?? 'unknown', beatSeq: _coherenceBeatSeq++ }),
17563
+ coherenceAdvert: buildCoherenceAdvert({
17564
+ boot: config,
17565
+ liveGet: (path, fallback) => liveConfig.get(path, fallback),
17566
+ // unified-self-action-backpressure INT7-1: the mode
17567
+ // rows read `demoted` from governor RUNTIME state —
17568
+ // a config-only read would advertise `enforce` on a
17569
+ // runtime-demoted machine and defeat the skew alarm.
17570
+ governorClassMode: (controllerId) => _selfActionGovernor?.getClassMode(controllerId) ?? 'observe',
17571
+ }, { instarVersion: ProcessIntegrity.getInstance()?.runningVersion ?? 'unknown', beatSeq: _coherenceBeatSeq++ }),
17510
17572
  };
17511
17573
  }
17512
17574
  catch {