instar 1.3.559 → 1.3.560

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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,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,CAg5btE;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"}
@@ -23,6 +23,7 @@ import { CodexResumeMap } from '../core/CodexResumeMap.js';
23
23
  import { paneIdleWithEmptyInput } from '../core/ModelSwapService.js';
24
24
  import { escalatedModelIds, normalizeTierEscalationConfig } from '../core/ModelTierEscalation.js';
25
25
  import { activeAutonomousJobs, autonomousRunRemainingForTopic } from '../core/AutonomousSessions.js';
26
+ import { AGE_LIMIT_ACTIVE_RUN_REASON } from '../core/WorkEvidence.js';
26
27
  import { TopicProfileTransferCarrier, createTopicProfilePullHandler } from '../core/TopicProfileTransferCarrier.js';
27
28
  import { closeAllSqlite } from '../core/SqliteRegistry.js';
28
29
  import { SessionManager } from '../core/SessionManager.js';
@@ -6197,7 +6198,13 @@ export async function startServer(options) {
6197
6198
  raiseAggregated: raiseResumeAggregated,
6198
6199
  }, {
6199
6200
  enabled: rqCfg.enabled ?? true,
6200
- dryRun: rqCfg.dryRun ?? true, // shipped observe-only (decision 2)
6201
+ // Live-on-dev (no-dark-on-dev directive, topic 13481): the queue ships
6202
+ // observe-only (dryRun:true) fleet-wide, but resolves to LIVE
6203
+ // (dryRun:false) on a development agent so the resume-idle-autonomous
6204
+ // fix is genuinely exercised on Echo. An explicit operator
6205
+ // monitoring.resumeQueue.dryRun still wins; the resume-queue keys stay
6206
+ // CODE-defaulted (never frozen into ConfigDefaults — preserves the fleet flip).
6207
+ dryRun: rqCfg.dryRun ?? !resolveDevAgentGate(undefined, config),
6201
6208
  maxAttempts: rqCfg.maxAttempts ?? 3,
6202
6209
  maxResurrections: rqCfg.maxResurrections ?? 2,
6203
6210
  entryTtlHours: rqCfg.entryTtlHours ?? 24,
@@ -6268,6 +6275,15 @@ export async function startServer(options) {
6268
6275
  catch { /* no flag */ }
6269
6276
  return Math.max(perTopic, globalOperatorStopAt, flagAt) > since;
6270
6277
  },
6278
+ // Resume-idle-autonomous fix (spec: resume-idle-autonomous-on-reap.md):
6279
+ // drain-time liveness re-check for an entry admitted via the
6280
+ // age-limit-active-run path. Returns true (= run FINISHED) when the topic's
6281
+ // autonomous run is no longer active (completed OR window elapsed) since
6282
+ // enqueue → the drainer invalidates `autonomous-run-finished`, never a
6283
+ // spawn. Reads the LOCAL autonomous-run state file (same vantage that
6284
+ // admitted the entry). A throw resolves to NOT-finished inside the drainer's
6285
+ // safeBool (SAFE side — the revival still passes the other reality gates).
6286
+ autonomousRunFinished: (topicId) => autonomousRunRemainingForTopic(config.stateDir, topicId) == null,
6271
6287
  jobCheck: (slug, queuedAtIso) => {
6272
6288
  if (!scheduler)
6273
6289
  return { ok: false, why: 'scheduler-unavailable' };
@@ -6381,7 +6397,7 @@ export async function startServer(options) {
6381
6397
  tier1Check: rqCfg.tier1Check ?? true,
6382
6398
  });
6383
6399
  resumeDrainer.start();
6384
- console.log(pc.green(` ResumeQueue started (${rqCfg.dryRun ?? true ? 'dry-run observe-only' : 'LIVE'}; drainer ${rqCfg.drainIntervalSec ?? 60}s tick)`));
6400
+ console.log(pc.green(` ResumeQueue started (${(rqCfg.dryRun ?? !resolveDevAgentGate(undefined, config)) ? 'dry-run observe-only' : 'LIVE'}; drainer ${rqCfg.drainIntervalSec ?? 60}s tick)`));
6385
6401
  // Boot reconciliation half 2 (R2.4): re-enqueue recent mid-work reaps
6386
6402
  // the queue lost to a crash window. Deferred 30s so the Telegram
6387
6403
  // adapter (topic resolution) exists; topic-bound candidates only —
@@ -6456,6 +6472,26 @@ export async function startServer(options) {
6456
6472
  const jobDef = e.session.jobSlug
6457
6473
  ? scheduler?.getJobs().find((j) => j.slug === e.session.jobSlug)
6458
6474
  : undefined;
6475
+ // Resume-idle-autonomous fix (spec: resume-idle-autonomous-on-reap.md):
6476
+ // an age-limit reap fires precisely when an autonomous session is IDLE
6477
+ // between turns, so its process-based work evidence is empty by
6478
+ // construction → it is never enqueued for revival, and an away-operator's
6479
+ // run sits dead until the next message. When the reaped topic still has an
6480
+ // ACTIVE autonomous run, the live run IS the work evidence: append the TRUE
6481
+ // `build-or-autonomous-active` strong signal (re-clamped by considerEnqueue)
6482
+ // and tag the reason so the drainer can re-verify liveness at drain time.
6483
+ // Guard ordering is load-bearing: the cold-path autonomousRunRemainingForTopic
6484
+ // read runs ONLY on the literal `age-limit` reason (every other reap pays
6485
+ // zero added cost), and the whole block sits inside the existing try/catch so
6486
+ // a throw fails toward NO injection (status-quo no-revive), never a spawn.
6487
+ let candidateReason = e.reason;
6488
+ let candidateWorkEvidence = e.workEvidence ?? [];
6489
+ if (e.reason === 'age-limit' &&
6490
+ topicId != null &&
6491
+ autonomousRunRemainingForTopic(config.stateDir, topicId) != null) {
6492
+ candidateReason = AGE_LIMIT_ACTIVE_RUN_REASON;
6493
+ candidateWorkEvidence = [...candidateWorkEvidence, 'build-or-autonomous-active'];
6494
+ }
6459
6495
  resumeQueue.considerEnqueue({
6460
6496
  sessionName: e.session.name,
6461
6497
  tmuxSession: e.session.tmuxSession,
@@ -6464,10 +6500,10 @@ export async function startServer(options) {
6464
6500
  jobResumeOptIn: jobDef?.resumeOnReap === true,
6465
6501
  resumeUuid: topicId != null ? (_topicResumeMap?.get(topicId) ?? null) : null,
6466
6502
  cwd: e.session.cwd ?? _projectDir,
6467
- reason: e.reason,
6503
+ reason: candidateReason,
6468
6504
  disposition: e.disposition ?? 'terminal',
6469
6505
  origin: e.origin ?? 'autonomous',
6470
- workEvidence: e.workEvidence ?? [],
6506
+ workEvidence: candidateWorkEvidence,
6471
6507
  });
6472
6508
  }
6473
6509
  }