instar 1.3.692 → 1.3.694
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.
- package/dist/core/MessagingToneGate.d.ts.map +1 -1
- package/dist/core/MessagingToneGate.js +22 -1
- package/dist/core/MessagingToneGate.js.map +1 -1
- package/dist/core/self-stop-floor.d.ts +43 -0
- package/dist/core/self-stop-floor.d.ts.map +1 -0
- package/dist/core/self-stop-floor.js +186 -0
- package/dist/core/self-stop-floor.js.map +1 -0
- package/dist/core/serveProgress.d.ts +61 -0
- package/dist/core/serveProgress.d.ts.map +1 -0
- package/dist/core/serveProgress.js +89 -0
- package/dist/core/serveProgress.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.693.md +45 -0
- package/upgrades/1.3.694.md +24 -0
- package/upgrades/side-effects/mesh-self-heal-g1-serve-progress.md +32 -0
- package/upgrades/side-effects/self-stop-floor.md +108 -0
|
@@ -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;
|
|
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;AAUvD;;;;;;;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;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iB;IAgBzB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,oBAAoB;IAqB5B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAmBxB;;;;;;;;OAQG;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 (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I;oBAC1C,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;wBAChD,CAAC,CAAE,CAAC,CAAC,gBAAgB,CAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;wBACnG,CAAC,CAAC,EAAE;oBACN,gBAAgB,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,CAAC,CAAC,kBAAkB,CAAY,CAAC,CAAC,CAAC,MAAM;oBACxG,0BAA0B,EAAE,CAAC,CAAC,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,aAA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;IACd,gBAAgB;IAChB,MAAM;IACN,iBAAiB;IACjB,wBAAwB;IACxB,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,wBAAwB;IACxB,uBAAuB;CACxB,CAAC;AAEF,SAAS,UAAU,CAAC,QAAgB,EAAE,OAA0B;IAC9D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAE/B,sEAAsE;IACtE,IAAI,UAAU,CAAC,GAAG,EAAE,eAAe,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAEjE,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACpD,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7C,MAAM,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,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MESH-SELF-HEAL G1 — the serve-progress watermark (MESH-SELF-HEAL-SPEC §3.1).
|
|
3
|
+
*
|
|
4
|
+
* `serveProgressedMonoMs` is the THIRD liveness signal — stamped when a fetched
|
|
5
|
+
* update is dispatched/served/durably-enqueued (proves end-to-end progress, closes
|
|
6
|
+
* the "fetched-and-dropped" gap, finding Adv-F4). It CANNOT share the lifeline's
|
|
7
|
+
* `lifeline-poll-active.json` (that record is the lifeline PROCESS's, atomically
|
|
8
|
+
* rewritten on every poll-state change with no serve field — a second-process write
|
|
9
|
+
* would clobber it). So it lives in its OWN single-writer record `state/serve-progress.json`,
|
|
10
|
+
* written by the dispatch seam and read cross-process by the relinquish evaluator
|
|
11
|
+
* (round-2 Int2-D / round-3 Les3-F1 — net-new, deliberately-acknowledged plumbing).
|
|
12
|
+
*
|
|
13
|
+
* THE LOAD-BEARING SAFETY: a **boot-epoch fence** (round-4 Adv4-B). Because this is a
|
|
14
|
+
* persisted file (one process can't read another's memory), a stamp written by a
|
|
15
|
+
* PRIOR incarnation must NEVER read as fresh after a crash/restart — else a
|
|
16
|
+
* crash-stale stamp would mask a non-serving new process (re-creating the zombie).
|
|
17
|
+
* The record carries a `bootId`; the reader discards any stamp whose `bootId` ≠ the
|
|
18
|
+
* current incarnation (a boot-epoch fence — NOT a raw monotonic compare, which
|
|
19
|
+
* across incarnations would be an invalid cross-domain subtraction). Within ONE
|
|
20
|
+
* incarnation the monotonic stamps share a clock domain, so the freshness compare is
|
|
21
|
+
* valid. The field is a single machine-global monotonic-MAX watermark (NOT per-topic
|
|
22
|
+
* state) — concurrent dispatch-seam writers are benign because it only ever advances
|
|
23
|
+
* (round-4 Adv4-A).
|
|
24
|
+
*
|
|
25
|
+
* Threat model + write posture mirror `pollIntent.ts`: local same-uid IPC, atomic
|
|
26
|
+
* tmp+rename so the reader never sees a torn record.
|
|
27
|
+
*/
|
|
28
|
+
export interface ServeProgressRecord {
|
|
29
|
+
/** Monotonic stamp (writer's monotonic clock) at the last served/enqueued update. */
|
|
30
|
+
serveProgressedMonoMs: number;
|
|
31
|
+
/** Writer process incarnation marker — the boot-epoch fence. */
|
|
32
|
+
bootId: string;
|
|
33
|
+
/** Writer pid (parity with pollIntent; diagnostics only). */
|
|
34
|
+
serverPid: number;
|
|
35
|
+
/** Wall-clock of the write (diagnostics; freshness uses the monotonic stamp). */
|
|
36
|
+
ts: number;
|
|
37
|
+
}
|
|
38
|
+
export declare function serveProgressPath(stateDir: string): string;
|
|
39
|
+
export declare function readServeProgress(stateDir: string): ServeProgressRecord | null;
|
|
40
|
+
/**
|
|
41
|
+
* Stamp serve progress. Monotonic-MAX: only ever advances — a write with a
|
|
42
|
+
* `monoMs` not greater than the current record's (SAME incarnation) is dropped, so
|
|
43
|
+
* concurrent dispatch-seam writers never regress the watermark. A record from a
|
|
44
|
+
* different `bootId` is always overwritten (a new incarnation starts its own clock
|
|
45
|
+
* domain; the prior stamp must not survive as fresh — the boot-epoch fence).
|
|
46
|
+
*/
|
|
47
|
+
export declare function writeServeProgress(stateDir: string, args: {
|
|
48
|
+
bootId: string;
|
|
49
|
+
serverPid: number;
|
|
50
|
+
monoMs: number;
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
* Is serve progress FRESH (the relinquish evaluator's read)? Boot-epoch-fenced:
|
|
54
|
+
* a stamp from a different incarnation (`bootId` mismatch) is treated as "no
|
|
55
|
+
* progress yet" (false) — so a crash-stale on-disk stamp can never mask a
|
|
56
|
+
* non-serving new process. Within the current incarnation the monotonic compare is
|
|
57
|
+
* a valid same-clock-domain subtraction. `currentBootId` + `currentMonoMs` are
|
|
58
|
+
* injected (the reader's own incarnation + monotonic now) so this is pure + testable.
|
|
59
|
+
*/
|
|
60
|
+
export declare function serveProgressFresh(stateDir: string, currentBootId: string, currentMonoMs: number, thresholdMs: number): boolean;
|
|
61
|
+
//# sourceMappingURL=serveProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serveProgress.d.ts","sourceRoot":"","sources":["../../src/core/serveProgress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,MAAM,WAAW,mBAAmB;IAClC,qFAAqF;IACrF,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAmB9E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC1D,IAAI,CAcN;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAKT"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MESH-SELF-HEAL G1 — the serve-progress watermark (MESH-SELF-HEAL-SPEC §3.1).
|
|
3
|
+
*
|
|
4
|
+
* `serveProgressedMonoMs` is the THIRD liveness signal — stamped when a fetched
|
|
5
|
+
* update is dispatched/served/durably-enqueued (proves end-to-end progress, closes
|
|
6
|
+
* the "fetched-and-dropped" gap, finding Adv-F4). It CANNOT share the lifeline's
|
|
7
|
+
* `lifeline-poll-active.json` (that record is the lifeline PROCESS's, atomically
|
|
8
|
+
* rewritten on every poll-state change with no serve field — a second-process write
|
|
9
|
+
* would clobber it). So it lives in its OWN single-writer record `state/serve-progress.json`,
|
|
10
|
+
* written by the dispatch seam and read cross-process by the relinquish evaluator
|
|
11
|
+
* (round-2 Int2-D / round-3 Les3-F1 — net-new, deliberately-acknowledged plumbing).
|
|
12
|
+
*
|
|
13
|
+
* THE LOAD-BEARING SAFETY: a **boot-epoch fence** (round-4 Adv4-B). Because this is a
|
|
14
|
+
* persisted file (one process can't read another's memory), a stamp written by a
|
|
15
|
+
* PRIOR incarnation must NEVER read as fresh after a crash/restart — else a
|
|
16
|
+
* crash-stale stamp would mask a non-serving new process (re-creating the zombie).
|
|
17
|
+
* The record carries a `bootId`; the reader discards any stamp whose `bootId` ≠ the
|
|
18
|
+
* current incarnation (a boot-epoch fence — NOT a raw monotonic compare, which
|
|
19
|
+
* across incarnations would be an invalid cross-domain subtraction). Within ONE
|
|
20
|
+
* incarnation the monotonic stamps share a clock domain, so the freshness compare is
|
|
21
|
+
* valid. The field is a single machine-global monotonic-MAX watermark (NOT per-topic
|
|
22
|
+
* state) — concurrent dispatch-seam writers are benign because it only ever advances
|
|
23
|
+
* (round-4 Adv4-A).
|
|
24
|
+
*
|
|
25
|
+
* Threat model + write posture mirror `pollIntent.ts`: local same-uid IPC, atomic
|
|
26
|
+
* tmp+rename so the reader never sees a torn record.
|
|
27
|
+
*/
|
|
28
|
+
import { existsSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
29
|
+
import { join } from 'node:path';
|
|
30
|
+
const SERVE_PROGRESS_FILE = 'serve-progress.json';
|
|
31
|
+
export function serveProgressPath(stateDir) {
|
|
32
|
+
return join(stateDir, SERVE_PROGRESS_FILE);
|
|
33
|
+
}
|
|
34
|
+
export function readServeProgress(stateDir) {
|
|
35
|
+
const p = serveProgressPath(stateDir);
|
|
36
|
+
if (!existsSync(p))
|
|
37
|
+
return null;
|
|
38
|
+
try {
|
|
39
|
+
const rec = JSON.parse(readFileSync(p, 'utf8'));
|
|
40
|
+
if (typeof rec?.serveProgressedMonoMs !== 'number' ||
|
|
41
|
+
typeof rec?.bootId !== 'string' ||
|
|
42
|
+
typeof rec?.ts !== 'number')
|
|
43
|
+
return null;
|
|
44
|
+
return rec;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// @silent-fallback-ok — a corrupt/unreadable serve-progress record reads as
|
|
48
|
+
// "no progress yet" (null → serveProgressFresh false), the SAFE direction: a
|
|
49
|
+
// holder that cannot read its own serve watermark is treated as possibly-non-
|
|
50
|
+
// serving (a relinquish candidate), NEVER masked as healthy. A DegradationReporter
|
|
51
|
+
// event per failed read of a best-effort liveness file would be noise.
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Stamp serve progress. Monotonic-MAX: only ever advances — a write with a
|
|
57
|
+
* `monoMs` not greater than the current record's (SAME incarnation) is dropped, so
|
|
58
|
+
* concurrent dispatch-seam writers never regress the watermark. A record from a
|
|
59
|
+
* different `bootId` is always overwritten (a new incarnation starts its own clock
|
|
60
|
+
* domain; the prior stamp must not survive as fresh — the boot-epoch fence).
|
|
61
|
+
*/
|
|
62
|
+
export function writeServeProgress(stateDir, args) {
|
|
63
|
+
const { bootId, serverPid, monoMs } = args;
|
|
64
|
+
const existing = readServeProgress(stateDir);
|
|
65
|
+
if (existing && existing.bootId === bootId && existing.serveProgressedMonoMs >= monoMs) {
|
|
66
|
+
return; // monotonic-MAX within the same incarnation — never regress
|
|
67
|
+
}
|
|
68
|
+
const p = serveProgressPath(stateDir);
|
|
69
|
+
const tmp = `${p}.tmp.${process.pid}`;
|
|
70
|
+
writeFileSync(tmp, JSON.stringify({ serveProgressedMonoMs: monoMs, bootId, serverPid, ts: Date.now() }), 'utf8');
|
|
71
|
+
renameSync(tmp, p);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Is serve progress FRESH (the relinquish evaluator's read)? Boot-epoch-fenced:
|
|
75
|
+
* a stamp from a different incarnation (`bootId` mismatch) is treated as "no
|
|
76
|
+
* progress yet" (false) — so a crash-stale on-disk stamp can never mask a
|
|
77
|
+
* non-serving new process. Within the current incarnation the monotonic compare is
|
|
78
|
+
* a valid same-clock-domain subtraction. `currentBootId` + `currentMonoMs` are
|
|
79
|
+
* injected (the reader's own incarnation + monotonic now) so this is pure + testable.
|
|
80
|
+
*/
|
|
81
|
+
export function serveProgressFresh(stateDir, currentBootId, currentMonoMs, thresholdMs) {
|
|
82
|
+
const rec = readServeProgress(stateDir);
|
|
83
|
+
if (!rec)
|
|
84
|
+
return false;
|
|
85
|
+
if (rec.bootId !== currentBootId)
|
|
86
|
+
return false; // boot-epoch fence
|
|
87
|
+
return currentMonoMs - rec.serveProgressedMonoMs < thresholdMs;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=serveProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serveProgress.js","sourceRoot":"","sources":["../../src/core/serveProgress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAalD,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,MAAM,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAwB,CAAC;QACvE,IACE,OAAO,GAAG,EAAE,qBAAqB,KAAK,QAAQ;YAC9C,OAAO,GAAG,EAAE,MAAM,KAAK,QAAQ;YAC/B,OAAO,GAAG,EAAE,EAAE,KAAK,QAAQ;YAC3B,OAAO,IAAI,CAAC;QACd,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,MA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 -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-06-28T10:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-06-28T10:37:09.930Z",
|
|
5
|
+
"instarVersion": "1.3.694",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -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,24 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Mesh Self-Heal **G1 — serve-progress watermark** (wiring increment A, MESH-SELF-HEAL-SPEC §3.1). Adds `src/core/serveProgress.ts`: the third liveness signal (`serveProgressedMonoMs` — proof a fetched update was actually served end-to-end, closing the "fetched-and-dropped" gap), in its own single-writer record `state/serve-progress.json`.
|
|
9
|
+
|
|
10
|
+
The load-bearing safety is a **boot-epoch fence**: a stamp left on disk by a crashed/prior process incarnation always reads as NOT fresh, so a crash-stale stamp can never mask a non-serving new process (which would re-create the zombie). Monotonic-MAX (only ever advances → concurrent writers benign), atomic tmp+rename, local same-uid IPC — mirrors `pollIntent.ts`.
|
|
11
|
+
|
|
12
|
+
Pure plumbing, NOT yet wired — zero runtime effect until increment B (the dispatch-seam write + the relinquish evaluator) consumes it. This watermark is also the prerequisite that lets the G2 take-over flip use a real serve/poll-health signal instead of a liveness approximation.
|
|
13
|
+
|
|
14
|
+
## What to Tell Your User
|
|
15
|
+
|
|
16
|
+
Nothing changes yet — this is inert internal plumbing for the deepest multi-machine self-heal piece (detecting a machine that holds the "in charge" badge but has stopped actually serving). No action needed.
|
|
17
|
+
|
|
18
|
+
## Summary of New Capabilities
|
|
19
|
+
|
|
20
|
+
- None user-facing. New internal record `state/serve-progress.json` + helpers (`src/core/serveProgress.ts`), consumed by a later wiring increment; no route, config, or runtime surface yet.
|
|
21
|
+
|
|
22
|
+
## Evidence
|
|
23
|
+
|
|
24
|
+
- `tests/unit/serveProgress.test.ts` — 6 unit tests: write/read roundtrip; missing→null/not-fresh; monotonic-MAX no-regress; new-incarnation overwrite; freshness within/past threshold; and the BOOT-EPOCH FENCE (a prior-incarnation stamp reads not-fresh even when recent). Typecheck clean.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Side-Effects Review — Mesh Self-Heal G1 (serve-progress watermark)
|
|
2
|
+
|
|
3
|
+
**Change:** The serve-progress watermark record (MESH-SELF-HEAL-SPEC §3.1) — `src/core/serveProgress.ts` (`writeServeProgress` / `readServeProgress` / `serveProgressFresh`) + 6 unit tests. The THIRD G1 liveness signal (`serveProgressedMonoMs` — end-to-end serve progress), in its OWN single-writer record `state/serve-progress.json` (it cannot share the lifeline's poll-active record without clobbering it). This is G1-wiring increment A: the watermark plumbing only. NOT YET CALLED by any writer or reader — ZERO runtime effect until increment B (the dispatch-seam write + the relinquish evaluator) consumes it. It is also the named **G2-enforce-enable prerequisite #1** (`localPollSucceededFresh` graduates from a liveness approximation to this real watermark).
|
|
4
|
+
|
|
5
|
+
**Decision point?** No — pure file I/O (a watermark record). Safety hinges on the boot-epoch fence (Q1/Q7).
|
|
6
|
+
|
|
7
|
+
## 1. Over-block
|
|
8
|
+
N/A — no gating. `serveProgressFresh` biases SAFE: missing record → false; bootId mismatch → false; only a same-incarnation in-threshold stamp → true.
|
|
9
|
+
|
|
10
|
+
## 2. Under-block
|
|
11
|
+
The boot-epoch fence is the guard against under-blocking (a crash-stale stamp masking a non-serving process): a prior incarnation's stamp (`bootId` mismatch) always reads NOT fresh. Tested.
|
|
12
|
+
|
|
13
|
+
## 3. Level-of-abstraction fit
|
|
14
|
+
Mirrors `pollIntent.ts` exactly (atomic tmp+rename, local same-uid IPC, integrity fields). Correct layer — a cross-process record + a pure freshness reader; the dispatch-seam wiring + the evaluator are increment B.
|
|
15
|
+
|
|
16
|
+
## 4. Signal vs authority compliance
|
|
17
|
+
COMPLIANT — pure I/O, no authority. It produces a freshness SIGNAL the relinquish decision will read; it never gates or actuates.
|
|
18
|
+
|
|
19
|
+
## 5. Interactions
|
|
20
|
+
Single-writer, monotonic-MAX → concurrent dispatch-seam writers are benign (only advances). Distinct file from `lifeline-poll-active.json` → no clobber of the lifeline's record. No reader/writer yet.
|
|
21
|
+
|
|
22
|
+
## 6. External surfaces
|
|
23
|
+
New file `state/serve-progress.json` (local, same-uid, like pollIntent). No route, no config. Written/read only once increment B wires it.
|
|
24
|
+
|
|
25
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
26
|
+
Machine-local, never replicated (Sca-F1) — read only by the owning machine for its OWN relinquish decision. The boot-epoch fence makes it survive-restart-safe (a prior incarnation's stamp can't mask the new one). No cross-machine surface.
|
|
27
|
+
|
|
28
|
+
## 8. Rollback cost
|
|
29
|
+
Trivial — revert the commit. Unreferenced; removing it cannot affect a running agent. The on-disk file (if ever written) is inert observability.
|
|
30
|
+
|
|
31
|
+
## Second-pass review
|
|
32
|
+
Not triggered (pure file-I/O building block, no live decision-point/authority/session-lifecycle touch). The Phase-5 second-pass IS required for increment B (it wires the dispatch-seam write + the relinquish evaluator into the lease holder branch + the F3 actuation).
|
|
@@ -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.
|