instar 1.3.1207 → 1.3.1209

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 (59) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +60 -10
  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 +10 -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 +13 -0
  9. package/dist/core/PostUpdateMigrator.js.map +1 -1
  10. package/dist/core/QuotaPoller.d.ts +21 -0
  11. package/dist/core/QuotaPoller.d.ts.map +1 -1
  12. package/dist/core/QuotaPoller.js +80 -12
  13. package/dist/core/QuotaPoller.js.map +1 -1
  14. package/dist/core/SubscriptionLoginLedger.d.ts +132 -0
  15. package/dist/core/SubscriptionLoginLedger.d.ts.map +1 -0
  16. package/dist/core/SubscriptionLoginLedger.js +456 -0
  17. package/dist/core/SubscriptionLoginLedger.js.map +1 -0
  18. package/dist/core/SubscriptionPool.d.ts +50 -0
  19. package/dist/core/SubscriptionPool.d.ts.map +1 -1
  20. package/dist/core/SubscriptionPool.js +169 -20
  21. package/dist/core/SubscriptionPool.js.map +1 -1
  22. package/dist/core/SubscriptionPoolAuthority.d.ts +81 -0
  23. package/dist/core/SubscriptionPoolAuthority.d.ts.map +1 -0
  24. package/dist/core/SubscriptionPoolAuthority.js +573 -0
  25. package/dist/core/SubscriptionPoolAuthority.js.map +1 -0
  26. package/dist/core/TopicProfileOrchestrator.d.ts +1 -1
  27. package/dist/core/TopicProfileOrchestrator.d.ts.map +1 -1
  28. package/dist/core/TopicProfileOrchestrator.js +46 -3
  29. package/dist/core/TopicProfileOrchestrator.js.map +1 -1
  30. package/dist/data/standards-guard-index.json +1 -1
  31. package/dist/data/standards-guard-index.meta.json +2 -2
  32. package/dist/data/standards-registry.meta.json +1 -1
  33. package/dist/feedback-factory/drain/FeedbackDrainStore.js +1 -1
  34. package/dist/feedback-factory/drain/FeedbackDrainStore.js.map +1 -1
  35. package/dist/scaffold/templates.d.ts.map +1 -1
  36. package/dist/scaffold/templates.js +1 -0
  37. package/dist/scaffold/templates.js.map +1 -1
  38. package/dist/server/AgentServer.d.ts +4 -0
  39. package/dist/server/AgentServer.d.ts.map +1 -1
  40. package/dist/server/AgentServer.js +21 -0
  41. package/dist/server/AgentServer.js.map +1 -1
  42. package/dist/server/fileRoutes.d.ts.map +1 -1
  43. package/dist/server/fileRoutes.js +7 -0
  44. package/dist/server/fileRoutes.js.map +1 -1
  45. package/dist/server/routes.d.ts +2 -0
  46. package/dist/server/routes.d.ts.map +1 -1
  47. package/dist/server/routes.js +137 -6
  48. package/dist/server/routes.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/data/builtin-manifest.json +65 -65
  51. package/src/data/standards-guard-index.json +1 -1
  52. package/src/data/standards-guard-index.meta.json +2 -2
  53. package/src/data/standards-registry.meta.json +1 -1
  54. package/src/scaffold/templates.ts +1 -0
  55. package/upgrades/1.3.1208.md +32 -0
  56. package/upgrades/1.3.1209.md +26 -0
  57. package/upgrades/side-effects/subscription-signin-ledger.md +90 -0
  58. package/upgrades/side-effects/topic-profile-kill-by-tmux-name.md +429 -0
  59. package/upgrades/subscription-signin-ledger.eli16.md +11 -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;AAiI7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAA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AoB,GAAG,IAAI,CAAC;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CAivBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA42sBtE;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"}
@@ -419,7 +419,10 @@ async function handleFixCommand(topicId, text, deps) {
419
419
  else {
420
420
  for (const s of stale) {
421
421
  try {
422
- deps.sessionManager.killSession(s.tmuxSession);
422
+ // killSession() resolves BY ID; handing it a tmux name misses the
423
+ // lookup and returns false silently ("the stop that does not stop").
424
+ // killSessionByTmuxName is the single place that resolution lives.
425
+ deps.sessionManager.killSessionByTmuxName(s.tmuxSession);
423
426
  }
424
427
  catch { /* best effort */ }
425
428
  }
@@ -12637,7 +12640,32 @@ export async function startServer(options) {
12637
12640
  // empty pool is a pure no-op (no background loop, no cost) until an operator
12638
12641
  // enrolls an account. Stores each account's login LOCATION, never tokens.
12639
12642
  const { SubscriptionPool, requiresOwnerRelogin, eligibleSiblingAccounts } = await import('../core/SubscriptionPool.js');
12640
- const subscriptionPool = new SubscriptionPool({ stateDir: config.stateDir });
12643
+ let subscriptionPoolMachineId = null;
12644
+ try {
12645
+ subscriptionPoolMachineId = coordinator.managers.identityManager.loadIdentity().machineId;
12646
+ }
12647
+ catch {
12648
+ // Dynamic authority reports machine-identity-unavailable; static v1
12649
+ // compatibility remains installed and history reads can expose the typed state.
12650
+ }
12651
+ const subscriptionPool = new SubscriptionPool({
12652
+ stateDir: config.stateDir,
12653
+ machineId: subscriptionPoolMachineId,
12654
+ });
12655
+ let subscriptionLoginLedger = null;
12656
+ if (subscriptionPoolMachineId && subscriptionPool.getContractCapability().version === 1) {
12657
+ try {
12658
+ const { SubscriptionLoginLedger } = await import('../core/SubscriptionLoginLedger.js');
12659
+ subscriptionLoginLedger = new SubscriptionLoginLedger({
12660
+ stateDir: config.stateDir,
12661
+ machineId: subscriptionPoolMachineId,
12662
+ writeEnabled: lockResult.acquired && lockResult.overridden !== true,
12663
+ });
12664
+ }
12665
+ catch (error) {
12666
+ console.warn(`[subscription-login-ledger] store unavailable: ${error instanceof Error ? error.message : String(error)}`);
12667
+ }
12668
+ }
12641
12669
  // Arm the already-built router's sibling-account failure tail. Read live (not a
12642
12670
  // snapshot) so an account enrolled, rate-limited or disabled later is reflected on the
12643
12671
  // next failure. Until this line runs the router's resolver sees null and returns no
@@ -12653,7 +12681,7 @@ export async function startServer(options) {
12653
12681
  ? process.env['CODEX_HOME'] || path.join(os.homedir(), '.codex')
12654
12682
  : null,
12655
12683
  });
12656
- if (subscriptionPool.size() > 0) {
12684
+ if (subscriptionPool.getAvailability().state === 'ready' && subscriptionPool.size() > 0) {
12657
12685
  console.log(pc.green(` Subscription pool: ${subscriptionPool.size()} account(s) registered`));
12658
12686
  }
12659
12687
  // WS5.2 §6.1a — wire cross-machine registry follow-me (METADATA ONLY). When the generic
@@ -13111,6 +13139,12 @@ export async function startServer(options) {
13111
13139
  const { QuotaPoller } = await import('../core/QuotaPoller.js');
13112
13140
  const quotaPoller = new QuotaPoller({
13113
13141
  pool: subscriptionPool,
13142
+ loginObservationSink: subscriptionLoginLedger
13143
+ ? (input) => subscriptionLoginLedger.recordObservation(input)
13144
+ : undefined,
13145
+ loginAdmission: subscriptionLoginLedger
13146
+ ? (cells) => subscriptionLoginLedger.reconcileAdmission(cells)
13147
+ : undefined,
13114
13148
  logger: { log: (m) => console.log(m), warn: (m) => console.warn(m) },
13115
13149
  // Census #1–#4: resolve each account's LIVE slot through the ledger (no-op while dark).
13116
13150
  locationGate: credentialLocationGate,
@@ -24739,6 +24773,7 @@ export async function startServer(options) {
24739
24773
  peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
24740
24774
  } if (peers.length === 0)
24741
24775
  return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, conversationRegistry, conversationBindAuth, conversationFollowThrough, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, getLastRelayEvent: threadlineGetLastRelayEvent, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, reviewCanaryBattery, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, writeAdmission: writeAdmission ?? undefined, getInboundQueue: () => _inboundQueue, getMachineCoherence: () => _machineCoherenceSentinel, getSingleMachineFailoverGap: () => _singleMachineFailoverGap, getMissingLoginSession: () => _missingLoginSession, getSessionPoolFailoverRunner: () => _sessionPoolFailoverRunnerDriver?.status() ?? null, sessionPoolPromotionActivation: _sessionPoolPromotionActivation, meshRpcDispatcher, deliverA2aToMachine: _deliverA2aToMachine ?? undefined, workingSetPullCoordinator, workingSetArtifactManager, orchestratorPoller, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, sendDrain: _sendDrain ?? undefined, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, duplicateReconciler: _duplicateReconciler ?? undefined, ownerDarkLadder: _ownerDarkLadder ?? undefined, spawnAdmission: _spawnAdmission ?? undefined, judgmentProvenance: _judgmentProvenance ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, externalHogSentinel, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, standDownRegistry: _standDownRegistry ?? undefined, standDownAudit: _standDownAudit ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
24776
+ server.setSubscriptionLoginLedger(subscriptionLoginLedger);
24742
24777
  server.setWorkQueue(workQueue);
24743
24778
  if (_stateSyncStoresResolved?.classReview?.enabled && replicatedPeerStreamReader) {
24744
24779
  const { CLASS_REVIEW_STORE_KEY, classReviewFromOriginRecord } = await import('../core/ClassReviewReplicatedStore.js');
@@ -24877,14 +24912,29 @@ export async function startServer(options) {
24877
24912
  return 'unconfirmed';
24878
24913
  return paneIdleWithEmptyInput(tail) ? 'confirmed-idle' : 'busy';
24879
24914
  },
24880
- killForResume: async (sessionName) => sessionManager.killSession(sessionName),
24915
+ // NB: listTopicSessions() supplies `sessionName` as the session's
24916
+ // TMUX NAME. killSession() resolves BY ID (state/sessions/<id>.json),
24917
+ // so passing a name here missed the lookup and returned false with no
24918
+ // kill — "the stop that does not stop". The respawn then found the old
24919
+ // session still alive and merely injected into it, so a framework swap
24920
+ // silently never happened. killSessionByTmuxName is the single place
24921
+ // that name→id resolution lives; its boolean is the REAL outcome and
24922
+ // the orchestrator now aborts the respawn when it is false.
24923
+ killForResume: async (sessionName) => sessionManager.killSessionByTmuxName(sessionName),
24881
24924
  killFresh: async (sessionName) => {
24882
- // Fresh respawn: clear the resume entry first so the next spawn does
24883
- // NOT --resume the (possibly cross-framework) transcript, then kill.
24884
- const topic = telegram?.getTopicForSession?.(sessionName);
24885
- if (topic != null && Number.isFinite(Number(topic)))
24886
- _topicResumeMap?.remove(Number(topic));
24887
- return sessionManager.killSession(sessionName);
24925
+ // Fresh respawn: the orchestrator has ALREADY parked this topic's
24926
+ // resume entry (claudeResume.park -> _topicResumeMap.park) before
24927
+ // calling us, and a parked entry is invisible to get() /
24928
+ // getForFramework() / getProvenance() so the next spawn cannot
24929
+ // --resume the cross-framework transcript. This port used to ALSO
24930
+ // call _topicResumeMap.remove(), which DELETES rather than parks;
24931
+ // that was redundant with the park and destroyed the cheap
24932
+ // recovery TopicResumeMap's own §8 rule protects ("'remove' means
24933
+ // PARK, not delete"). It also made the kill-failure abort
24934
+ // unrecoverable: unpark() finds no entry and restores nothing, so
24935
+ // a still-live session lost its resume id to an attempt that was
24936
+ // supposed to be a no-op.
24937
+ return sessionManager.killSessionByTmuxName(sessionName);
24888
24938
  },
24889
24939
  spawn: async (topicKey, _resolved, _directive) => {
24890
24940
  // The orchestrator already killed; respawn re-resolves the (now