instar 1.3.691 → 1.3.693

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":"MessagingToneGate.d.ts","sourceRoot":"","sources":["../../src/core/MessagingToneGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AASvD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEhE;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUvC;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,aAAa,GACpB,gBAAgB,CAqBlB;AASD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uFAAuF;IACvF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;;;OAUG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;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G;IACH,OAAO,CAAC,aAAa;CAmCtB"}
@@ -21,6 +21,7 @@ import crypto from 'node:crypto';
21
21
  import { isCapacityUnavailable } from './SpawnCapIntelligenceProvider.js';
22
22
  import { detectGateSignals, GATE_SIGNAL_KIND_TO_RULE, } from './GateSignalDetectors.js';
23
23
  import { detectInternalIdLeak } from './internal-id-leak.js';
24
+ import { detectSelfStopShape } from './self-stop-floor.js';
24
25
  /**
25
26
  * The pure, synchronous deterministic leak floor used on the degraded path
26
27
  * (F4 graceful degradation). NO LLM, NO subprocess — just the B1–B7 artifact
@@ -63,6 +64,26 @@ export function buildDegradedToneResult(text, latencyMs, reason) {
63
64
  degradedToDeterministic: true,
64
65
  };
65
66
  }
67
+ // ux-is-the-product-hardening §2.1 — the behavioral self-stop guard (B15/B18)
68
+ // requires the LLM judge, so it vanishes on this degraded path. The
69
+ // deterministic self-stop floor backstops exactly that gap: HOLD (fail-CLOSED
70
+ // on suspicion) a clean-prose self-stop rather than wave a drift message
71
+ // through while the judge is offline. Narrow + high-precision (stop ACTION +
72
+ // self-protective REASON); inherits the failClosedOnExhaustion:false
73
+ // kill-switch automatically (when false, review() fails open and never reaches
74
+ // this function). The 2026-06-27 incident is the founding case.
75
+ const selfStop = detectSelfStopShape(text);
76
+ if (selfStop.detected) {
77
+ return {
78
+ pass: false,
79
+ rule: 'B15_CONTEXT_DEATH_STOP',
80
+ issue: `Outbound tone review degraded to the deterministic floor (${reason}) and caught a self-stop shape (action "${selfStop.actionMatch}" + self-protective reason "${selfStop.reasonMatch}") with the LLM judge unavailable.`,
81
+ suggestion: 'Held on the deterministic self-stop floor: the work is pre-approved and reversible — drop the pause/defer framing and continue, or restate an explicit legitimate-stop reason (a genuine operator decision, an external blocker, or true completion).',
82
+ latencyMs,
83
+ failedClosed: true,
84
+ degradedToDeterministic: true,
85
+ };
86
+ }
66
87
  return {
67
88
  pass: true,
68
89
  rule: '',
@@ -436,7 +457,7 @@ These rules only fire when the producer has explicitly marked the candidate as a
436
457
 
437
458
  When you BLOCK, the issue field must state WHICH intent you detected and WHY this candidate expresses it, in your OWN words (1–2 sentences) — not "matched phrase X". Inability to cleanly articulate is NOT a pass license: if a stop is proposed and the reason is agent-state, BLOCK and say so plainly.
438
459
 
439
- Examples of the KIND of framing (ILLUSTRATIVE, NOT a checklist, NOT a necessary condition — recognize any paraphrase): "fresh session", "pick this up later", "tail of this run", "remaining context", "fresh focus / with a clear head", "more runway left in my window", "I'm sharper earlier in a run", "to avoid muddy output".
460
+ Examples of the KIND of framing (ILLUSTRATIVE, NOT a checklist, NOT a necessary condition — recognize any paraphrase): "fresh session", "pick this up later", "tail of this run", "remaining context", "fresh focus / with a clear head", "more runway left in my window", "I'm sharper earlier in a run", "to avoid muddy output", "not as the tail of an already-huge work session", "do it as a clean, focused pass", "rather not risk a half-finished restart / deploying restarts the agent" (restart-disruption avoidance is the AGENT'S own convenience, not a legitimate stop — a restart is a minimal, recoverable disruption), and treating a SELF-FIXABLE local/environment/test/setup failure as a reason to PAUSE rather than a task to fix (fixing the local environment is the agent's own job; "the environment is broken so I'll stop" is an agent-state stop unless the failure is a GENUINE external blocker the agent has exhausted).
440
461
 
441
462
  Severity: HIGH. False-negatives (a real slip getting through) are worse than false-positives — the operator explicitly asked for this guard against a recurring failure mode. The reason-gate above is what keeps it from over-blocking honest status disclosure (step 1).
442
463
 
@@ -1 +1 @@
1
- {"version":3,"file":"MessagingToneGate.js","sourceRoot":"","sources":["../../src/core/MessagingToneGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GAEzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAY7D;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAY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,4BAA4B,CAAC,KAAK,IAAI;oBACpE,wBAAwB,EAAE,CAAC,CAAC,0BAA0B,CAAC,KAAK,IAAI;iBACjE,CAAC;YACJ,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACP,uEAAuE;YACvE,uEAAuE;YACvE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAED,6IAA6I;AAC7I,SAAS,cAAc,CAAC,CAAS;IAC/B,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,OAAO,CAAC;IAC1C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AACrC,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Deterministic self-stop floor — the no-LLM backstop for the behavioral
3
+ * self-stop guard (B15/B18) on the DEGRADED tone-gate path.
4
+ *
5
+ * Spec: docs/specs/ux-is-the-product-hardening.md §2.1
6
+ *
7
+ * Why this exists (the 2026-06-27 incident): the behavioral self-stop rules
8
+ * (B15_CONTEXT_DEATH_STOP, B18_AUTONOMY_STOP) require the LLM judge. When the
9
+ * LLM backend is unavailable (provider throw → fail-open, or slow-budget-timeout
10
+ * → degrade to the leak-only floor) the self-stop guard SILENTLY VANISHES — which
11
+ * is exactly the flaky-backend condition under which an agent is most likely to
12
+ * be drifting. The leak floor (detectDeterministicLeak) keeps secrets/paths/
13
+ * commands from escaping during an outage, but it does NOT catch a clean-prose
14
+ * self-stop. This module fills that one gap: a deterministic recognizer for the
15
+ * self-stop SHAPE so the degraded path can HOLD (fail-CLOSED on suspicion) rather
16
+ * than wave a drift message through.
17
+ *
18
+ * Threat model: drift-correction, NOT a security boundary (same as the LLM gate).
19
+ * It is intentionally NARROW and high-precision (a stop/defer ACTION conjoined
20
+ * with a self-protective REASON), because it runs only on the degraded path where
21
+ * its verdict HOLDS a message. A genuine question to the operator or an external
22
+ * blocker report carries no self-protective reason and so is NOT held.
23
+ *
24
+ * Bias (degraded path only): favor false-POSITIVES — holding a borderline agent
25
+ * self-stop costs the agent a re-think; a false-NEGATIVE is the exact failure we
26
+ * are fixing. This is the inverse of B16/B17's bias because the cost asymmetry is
27
+ * inverted when the judge is offline.
28
+ */
29
+ export interface SelfStopFloorResult {
30
+ /** True when the text expresses the self-stop shape (stop/defer + self-protective reason). */
31
+ detected: boolean;
32
+ /** The action phrase that matched (for the audit issue), when detected. */
33
+ actionMatch?: string;
34
+ /** The self-protective reason phrase that matched (for the audit issue), when detected. */
35
+ reasonMatch?: string;
36
+ }
37
+ /**
38
+ * Detect the self-stop shape in an AGENT-OUTBOUND message. Detection requires
39
+ * BOTH a stop/defer ACTION marker AND a self-protective REASON marker, and NO
40
+ * strong legitimate-stop override. Pure and synchronous (no LLM, no subprocess).
41
+ */
42
+ export declare function detectSelfStopShape(text: string): SelfStopFloorResult;
43
+ //# sourceMappingURL=self-stop-floor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-stop-floor.d.ts","sourceRoot":"","sources":["../../src/core/self-stop-floor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,8FAA8F;IAC9F,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8ID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAarE"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Deterministic self-stop floor — the no-LLM backstop for the behavioral
3
+ * self-stop guard (B15/B18) on the DEGRADED tone-gate path.
4
+ *
5
+ * Spec: docs/specs/ux-is-the-product-hardening.md §2.1
6
+ *
7
+ * Why this exists (the 2026-06-27 incident): the behavioral self-stop rules
8
+ * (B15_CONTEXT_DEATH_STOP, B18_AUTONOMY_STOP) require the LLM judge. When the
9
+ * LLM backend is unavailable (provider throw → fail-open, or slow-budget-timeout
10
+ * → degrade to the leak-only floor) the self-stop guard SILENTLY VANISHES — which
11
+ * is exactly the flaky-backend condition under which an agent is most likely to
12
+ * be drifting. The leak floor (detectDeterministicLeak) keeps secrets/paths/
13
+ * commands from escaping during an outage, but it does NOT catch a clean-prose
14
+ * self-stop. This module fills that one gap: a deterministic recognizer for the
15
+ * self-stop SHAPE so the degraded path can HOLD (fail-CLOSED on suspicion) rather
16
+ * than wave a drift message through.
17
+ *
18
+ * Threat model: drift-correction, NOT a security boundary (same as the LLM gate).
19
+ * It is intentionally NARROW and high-precision (a stop/defer ACTION conjoined
20
+ * with a self-protective REASON), because it runs only on the degraded path where
21
+ * its verdict HOLDS a message. A genuine question to the operator or an external
22
+ * blocker report carries no self-protective reason and so is NOT held.
23
+ *
24
+ * Bias (degraded path only): favor false-POSITIVES — holding a borderline agent
25
+ * self-stop costs the agent a re-think; a false-NEGATIVE is the exact failure we
26
+ * are fixing. This is the inverse of B16/B17's bias because the cost asymmetry is
27
+ * inverted when the judge is offline.
28
+ */
29
+ /**
30
+ * (A) Stop / defer / hand-off ACTION markers — the agent proposing to halt or
31
+ * postpone in-flight work. ILLUSTRATIVE of the shape, matched case-insensitively
32
+ * as substrings. The list is deliberately broad on the ACTION axis because the
33
+ * REASON axis (B) is what makes a match high-precision.
34
+ */
35
+ const ACTION_MARKERS = [
36
+ 'pause here',
37
+ 'pausing here',
38
+ 'pausing rather than',
39
+ "i'm pausing",
40
+ 'im pausing',
41
+ 'going to pause',
42
+ 'will pause here',
43
+ 'let me pause',
44
+ 'stop here',
45
+ 'stopping here',
46
+ "i'll stop here",
47
+ 'let me stop here',
48
+ 'hold off on',
49
+ 'holding off on',
50
+ 'pick this up later',
51
+ 'pick it up later',
52
+ 'pick this back up later',
53
+ 'resume this later',
54
+ 'resume it later',
55
+ 'continue this later',
56
+ 'continue in a fresh',
57
+ 'continue in a new session',
58
+ 'leave it here for now',
59
+ 'leave this here for now',
60
+ 'wrap up here',
61
+ 'wrapping up here',
62
+ 'good stopping point',
63
+ 'natural stopping point',
64
+ 'natural off-ramp',
65
+ 'park this for',
66
+ 'parking this for',
67
+ 'hand this off',
68
+ 'handing this off',
69
+ 'handing it back',
70
+ 'hand it back',
71
+ ];
72
+ /**
73
+ * (B) Self-protective REASON markers — the agent's OWN operational state /
74
+ * convenience used to justify the stop, rather than a legitimate stop reason.
75
+ * Three families: context/fatigue, restart-avoidance, and environment-as-stop.
76
+ */
77
+ const REASON_MARKERS = [
78
+ // context / fatigue / volume / freshness — kept specific so an incidental
79
+ // mention of a data structure ("the tail of the array") or a UI ("compact
80
+ // layout") does NOT match (over-block fix, second-pass review 2026-06-28).
81
+ 'context window',
82
+ 'running low on context',
83
+ 'low on context',
84
+ 'out of context',
85
+ 'remaining context',
86
+ 'compact the conversation',
87
+ 'compact to continue',
88
+ 'fresh focus',
89
+ 'with a clear head',
90
+ 'clearer head',
91
+ "i'm sharper",
92
+ 'sharper earlier',
93
+ 'better fresh',
94
+ 'a clean, focused pass',
95
+ 'a clean focused pass',
96
+ 'clean focused pass',
97
+ 'half-finished',
98
+ 'half finished',
99
+ 'barreling ahead',
100
+ 'barrelling ahead',
101
+ 'huge work session',
102
+ 'already-huge',
103
+ 'already huge work',
104
+ 'tail of this run',
105
+ 'tail of this session',
106
+ 'tail of an already',
107
+ 'tail of a huge',
108
+ "i've done a lot already",
109
+ 'done a lot already',
110
+ "it's late",
111
+ 'it is late',
112
+ "i'm getting tired",
113
+ 'muddy output',
114
+ // restart / redeploy avoidance (the operator: a restart is a MINIMAL disruption)
115
+ 'restarts the agent',
116
+ 'restart the agent',
117
+ 'disruptive restart',
118
+ 'half-finished restart',
119
+ 'avoid a restart',
120
+ 'rather not restart',
121
+ 'risk a restart',
122
+ // environment-issue-as-stop — kept to the stop-specific phrasing only (the
123
+ // operator's directive: FIX the local environment; it's not a stop reason).
124
+ // The broad LLM-judge clause in B15 covers softer environment framings.
125
+ 'environment-only failures',
126
+ 'environment-only failure',
127
+ ];
128
+ /**
129
+ * Strong LEGITIMATE-stop overrides — when present, the stop's reason is NOT
130
+ * self-protective, so the floor does NOT hold. Kept narrow and high-confidence:
131
+ * an external dependency clearing on its own schedule, or an explicit
132
+ * operator-only/credential reason. (A bare "?" is intentionally NOT a legit
133
+ * override here — a self-stop dressed as a rhetorical question must still hold on
134
+ * the degraded path; the agent can re-send a genuine decision question without
135
+ * the self-stop framing.)
136
+ */
137
+ const LEGIT_OVERRIDES = [
138
+ 'rate limit',
139
+ 'rate-limit',
140
+ 'rate-limited',
141
+ 'rate limited',
142
+ 'once ci is green',
143
+ 'when ci is green',
144
+ 'until ci',
145
+ 'waiting on the deploy',
146
+ 'until the deploy',
147
+ 'api error',
148
+ 'returned 500',
149
+ 'returned a 500',
150
+ ' 503',
151
+ 'service is down',
152
+ 'service is unavailable',
153
+ 'waiting on you to',
154
+ 'need your password',
155
+ 'need a credential',
156
+ 'awaiting your approval',
157
+ 'pending your approval',
158
+ ];
159
+ function firstMatch(haystack, needles) {
160
+ for (const n of needles) {
161
+ if (haystack.includes(n))
162
+ return n;
163
+ }
164
+ return undefined;
165
+ }
166
+ /**
167
+ * Detect the self-stop shape in an AGENT-OUTBOUND message. Detection requires
168
+ * BOTH a stop/defer ACTION marker AND a self-protective REASON marker, and NO
169
+ * strong legitimate-stop override. Pure and synchronous (no LLM, no subprocess).
170
+ */
171
+ export function detectSelfStopShape(text) {
172
+ if (!text)
173
+ return { detected: false };
174
+ const hay = text.toLowerCase();
175
+ // A legitimate external/credential reason de-fangs the whole message.
176
+ if (firstMatch(hay, LEGIT_OVERRIDES))
177
+ return { detected: false };
178
+ const actionMatch = firstMatch(hay, ACTION_MARKERS);
179
+ if (!actionMatch)
180
+ return { detected: false };
181
+ const reasonMatch = firstMatch(hay, REASON_MARKERS);
182
+ if (!reasonMatch)
183
+ return { detected: false };
184
+ return { detected: true, actionMatch, reasonMatch };
185
+ }
186
+ //# sourceMappingURL=self-stop-floor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-stop-floor.js","sourceRoot":"","sources":["../../src/core/self-stop-floor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAWH;;;;;GAKG;AACH,MAAM,cAAc,GAAsB;IACxC,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,aAAa;IACb,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,yBAAyB;IACzB,mBAAmB;IACnB,iBAAiB;IACjB,qBAAqB;IACrB,qBAAqB;IACrB,2BAA2B;IAC3B,uBAAuB;IACvB,yBAAyB;IACzB,cAAc;IACd,kBAAkB;IAClB,qBAAqB;IACrB,wBAAwB;IACxB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;CACf,CAAC;AAEF;;;;GAIG;AACH,MAAM,cAAc,GAAsB;IACxC,0EAA0E;IAC1E,0EAA0E;IAC1E,2EAA2E;IAC3E,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,0BAA0B;IAC1B,qBAAqB;IACrB,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,eAAe;IACf,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,sBAAsB;IACtB,oBAAoB;IACpB,gBAAgB;IAChB,yBAAyB;IACzB,oBAAoB;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M,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACpD,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAE7C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * MESH-SELF-HEAL G1 — lease↔job binding via a THREE-SIGNAL liveness model (pure core).
3
+ *
4
+ * Spec: MESH-SELF-HEAL-SPEC §3.1. The DEEPEST fix: the "in charge" lease means two
5
+ * things at once — "I'm the coordinator" AND "I'm actually serving you" — and
6
+ * conflating them is what let the 2026-06-19/27 zombie hold the badge while serving
7
+ * nothing. G1 binds the two: a holder that has stopped doing the JOB must relinquish
8
+ * the badge, decided from THREE machine-local, monotonic liveness signals sourced
9
+ * from the lifeline's ACTUAL-poll truth (FD10: server-intent ≠ lifeline-actual is
10
+ * exactly what hid the incident).
11
+ *
12
+ * This module is the PURE decision (no I/O) so every branch is unit-testable on both
13
+ * sides. The caller supplies freshness booleans (computed by comparing each
14
+ * machine-local monotonic watermark against `jobStaleThresholdMs` on its OWN clock —
15
+ * never a cross-process/cross-machine monotonic subtraction), the debounce result,
16
+ * and POSITIVE peer-evidence of a global outage. It is SIGNAL/decision only; the
17
+ * caller actuates via F3's `relinquishAndBroadcast()` (signed tombstone). Ships DARK.
18
+ *
19
+ * The three signals (all machine-local, evaluated by the machine about ITSELF):
20
+ * - pollAttemptedMonoMs — a getUpdates cycle was attempted (alive + trying)
21
+ * - pollSucceededMonoMs — a getUpdates response succeeded (channel reachable)
22
+ * - serveProgressedMonoMs — a fetched update was dispatched/served (end-to-end)
23
+ */
24
+ export interface ZombieRelinquishInput {
25
+ /** This machine currently holds the fenced lease. */
26
+ holdsLease: boolean;
27
+ /** The `active` lease role (NOT observe-only/deferential — those are F3's path,
28
+ * not G1; finding Int-LOW). G1 only ever acts on an active holder. */
29
+ isActiveLeaseRole: boolean;
30
+ /**
31
+ * Updates are PENDING = `lastFetchedUpdateId > lastServedUpdateId` (the two
32
+ * poll-side counters) — NOT serve-queue depth, NOT the Telegram-acked offset
33
+ * (Adv2-F5/Adv3-F-D: the poller advances the offset on FETCH, so "offset not
34
+ * advanced" would falsely read non-pending even when serve silently dropped).
35
+ */
36
+ pending: boolean;
37
+ /** pollAttemptedMonoMs fresh (within jobStaleThresholdMs, own clock). */
38
+ pollAttemptedFresh: boolean;
39
+ /** pollSucceededMonoMs fresh. */
40
+ pollSucceededFresh: boolean;
41
+ /** serveProgressedMonoMs fresh (boot-epoch-fenced — a prior incarnation's stamp
42
+ * reads as NOT fresh; round-4 Adv4-B). */
43
+ serveProgressedFresh: boolean;
44
+ /** The relevant-staleness has PERSISTED across N fresh evaluator ticks (Adv-F8 —
45
+ * defeats an evaluator-resume false trip). The caller debounces. */
46
+ staleConfirmed: boolean;
47
+ /**
48
+ * POSITIVE evidence the outage is GLOBAL: a fresh, signed heartbeat from ≥1 live
49
+ * peer in-window that ALSO reports pollSucceeded-stale. "I can't hear any peer"
50
+ * must NEVER set this true (Adv2-F2 — a heartbeat-transport partition is not a
51
+ * global outage; misreading it would HOLD and protect a real zombie).
52
+ */
53
+ peerConfirmsGlobalOutage: boolean;
54
+ }
55
+ export type ZombieRelinquishAction = 'not-applicable' | 'healthy' | 'await-confirm' | 'hold-global' | 'relinquish' | 'relinquish-wedged';
56
+ export interface ZombieRelinquishDecision {
57
+ action: ZombieRelinquishAction;
58
+ /** Should the caller run relinquishAndBroadcast() now? */
59
+ relinquish: boolean;
60
+ /** Short machine-readable reason for the audit log. */
61
+ reason: string;
62
+ }
63
+ /**
64
+ * Decide whether an active lease-HOLDER is a zombie that must relinquish. Pure;
65
+ * the caller actuates only on `relinquish` (quiesce the renew path + draw a
66
+ * tombstone nonce > the highest it will emit this epoch, then relinquishAndBroadcast).
67
+ */
68
+ export declare function decideZombieRelinquish(input: ZombieRelinquishInput): ZombieRelinquishDecision;
69
+ /**
70
+ * G1 soak/observability ledger — evaluable evidence (mirrors G2/G3 close-the-loop).
71
+ * Counts each decision-class transition. SIGNAL only.
72
+ */
73
+ export interface ZombieRelinquishLedgerSummary {
74
+ evaluations: number;
75
+ relinquishedLocal: number;
76
+ relinquishedWedged: number;
77
+ heldGlobal: number;
78
+ healthy: number;
79
+ awaitConfirm: number;
80
+ firstAt: string | null;
81
+ lastAt: string | null;
82
+ }
83
+ export declare class ZombieRelinquishLedger {
84
+ private s;
85
+ record(decision: ZombieRelinquishDecision, nowIso: string): void;
86
+ summary(): ZombieRelinquishLedgerSummary;
87
+ }
88
+ /** Process-wide shared G1 ledger (mirrors sharedG2NobodyPollingLedger). */
89
+ export declare const sharedG1ZombieRelinquishLedger: ZombieRelinquishLedger;
90
+ //# sourceMappingURL=zombieRelinquish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zombieRelinquish.d.ts","sourceRoot":"","sources":["../../src/core/zombieRelinquish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,qBAAqB;IACpC,qDAAqD;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB;2EACuE;IACvE,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,yEAAyE;IACzE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B;+CAC2C;IAC3C,oBAAoB,EAAE,OAAO,CAAC;IAC9B;yEACqE;IACrE,cAAc,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,MAAM,sBAAsB,GAC9B,gBAAgB,GAChB,SAAS,GACT,eAAe,GACf,aAAa,GACb,YAAY,GACZ,mBAAmB,CAAC;AAExB,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,0DAA0D;IAC1D,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,CAsC7F;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,CAAC,CAGP;IAEF,MAAM,CAAC,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAchE,OAAO,IAAI,6BAA6B;CAGzC;AAED,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,wBAA+B,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * MESH-SELF-HEAL G1 — lease↔job binding via a THREE-SIGNAL liveness model (pure core).
3
+ *
4
+ * Spec: MESH-SELF-HEAL-SPEC §3.1. The DEEPEST fix: the "in charge" lease means two
5
+ * things at once — "I'm the coordinator" AND "I'm actually serving you" — and
6
+ * conflating them is what let the 2026-06-19/27 zombie hold the badge while serving
7
+ * nothing. G1 binds the two: a holder that has stopped doing the JOB must relinquish
8
+ * the badge, decided from THREE machine-local, monotonic liveness signals sourced
9
+ * from the lifeline's ACTUAL-poll truth (FD10: server-intent ≠ lifeline-actual is
10
+ * exactly what hid the incident).
11
+ *
12
+ * This module is the PURE decision (no I/O) so every branch is unit-testable on both
13
+ * sides. The caller supplies freshness booleans (computed by comparing each
14
+ * machine-local monotonic watermark against `jobStaleThresholdMs` on its OWN clock —
15
+ * never a cross-process/cross-machine monotonic subtraction), the debounce result,
16
+ * and POSITIVE peer-evidence of a global outage. It is SIGNAL/decision only; the
17
+ * caller actuates via F3's `relinquishAndBroadcast()` (signed tombstone). Ships DARK.
18
+ *
19
+ * The three signals (all machine-local, evaluated by the machine about ITSELF):
20
+ * - pollAttemptedMonoMs — a getUpdates cycle was attempted (alive + trying)
21
+ * - pollSucceededMonoMs — a getUpdates response succeeded (channel reachable)
22
+ * - serveProgressedMonoMs — a fetched update was dispatched/served (end-to-end)
23
+ */
24
+ /**
25
+ * Decide whether an active lease-HOLDER is a zombie that must relinquish. Pure;
26
+ * the caller actuates only on `relinquish` (quiesce the renew path + draw a
27
+ * tombstone nonce > the highest it will emit this epoch, then relinquishAndBroadcast).
28
+ */
29
+ export function decideZombieRelinquish(input) {
30
+ const { holdsLease, isActiveLeaseRole, pending, pollAttemptedFresh, pollSucceededFresh, serveProgressedFresh, staleConfirmed, peerConfirmsGlobalOutage, } = input;
31
+ // G1 only acts on an ACTIVE holder. A non-holder / observe-only / deferential
32
+ // machine is handled elsewhere (F3 / G2), never here.
33
+ if (!holdsLease || !isActiveLeaseRole) {
34
+ return { action: 'not-applicable', relinquish: false, reason: 'not-an-active-holder' };
35
+ }
36
+ // The relevant liveness signal: end-to-end SERVE progress when updates are
37
+ // pending, else the poll-SUCCESS heartbeat when idle (no pending work to serve).
38
+ const relevantStale = pending ? !serveProgressedFresh : !pollSucceededFresh;
39
+ if (!relevantStale) {
40
+ return { action: 'healthy', relinquish: false, reason: pending ? 'serve-progressing' : 'poll-succeeding' };
41
+ }
42
+ // Debounce: a single stale read is not a zombie (an evaluator-resume blip).
43
+ if (!staleConfirmed) {
44
+ return { action: 'await-confirm', relinquish: false, reason: 'stale-not-yet-confirmed' };
45
+ }
46
+ // The poll LOOP itself is wedged (not even attempting) → relinquish unconditionally;
47
+ // a wedged holder serves nothing and HOLD cannot be justified.
48
+ if (!pollAttemptedFresh) {
49
+ return { action: 'relinquish-wedged', relinquish: true, reason: 'poll-loop-wedged-pollattempted-stale' };
50
+ }
51
+ // pollAttempted is fresh (alive + trying) but the channel/serve is stale. Only a
52
+ // POSITIVE peer confirmation that the outage is shared justifies HOLD; absent it,
53
+ // treat as LOCAL failure and relinquish (the safe direction — G2 picks a server).
54
+ if (peerConfirmsGlobalOutage) {
55
+ return { action: 'hold-global', relinquish: false, reason: 'global-outage-peer-confirmed-hold' };
56
+ }
57
+ return { action: 'relinquish', relinquish: true, reason: 'local-failure-relinquish-safe-direction' };
58
+ }
59
+ export class ZombieRelinquishLedger {
60
+ s = {
61
+ evaluations: 0, relinquishedLocal: 0, relinquishedWedged: 0, heldGlobal: 0,
62
+ healthy: 0, awaitConfirm: 0, firstAt: null, lastAt: null,
63
+ };
64
+ record(decision, nowIso) {
65
+ if (decision.action === 'not-applicable')
66
+ return; // a non-holder is a non-event
67
+ this.s.evaluations += 1;
68
+ switch (decision.action) {
69
+ case 'relinquish':
70
+ this.s.relinquishedLocal += 1;
71
+ break;
72
+ case 'relinquish-wedged':
73
+ this.s.relinquishedWedged += 1;
74
+ break;
75
+ case 'hold-global':
76
+ this.s.heldGlobal += 1;
77
+ break;
78
+ case 'healthy':
79
+ this.s.healthy += 1;
80
+ break;
81
+ case 'await-confirm':
82
+ this.s.awaitConfirm += 1;
83
+ break;
84
+ }
85
+ if (this.s.firstAt === null)
86
+ this.s.firstAt = nowIso;
87
+ this.s.lastAt = nowIso;
88
+ }
89
+ summary() {
90
+ return { ...this.s };
91
+ }
92
+ }
93
+ /** Process-wide shared G1 ledger (mirrors sharedG2NobodyPollingLedger). */
94
+ export const sharedG1ZombieRelinquishLedger = new ZombieRelinquishLedger();
95
+ //# sourceMappingURL=zombieRelinquish.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zombieRelinquish.js","sourceRoot":"","sources":["../../src/core/zombieRelinquish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAkDH;;;;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ACL,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC;IACvB,CAAC;CACF;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.691",
3
+ "version": "1.3.693",
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-28T09:47:08.176Z",
5
- "instarVersion": "1.3.691",
4
+ "generatedAt": "2026-06-28T10:28:11.496Z",
5
+ "instarVersion": "1.3.693",
6
6
  "entryCount": 202,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,25 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ Mesh Self-Heal **G1 — core decision logic** (increment 1 of the lease↔job binding, MESH-SELF-HEAL-SPEC §3.1). Adds `src/core/zombieRelinquish.ts`: the PURE, deterministic decision for the deepest fix — the "in charge" lease currently means two things at once ("I'm the coordinator" AND "I'm actually serving you"), and conflating them is what let a machine hold the badge while serving nothing. G1 binds them: an active holder that has stopped doing the JOB must relinquish.
9
+
10
+ - `decideZombieRelinquish` — three-signal liveness (pollAttempted / pollSucceeded / serveProgressed, all machine-local, about the machine ITSELF): `not-applicable` for a non-active-holder; `healthy`; `await-confirm` (debounced); `relinquish-wedged` (poll loop dead → unconditional); `hold-global` (only on POSITIVE peer evidence the outage is shared — "can't hear a peer" ≠ global); `relinquish` (confirmed LOCAL failure → safe direction, G2 backstops). Pending work keys on serve-progress; idle keys on poll-success.
11
+ - `ZombieRelinquishLedger` — evaluable soak evidence (mirrors G2/G3).
12
+
13
+ Pure decision logic, NOT yet wired — ZERO runtime effect until the next increment (the three-signal watermark plumbing incl. the new `state/serve-progress.json` record + the tickLease holder-branch wiring + F3 relinquish actuation) consumes it.
14
+
15
+ ## What to Tell Your User
16
+
17
+ Nothing changes yet — inert internal decision logic for the deepest part of the multi-machine self-heal, not active anywhere. When the full feature lands, a machine that holds the "in charge" badge but has quietly stopped fetching/serving your messages will automatically hand the badge off (instead of sitting on it while messages drop) — and exactly one healthy machine takes over. No action needed.
18
+
19
+ ## Summary of New Capabilities
20
+
21
+ - None user-facing in this increment. New internal module `src/core/zombieRelinquish.ts` (pure decision core) consumed by a later wiring increment; no route, config flag, or runtime surface added yet.
22
+
23
+ ## Evidence
24
+
25
+ - `tests/unit/zombieRelinquish.test.ts` — 11 unit tests covering both sides of every branch: not-a-holder / observe-only → not-applicable; healthy (pending→serve, idle→poll); await-confirm; relinquish-wedged; hold-global (peer-confirmed); relinquish (no peer evidence = safe direction); fetched-and-dropped zombie; ledger accounting. Typecheck clean.
@@ -0,0 +1,45 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ The always-on outbound message gate has a behavioral check that blocks the agent from talking itself
9
+ out of finishing pre-approved work (the "let me pause and pick this up fresh later" / "good stopping
10
+ point" / "I'd rather not restart" bail-out habit). That check needs the LLM judge — and when the judge
11
+ was unreachable (a flaky backend), the gate quietly let the message through. The leak backup
12
+ (passwords / file paths / commands) still ran, but the behavioral self-stop check simply vanished
13
+ under outage — exactly when the agent is most likely to be drifting.
14
+
15
+ This adds a deterministic, no-LLM **self-stop floor** to the gate's existing degraded path
16
+ (`src/core/self-stop-floor.ts`, wired into `buildDegradedToneResult`). When the LLM judge is offline
17
+ and a message has the self-stop SHAPE — a stop/defer action conjoined with a self-protective reason
18
+ (volume/fatigue, restart-avoidance, or treating a fixable local issue as a reason to stop) — the
19
+ message is now HELD and surfaced back to the agent ("the work is pre-approved — continue") instead of
20
+ being waved through. A genuine decision question to the operator or an external-blocker wait carries
21
+ no self-protective reason and still sends. The LLM-judge B15 rule also got an illustrative clause for
22
+ these same framings. The existing `messaging.toneGate.failClosedOnExhaustion: false` kill-switch
23
+ covers the floor too.
24
+
25
+ ## What to Tell Your User
26
+
27
+ If your agent ever went quiet under load and then later admitted it had "paused to pick things up
28
+ fresh" — that gap is now closed on the degraded path. When the message-checking engine is briefly
29
+ offline, the agent can no longer quietly send itself a bail-out and stop; the message is held and the
30
+ agent is pushed to keep going on work you already approved. Nothing changes on normal sends, and your
31
+ existing override still works.
32
+
33
+ ## Summary of New Capabilities
34
+
35
+ - Deterministic self-stop backstop on the outbound gate's degraded path — the "don't talk yourself out
36
+ of finishing" guard no longer disappears when the LLM judge is unavailable.
37
+
38
+ ## Evidence
39
+
40
+ - Replay of the 2026-06-27 bail-out message through the live deployed gate: `pass=false
41
+ rule=B15_CONTEXT_DEATH_STOP` (the gate's logic was already correct; the defect was fail-open under
42
+ outage, confirmed by `/metrics/features` showing fired=0 across 394 real calls in 72h).
43
+ - tests/unit/self-stop-floor.test.ts (10 cases) + tests/unit/MessagingToneGate.test.ts (4 new
44
+ degraded-path cases): the slip HOLDs on a provider throw, a legit decision question SENDs, the
45
+ kill-switch fails open. 86 related tests green; `tsc --noEmit` clean.
@@ -0,0 +1,32 @@
1
+ # Side-Effects Review — Mesh Self-Heal G1 (core decision logic)
2
+
3
+ **Change:** The PURE decision core of G1 (lease↔job binding via a three-signal liveness model) from MESH-SELF-HEAL-SPEC §3.1 — `src/core/zombieRelinquish.ts` (`decideZombieRelinquish` + `ZombieRelinquishLedger`) + 11 unit tests. This is increment 1 of G1: the decision only. It is NOT YET WIRED to any tick, watermark plumbing, or actuation — ZERO runtime effect until a later increment consumes it.
4
+
5
+ **Decision point?** The module encodes a decision (is an active holder a zombie that must relinquish?), but nothing CALLS it yet, so there is no live decision-point in this increment. Signal-vs-authority assessed (Q4).
6
+
7
+ ## 1. Over-block
8
+ N/A — unwired. By design it biases AGAINST relinquishing: `not-applicable` for a non-active-holder; `healthy` when the relevant signal is fresh; `await-confirm` until the staleness persists across N ticks. It only relinquishes on a CONFIRMED zombie.
9
+
10
+ ## 2. Under-block
11
+ As pure logic, none in-scope. The KNOWN not-yet-built pieces (tracked, not orphan-deferred — see MESH-SELF-HEAL-G2-BUILD.md / spec §3.1): the three-signal watermark plumbing (`pollAttempted/SucceededMonoMs` from `lifeline-poll-active.json`; `serveProgressedMonoMs` in a NEW single-writer `state/serve-progress.json` with a boot-epoch fence), the `lastFetched>lastServed` pending counters, the per-tick debounce, the positive-peer-evidence global-outage signal, and the tickLease holder-branch wiring + F3 `relinquishAndBroadcast` actuation (with the tombstone-nonce quiesce). Until those land, this module is inert.
12
+
13
+ ## 3. Level-of-abstraction fit
14
+ Correct. A pure decision module mirroring `nobodyPollingRecovery.ts` (G2) / `leaseGatedSpawn.ts` (G3) — no I/O, fully unit-testable, consumed by a thin wiring layer later. It encodes the spec's exact rule: pending → serveProgressed signal, idle → pollSucceeded signal; wedged poll loop → unconditional relinquish; "can't hear a peer" ≠ global (only positive peer evidence HOLDs).
15
+
16
+ ## 4. Signal vs authority compliance
17
+ COMPLIANT. Pure function, no I/O, no authority. The actual authority (`relinquishAndBroadcast` — a signed tombstone) lives in the lease coordinator, which the future wiring calls; this module only DECIDES. The decision keys ONLY on machine-local signals about the machine ITSELF (never a peer-observed value driving a relinquish; finding Sec-F1) — the structural defense against a skew/partition-induced false relinquish.
18
+
19
+ ## 5. Interactions
20
+ None in this increment (unwired). Intended (wiring increment): reads the lifeline-actual truth (FD10) + the new serve-progress record; the relinquish runs F3's path; it composes with G2 (a relinquished holder lets G2's single-claimant pick a server) and G3 (the lease it binds is the same fence G3's spawn gate reads).
21
+
22
+ ## 6. External surfaces
23
+ None yet. No route, config flag, or watermark write in this increment — pure logic. The exported `sharedG1ZombieRelinquishLedger` singleton mirrors the G2/G3 ledgers; written/read only once the wiring lands.
24
+
25
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
26
+ This IS the deepest cross-machine coherence fix — binding "holds the lease" to "actually serving" so a zombie holder self-relinquishes. The three watermarks are machine-local, never replicated (Sca-F1), evaluated by each machine about ITSELF (skew-immune — no foreign-monotonic subtraction). The decision is local; coherence emerges because a zombie relinquishes and G2's fenced single-claimant picks the successor.
27
+
28
+ ## 8. Rollback cost
29
+ Trivial — revert the commit. Unreferenced by any runtime path, so removing it cannot affect a running agent. No config, no migration, no state.
30
+
31
+ ## Second-pass review
32
+ Not triggered for this increment (unwired pure logic, no live decision-point / block-allow authority / session-lifecycle touch). The Phase-5 second-pass IS required for the WIRING increment (it consumes lease-relinquish authority + adds cross-process watermark plumbing) and is flagged for that increment.
@@ -0,0 +1,108 @@
1
+ # Side-Effects Review — Deterministic self-stop floor (degraded-path behavioral backstop)
2
+
3
+ **Spec:** docs/specs/ux-is-the-product-hardening.md (Tier 1 — staged ELI16 + this artifact; no converged spec). **ELI16:** docs/specs/ux-is-the-product-hardening.eli16.md
4
+ **Parent:** The User Experience Is the Product — Reachability/Responsiveness/Coherence Are Sacred; Structure > Willpower.
5
+ **Files:** src/core/self-stop-floor.ts (new), src/core/MessagingToneGate.ts (wire into buildDegradedToneResult + B15 illustrative clause), tests/unit/self-stop-floor.test.ts (new), tests/unit/MessagingToneGate.test.ts (4 new degraded-path cases).
6
+
7
+ ## What changed
8
+
9
+ 1. **self-stop-floor.ts (new):** a pure, synchronous `detectSelfStopShape(text)` — recognizes the
10
+ self-stop SHAPE = a stop/defer ACTION marker conjoined with a self-protective REASON marker
11
+ (context/fatigue/volume, restart-avoidance, environment-as-stop), with a strong legitimate-stop
12
+ override (external dependency clearing, credential/approval). No LLM, no subprocess.
13
+ 2. **MessagingToneGate.buildDegradedToneResult:** after the existing deterministic LEAK check, run
14
+ the self-stop floor; if it fires → HOLD (rule `B15_CONTEXT_DEATH_STOP`, `failedClosed:true`,
15
+ `degradedToDeterministic:true`). This is the shared degrade site, so BOTH degrade manifestations
16
+ (provider-throw inside review() AND slow-budget-timeout at the route seam) are covered identically.
17
+ 3. **B15 prompt:** one ILLUSTRATIVE clause added (restart-disruption avoidance, "tail of a huge work
18
+ session", environment-as-stop) — NOT a literal gate; the rule still judges by meaning.
19
+
20
+ ## Phase 1 — Principle check (signal vs authority)
21
+
22
+ This change DOES touch a decision point (it can HOLD an outbound message). Per
23
+ `docs/signal-vs-authority.md`: the detector is a SIGNAL producer (`detectSelfStopShape` returns a
24
+ boolean shape verdict); the AUTHORITY remains `buildDegradedToneResult` / the gate. The brittle
25
+ deterministic check is given blocking authority ONLY on the already-degraded path where the
26
+ alternative is a blind fail-open — i.e. it strictly improves on "no check at all". On the normal
27
+ (judge-available) path, the smart LLM authority is unchanged and owns the decision. So the brittle
28
+ detector never parallels or shadows the smart gate; it backstops it only when the smart gate is
29
+ absent. This is the sanctioned use of a brittle check (a floor under outage), not a brittle check
30
+ holding primary authority.
31
+
32
+ ## Side-effects review (the 8 questions)
33
+
34
+ 1. **Over-block** — Could hold a legitimate agent message that happens to pair a stop-word with a
35
+ self-protective-sounding word, ONLY while the LLM judge is down. Mitigated by: requiring BOTH an
36
+ action AND a reason marker (conjunction → high precision), the legitimate-stop override (external
37
+ blocker / credential), and the fact it only runs on the degraded path. A held message is surfaced
38
+ to the agent to revise, never dropped. Bias is intentionally toward over-hold here (the safe
39
+ direction under outage) per the operator's explicit "never let this slip again."
40
+ 2. **Under-block** — A self-stop phrased with NO word in either list (a wholly novel euphemism) still
41
+ slips on the degraded path. Accepted: the deterministic floor cannot match the full semantic space
42
+ — that is what the LLM judge is for, and the real fix for availability is the backend-reliability
43
+ work (pi/gemini fallback, already merged) so the judge is actually present. The floor reduces, it
44
+ does not eliminate, the degraded-path gap. No silent claim of completeness.
45
+ 3. **Level-of-abstraction fit** — Correct layer: it lives beside the existing deterministic leak floor
46
+ (`detectDeterministicLeak`) and wires into the same `buildDegradedToneResult`, so the slow and fast
47
+ degrade manifestations get it identically. It does NOT duplicate B15's LLM logic; it is explicitly
48
+ the degraded-path-only backstop. A higher layer (the LLM judge) already owns the normal path.
49
+ 4. **Signal vs authority compliance** — Compliant (see Phase 1). The detector is a signal; the gate is
50
+ the authority; the brittle check holds authority only where the smart authority is unavailable.
51
+ 5. **Interactions** — Runs AFTER the leak check in `buildDegradedToneResult` (a leak still HOLDs
52
+ first, with its own rule). It does NOT run on the normal path, so it cannot shadow or double-fire
53
+ with the LLM B15. It inherits the `failClosedOnExhaustion` three-valued knob automatically: when
54
+ `false`, review() fails open before reaching `buildDegradedToneResult`, so the floor is skipped
55
+ (proven by test); when `true`, review() pure-holds before reaching it; the floor only manifests on
56
+ the DEFAULT (unset) degrade disposition. No race with cleanup.
57
+ 6. **External surfaces** — Only changes what the user sees on the narrow degraded+self-stop case (they
58
+ now do NOT receive a bail-out message during an outage; the agent is told to continue). No new
59
+ route, no new config key, no cross-agent surface, no data model change. Depends on no timing or
60
+ runtime state beyond the text itself (pure function).
61
+ 7. **Multi-machine posture** — **Machine-local BY DESIGN, and correctly so.** The tone gate runs on
62
+ whichever machine is sending the message; the floor is a pure function of the message text with no
63
+ state. There is nothing to replicate or proxy — every machine that runs the gate runs the same
64
+ deterministic floor identically. No single-machine assumption, no durable state to strand, no URL.
65
+ 8. **Rollback cost** — Trivial. The whole degraded path is already gated by
66
+ `messaging.toneGate.failClosedOnExhaustion: false` (operator kill-switch → fail-open, skips the
67
+ floor). To fully revert: drop the `detectSelfStopShape` call in `buildDegradedToneResult` + the
68
+ new module. Additive, no migration, no state repair.
69
+
70
+ ## Tests
71
+
72
+ - tests/unit/self-stop-floor.test.ts (10): the 2026-06-27 slip detects; restart/context/environment
73
+ framings detect; legitimate operator-decision question, external-blocker wait, normal progress
74
+ report, action-without-reason, reason-without-action, and empty input do NOT detect.
75
+ - tests/unit/MessagingToneGate.test.ts (+4): on a provider throw — the slip HOLDs (B15), a legit
76
+ decision question SENDs, and the `failClosedOnExhaustion:false` kill-switch fails open (floor
77
+ skipped). 86 related tests green; `tsc --noEmit` clean.
78
+
79
+ ## Rollback
80
+
81
+ Set `messaging.toneGate.failClosedOnExhaustion: false` (existing operator knob) → the floor is skipped
82
+ (pure fail-open restored). Full revert: remove the `detectSelfStopShape` wiring + module. Additive
83
+ throughout; no data or state migration.
84
+
85
+ ## Phase 5 — Second-pass review (required: touches the message gate)
86
+
87
+ An independent reviewer subagent audited this change against the code (not the artifact's claims).
88
+ **Verdict: Concur with the review**, with one non-blocking over-block concern.
89
+
90
+ Verified independently: (1) signal-vs-authority — `detectSelfStopShape` has exactly one caller,
91
+ `buildDegradedToneResult`, reached only on the two degrade sites; the normal path returns before it.
92
+ (2) Kill-switch inheritance confirmed on BOTH degrade sites (`failClosedOnExhaustion===false` fails
93
+ open before the floor is reached in `review()`, and `budgetDegrade` is `undefined` unless the
94
+ disposition is unset at the route seam). (3) No double-fire/shadow with the leak floor (leak runs
95
+ first, self-stop only when leak is null). (4) Tests prove the claims (drive real `gate.review()` with
96
+ an error provider), not tautological.
97
+
98
+ **Concern raised (addressed in-change, NOT deferred):** several markers were over-broad substrings
99
+ that would hold legitimate degraded-path messages (e.g. "come back to this … the tail of the array",
100
+ "as a follow-up; a local environment concern", "wrap up here — the compact dashboard layout",
101
+ "handoff doc covering this long work session"). Fixed by tightening both marker lists: dropped the
102
+ generic action phrases ("come back to this", "as a follow-up", bare "handoff", bare "defer/park"),
103
+ dropped the generic reason substrings (bare "compact" → "compact the conversation"; bare "tail of" →
104
+ "tail of this run/session / an already / a huge"; dropped bare "long/big work session", "local
105
+ environment"/"environment issue"/"environment failures" → kept only "environment-only failures"). The
106
+ four flagged false positives + one extra are now locked in as passing regression tests
107
+ (`self-stop-floor.test.ts` → "over-block regressions"); the 2026-06-27 incident still detects. 55
108
+ tests green after the tightening, `tsc` clean.