greprag 5.47.0 → 5.48.0

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.
@@ -0,0 +1,9 @@
1
+ /** assistant-doctrine — the flagged-assistant-project doctrine auto-load as a
2
+ * reminder-interrupt module (docs/reminder-interrupt.md §Registry spec). announce-ONLY
3
+ * + pass-through: the doctrine text is PRECOMPUTED by the hook (buildAssistantDoctrineContext
4
+ * reads doctrine files — I/O that belongs in the hook). Fires ONLY for the assistant
5
+ * project — env.assistantDoctrine is null everywhere else, so a normal project sees
6
+ * nothing. adr: adr/assistant-role.md */
7
+ import { ReminderEnv, Detection, ReminderModule } from './reminder-types';
8
+ export declare function assistantDetect(env: ReminderEnv): Detection;
9
+ export declare const assistantDoctrineModule: ReminderModule;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /** assistant-doctrine — the flagged-assistant-project doctrine auto-load as a
3
+ * reminder-interrupt module (docs/reminder-interrupt.md §Registry spec). announce-ONLY
4
+ * + pass-through: the doctrine text is PRECOMPUTED by the hook (buildAssistantDoctrineContext
5
+ * reads doctrine files — I/O that belongs in the hook). Fires ONLY for the assistant
6
+ * project — env.assistantDoctrine is null everywhere else, so a normal project sees
7
+ * nothing. adr: adr/assistant-role.md */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.assistantDoctrineModule = void 0;
10
+ exports.assistantDetect = assistantDetect;
11
+ function assistantDetect(env) {
12
+ return env.assistantDoctrine ? { tier: 'ambient' } : { tier: 'silent' };
13
+ }
14
+ exports.assistantDoctrineModule = {
15
+ id: 'assistant-doctrine',
16
+ detect: assistantDetect,
17
+ announce: (env) => env.assistantDoctrine ?? null,
18
+ reminder: () => null,
19
+ };
20
+ //# sourceMappingURL=assistant-reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistant-reminder.js","sourceRoot":"","sources":["../../src/commands/assistant-reminder.ts"],"names":[],"mappings":";AAAA;;;;;0CAK0C;;;AAI1C,0CAEC;AAFD,SAAgB,eAAe,CAAC,GAAgB;IAC9C,OAAO,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC1E,CAAC;AAEY,QAAA,uBAAuB,GAAmB;IACrD,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,iBAAiB,IAAI,IAAI;IAChD,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;CACrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** checkpoint — the open-checkpoints SessionStart landmark as a reminder-interrupt
2
+ * module (docs/reminder-interrupt.md §Registry spec). announce-ONLY: checkpoints are
3
+ * operator-triggered landmarks surfaced once at session start, never per-turn traffic
4
+ * (reminder → null). `detect` gates on the hook-supplied list so the announce auto-
5
+ * silences when nothing is open. The PURE render (list → hint block) lives here — the
6
+ * hook owns only the fetch (I/O), keeping the module unit-testable. */
7
+ import { ReminderEnv, Detection, ReminderModule, OpenCheckpointSlim } from './reminder-types';
8
+ /** Format the open-checkpoints hint block: 3-most-recent rows + a single overflow line
9
+ * when there are more. Returns null on zero (the announce is then skipped). */
10
+ export declare function renderCheckpointHint(open: OpenCheckpointSlim[], projectName: string): string | null;
11
+ /** Open checkpoints present → ambient announce; none (or per-turn, where the list is
12
+ * absent) → silent. */
13
+ export declare function checkpointDetect(env: ReminderEnv): Detection;
14
+ export declare const checkpointModule: ReminderModule;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /** checkpoint — the open-checkpoints SessionStart landmark as a reminder-interrupt
3
+ * module (docs/reminder-interrupt.md §Registry spec). announce-ONLY: checkpoints are
4
+ * operator-triggered landmarks surfaced once at session start, never per-turn traffic
5
+ * (reminder → null). `detect` gates on the hook-supplied list so the announce auto-
6
+ * silences when nothing is open. The PURE render (list → hint block) lives here — the
7
+ * hook owns only the fetch (I/O), keeping the module unit-testable. */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.checkpointModule = void 0;
10
+ exports.renderCheckpointHint = renderCheckpointHint;
11
+ exports.checkpointDetect = checkpointDetect;
12
+ /** Render a YYYY-MM-DD date in UTC for the session-start hint. */
13
+ function fmtCheckpointDate(iso) {
14
+ return iso.slice(0, 10);
15
+ }
16
+ /** Format the open-checkpoints hint block: 3-most-recent rows + a single overflow line
17
+ * when there are more. Returns null on zero (the announce is then skipped). */
18
+ function renderCheckpointHint(open, projectName) {
19
+ if (open.length === 0)
20
+ return null;
21
+ // Server returns DESC by created_at; take the 3 most recent.
22
+ const top = open.slice(0, 3);
23
+ const overflow = open.length - top.length;
24
+ const lines = [];
25
+ lines.push(`[${open.length} checkpoint${open.length === 1 ? '' : 's'} open in ${projectName}:`);
26
+ for (const cp of top) {
27
+ lines.push(` · ${cp.nodeId} ${cp.title} (since ${fmtCheckpointDate(cp.createdAt)})`);
28
+ }
29
+ if (overflow > 0) {
30
+ lines.push(` · ${overflow} more — greprag checkpoint list]`);
31
+ }
32
+ else {
33
+ lines.push(` View one: greprag checkpoint show <id>]`);
34
+ }
35
+ return lines.join('\n');
36
+ }
37
+ /** Open checkpoints present → ambient announce; none (or per-turn, where the list is
38
+ * absent) → silent. */
39
+ function checkpointDetect(env) {
40
+ return (env.openCheckpoints && env.openCheckpoints.length > 0)
41
+ ? { tier: 'ambient' }
42
+ : { tier: 'silent' };
43
+ }
44
+ exports.checkpointModule = {
45
+ id: 'checkpoint',
46
+ detect: checkpointDetect,
47
+ announce: (env) => renderCheckpointHint(env.openCheckpoints ?? [], env.projectName ?? ''),
48
+ reminder: () => null,
49
+ };
50
+ //# sourceMappingURL=checkpoint-reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-reminder.js","sourceRoot":"","sources":["../../src/commands/checkpoint-reminder.ts"],"names":[],"mappings":";AAAA;;;;;wEAKwE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,MAAM,GAAG,CAAC,CAAC;QAC5D,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE;QACrB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACzB,CAAC;AAEY,QAAA,gBAAgB,GAAmB;IAC9C,EAAE,EAAE,YAAY;IAChB,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,EAAE,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;IACzF,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;CACrB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /** front-desk — the shared tenant front-desk mailbox as a reminder-interrupt module
2
+ * (docs/reminder-interrupt.md §Registry spec). The module that uses BOTH halves of the
3
+ * pair: a SessionStart `announce` (discreet count of cold opens + inbound email waiting
4
+ * at the shared desk) AND a per-turn `reminder` (envelope-only "you've got mail from X"
5
+ * notice). This is the "announce + reminder often utilize each other" case the registry
6
+ * was consolidated for — one module, one mailbox, two surfaces.
7
+ *
8
+ * PURE: the hook owns the count fetch (frontDeskUnread) AND the notice's network + per-
9
+ * machine dedup (frontDeskNotice), passing both via env; the module only formats the
10
+ * count and routes the precomputed notice.
11
+ *
12
+ * Privacy — front-desk is the SHARED tenant mailbox (cold opens + inbound email addressed
13
+ * to nobody's session), so its count leaks nothing private. This is NOT the v5.6.1
14
+ * project-wide eavesdrop vector that betrayed a sibling session's session-targeted DMs.
15
+ * adr: adr/address-grammar.md (2026-06-10), docs/front-desk-switchboard.md §5 */
16
+ import { ReminderEnv, Detection, ReminderModule } from './reminder-types';
17
+ /** SessionStart count hint — the discreet door (count + how to read), never content.
18
+ * Null at zero so the announce is skipped. */
19
+ export declare function buildFrontDeskAnnounce(unread: number): string | null;
20
+ /** Either surface has something → ambient (soft, never a forced-decision directive); else
21
+ * silent. SessionStart sets frontDeskUnread; per-turn sets frontDeskNotice. */
22
+ export declare function frontDeskDetect(env: ReminderEnv): Detection;
23
+ export declare const frontDeskModule: ReminderModule;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /** front-desk — the shared tenant front-desk mailbox as a reminder-interrupt module
3
+ * (docs/reminder-interrupt.md §Registry spec). The module that uses BOTH halves of the
4
+ * pair: a SessionStart `announce` (discreet count of cold opens + inbound email waiting
5
+ * at the shared desk) AND a per-turn `reminder` (envelope-only "you've got mail from X"
6
+ * notice). This is the "announce + reminder often utilize each other" case the registry
7
+ * was consolidated for — one module, one mailbox, two surfaces.
8
+ *
9
+ * PURE: the hook owns the count fetch (frontDeskUnread) AND the notice's network + per-
10
+ * machine dedup (frontDeskNotice), passing both via env; the module only formats the
11
+ * count and routes the precomputed notice.
12
+ *
13
+ * Privacy — front-desk is the SHARED tenant mailbox (cold opens + inbound email addressed
14
+ * to nobody's session), so its count leaks nothing private. This is NOT the v5.6.1
15
+ * project-wide eavesdrop vector that betrayed a sibling session's session-targeted DMs.
16
+ * adr: adr/address-grammar.md (2026-06-10), docs/front-desk-switchboard.md §5 */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.frontDeskModule = void 0;
19
+ exports.buildFrontDeskAnnounce = buildFrontDeskAnnounce;
20
+ exports.frontDeskDetect = frontDeskDetect;
21
+ /** SessionStart count hint — the discreet door (count + how to read), never content.
22
+ * Null at zero so the announce is skipped. */
23
+ function buildFrontDeskAnnounce(unread) {
24
+ if (!unread || unread <= 0)
25
+ return null;
26
+ return `[📬 ${unread} message${unread === 1 ? '' : 's'} at the front desk — \`greprag inbox --front-desk\` to read]`;
27
+ }
28
+ /** Either surface has something → ambient (soft, never a forced-decision directive); else
29
+ * silent. SessionStart sets frontDeskUnread; per-turn sets frontDeskNotice. */
30
+ function frontDeskDetect(env) {
31
+ const unread = env.frontDeskUnread ?? 0;
32
+ return (unread > 0 || env.frontDeskNotice) ? { tier: 'ambient' } : { tier: 'silent' };
33
+ }
34
+ exports.frontDeskModule = {
35
+ id: 'front-desk',
36
+ detect: frontDeskDetect,
37
+ announce: (env) => buildFrontDeskAnnounce(env.frontDeskUnread ?? 0),
38
+ reminder: (_d, env) => env.frontDeskNotice ?? null,
39
+ };
40
+ //# sourceMappingURL=frontdesk-reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontdesk-reminder.js","sourceRoot":"","sources":["../../src/commands/frontdesk-reminder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAMlF,wDAGC;AAID,0CAGC;AAZD;+CAC+C;AAC/C,SAAgB,sBAAsB,CAAC,MAAc;IACnD,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,OAAO,MAAM,WAAW,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,8DAA8D,CAAC;AACvH,CAAC;AAED;gFACgF;AAChF,SAAgB,eAAe,CAAC,GAAgB;IAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,eAAe,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACxF,CAAC;AAEY,QAAA,eAAe,GAAmB;IAC7C,EAAE,EAAE,YAAY;IAChB,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,sBAAsB,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,CAAC;IACnE,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI;CACnD,CAAC"}
@@ -35,7 +35,32 @@ export declare const FATAL_EXIT_CODE = 64;
35
35
  * so it respawns; SIGINT/SIGTERM skip these and return via the
36
36
  * normal abort path. */
37
37
  export declare function installLastResortHandlers(): void;
38
+ type ChildExit = {
39
+ code: number | null;
40
+ signal: NodeJS.Signals | null;
41
+ err: Error | null;
42
+ };
43
+ /** Human-readable cause for a child death + whether it was an OS-level native
44
+ * crash. Turns "exit 3221226091" into "native crash 0xC000026B (DLL init failed —
45
+ * out of commit memory / window station gone)" so both the respawn log and the
46
+ * stand-down diagnostic are actionable instead of opaque digits. */
47
+ export declare function describeChildExit(exit: ChildExit): {
48
+ reason: string;
49
+ native: boolean;
50
+ };
51
+ /** Pure crash-loop decision (testable, mirrors capSurplusVerdict/gcVerdict).
52
+ * Given how long the just-exited child lived (`liveMs`) and the running
53
+ * fast-death `streak`, return the updated streak and whether the supervisor
54
+ * should STAND DOWN instead of respawning. A child that lived at least
55
+ * `lifetimeMs` did real work → streak resets to 0. Otherwise the streak grows
56
+ * and trips once it reaches `maxDeaths`. This is the whole breaker rule — no
57
+ * process state, just a count + a lifetime floor. */
58
+ export declare function crashLoopVerdict(liveMs: number, streak: number, lifetimeMs: number, maxDeaths: number): {
59
+ streak: number;
60
+ standDown: boolean;
61
+ };
38
62
  /** Parent supervisor. Spawns the watch loop as a Node child, forwards
39
63
  * stdio so Monitor sees each printed line as a notification verbatim,
40
64
  * and respawns on any non-clean exit. */
41
65
  export declare function runSupervisor(): Promise<void>;
66
+ export {};
@@ -29,6 +29,8 @@
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.FATAL_EXIT_CODE = exports.SUPERVISE_ENV = void 0;
31
31
  exports.installLastResortHandlers = installLastResortHandlers;
32
+ exports.describeChildExit = describeChildExit;
33
+ exports.crashLoopVerdict = crashLoopVerdict;
32
34
  exports.runSupervisor = runSupervisor;
33
35
  const child_process_1 = require("child_process");
34
36
  const inbox_watch_1 = require("./inbox-watch");
@@ -67,6 +69,29 @@ const SUPERVISOR_BACKOFF_FACTOR = 2;
67
69
  // 60s of uninterrupted child life resets the backoff so a long-lived
68
70
  // child that finally dies retries fast, not slowly.
69
71
  const SUPERVISOR_HEALTHY_RESET_MS = 60_000;
72
+ // ---- Crash-loop circuit breaker ------------------------------------------
73
+ // A child that dies almost immediately, over and over, is NOT a transient
74
+ // network blip (the inner SSE loop absorbs those without ever exiting) — it is a
75
+ // child that CANNOT STAY UP. The two field-observed shapes:
76
+ // * an OS-level native death BEFORE any JS runs — e.g. exit 0xC000026B
77
+ // (STATUS_DLL_INIT_FAILED): the loader could not commit memory to map node's
78
+ // DLLs. This appears when the system is out of *commit charge* (RAM + a
79
+ // hard-capped page file), even with physical RAM free. Nothing the child can
80
+ // catch — it never reaches main(). See docs/session-heap-ceiling.md.
81
+ // * a JS throw before the SSE connects — handled into a fast exit 2 by the
82
+ // last-resort handlers, but still a child that never does useful work.
83
+ // Respawning either forever (the pre-fix behaviour — backoff merely capped at
84
+ // 30s, loop never terminating) achieves nothing, churns the very commit charge
85
+ // that is exhausted, floods Monitor with respawn notifications (which grows the
86
+ // consuming session's heap — the same exhaustion, fed), and buries the real
87
+ // cause under an endless "child died — respawning" wall. So: count consecutive
88
+ // FAST abnormal deaths; after CRASH_LOOP_MAX of them, STAND DOWN loudly and let
89
+ // the next-turn arm reminder re-arm once the machine recovers. A child that
90
+ // lives at least CRASH_LOOP_LIFETIME_MS did real work and clears the counter.
91
+ // This is the root-cause repair of "a respawn-on-crash supervisor masking a
92
+ // crashing child." adr: adr/monitor-resilience.md
93
+ const CRASH_LOOP_LIFETIME_MS = 10_000;
94
+ const CRASH_LOOP_MAX = 5;
70
95
  // Exit code the child uses for "fatal, do not respawn" conditions —
71
96
  // 4xx HTTP responses, missing API key, missing anchor. Anything else
72
97
  // (signal, code 1, code 2, exception) is a crash and gets respawned.
@@ -116,6 +141,66 @@ function ownerPidFromArgv(argv) {
116
141
  }
117
142
  return undefined;
118
143
  }
144
+ /** True iff `code` is a Windows native (NTSTATUS) crash, NOT a normal JS-level
145
+ * exit. The error-severity NTSTATUS range (>= 0xC0000000 — access violation, DLL
146
+ * init failed, stack overflow…) and the 0x4001000x debug-terminate family
147
+ * (external TerminateProcess / console kill) both mean the process died BELOW the
148
+ * JS runtime. The child's try/catch and last-resort handlers cannot turn these
149
+ * into a clean exit — they fire only once main() is running; a loader failure or
150
+ * an uncatchable TerminateProcess never gets there. That is precisely why the
151
+ * meaningful repair lives here in the supervisor, not in the child. */
152
+ function isNativeCrashCode(code) {
153
+ if (code === null)
154
+ return false;
155
+ const u = code >>> 0;
156
+ return u >= 0xc0000000 || (u & 0xffff0000) === 0x40010000;
157
+ }
158
+ /** Human-readable cause for a child death + whether it was an OS-level native
159
+ * crash. Turns "exit 3221226091" into "native crash 0xC000026B (DLL init failed —
160
+ * out of commit memory / window station gone)" so both the respawn log and the
161
+ * stand-down diagnostic are actionable instead of opaque digits. */
162
+ function describeChildExit(exit) {
163
+ if (exit.err)
164
+ return { reason: `spawn error: ${exit.err.message}`, native: false };
165
+ if (exit.signal)
166
+ return { reason: `signal ${exit.signal}`, native: false };
167
+ const code = exit.code;
168
+ if (code === null)
169
+ return { reason: 'unknown exit', native: false };
170
+ if (!isNativeCrashCode(code)) {
171
+ // 129..255 is the signal-as-exit-code convention Node uses on Windows when a
172
+ // kill arrives as a code rather than a signal (e.g. 143 = 128 + SIGTERM).
173
+ if (code > 128 && code < 256) {
174
+ return { reason: `killed (exit ${code} = signal ${code - 128})`, native: false };
175
+ }
176
+ return { reason: `exit ${code}`, native: false };
177
+ }
178
+ const u = code >>> 0;
179
+ const hex = '0x' + u.toString(16).toUpperCase().padStart(8, '0');
180
+ const KNOWN = {
181
+ 0xc000026b: 'DLL init failed — out of commit memory / window station gone',
182
+ 0xc0000005: 'access violation',
183
+ 0xc00000fd: 'stack overflow',
184
+ 0xc000013a: 'Ctrl-C / console close',
185
+ 0x40010004: 'terminated (external TerminateProcess / OS kill)',
186
+ 0x40010005: 'Ctrl-C (debugger)',
187
+ };
188
+ const note = KNOWN[u] ? ` (${KNOWN[u]})` : '';
189
+ return { reason: `native crash ${hex}${note}`, native: true };
190
+ }
191
+ /** Pure crash-loop decision (testable, mirrors capSurplusVerdict/gcVerdict).
192
+ * Given how long the just-exited child lived (`liveMs`) and the running
193
+ * fast-death `streak`, return the updated streak and whether the supervisor
194
+ * should STAND DOWN instead of respawning. A child that lived at least
195
+ * `lifetimeMs` did real work → streak resets to 0. Otherwise the streak grows
196
+ * and trips once it reaches `maxDeaths`. This is the whole breaker rule — no
197
+ * process state, just a count + a lifetime floor. */
198
+ function crashLoopVerdict(liveMs, streak, lifetimeMs, maxDeaths) {
199
+ if (liveMs >= lifetimeMs)
200
+ return { streak: 0, standDown: false };
201
+ const next = streak + 1;
202
+ return { streak: next, standDown: next >= maxDeaths };
203
+ }
119
204
  /** Fire one short, best-effort liveness request. Never throws; never blocks
120
205
  * longer than `timeoutMs` (so a dead network can't hang the heartbeat or stall
121
206
  * exit). adr: docs/registry-freshness-design.md */
@@ -147,6 +232,10 @@ function deregisterUrl(apiUrl, session) {
147
232
  * and respawns on any non-clean exit. */
148
233
  async function runSupervisor() {
149
234
  let backoff = SUPERVISOR_BACKOFF_INITIAL_MS;
235
+ // Crash-loop breaker state: how many times in a row the child died FAST
236
+ // (lived < CRASH_LOOP_LIFETIME_MS). Reset whenever a child survives long
237
+ // enough to have done real work. See the constants block above.
238
+ let consecutiveFastDeaths = 0;
150
239
  let shutdownRequested = false;
151
240
  let currentChild = null;
152
241
  // Forward terminal-style signals to the child so Ctrl-C or TaskStop
@@ -299,11 +388,29 @@ async function runSupervisor() {
299
388
  }
300
389
  if (liveMs >= SUPERVISOR_HEALTHY_RESET_MS)
301
390
  backoff = SUPERVISOR_BACKOFF_INITIAL_MS;
302
- const reason = exit.err
303
- ? `spawn error: ${exit.err.message}`
304
- : exit.signal
305
- ? `signal ${exit.signal}`
306
- : `exit ${exit.code}`;
391
+ const { reason, native } = describeChildExit(exit);
392
+ // Crash-loop circuit breaker. A child that lived at least
393
+ // CRASH_LOOP_LIFETIME_MS did real work → streak resets and we respawn as
394
+ // normal. Otherwise it is failing to stay up; the streak grows, and once it
395
+ // reaches CRASH_LOOP_MAX we STAND DOWN instead of respawning into the same
396
+ // wall forever. This is the masking smell this fix removes: a child that
397
+ // cannot start (native loader crash) or throws at startup must surface, not
398
+ // be hidden behind an endless respawn.
399
+ const breaker = crashLoopVerdict(liveMs, consecutiveFastDeaths, CRASH_LOOP_LIFETIME_MS, CRASH_LOOP_MAX);
400
+ consecutiveFastDeaths = breaker.streak;
401
+ if (breaker.standDown) {
402
+ const hint = native
403
+ ? `the child is dying at the OS level (${reason}) before it can run — characteristic of system commit-charge / page-file exhaustion (NOT physical RAM; see docs/session-heap-ceiling.md). Standing down so we stop feeding the exhaustion; the next-turn arm reminder retries once the machine recovers.`
404
+ : `the child cannot stay up (${reason}). Run \`greprag inbox watch --no-supervise\` to see the underlying error. Standing down to avoid a respawn storm.`;
405
+ console.error(`${LOG_PREFIX} supervisor: child crash-looped ${consecutiveFastDeaths}× (each < ${(0, inbox_watch_1.fmtDuration)(CRASH_LOOP_LIFETIME_MS)}) — ${hint}`);
406
+ (0, watcher_registry_1.watcherAuditLog)(`crash-loop session=${session ?? 'tenant'} deaths=${consecutiveFastDeaths} last=${reason}`);
407
+ terminalReason = `crash-loop-standdown (${reason})`;
408
+ // Exit FATAL (64) so the bash relauncher BREAKs rather than relaunching us
409
+ // into the same storm one level up; re-arm on a later turn is the recovery
410
+ // path. adr: adr/monitor-resilience.md
411
+ process.exitCode = exports.FATAL_EXIT_CODE;
412
+ break;
413
+ }
307
414
  console.error(`${LOG_PREFIX} supervisor: child died (${reason}) after ${(0, inbox_watch_1.fmtDuration)(liveMs)} — respawning in ${(0, inbox_watch_1.fmtDuration)(backoff)}`);
308
415
  await sleepUntilOrShutdown(backoff, () => shutdownRequested);
309
416
  backoff = Math.min(backoff * SUPERVISOR_BACKOFF_FACTOR, SUPERVISOR_BACKOFF_MAX_MS);
@@ -1 +1 @@
1
- {"version":3,"file":"inbox-watch-supervisor.js","sourceRoot":"","sources":["../../src/commands/inbox-watch-supervisor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CAAC,CAAC;QACzD,CAAC,CAAC;QACF,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"inbox-watch-supervisor.js","sourceRoot":"","sources":["../../src/commands/inbox-watch-supervisor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;qCA0BqC;;;AAkFrC,8DAWC;AAiDD,8CAyBC;AASD,4CAMC;AAiCD,sCA8MC;AAnaD,iDAAoD;AACpD,+CAAgF;AAChF,yDAA8G;AAE9G,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAE3C,6EAA6E;AAC7E,yCAAyC;AACzC,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,WAAW;AACX,4EAA4E;AAC5E,8EAA8E;AAC9E,iFAAiF;AACjF,oEAAoE;AACpE,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6CAA6C;AAE7C,gFAAgF;AAChF,oBAAoB;AACpB,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACpC,6EAA6E;AAC7E,MAAM,qBAAqB,GAAG,KAAK,CAAC;AACpC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,oEAAoE;AACpE,iEAAiE;AACjE,qCAAqC;AACxB,QAAA,aAAa,GAAG,qBAAqB,CAAC;AAEnD,2DAA2D;AAC3D,+DAA+D;AAC/D,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,qEAAqE;AACrE,oDAAoD;AACpD,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAE3C,6EAA6E;AAC7E,0EAA0E;AAC1E,iFAAiF;AACjF,4DAA4D;AAC5D,yEAAyE;AACzE,iFAAiF;AACjF,4EAA4E;AAC5E,iFAAiF;AACjF,yEAAyE;AACzE,6EAA6E;AAC7E,2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IACtD,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,eAAe,CACnB,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,OAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,kBAAkB,CAC9E,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC;AAED;;2EAE2E;AAC3E,SAAS,oBAAoB,CAAC,EAAU,EAAE,MAAqB;IAC7D,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,IAAI,MAAM,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ,EAAE,CAAC;gBAAC,OAAO,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;YAC9D,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACzD,CAAC,CAAC;QACF,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -450,6 +450,8 @@ async function runOpenCodeInit(opts) {
450
450
  const helpersDest = path.join(grepragHome, 'opencode-plugin-helpers.js');
451
451
  const pluginMainSrc = path.join(__dirname, '../opencode-plugin.js');
452
452
  const helpersSrc = path.join(__dirname, '../opencode-plugin-helpers.js');
453
+ const procSrc = path.join(__dirname, '../proc.js');
454
+ const procDest = path.join(grepragHome, 'opencode-plugin-proc.js');
453
455
  let pluginInstalled = false;
454
456
  if (fs.existsSync(pluginMainSrc)) {
455
457
  if (!fs.existsSync(pluginDir))
@@ -462,6 +464,15 @@ async function runOpenCodeInit(opts) {
462
464
  else {
463
465
  fs.copyFileSync(helpersSrc, helpersDest);
464
466
  }
467
+ // proc.ts wrappers — the plugin requires these by absolute path because it
468
+ // cannot relative-require './proc' from the single-file plugins dir (that
469
+ // crashes plugin load: "Cannot find module './proc'"). Ship beside helpers.
470
+ if (!fs.existsSync(procSrc)) {
471
+ console.warn(` proc artifact missing: ${procSrc} — run \`npm run build\` in packages/cli and retry`);
472
+ }
473
+ else {
474
+ fs.copyFileSync(procSrc, procDest);
475
+ }
465
476
  fs.copyFileSync(pluginMainSrc, pluginMain);
466
477
  // Stale cleanup: prior deploys (commit 5d1a384, 2026-06-06) installed
467
478
  // the helpers as `opencode-plugin-helpers.js` INSIDE the plugins dir.