instar 1.3.638 → 1.3.640

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.
@@ -53,7 +53,7 @@ function monotonicNow() {
53
53
  return performance.now();
54
54
  }
55
55
  }
56
- catch { /* environments without performance API */ }
56
+ catch { /* @silent-fallback-ok: environment-capability probe, not a degradation — a runtime without the `performance` API falls back to `Date.now()`; a clock-source probe is low-risk and not a reportable degradation. */ }
57
57
  return Date.now();
58
58
  }
59
59
  // Durable RestartPending queue caps (per §A5). When `_setRestartPending(true)`
@@ -89,6 +89,20 @@ export class DegradationReporter {
89
89
  healers = new Map();
90
90
  // Dedup: track last alert time per feature to avoid spamming Telegram
91
91
  lastAlertTime = new Map();
92
+ // ── Never-silent degradation lifecycle (Resilient Degradation Ladder §4) ──────
93
+ // Tracks open heuristic-fallback degradations so one can NEVER silently persist
94
+ // indefinitely (the operator's principle). Designed to NOT repeat the 2026-06-21
95
+ // wedge: bounded (MAX_OPEN), O(1) per open/resolve (no full-map serialize), the
96
+ // escalation sweep NEVER calls report()/reportEvent()/gateHealthAlert (it surfaces
97
+ // via telegramSender directly), and it is liveness-gated (a run-once/idle component
98
+ // auto-closes via TTL rather than escalating a false alarm).
99
+ openDegradations = new Map();
100
+ neverSilentEnabled = false;
101
+ neverSilentEscalateMs = 15 * 60_000; // 15m before a persistent open escalates
102
+ neverSilentTtlMs = 30 * 60_000; // idle/run-once auto-close window
103
+ neverSilentMaxOpen = 500; // hard cap on the open map (anti-wedge)
104
+ /** Injectable clock for the lifecycle (testing). Default Date.now. */
105
+ neverSilentNow = () => Date.now();
92
106
  // F-3 additions ─────────────────────────────────────────────
93
107
  // The Remediator dispatch hook (F-8 wires the consumer). When set, the
94
108
  // legacy `.report(...)` and the new `.reportStructured(...)` both route
@@ -154,6 +168,108 @@ export class DegradationReporter {
154
168
  registerHealer(feature, healer) {
155
169
  this.healers.set(feature, healer);
156
170
  }
171
+ // ── Never-silent degradation lifecycle (Resilient Degradation Ladder §4) ──────
172
+ /** Configure (and enable) never-silent tracking. Called once at server startup with the
173
+ * dev-gate-resolved `enabled`. `now` is injectable for tests. */
174
+ configureNeverSilent(opts) {
175
+ this.neverSilentEnabled = opts.enabled === true;
176
+ if (opts.escalateMs && opts.escalateMs > 0)
177
+ this.neverSilentEscalateMs = opts.escalateMs;
178
+ if (opts.ttlMs && opts.ttlMs > 0)
179
+ this.neverSilentTtlMs = opts.ttlMs;
180
+ if (opts.maxOpen && opts.maxOpen > 0)
181
+ this.neverSilentMaxOpen = opts.maxOpen;
182
+ if (opts.now)
183
+ this.neverSilentNow = opts.now;
184
+ this.openDegradations.clear(); // fresh config = fresh state (startup is empty; gives test isolation)
185
+ }
186
+ nsKey(component, framework) {
187
+ return component + '::' + framework;
188
+ }
189
+ /**
190
+ * A heuristic fallback fired for (component, framework) — open a degradation, or if one is
191
+ * already open, increment its retry-attempts (the liveness signal: it tried again and STILL
192
+ * failed → stuck). Bounded by MAX_OPEN (oldest evicted), O(1). No-op when disabled.
193
+ */
194
+ openDegradation(component, framework) {
195
+ if (!this.neverSilentEnabled)
196
+ return;
197
+ const k = this.nsKey(component, framework);
198
+ const existing = this.openDegradations.get(k);
199
+ if (existing) {
200
+ existing.retryAttempts++; // a re-attempt that also fell to heuristic = it's genuinely stuck
201
+ return;
202
+ }
203
+ if (this.openDegradations.size >= this.neverSilentMaxOpen) {
204
+ const oldest = this.openDegradations.keys().next().value; // Map preserves insertion order
205
+ if (oldest !== undefined)
206
+ this.openDegradations.delete(oldest);
207
+ }
208
+ this.openDegradations.set(k, {
209
+ component, framework, openedAt: this.neverSilentNow(), retryAttempts: 0, lastEscalatedAt: null,
210
+ });
211
+ }
212
+ /**
213
+ * A real-LLM call for (component, framework) SUCCEEDED — auto-resolve the open degradation
214
+ * (the never-silent recovery). Returns the degraded duration (ms) or null if none was open.
215
+ * O(1). No-op when disabled.
216
+ */
217
+ resolveDegradation(component, framework) {
218
+ if (!this.neverSilentEnabled)
219
+ return null;
220
+ const k = this.nsKey(component, framework);
221
+ const d = this.openDegradations.get(k);
222
+ if (!d)
223
+ return null;
224
+ this.openDegradations.delete(k);
225
+ return this.neverSilentNow() - d.openedAt;
226
+ }
227
+ /** Count of currently-open degradations (observability). */
228
+ openDegradationCount() {
229
+ return this.openDegradations.size;
230
+ }
231
+ /**
232
+ * Level-triggered sweep (timer-driven): escalate a degradation OPEN past escalateMs that has
233
+ * genuinely retried (≥1), and TTL-auto-close an idle/run-once one (0 retries past ttlMs). Deduped
234
+ * per episode (re-escalates only after another full window). REENTRANCY-SAFE: it NEVER calls
235
+ * report()/reportEvent()/gateHealthAlert — it surfaces via telegramSender directly (the 2026-06-21
236
+ * wedge was that recursion). No-op when disabled.
237
+ */
238
+ sweepOpenDegradations() {
239
+ if (!this.neverSilentEnabled)
240
+ return;
241
+ const now = this.neverSilentNow();
242
+ for (const [k, d] of this.openDegradations) {
243
+ const age = now - d.openedAt;
244
+ if (d.retryAttempts === 0) {
245
+ // Idle / run-once: degraded once, never retried → done, not stuck. Auto-close at the TTL.
246
+ if (age > this.neverSilentTtlMs)
247
+ this.openDegradations.delete(k);
248
+ continue;
249
+ }
250
+ if (age > this.neverSilentEscalateMs &&
251
+ (d.lastEscalatedAt === null || now - d.lastEscalatedAt > this.neverSilentEscalateMs)) {
252
+ d.lastEscalatedAt = now;
253
+ this.escalatePersistentDegradation(d, age);
254
+ }
255
+ }
256
+ }
257
+ /** Surface a persistent-degradation attention item DIRECTLY (fixed template, no toneGate, no
258
+ * report — reentrancy-safe per §4). Best-effort; never throws into the sweep. */
259
+ escalatePersistentDegradation(d, ageMs) {
260
+ try {
261
+ if (!this.telegramSender || this.alertTopicId === null)
262
+ return;
263
+ const mins = Math.round(ageMs / 60_000);
264
+ const msg = `⚠ ${d.component} has been on its heuristic fallback for ~${mins}m — the real-LLM path ` +
265
+ `(${d.framework}) hasn't recovered. It auto-clears the next time an LLM call for it succeeds.`;
266
+ void this.telegramSender(this.alertTopicId, msg);
267
+ }
268
+ catch {
269
+ // @silent-fallback-ok: escalation is best-effort; a send failure must never throw into the
270
+ // level-triggered sweep (which would stall the timer). The next sweep retries.
271
+ }
272
+ }
157
273
  /**
158
274
  * Report a degradation event.
159
275
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DegradationReporter.js","sourceRoot":"","sources":["../../src/monitoring/DegradationReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAmG3D;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,sGAAsG,CAAC;AAY1I,2EAA2E;AAC3E,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAEnD;;;;;GAKG;AACH,SAAS,YAAY;IACnB,IAAI,CAAC;QACH,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;YAChF,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,0CAA0C,CAAC,CAAC;IACtD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAED,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,kDAAkD;AAClD,MAAM,yBAAyB,GAAG,IAAI,CAAC;AACvC,MAAM,uBAAuB,GAAG,CAAC,GAAG,IAAI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EAAE,CAAC;gBACb,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACxB,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YAED,4BAA4B;YAC5B,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBAC1B,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YAClC,CAAC;YAED,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;QAAC,MAAM,CAAC;YACP,kCAAkC;QACpC,CAAC;IACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.638",
3
+ "version": "1.3.640",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-22T00:51:13.440Z",
5
- "instarVersion": "1.3.638",
4
+ "generatedAt": "2026-06-22T03:15:59.405Z",
5
+ "instarVersion": "1.3.640",
6
6
  "entryCount": 202,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -1586,7 +1586,7 @@
1586
1586
  "type": "subsystem",
1587
1587
  "domain": "monitoring",
1588
1588
  "sourcePath": "src/monitoring/DegradationReporter.ts",
1589
- "contentHash": "cafbe8bf319bee2c188c4323f2779b189faba87643f2e29e29d375c2b0c5ceed",
1589
+ "contentHash": "3895b7eb8c6d3caf4337014ad6aeda537ae5f2507fa22a2357609be319811326",
1590
1590
  "since": "2025-01-01"
1591
1591
  },
1592
1592
  "subsystem:telegram-lifeline": {
@@ -0,0 +1,48 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: minor -->
5
+
6
+ ## What Changed
7
+
8
+ When your agent's AI provider hits a rate limit, it has to decide what to do next. Until now it
9
+ switched to a different AI provider right away. The operator's rule is gentler: for *background*
10
+ work, first slow down and retry the same provider; only switch if that doesn't clear it. And a call
11
+ the agent is *waiting on* (a safety gate) should stay responsive — switch fast and stop safely,
12
+ never hang.
13
+
14
+ This adds the first slice of that "degradation ladder," **off by default** (and on for the dev agent
15
+ first). For a background call that hits a rate limit, the agent now backs off and retries the same
16
+ provider before switching. For an awaited gate, the whole failure-handling path is capped by a
17
+ single short time budget so the agent never stalls — it switches fast and, if every switch fails,
18
+ stops safely (it never falls back to a dumb rule-of-thumb on a gate). When the feature is off, the
19
+ behavior is exactly what it was before.
20
+
21
+ ## What to Tell Your User
22
+
23
+ Nothing changes unless you turn it on. Once on, your agent rides out a rate limit more gracefully on
24
+ its background work (a brief wait-and-retry instead of an immediate provider switch), while keeping
25
+ the calls you're actually waiting on fast and safe. The queue step and the "never silently stuck"
26
+ tracker from the full design land in later updates.
27
+
28
+ ## Summary of New Capabilities
29
+
30
+ - `intelligence.degradationLadder` config: `{ gatingLadderBudgetMs (default 6000), backoff: {
31
+ enabled (dev-gated), baseMs, factor, maxAttempts, ceilingMs, maxWaitMs } }`.
32
+ - A new `attribution.deferrable` flag marking a call as background (not synchronously awaited) — only
33
+ deferrable calls get the backoff rung; a `gating` call is always treated as non-deferrable.
34
+ - `IntelligenceRouter` now: backs off + retries the same provider on a rate-limit for deferrable
35
+ calls (via `options.rateLimitWaitMs`) before switching; caps an awaited gate's whole failure path
36
+ with a single wall-clock budget (responsiveness); applies framework-swap to deferrable calls too.
37
+ - Dark/dev-gated (`resolveDevAgentGate` + a `DEV_GATED_FEATURES` entry): live on the dev agent,
38
+ dark on the fleet; absent ⇒ exactly today's framework-swap-only behavior.
39
+
40
+ ## Evidence
41
+
42
+ **Before:** the router's gating-failure `catch` swapped frameworks immediately on any failure with
43
+ no same-provider retry and no total time budget (a gating call could ride the full per-attempt cap ×
44
+ chain length). **After:** a deferrable rate-limited call backs off and retries the same provider
45
+ first; a gating call has no backoff and its whole failure path is capped at 6s. Reproduced by
46
+ `tests/unit/degradation-ladder.test.ts` (8 cases covering both sides of each boundary), with the
47
+ ladder-absent case asserting byte-for-byte today's behavior. The existing swap-loop tests
48
+ (`provider-fallback-swap-timeout.test.ts`) are unaffected; full lint + tsc green.
@@ -0,0 +1,46 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: minor -->
5
+
6
+ ## What Changed
7
+
8
+ The other half of the rate-limit principle: **never let the agent silently stay stuck on a
9
+ fallback.** When an internal call exhausts its options and the caller drops to a simple rule-of-thumb
10
+ instead of real AI, the agent now tracks that. The moment a real AI call for that component succeeds
11
+ again, it clears itself automatically. And if it stays stuck for too long (default 15 minutes) AND
12
+ has genuinely retried, the agent raises one calm heads-up that the AI path hasn't recovered — so a
13
+ degraded state can't quietly rot. A component that just ran once and finished (not stuck) quietly
14
+ closes itself with no false alarm.
15
+
16
+ This is **off by default** (on for the dev agent first), and it's built carefully to NOT repeat an
17
+ event-loop freeze the same subsystem caused earlier: it's bounded, it never re-enters the alert
18
+ machinery, and it only alerts when something is genuinely stuck.
19
+
20
+ ## What to Tell Your User
21
+
22
+ Nothing changes unless you turn it on. Once on, if your agent ever falls back from real AI to a
23
+ basic rule on some internal check and stays that way, you'll get one quiet heads-up instead of it
24
+ silently persisting — and it clears itself the moment the AI path recovers.
25
+
26
+ ## Summary of New Capabilities
27
+
28
+ - `DegradationReporter` open-degradation lifecycle: `openDegradation` / `resolveDegradation` /
29
+ `sweepOpenDegradations` / `configureNeverSilent` + `openDegradationCount`, keyed on
30
+ `(component, framework)`, bounded by a hard cap, O(1) per open/resolve.
31
+ - `IntelligenceRouter` `onHeuristicFallthrough` (fires when a non-gating call exhausts the ladder)
32
+ + `onResolved` (fires on a successful real-LLM answer) hooks, wired to the reporter.
33
+ - A dev-gated 60-second sweep that escalates a genuinely-stuck degradation (≥1 retry, open past
34
+ `escalateMs`, deduped) and auto-closes an idle/run-once one at the TTL.
35
+ - Dark/dev-gated (`resolveDevAgentGate` + a `DEV_GATED_FEATURES` entry); no-op when off.
36
+
37
+ ## Evidence
38
+
39
+ **Before:** `DegradationReporter` reported a degradation once (`report()` + a one-shot self-healer)
40
+ but had NO continuous "is this still degraded?" tracking — a fallback could persist indefinitely with
41
+ nobody knowing. **After:** a non-gating heuristic fallthrough opens a tracked degradation; a real
42
+ answer auto-resolves it; a genuinely-stuck one escalates once (deduped); a run-once one auto-closes.
43
+ Reproduced by `tests/unit/degradation-never-silent.test.ts` (6 cases) + 3 router-hook cases in
44
+ `degradation-ladder.test.ts`. Critically, the escalation path surfaces via `telegramSender` directly
45
+ and NEVER calls `report()` — the reentrancy that caused the 2026-06-21 event-loop wedge cannot recur.
46
+ Full lint + tsc green; the existing reporter/router tests are unaffected.
@@ -0,0 +1,99 @@
1
+ # Side-Effects Review — Resilient Degradation Ladder Increment 1 (path-dependent ladder core)
2
+
3
+ **Slug:** `resilient-degradation-ladder-increment-1` · **Tier:** 2 (spec-driven; converged +
4
+ operator-approved). **Spec:** `docs/specs/resilient-degradation-ladder.md` §3 (rungs a + gating
5
+ budget), §5 D1–D3.
6
+
7
+ ## Summary of the change
8
+
9
+ The v1 core of the degradation ladder, dark/dev-gated, in `IntelligenceRouter`'s gating-failure
10
+ `catch`:
11
+ - `attribution.deferrable` flag (types.ts) — marks BACKGROUND work not synchronously awaited.
12
+ - `intelligence.degradationLadder` config (types.ts) — `gatingLadderBudgetMs`, `backoff` bounds.
13
+ - Router ladder: a DEFERRABLE call on a rate-limit BACKS OFF (sets `options.rateLimitWaitMs` so the
14
+ provider-layer `acquireOrWait` waits, bounded + jittered, ≤ maxAttempts) before swapping; a GATING
15
+ call gets NO backoff and the whole failure path is capped by a single `gatingLadderBudgetMs`
16
+ wall-clock deadline (responsiveness); framework-swap now applies to deferrable too.
17
+ - Server wiring (server.ts) resolves the ladder via `resolveDevAgentGate` (live-on-dev / dark-fleet);
18
+ `DEV_GATED_FEATURES` registration (devGatedFeatures.ts).
19
+
20
+ NOT in this increment (later): the queue rung, the never-silent tracking, the per-call account-swap.
21
+
22
+ ## Decision-point inventory
23
+
24
+ All frozen in spec §5 (D1 config + dark rollout; D2 backoff bounds 500/×2/3/8s/60s; D3
25
+ gatingLadderBudgetMs=6s, load-bearing). No callsite decision introduced.
26
+
27
+ ## 1. Over-block (false positive)
28
+
29
+ The deferrable backoff only fires on `isRateLimitError(err)` (RateLimitError name OR a
30
+ rate-limit/usage-limit/429 message); a HARD error skips backoff and goes straight to swap (tested).
31
+ So a non-rate-limit failure is never slowed. The gating budget only CAPS the gating failure path
32
+ sooner — a gate still fails closed (never a heuristic); capping at 6s is more responsive, never less
33
+ safe.
34
+
35
+ ## 2. Under-block
36
+
37
+ Backoff applies only to DEFERRABLE (caller-declared) calls. A gating call (awaited) gets no backoff
38
+ (can't stall) and is never queued (gating dominates deferrable — tested). When the ladder is OFF
39
+ (fleet default, unconfigured) the router is byte-for-byte today's behavior (tested:
40
+ "ladder absent ⇒ today's behavior").
41
+
42
+ ## 4. Signal vs authority
43
+
44
+ The router takes no destructive action; it only chooses which provider serves a call and reports
45
+ each transition via the existing `onDegrade` (→ DegradationReporter / /metrics/features). The
46
+ heuristic last-resort and the gating fail-closed are UNCHANGED behaviors; this increment only
47
+ re-orders the deferrable path and bounds the gating path.
48
+
49
+ ## 5. Interactions
50
+
51
+ The existing framework-swap loop is preserved; the gating-budget deadline check is added at the TOP
52
+ of each swap iteration (so a gating call that exceeds its budget stops swapping). The existing
53
+ `swapAttemptTimeoutMs` per-attempt cap is unchanged. The deferrable backoff is NEW and only runs on
54
+ a rate-limit before the swap. The existing `provider-fallback-swap-timeout.test.ts` (the swap loop's
55
+ own tests) is unaffected.
56
+
57
+ ## 6. External surfaces
58
+
59
+ No new route. Additive config (`intelligence.degradationLadder`) + one additive attribution field
60
+ (`deferrable`), both optional. No persistence, no messaging.
61
+
62
+ ## 6b. Operator-surface quality
63
+
64
+ N/A — no operator/dashboard/approval surface (enabling is a config edit / the dev-agent gate).
65
+
66
+ ## Framework generality
67
+
68
+ The ladder operates DOWNSTREAM of framework routing (inside the resolved framework's failure
69
+ `catch`), so it is framework-agnostic — it works for whichever framework a component routed to. The
70
+ account-global breaker scope (the wait it leans on) is documented in the spec §2.
71
+
72
+ ## 7. Multi-machine posture
73
+
74
+ Per-process / machine-local: each machine's router handles its own internal calls. No replicated
75
+ state, no cross-machine contract. (Rung-b account-swap, the only cross-machine concern raised in
76
+ review, is out of v1.)
77
+
78
+ ## 8. Rollback cost
79
+
80
+ Trivial: the ladder is dark on the fleet (the construction returns `undefined` unless dev-gated /
81
+ configured), so reverting is removing an unused-on-fleet code path. An operator who enabled it sets
82
+ `intelligence.degradationLadder.backoff.enabled: false`. The `attribution.deferrable` field defaults
83
+ false at every unmodified callsite.
84
+
85
+ ## Evidence pointers
86
+
87
+ - `tests/unit/degradation-ladder.test.ts` (8): deferrable backoff retries+succeeds (sets
88
+ rateLimitWaitMs); backoff-exhausted→swap; gating has NO backoff (fail closed); gating-budget
89
+ consumed→stops swapping before all targets; non-gating-non-deferrable=today's behavior;
90
+ gating-dominates-deferrable; backoff-only-on-rate-limit; ladder-absent=today's behavior.
91
+ - The `DEV_GATED_FEATURES` both-sides wiring test confirms the new entry resolves live-on-dev /
92
+ dark-on-fleet.
93
+ - `provider-fallback-swap-timeout.test.ts` (existing swap-loop tests) unaffected. Full `npm run lint`
94
+ (incl. lint-dev-agent-dark-gate) + `tsc` green.
95
+
96
+ ## Conclusion
97
+
98
+ The behavior-preserving-when-off, dev-gated v1 of the degradation ladder: deferrable work slows down
99
+ before switching; an awaited gate stays responsive (6s budget) and still fails closed. Ship.
@@ -0,0 +1,97 @@
1
+ # Side-Effects Review — Resilient Degradation Ladder Increment 2 (never-silent tracking)
2
+
3
+ **Slug:** `resilient-degradation-ladder-increment-2` · **Tier:** 2 (spec-driven; converged +
4
+ operator-approved). **Spec:** `docs/specs/resilient-degradation-ladder.md` §4, D6.
5
+
6
+ ## Summary of the change
7
+
8
+ The never-silent half of the operator's principle ("never silently remain degraded indefinitely"),
9
+ dark/dev-gated:
10
+ - `DegradationReporter` gains an open-degradation lifecycle (§4): `openDegradation` /
11
+ `resolveDegradation` / `sweepOpenDegradations` / `configureNeverSilent`, keyed on
12
+ `(component, framework)`, bounded by MAX_OPEN, O(1) per open/resolve.
13
+ - `IntelligenceRouter` gains `onHeuristicFallthrough` (fired at each NON-gating throw — the caller
14
+ will use its heuristic) + `onResolved` (fired at each successful real-LLM answer) hooks.
15
+ - Server wires the hooks to the reporter + calls `configureNeverSilent` (dev-gated via
16
+ `resolveDevAgentGate`) + starts a 60s `unref`'d sweep timer.
17
+ - `DEV_GATED_FEATURES` registration (`degradationLadderNeverSilent`).
18
+
19
+ ## Decision-point inventory
20
+
21
+ Frozen in spec §5 D6: escalateMs 15m, TTL 30m, MAX_OPEN 500, key (component, framework),
22
+ liveness-gated (≥1 retry to escalate; TTL-close otherwise), deduped per episode.
23
+
24
+ ## 1. Over-block / false positive
25
+
26
+ The big false-positive class (round-1): a run-once / idle component that degrades once and never
27
+ calls again. Closed by the LIVENESS gate — a degradation with 0 retries since open AUTO-CLOSES at
28
+ the TTL instead of escalating (tested). Only a degradation that genuinely RE-attempted and still
29
+ fell to heuristic (≥1 retry) escalates. Escalation is deduped per episode (re-escalates only after
30
+ another full window — tested).
31
+
32
+ ## 2. Under-block
33
+
34
+ Tracking only opens on a NON-gating heuristic fallthrough (where the heuristic actually runs); a
35
+ gating fail-closed is NOT tracked (it's the safe outcome, not a heuristic — tested:
36
+ onHeuristicFallthrough does NOT fire for a gating call). No-op when disabled.
37
+
38
+ ## 4. Signal vs authority
39
+
40
+ The escalation is an attention SIGNAL (a deduped fixed-template Telegram line), never a gate. It
41
+ takes no destructive action. The auto-resolve is observational (a successful call clears the open
42
+ state). Consistent with Signal-vs-Authority.
43
+
44
+ ## 5. Interactions — THE WEDGE-CRITICAL SECTION
45
+
46
+ §4 extends the exact `DegradationReporter` subsystem that caused the 2026-06-21 event-loop wedge
47
+ (`gateHealthAlert`→`toneGate.review`→router→`report`→`reportEvent`→recursion + growing-array
48
+ JSON.stringify). This increment is designed to NOT repeat it:
49
+ - The sweep NEVER calls `report()`/`reportEvent()`/`gateHealthAlert` — it surfaces an attention item
50
+ via `telegramSender` DIRECTLY (no toneGate, no events-array growth, no recursion). Tested: the
51
+ escalation path sends via the fake telegramSender, never through report.
52
+ - The open map is BOUNDED (MAX_OPEN; oldest evicted — tested) — no unbounded growth.
53
+ - open/resolve are O(1) Map mutations — no full-map serialize per event.
54
+ - The existing `_gatingHealthAlert` reentrancy guard + `MAX_EVENTS` cap are untouched.
55
+
56
+ ## 6. External surfaces
57
+
58
+ No new route. The only new egress is the deduped escalation line (the operator's explicit want).
59
+ The new config (`intelligence.degradationLadder.neverSilent`) shipped in Increment 1's types.
60
+
61
+ ## 6b. Operator-surface quality
62
+
63
+ N/A — no dashboard/approval surface. `openDegradationCount()` is a read-only observability getter.
64
+
65
+ ## Framework generality
66
+
67
+ Framework-agnostic — the hooks key on the resolved framework; works for whichever framework the
68
+ component routes to.
69
+
70
+ ## 7. Multi-machine posture
71
+
72
+ Machine-local: each machine's reporter tracks its own degradations + its own sweep timer. No
73
+ replicated state. (A sustained per-machine degradation could double-alert on a 2-machine setup for
74
+ one provider outage — accepted as a minor local-dedup limitation, noted in the spec §6.)
75
+
76
+ ## 8. Rollback cost
77
+
78
+ Trivial: dark on the fleet (`configureNeverSilent({enabled:false})` when not dev/configured) — the
79
+ lifecycle methods are all `if (!enabled) return` no-ops and no sweep timer is started. The router
80
+ hooks are no-ops downstream when disabled. Revert = remove an unused-on-fleet code path.
81
+
82
+ ## Evidence pointers
83
+
84
+ - `tests/unit/degradation-never-silent.test.ts` (6): open→resolve duration; run-once TTL-auto-close
85
+ (NO escalation); stuck (≥1 retry) escalates once past the window + deduped + re-escalates after a
86
+ new window; (component,framework) keying (no cross-resolution); bounded (MAX_OPEN evict);
87
+ disabled=no-op.
88
+ - `tests/unit/degradation-ladder.test.ts` (+3 hook cases): onResolved on success; onHeuristicFallthrough
89
+ on a non-gating exhaustion; onHeuristicFallthrough does NOT fire for a gating call.
90
+ - The `DEV_GATED_FEATURES` both-sides wiring test confirms `degradationLadderNeverSilent` resolves
91
+ live-on-dev / dark-on-fleet. Full `npm run lint` (incl. lint-dev-agent-dark-gate) + `tsc` green.
92
+
93
+ ## Conclusion
94
+
95
+ Delivers the never-silent guarantee — a heuristic fallback can no longer silently persist
96
+ indefinitely: it auto-resolves on recovery and escalates if genuinely stuck — built carefully to NOT
97
+ repeat the wedge it extends. Dark/dev-gated, no-op when off. Ship.