instar 1.3.905 → 1.3.907

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 (101) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +140 -6
  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 +20 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/MessagingToneGate.d.ts.map +1 -1
  8. package/dist/core/MessagingToneGate.js +21 -0
  9. package/dist/core/MessagingToneGate.js.map +1 -1
  10. package/dist/core/PostUpdateMigrator.d.ts +22 -0
  11. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  12. package/dist/core/PostUpdateMigrator.js +70 -0
  13. package/dist/core/PostUpdateMigrator.js.map +1 -1
  14. package/dist/core/ProactiveSwapMonitor.d.ts +4 -0
  15. package/dist/core/ProactiveSwapMonitor.d.ts.map +1 -1
  16. package/dist/core/ProactiveSwapMonitor.js +17 -8
  17. package/dist/core/ProactiveSwapMonitor.js.map +1 -1
  18. package/dist/core/QuotaAwareScheduler.d.ts +3 -1
  19. package/dist/core/QuotaAwareScheduler.d.ts.map +1 -1
  20. package/dist/core/QuotaAwareScheduler.js +5 -4
  21. package/dist/core/QuotaAwareScheduler.js.map +1 -1
  22. package/dist/core/SessionManager.d.ts +19 -0
  23. package/dist/core/SessionManager.d.ts.map +1 -1
  24. package/dist/core/SessionManager.js +33 -0
  25. package/dist/core/SessionManager.js.map +1 -1
  26. package/dist/core/SessionPoolFailoverRunner.d.ts +94 -0
  27. package/dist/core/SessionPoolFailoverRunner.d.ts.map +1 -0
  28. package/dist/core/SessionPoolFailoverRunner.js +89 -0
  29. package/dist/core/SessionPoolFailoverRunner.js.map +1 -0
  30. package/dist/core/SessionPoolRolloutDriver.d.ts +74 -0
  31. package/dist/core/SessionPoolRolloutDriver.d.ts.map +1 -0
  32. package/dist/core/SessionPoolRolloutDriver.js +78 -0
  33. package/dist/core/SessionPoolRolloutDriver.js.map +1 -0
  34. package/dist/core/SessionRefresh.d.ts +3 -0
  35. package/dist/core/SessionRefresh.d.ts.map +1 -1
  36. package/dist/core/SessionRefresh.js +19 -0
  37. package/dist/core/SessionRefresh.js.map +1 -1
  38. package/dist/core/SwapAntiThrash.d.ts +1 -0
  39. package/dist/core/SwapAntiThrash.d.ts.map +1 -1
  40. package/dist/core/SwapAntiThrash.js +9 -5
  41. package/dist/core/SwapAntiThrash.js.map +1 -1
  42. package/dist/core/SwapLedger.d.ts +2 -0
  43. package/dist/core/SwapLedger.d.ts.map +1 -1
  44. package/dist/core/SwapLedger.js.map +1 -1
  45. package/dist/core/deferral-floor.d.ts +50 -0
  46. package/dist/core/deferral-floor.d.ts.map +1 -0
  47. package/dist/core/deferral-floor.js +169 -0
  48. package/dist/core/deferral-floor.js.map +1 -0
  49. package/dist/core/devGatedFeatures.d.ts.map +1 -1
  50. package/dist/core/devGatedFeatures.js +12 -0
  51. package/dist/core/devGatedFeatures.js.map +1 -1
  52. package/dist/core/sessionPoolFailoverCheck.d.ts +67 -0
  53. package/dist/core/sessionPoolFailoverCheck.d.ts.map +1 -0
  54. package/dist/core/sessionPoolFailoverCheck.js +57 -0
  55. package/dist/core/sessionPoolFailoverCheck.js.map +1 -0
  56. package/dist/core/types.d.ts +33 -0
  57. package/dist/core/types.d.ts.map +1 -1
  58. package/dist/core/types.js.map +1 -1
  59. package/dist/messaging/slack/SlackAdapter.d.ts +3 -0
  60. package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -1
  61. package/dist/messaging/slack/SlackAdapter.js +18 -0
  62. package/dist/messaging/slack/SlackAdapter.js.map +1 -1
  63. package/dist/monitoring/BlockerLifecycleService.d.ts.map +1 -1
  64. package/dist/monitoring/BlockerLifecycleService.js +11 -5
  65. package/dist/monitoring/BlockerLifecycleService.js.map +1 -1
  66. package/dist/monitoring/MissingLoginSessionDetector.d.ts +159 -0
  67. package/dist/monitoring/MissingLoginSessionDetector.d.ts.map +1 -0
  68. package/dist/monitoring/MissingLoginSessionDetector.js +166 -0
  69. package/dist/monitoring/MissingLoginSessionDetector.js.map +1 -0
  70. package/dist/monitoring/SingleMachineFailoverGapDetector.d.ts +144 -0
  71. package/dist/monitoring/SingleMachineFailoverGapDetector.d.ts.map +1 -0
  72. package/dist/monitoring/SingleMachineFailoverGapDetector.js +152 -0
  73. package/dist/monitoring/SingleMachineFailoverGapDetector.js.map +1 -0
  74. package/dist/monitoring/guardManifest.d.ts.map +1 -1
  75. package/dist/monitoring/guardManifest.js +40 -0
  76. package/dist/monitoring/guardManifest.js.map +1 -1
  77. package/dist/monitoring/missingLoginSessionWiring.d.ts +96 -0
  78. package/dist/monitoring/missingLoginSessionWiring.d.ts.map +1 -0
  79. package/dist/monitoring/missingLoginSessionWiring.js +97 -0
  80. package/dist/monitoring/missingLoginSessionWiring.js.map +1 -0
  81. package/dist/monitoring/singleMachineFailoverGapWiring.d.ts +56 -0
  82. package/dist/monitoring/singleMachineFailoverGapWiring.d.ts.map +1 -0
  83. package/dist/monitoring/singleMachineFailoverGapWiring.js +48 -0
  84. package/dist/monitoring/singleMachineFailoverGapWiring.js.map +1 -0
  85. package/dist/server/AgentServer.d.ts +2 -0
  86. package/dist/server/AgentServer.d.ts.map +1 -1
  87. package/dist/server/AgentServer.js +2 -0
  88. package/dist/server/AgentServer.js.map +1 -1
  89. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  90. package/dist/server/CapabilityIndex.js +30 -0
  91. package/dist/server/CapabilityIndex.js.map +1 -1
  92. package/dist/server/routes.d.ts +2 -0
  93. package/dist/server/routes.d.ts.map +1 -1
  94. package/dist/server/routes.js +41 -3
  95. package/dist/server/routes.js.map +1 -1
  96. package/package.json +1 -1
  97. package/src/data/builtin-manifest.json +65 -65
  98. package/upgrades/1.3.906.md +20 -0
  99. package/upgrades/1.3.907.md +30 -0
  100. package/upgrades/side-effects/proactive-default-account-swap.md +124 -0
  101. package/upgrades/side-effects/throughput-window-semantics.md +79 -0
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Subprocess failover check — the injectable `runFailoverCheck` for
3
+ * `SessionPoolFailoverRunner` that produces an HONEST green/red verdict by
4
+ * running the REAL two-node sessionPool failover E2E as a bounded subprocess.
5
+ *
6
+ * Why a subprocess (not an in-process re-implementation): the proven failover
7
+ * assertion already lives in `tests/e2e/sessionpool-failover-two-node.test.ts`
8
+ * (the merged #1551 E2E — real two servers, real ownership FSM, real force-claim
9
+ * takeover). Re-implementing it in-process risks a DIFFERENT, weaker check that
10
+ * could green a broken failover (the exact honesty-line risk the runner guards).
11
+ * Running the SAME vitest E2E as a bounded subprocess reuses that trusted
12
+ * assertion verbatim, so the recorded green means what CI's green means.
13
+ *
14
+ * ── Honesty mapping (load-bearing) ──
15
+ * The runner records green on a genuine pass, red on a genuine regression, and
16
+ * NOTHING on a throw. This check honours that three-way contract:
17
+ * ran to completion, exit 0 → { outcome: 'green' } (failover proven)
18
+ * ran to completion, exit non-zero → { outcome: 'red' } (real regression)
19
+ * did NOT run to completion → THROW (spawn error / timeout
20
+ * (or a null exit code) / harness couldn't run — NOT a failover
21
+ * verdict; the runner records nothing so a
22
+ * transient infra failure never masquerades
23
+ * as a red demotion or a green promotion).
24
+ *
25
+ * ── Scope note ──
26
+ * This check requires the instar SOURCE + a vitest runner on the executing
27
+ * machine (a dev / test-as-self context). A deployed agent with no source cannot
28
+ * use it; that agent needs the separate in-process check (a tracked follow-up).
29
+ * The process spawn itself is INJECTED (`runProcess`) so this module is pure and
30
+ * unit-tests with zero real subprocess.
31
+ */
32
+ import type { FailoverCheckResult } from './SessionPoolFailoverRunner.js';
33
+ /** The default E2E the check runs — the merged #1551 real two-node failover. */
34
+ export declare const DEFAULT_FAILOVER_E2E_PATH = "tests/e2e/sessionpool-failover-two-node.test.ts";
35
+ export declare const DEFAULT_FAILOVER_TIMEOUT_MS = 180000;
36
+ /** Result of the injected process runner. `ranToCompletion:false` = could not run. */
37
+ export interface SubprocessRunResult {
38
+ /** true iff the runner actually executed the suite to a verdict (exit code known). */
39
+ ranToCompletion: boolean;
40
+ /** The process exit code, or null when it did not run to completion. */
41
+ exitCode: number | null;
42
+ /** A durable, human-traceable pointer to this run (a log path / run id). */
43
+ evidenceRef: string;
44
+ }
45
+ export interface SubprocessFailoverCheckDeps {
46
+ /**
47
+ * Spawn the failover E2E and resolve once it finishes (or times out). MUST
48
+ * resolve — a spawn failure or timeout resolves with `ranToCompletion:false`,
49
+ * NOT a rejection, so the mapping below owns the honesty decision.
50
+ */
51
+ runProcess: (args: {
52
+ testPath: string;
53
+ timeoutMs: number;
54
+ }) => Promise<SubprocessRunResult>;
55
+ /** Which E2E to run (defaults to the merged two-node failover E2E). */
56
+ testPath?: string;
57
+ /** Bounded wall-clock budget for the subprocess. */
58
+ timeoutMs?: number;
59
+ }
60
+ /**
61
+ * Build the injectable `runFailoverCheck` for `SessionPoolFailoverRunner`. It
62
+ * runs the real failover E2E as a bounded subprocess and maps the outcome per the
63
+ * honesty contract above (throws when the check could not run, so the runner
64
+ * records nothing).
65
+ */
66
+ export declare function makeSubprocessFailoverCheck(deps: SubprocessFailoverCheckDeps): () => Promise<FailoverCheckResult>;
67
+ //# sourceMappingURL=sessionPoolFailoverCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionPoolFailoverCheck.d.ts","sourceRoot":"","sources":["../../src/core/sessionPoolFailoverCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,gFAAgF;AAChF,eAAO,MAAM,yBAAyB,oDAAoD,CAAC;AAC3F,eAAO,MAAM,2BAA2B,SAAU,CAAC;AAEnD,sFAAsF;AACtF,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,eAAe,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5F,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,2BAA2B,GAChC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAiBpC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Subprocess failover check — the injectable `runFailoverCheck` for
3
+ * `SessionPoolFailoverRunner` that produces an HONEST green/red verdict by
4
+ * running the REAL two-node sessionPool failover E2E as a bounded subprocess.
5
+ *
6
+ * Why a subprocess (not an in-process re-implementation): the proven failover
7
+ * assertion already lives in `tests/e2e/sessionpool-failover-two-node.test.ts`
8
+ * (the merged #1551 E2E — real two servers, real ownership FSM, real force-claim
9
+ * takeover). Re-implementing it in-process risks a DIFFERENT, weaker check that
10
+ * could green a broken failover (the exact honesty-line risk the runner guards).
11
+ * Running the SAME vitest E2E as a bounded subprocess reuses that trusted
12
+ * assertion verbatim, so the recorded green means what CI's green means.
13
+ *
14
+ * ── Honesty mapping (load-bearing) ──
15
+ * The runner records green on a genuine pass, red on a genuine regression, and
16
+ * NOTHING on a throw. This check honours that three-way contract:
17
+ * ran to completion, exit 0 → { outcome: 'green' } (failover proven)
18
+ * ran to completion, exit non-zero → { outcome: 'red' } (real regression)
19
+ * did NOT run to completion → THROW (spawn error / timeout
20
+ * (or a null exit code) / harness couldn't run — NOT a failover
21
+ * verdict; the runner records nothing so a
22
+ * transient infra failure never masquerades
23
+ * as a red demotion or a green promotion).
24
+ *
25
+ * ── Scope note ──
26
+ * This check requires the instar SOURCE + a vitest runner on the executing
27
+ * machine (a dev / test-as-self context). A deployed agent with no source cannot
28
+ * use it; that agent needs the separate in-process check (a tracked follow-up).
29
+ * The process spawn itself is INJECTED (`runProcess`) so this module is pure and
30
+ * unit-tests with zero real subprocess.
31
+ */
32
+ /** The default E2E the check runs — the merged #1551 real two-node failover. */
33
+ export const DEFAULT_FAILOVER_E2E_PATH = 'tests/e2e/sessionpool-failover-two-node.test.ts';
34
+ export const DEFAULT_FAILOVER_TIMEOUT_MS = 180_000;
35
+ /**
36
+ * Build the injectable `runFailoverCheck` for `SessionPoolFailoverRunner`. It
37
+ * runs the real failover E2E as a bounded subprocess and maps the outcome per the
38
+ * honesty contract above (throws when the check could not run, so the runner
39
+ * records nothing).
40
+ */
41
+ export function makeSubprocessFailoverCheck(deps) {
42
+ const testPath = deps.testPath ?? DEFAULT_FAILOVER_E2E_PATH;
43
+ const timeoutMs = deps.timeoutMs ?? DEFAULT_FAILOVER_TIMEOUT_MS;
44
+ return async () => {
45
+ const r = await deps.runProcess({ testPath, timeoutMs });
46
+ if (!r.ranToCompletion || r.exitCode === null) {
47
+ // Could not run to a verdict → NOT a failover result. Throw so the runner
48
+ // records nothing (never a fabricated green promotion or red demotion).
49
+ throw new Error(`sessionPool failover check did not run to completion (evidence: ${r.evidenceRef})`);
50
+ }
51
+ return {
52
+ outcome: r.exitCode === 0 ? 'green' : 'red',
53
+ evidenceRef: r.evidenceRef,
54
+ };
55
+ };
56
+ }
57
+ //# sourceMappingURL=sessionPoolFailoverCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionPoolFailoverCheck.js","sourceRoot":"","sources":["../../src/core/sessionPoolFailoverCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,gFAAgF;AAChF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iDAAiD,CAAC;AAC3F,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AAyBnD;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,IAAiC;IAEjC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,yBAAyB,CAAC;IAC5D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,2BAA2B,CAAC;IAChE,OAAO,KAAK,IAAkC,EAAE;QAC9C,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC9C,0EAA0E;YAC1E,wEAAwE;YACxE,MAAM,IAAI,KAAK,CACb,mEAAmE,CAAC,CAAC,WAAW,GAAG,CACpF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;YAC3C,WAAW,EAAE,CAAC,CAAC,WAAW;SAC3B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -5921,6 +5921,39 @@ export interface MonitoringConfig {
5921
5921
  * Registered in DEV_GATED_FEATURES; GET /external-hog. Machine-local by design
5922
5922
  * (hardware-bound-resource — a host OS process is bound to one kernel).
5923
5923
  */
5924
+ /**
5925
+ * SingleMachineFailoverGapDetector (increment 2) — a pure SIGNAL-only guard that
5926
+ * surfaces the "no failover target for active autonomous work" gap BEFORE it bites
5927
+ * (the 2026-07-22 Codey overnight loss): single-machine (no online mesh peer) WHILE
5928
+ * active autonomous runs → ONE deduped HIGH attention item. Never blocks, provisions,
5929
+ * or kills. `enabled` is OMITTED so the runtime resolves it through the
5930
+ * developmentAgent dark-feature gate (resolveDevAgentGate): LIVE on a dev agent, DARK
5931
+ * on the fleet. `dryRun: true` is the graduated-rollout first rung — it computes +
5932
+ * counts would-raise but raises NOTHING until a deliberate dryRun:false flip.
5933
+ * Registered in DEV_GATED_FEATURES; GET /pool/failover-gap.
5934
+ */
5935
+ singleMachineFailoverGap?: {
5936
+ enabled?: boolean;
5937
+ dryRun?: boolean;
5938
+ };
5939
+ /**
5940
+ * MissingLoginSessionDetector (increment 2) — a pure SIGNAL-only guard that
5941
+ * surfaces the "a live session is running on an account whose local login has
5942
+ * gone missing" gap BEFORE the session walls silently (the 2026-07-22 justin-gmail
5943
+ * silent auth-death): a running session bound to an account the subscription pool
5944
+ * flagged `identityDrift.repairState === 'owner-relogin-required'` /
5945
+ * `actualAccountId === 'missing-local-login'` → ONE deduped HIGH attention item.
5946
+ * Never swaps, re-logins, or touches a session. `enabled` is OMITTED so the
5947
+ * runtime resolves it through the developmentAgent dark-feature gate
5948
+ * (resolveDevAgentGate): LIVE on a dev agent, DARK on the fleet. `dryRun: true`
5949
+ * is the graduated-rollout first rung — it computes + counts would-raise but
5950
+ * raises NOTHING until a deliberate dryRun:false flip. Registered in
5951
+ * DEV_GATED_FEATURES; GET /pool/missing-login.
5952
+ */
5953
+ missingLoginSession?: {
5954
+ enabled?: boolean;
5955
+ dryRun?: boolean;
5956
+ };
5924
5957
  externalHogSentinel?: {
5925
5958
  enabled?: boolean;
5926
5959
  dryRun?: boolean;