instar 1.3.1202 → 1.3.1204

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 (38) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +55 -9
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/CredentialLocationLedger.d.ts.map +1 -1
  5. package/dist/core/CredentialLocationLedger.js +3 -2
  6. package/dist/core/CredentialLocationLedger.js.map +1 -1
  7. package/dist/core/InUseAccountResolver.d.ts +84 -2
  8. package/dist/core/InUseAccountResolver.d.ts.map +1 -1
  9. package/dist/core/InUseAccountResolver.js +85 -12
  10. package/dist/core/InUseAccountResolver.js.map +1 -1
  11. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  12. package/dist/core/PostUpdateMigrator.js +7 -0
  13. package/dist/core/PostUpdateMigrator.js.map +1 -1
  14. package/dist/data/standards-guard-index.json +1 -1
  15. package/dist/data/standards-guard-index.meta.json +2 -2
  16. package/dist/data/standards-registry.meta.json +1 -1
  17. package/dist/monitoring/AutonomousLivenessReconciler.d.ts +12 -1
  18. package/dist/monitoring/AutonomousLivenessReconciler.d.ts.map +1 -1
  19. package/dist/monitoring/AutonomousLivenessReconciler.js +79 -3
  20. package/dist/monitoring/AutonomousLivenessReconciler.js.map +1 -1
  21. package/dist/monitoring/AutonomousThroughputFloor.d.ts +8 -0
  22. package/dist/monitoring/AutonomousThroughputFloor.d.ts.map +1 -1
  23. package/dist/monitoring/AutonomousThroughputFloor.js +17 -3
  24. package/dist/monitoring/AutonomousThroughputFloor.js.map +1 -1
  25. package/dist/scaffold/templates.d.ts.map +1 -1
  26. package/dist/scaffold/templates.js +3 -1
  27. package/dist/scaffold/templates.js.map +1 -1
  28. package/package.json +1 -1
  29. package/skills/spec-converge/scripts/cross-model-review.mjs +9 -1
  30. package/src/data/builtin-manifest.json +19 -19
  31. package/src/data/standards-guard-index.json +1 -1
  32. package/src/data/standards-guard-index.meta.json +2 -2
  33. package/src/data/standards-registry.meta.json +1 -1
  34. package/src/scaffold/templates.ts +3 -1
  35. package/upgrades/1.3.1203.md +103 -0
  36. package/upgrades/1.3.1204.md +43 -0
  37. package/upgrades/side-effects/credential-identity-dual-subscription-email.md +220 -0
  38. package/upgrades/side-effects/stall-sentinel-recovery.md +121 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoFH,OAAO,EAAE,cAAc,EAAwD,MAAM,2BAA2B,CAAC;AAUjH,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA4BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAgI7D,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;AAuID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAouDD;;;;;;;;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,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,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9477,6 +9477,18 @@ export async function startServer(options) {
9477
9477
  }
9478
9478
  return set;
9479
9479
  },
9480
+ idleTopicSnapshot: () => {
9481
+ const idle = new Map();
9482
+ for (const s of sessionManager.listRunningSessions()) {
9483
+ const topicId = resolveTopicForTmux(s.tmuxSession);
9484
+ if (topicId == null)
9485
+ continue;
9486
+ const frame = sessionManager.captureOutput(s.tmuxSession, 60);
9487
+ if (frame && SessionReaper.isPositivelyIdle(s.framework, frame))
9488
+ idle.set(topicId, s.tmuxSession);
9489
+ }
9490
+ return idle;
9491
+ },
9480
9492
  queuePaused: () => rq.isPaused(),
9481
9493
  topicInResumeQueue: (topicId) => rq.list().some((e) => e.topicId === topicId && (e.status === 'queued' || e.status === 'starting')),
9482
9494
  operatorStoppedSince: sharedOperatorStopSince,
@@ -9575,6 +9587,16 @@ export async function startServer(options) {
9575
9587
  // CAS / owned-by-peer race withholds — never undoes the live spawn).
9576
9588
  _claimOwnershipForAutonomousSpawn?.(topicId);
9577
9589
  },
9590
+ recoverIdle: async ({ sessionName }) => {
9591
+ if (!_sessionRefresh)
9592
+ return false;
9593
+ const result = await _sessionRefresh.refreshSession({
9594
+ sessionName,
9595
+ fresh: true,
9596
+ reason: 'autonomous-completed-turn-continuation',
9597
+ });
9598
+ return result.ok;
9599
+ },
9578
9600
  claimInflight: (topicId) => {
9579
9601
  if (livenessInflight.has(topicId))
9580
9602
  return false; // CAS: someone holds it
@@ -12789,15 +12811,21 @@ export async function startServer(options) {
12789
12811
  });
12790
12812
  // Compose the host identity resolver: REAL oracle (slot blob → email) → pool (email → accountId).
12791
12813
  const { CredentialIdentityOracle: CredSwapOracle } = await import('../core/CredentialIdentityOracle.js');
12814
+ const { resolveClaudeSlotAccountId } = await import('../core/InUseAccountResolver.js');
12792
12815
  const credSwapOracle = new CredSwapOracle();
12793
12816
  const credResolveIdentity = async (slot) => {
12794
- const r = await credSwapOracle.resolveSlotTenant(slot);
12795
- if (r.unavailable || !r.email)
12796
- return { unavailable: true, reason: r.reason ?? 'oracle unavailable' };
12797
- const matches = subscriptionPool.list().filter((a) => a.email && a.email === r.email);
12798
- if (matches.length !== 1)
12799
- return { unavailable: true, reason: `ambiguous/unknown email (${matches.length} pool matches)` };
12800
- return { accountId: matches[0].id };
12817
+ // The oracle probed Anthropic's OAuth profile endpoint, so its email denotes a CLAUDE
12818
+ // login and nothing else. The pool mapping lives in `resolveClaudeSlotAccountId` — one
12819
+ // shared, tested definition because this lookup previously searched the WHOLE pool:
12820
+ // an operator who backs a Claude subscription AND a Codex subscription with the same
12821
+ // Google account has two rows carrying one email, and the unscoped lookup read that as
12822
+ // a genuine 2-way collision -> `unavailable` -> `missing-local-login`, asking the
12823
+ // operator to re-authenticate a login that was present, unexpired and valid. Verified
12824
+ // 2026-08-26: both of this machine's flagged accounts were exactly the dual-subscription
12825
+ // pair, and both resolved cleanly through the oracle. A collision WITHIN claude-code is
12826
+ // still genuine ambiguity and still fails closed — this resolver gates credential MOVES,
12827
+ // so it must never guess which of two homes a blob belongs to.
12828
+ return resolveClaudeSlotAccountId(subscriptionPool.list(), await credSwapOracle.resolveSlotTenant(slot));
12801
12829
  };
12802
12830
  let quotaPollerRef = null;
12803
12831
  const credentialSwapExecutor = new CredentialSwapExecutor({
@@ -24592,8 +24620,26 @@ export async function startServer(options) {
24592
24620
  return { merged, open, digest: createHash('sha256').update(JSON.stringify({ merged, open })).digest('hex') };
24593
24621
  };
24594
24622
  autonomousThroughputFloor = new AutonomousThroughputFloor({
24595
- listRuns: () => activeAutonomousJobs(config.stateDir).flatMap(job => { const topicId = Number(job.topic); const startedAt = Date.parse(job.startedAt ?? ''); if (!Number.isSafeInteger(topicId) || topicId <= 0 || !Number.isFinite(startedAt))
24596
- return []; const markers = readAutonomousRunMarkers(config.stateDir, topicId); return [{ signalRunId: `topic:${topicId}:${job.startedAt}`, topicId, startedAt, telegramBacked: Boolean(telegram), registeredMachineCount: _listPoolMachines?.().length || 1, midMove: !markers || Boolean(markers.movedTo || markers.moveSuspended) }]; }),
24623
+ listRuns: () => activeAutonomousJobs(config.stateDir).flatMap(job => {
24624
+ const topicId = Number(job.topic);
24625
+ const startedAt = Date.parse(job.startedAt ?? '');
24626
+ if (!Number.isSafeInteger(topicId) || topicId <= 0 || !Number.isFinite(startedAt))
24627
+ return [];
24628
+ const markers = readAutonomousRunMarkers(config.stateDir, topicId);
24629
+ const ownershipRecord = sessionOwnershipRegistry?.read(String(topicId)) ?? null;
24630
+ const ownership = ownershipRecord?.status === 'active'
24631
+ ? (ownershipRecord.ownerMachineId === _meshSelfId ? 'local-active' : 'remote-active')
24632
+ : 'unknown';
24633
+ return [{
24634
+ signalRunId: `topic:${topicId}:${job.startedAt}`,
24635
+ topicId,
24636
+ startedAt,
24637
+ telegramBacked: Boolean(telegram),
24638
+ registeredMachineCount: _listPoolMachines?.().length || 1,
24639
+ ownership,
24640
+ midMove: !markers || Boolean(markers.movedTo || markers.moveSuspended),
24641
+ }];
24642
+ }),
24597
24643
  sweep: async (_run, previous) => { try {
24598
24644
  const next = await snapshot(previous);
24599
24645
  return { status: 'ok', snapshot: next, meaningfulDelta: previous ? hasMeaningfulDeliverableDelta(previous, next) : false };