instar 1.3.640 → 1.3.642

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;AAoCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAsH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA+EtD;;;;;;;;;;;;;;;;;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;AAy4CD,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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E,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,CA+oftE;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"}
@@ -4636,6 +4636,26 @@ export async function startServer(options) {
4636
4636
  // operator override and silently disable the default policy (round-1 M5).
4637
4637
  const operatorSetComponentFrameworks = config.sessions?.componentFrameworks !== undefined;
4638
4638
  const computedDefault = resolveInternalFrameworkDefault(activeFrameworkSet);
4639
+ // Resilient Degradation Ladder rung gates, resolved ONCE here (dev-gated: `enabled` OMITTED in
4640
+ // config ⇒ resolveDevAgentGate ⇒ live-on-dev / dark-on-fleet). The ladder object is present
4641
+ // when ANY rung is active; absent (fleet, unconfigured) ⇒ undefined ⇒ EXACTLY today's behavior.
4642
+ const dlCfg = config.intelligence?.degradationLadder;
4643
+ const ladderBackoffEnabled = resolveDevAgentGate(dlCfg?.backoff?.enabled, config);
4644
+ const ladderQueueEnabled = resolveDevAgentGate(dlCfg?.queue?.enabled, config);
4645
+ // Dedicated LlmQueue for the queue rung (§3b.3) — built ONLY when the rung is active so the
4646
+ // fleet default allocates nothing. A deferrable internal call that exhausted framework-swap
4647
+ // WAITS here for capacity (background lane, its own small daily cap so it can't starve
4648
+ // interactive callers; maxConcurrent:1 serializes retries → naturally herd-safe) instead of
4649
+ // dropping to its heuristic. `drainMinGapMs` is the opt-in §3c pacing gap (0/off by default).
4650
+ let degradationLadderQueue;
4651
+ if (ladderQueueEnabled) {
4652
+ const { LlmQueue: DegradationLadderQueueCls } = await import('../monitoring/LlmQueue.js');
4653
+ degradationLadderQueue = new DegradationLadderQueueCls({
4654
+ maxConcurrent: 1,
4655
+ maxDailyCents: 25,
4656
+ backgroundDispatchMinGapMs: dlCfg?.queue?.drainMinGapMs ?? 0,
4657
+ });
4658
+ }
4639
4659
  sharedIntelligence = new IntelligenceRouter({
4640
4660
  defaultProvider: rawDefault,
4641
4661
  defaultFramework: defaultFw,
@@ -4665,27 +4685,28 @@ export async function startServer(options) {
4665
4685
  // §4.5: per-attempt swap timeout, inline-defaulted to 5s (no ConfigDefaults
4666
4686
  // entry — codexExecJson precedent; absent ⇒ 5s, present ⇒ operator's value).
4667
4687
  swapAttemptTimeoutMs: config.intelligence?.swapAttemptTimeoutMs ?? 5000,
4668
- // Resilient Degradation Ladder (docs/specs/resilient-degradation-ladder.md), v1.
4669
- // Dev-gated: the backoff rung's `enabled` is OMITTED in config so resolveDevAgentGate
4670
- // resolves it (live-on-dev / dark-on-fleet); the gating budget rides the ladder's
4671
- // activation. Absent (fleet, unconfigured) undefined ⇒ EXACTLY today's behavior.
4672
- ladder: (() => {
4673
- const dl = config.intelligence?.degradationLadder;
4674
- const backoffEnabled = resolveDevAgentGate(dl?.backoff?.enabled, config);
4675
- if (!backoffEnabled)
4676
- return undefined;
4677
- return {
4678
- gatingLadderBudgetMs: dl?.gatingLadderBudgetMs ?? 6000,
4679
- backoffEnabled,
4688
+ // The dedicated queue for the DEFERRABLE queue rung (§3b.3); undefined when the rung is
4689
+ // dark the rung is a no-op (a deferrable call falls straight to its heuristic, as before).
4690
+ llmQueue: degradationLadderQueue,
4691
+ // Resilient Degradation Ladder (docs/specs/resilient-degradation-ladder.md). Dev-gated: each
4692
+ // rung's `enabled` is OMITTED in config so resolveDevAgentGate resolves it (live-on-dev /
4693
+ // dark-on-fleet); the gating budget rides the ladder's activation. The ladder object is
4694
+ // present when ANY rung (backoff OR queue) is active; absent ⇒ EXACTLY today's behavior.
4695
+ ladder: (ladderBackoffEnabled || ladderQueueEnabled)
4696
+ ? {
4697
+ gatingLadderBudgetMs: dlCfg?.gatingLadderBudgetMs ?? 6000,
4698
+ backoffEnabled: ladderBackoffEnabled,
4680
4699
  backoff: {
4681
- baseMs: dl?.backoff?.baseMs ?? 500,
4682
- factor: dl?.backoff?.factor ?? 2,
4683
- maxAttempts: dl?.backoff?.maxAttempts ?? 3,
4684
- ceilingMs: dl?.backoff?.ceilingMs ?? 8000,
4685
- maxWaitMs: dl?.backoff?.maxWaitMs ?? 60000,
4700
+ baseMs: dlCfg?.backoff?.baseMs ?? 500,
4701
+ factor: dlCfg?.backoff?.factor ?? 2,
4702
+ maxAttempts: dlCfg?.backoff?.maxAttempts ?? 3,
4703
+ ceilingMs: dlCfg?.backoff?.ceilingMs ?? 8000,
4704
+ maxWaitMs: dlCfg?.backoff?.maxWaitMs ?? 60000,
4686
4705
  },
4687
- };
4688
- })(),
4706
+ queueEnabled: ladderQueueEnabled,
4707
+ queueAttemptTimeoutMs: dlCfg?.queue?.attemptTimeoutMs ?? 60000,
4708
+ }
4709
+ : undefined,
4689
4710
  // Each non-default framework gets its OWN breaker (built once, from the
4690
4711
  // shared probe-cache so the active-set probe doesn't double-build).
4691
4712
  buildProvider: (fw) => cachedBuild(fw),