instar 1.3.557 → 1.3.559

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.
@@ -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;AAiH7D,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;AAy3CD,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,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AE,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,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA02btE;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"}
@@ -22,7 +22,7 @@ import { TopicProfileOrchestrator, resolvedToApplied, } from '../core/TopicProfi
22
22
  import { CodexResumeMap } from '../core/CodexResumeMap.js';
23
23
  import { paneIdleWithEmptyInput } from '../core/ModelSwapService.js';
24
24
  import { escalatedModelIds, normalizeTierEscalationConfig } from '../core/ModelTierEscalation.js';
25
- import { activeAutonomousJobs } from '../core/AutonomousSessions.js';
25
+ import { activeAutonomousJobs, autonomousRunRemainingForTopic } from '../core/AutonomousSessions.js';
26
26
  import { TopicProfileTransferCarrier, createTopicProfilePullHandler } from '../core/TopicProfileTransferCarrier.js';
27
27
  import { closeAllSqlite } from '../core/SqliteRegistry.js';
28
28
  import { SessionManager } from '../core/SessionManager.js';
@@ -5038,7 +5038,12 @@ export async function startServer(options) {
5038
5038
  // best-effort (the refusal itself is the load-bearing safety).
5039
5039
  const telegramForRoleGuard = telegram; // const-narrow for the closure
5040
5040
  scheduler.setRoleGuard(() => ({
5041
- enabled: config.multiMachine?.seamlessness?.ws43RoleGuard === true,
5041
+ // DEV-AGENT DARK GATE (operator directive 2026-06-13, topic 13481):
5042
+ // read ws43RoleGuard through resolveDevAgentGate so it resolves LIVE on
5043
+ // a dev agent / DARK on the fleet. The guard can only ever REFUSE a
5044
+ // spawn (never wrongly spawn — the safe direction); single-machine
5045
+ // agents always hold the lease, so it never fires there even live.
5046
+ enabled: resolveDevAgentGate(config.multiMachine?.seamlessness?.ws43RoleGuard, config),
5042
5047
  holdsLease: coordinator.holdsLease(),
5043
5048
  }), (slug, machineId) => {
5044
5049
  void telegramForRoleGuard.createAttentionItem({
@@ -6044,6 +6049,24 @@ export async function startServer(options) {
6044
6049
  quietHoursEndAt: (now) => notificationBatcher.quietHoursEndAt(now),
6045
6050
  summaryReleaseAt: (now) => notificationBatcher.nextSummaryReleaseAt(now),
6046
6051
  resumeQueuedFor: (tmuxSession) => resumeQueuedForSession(tmuxSession),
6052
+ // Honest-recycle (honest-session-recycle-spec): tell ReapNotifier whether
6053
+ // this session's topic has an ACTIVE autonomous run (and how long is left),
6054
+ // so an age-limit RECYCLE of a still-active run reads as a continuation
6055
+ // instead of a "reached its maximum allowed runtime" death. Read here at
6056
+ // the wiring layer (which has the autonomous state) — SessionManager's kill
6057
+ // chokepoint is untouched. Returns null ⇒ legacy death copy (safe default).
6058
+ autonomousRunActiveFor: (tmuxSession) => {
6059
+ try {
6060
+ const t = telegram?.getTopicForSession(tmuxSession);
6061
+ if (t == null)
6062
+ return null;
6063
+ return autonomousRunRemainingForTopic(config.stateDir, t);
6064
+ }
6065
+ catch {
6066
+ // Fail toward the legacy death copy — never silence the notice.
6067
+ return null;
6068
+ }
6069
+ },
6047
6070
  reportDegradation: (reason, impact) => {
6048
6071
  try {
6049
6072
  DegradationReporter.getInstance().report({
@@ -9070,7 +9093,12 @@ export async function startServer(options) {
9070
9093
  const { SpeakerElection } = await import('../monitoring/SpeakerElection.js');
9071
9094
  const ws3Cfg = () => (config.multiMachine?.seamlessness ?? {});
9072
9095
  const speakerElection = new SpeakerElection({
9073
- enabled: () => ws3Cfg().ws3OneVoice === true,
9096
+ // DEV-AGENT DARK GATE (operator directive 2026-06-13, topic 13481): read
9097
+ // ws3OneVoice through resolveDevAgentGate so it resolves LIVE on a dev agent
9098
+ // (config OMITS it → undefined → !!developmentAgent) and DARK on the fleet.
9099
+ // An explicit config value still wins. Single-machine is a no-op regardless
9100
+ // (the election never engages below 2 online machines).
9101
+ enabled: () => resolveDevAgentGate(ws3Cfg().ws3OneVoice, config),
9074
9102
  currentMachineId: (() => {
9075
9103
  // @silent-fallback-ok — no machine identity = the election's legacy-no-machine-id
9076
9104
  // verdict (always speak): the designed single-machine degradation, not a loss.
@@ -13025,8 +13053,18 @@ export async function startServer(options) {
13025
13053
  });
13026
13054
  const registryForCutover = machinePoolRegistry;
13027
13055
  scheduler.setJournalLeaseCutover(leaseStore, () => ({
13028
- enabled: config.multiMachine?.seamlessness?.ws43JournalLease === true,
13029
- dryRun: config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun !== false,
13056
+ // DEV-AGENT DARK GATE (operator directive 2026-06-13, topic 13481):
13057
+ // read ws43JournalLease through resolveDevAgentGate → LIVE on a dev
13058
+ // agent / DARK on the fleet (config OMITS both flags). ws43JournalLease
13059
+ // DryRun resolves COHERENTLY: on a dev agent the cutover goes genuinely
13060
+ // live (dryRun → false) so the journal-lease path is actually exercised,
13061
+ // not just logged; on the fleet it resolves to the safe dry-run default
13062
+ // (true). An explicit config value still wins on either flag. A genuine
13063
+ // live cutover only engages when the flag resolves live AND the pool is
13064
+ // flag-coherent (≥2 machines all advertising not-dry-run), so a
13065
+ // single-machine dev agent never half-migrates.
13066
+ enabled: resolveDevAgentGate(config.multiMachine?.seamlessness?.ws43JournalLease, config),
13067
+ dryRun: config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun ?? !resolveDevAgentGate(undefined, config),
13030
13068
  epoch: coordinator.getLeaseEpoch(),
13031
13069
  peers: registryForCutover
13032
13070
  .getCapacities()
@@ -13126,7 +13164,7 @@ export async function startServer(options) {
13126
13164
  // WS1.1 capability advertisement (spec invariant 5): a bounded
13127
13165
  // fixed-size summary, never an inventory. Reported live each
13128
13166
  // heartbeat so a queue going dark withdraws the capability.
13129
- seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink, ws44PoolCache: !!_poolPollCache, ws43JournalLease: config.multiMachine?.seamlessness?.ws43JournalLease === true && config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun !== true, stateSyncReceive: selfStateSyncReceive() },
13167
+ seamlessnessFlags: { ws11DeliverReceive: !!_inboundQueue, ws12DrainReceive: !!_drainRunner, ws44PoolLinks: !!_poolLink, ws44PoolCache: !!_poolPollCache, ws43JournalLease: resolveDevAgentGate(config.multiMachine?.seamlessness?.ws43JournalLease, config) && (config.multiMachine?.seamlessness?.ws43JournalLeaseDryRun ?? !resolveDevAgentGate(undefined, config)) !== true, stateSyncReceive: selfStateSyncReceive() },
13130
13168
  // Durable Inbound Message Queue §5.1: depth + oldest + tenure +
13131
13169
  // bounded top-K — the survivor's loss-SUSPECTED item, capped
13132
13170
  // re-placement arm, and supersede-dedupe key all read these.
@@ -13427,7 +13465,14 @@ export async function startServer(options) {
13427
13465
  const ws13Cfg = () => (config.multiMachine?.seamlessness ?? {});
13428
13466
  const { OwnershipReconciler } = await import('../core/OwnershipReconciler.js');
13429
13467
  const reconciler = new OwnershipReconciler({
13430
- enabled: () => ws13Cfg().ws13Reconcile === true,
13468
+ // DEV-AGENT DARK GATE (operator directive 2026-06-13, topic 13481):
13469
+ // read ws13Reconcile through resolveDevAgentGate so the reconcile loop
13470
+ // resolves LIVE on a dev agent / DARK on the fleet. ws13DryRun STAYS a
13471
+ // plain config read (the in-component "log intended CAS without
13472
+ // performing it" rung — NOT the dev-gate); so on a dev agent the loop
13473
+ // runs live but in dry-run (no destructive CAS), exactly as the rollout
13474
+ // ladder intends. Strict single-machine no-op inside the module.
13475
+ enabled: () => resolveDevAgentGate(ws13Cfg().ws13Reconcile, config),
13431
13476
  dryRun: () => ws13Cfg().ws13DryRun !== false,
13432
13477
  selfMachineId: _meshSelfId,
13433
13478
  pinStore: _topicPinStore,