@groundnuty/macf-channel-server 0.2.41 → 0.2.43

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,31 @@
1
+ /**
2
+ * Periodic "alive" tick (groundnuty/macf#642).
3
+ *
4
+ * Writes a heartbeat line to the forensic log every 60s. The point is NOT the
5
+ * line itself but its absence: when the channel-server dies a SILENT death — an
6
+ * OOM-kill, SIGKILL, or power loss where no crash handler or shutdown handler
7
+ * ever runs — the forensic log simply stops. The last `alive` line then bounds
8
+ * the death to a ≤60s window, the difference between "we know roughly when it
9
+ * died" and "no signal at all".
10
+ *
11
+ * Lifecycle MIRRORS `createRegistryHeartbeat` / `createOtelReachabilityProbe`:
12
+ * an `unref()`'d `setInterval` that can never pin the event loop open, plus an
13
+ * idempotent `stop()`. The tick is wrapped best-effort so a logger throw (disk
14
+ * full) can never escape and crash the process via an uncaught timer exception.
15
+ */
16
+ import type { Logger } from '@groundnuty/macf-core';
17
+ import type { LifecycleTracker } from './lifecycle.js';
18
+ export declare const DEFAULT_ALIVE_TICK_INTERVAL_MS = 60000;
19
+ export interface AliveTicker {
20
+ /** Start the periodic tick (no-op if already started). */
21
+ readonly start: () => void;
22
+ /** Clear the interval (idempotent; safe before start). */
23
+ readonly stop: () => void;
24
+ }
25
+ export declare function createAliveTicker(opts: {
26
+ readonly logger: Logger;
27
+ readonly lifecycle: Pick<LifecycleTracker, 'snapshot'>;
28
+ /** Cadence in ms; default 60s. */
29
+ readonly intervalMs?: number;
30
+ }): AliveTicker;
31
+ //# sourceMappingURL=alive-ticker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alive-ticker.d.ts","sourceRoot":"","sources":["../src/alive-ticker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IACvD,kCAAkC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,WAAW,CAiCd"}
@@ -0,0 +1,36 @@
1
+ export const DEFAULT_ALIVE_TICK_INTERVAL_MS = 60_000;
2
+ export function createAliveTicker(opts) {
3
+ const { logger, lifecycle } = opts;
4
+ const intervalMs = opts.intervalMs ?? DEFAULT_ALIVE_TICK_INTERVAL_MS;
5
+ let timer = null;
6
+ function tick() {
7
+ try {
8
+ const snap = lifecycle.snapshot();
9
+ logger.info('alive', {
10
+ phase: snap.phase,
11
+ uptime_ms: snap.uptime_ms,
12
+ pid: process.pid,
13
+ });
14
+ }
15
+ catch {
16
+ // Best-effort: a logger throw (e.g. disk full) must never escape a timer
17
+ // callback and become an uncaughtException. The next tick retries.
18
+ }
19
+ }
20
+ return {
21
+ start() {
22
+ if (timer !== null)
23
+ return;
24
+ timer = setInterval(tick, intervalMs);
25
+ // Never let the alive-tick interval keep the process alive.
26
+ timer.unref();
27
+ },
28
+ stop() {
29
+ if (timer !== null) {
30
+ clearInterval(timer);
31
+ timer = null;
32
+ }
33
+ },
34
+ };
35
+ }
36
+ //# sourceMappingURL=alive-ticker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alive-ticker.js","sourceRoot":"","sources":["../src/alive-ticker.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AASrD,MAAM,UAAU,iBAAiB,CAAC,IAKjC;IACC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,8BAA8B,CAAC;IACrE,IAAI,KAAK,GAA0C,IAAI,CAAC;IAExD,SAAS,IAAI;QACX,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;YAClC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,GAAG,EAAE,OAAO,CAAC,GAAG;aACjB,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,yEAAyE;YACzE,mEAAmE;QACrE,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK;YACH,IAAI,KAAK,KAAK,IAAI;gBAAE,OAAO;YAC3B,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACtC,4DAA4D;YAC5D,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;QACD,IAAI;YACF,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,aAAa,CAAC,KAAK,CAAC,CAAC;gBACrB,KAAK,GAAG,IAAI,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Top-level crash handlers (groundnuty/macf#642).
3
+ *
4
+ * The channel-server previously had NO `uncaughtException` /
5
+ * `unhandledRejection` handlers — only `shutdown.ts`'s SIGTERM/SIGINT/stdin
6
+ * paths and the `main().catch` bootstrap guard. So an exception thrown outside
7
+ * an awaited boundary, or a rejected promise nobody awaited, would terminate
8
+ * the process via Node's default handler with (at best) an unformatted stderr
9
+ * dump — and stderr is exactly the channel Claude Code stops draining under
10
+ * load. The result: a silent death with no forensic trail.
11
+ *
12
+ * These handlers close that gap. On a fatal uncaught error they:
13
+ * 1. log the full error + stack + last-known lifecycle phase to the forensic
14
+ * FILE logger AND stderr (belt-and-suspenders — either may be the only
15
+ * surviving channel),
16
+ * 2. attempt a graceful registry deregister via the shutdown `cleanup`, but
17
+ * behind a HARD TIMEOUT so a wedged cleanup can never hang the handler,
18
+ * 3. `process.exit(1)`.
19
+ *
20
+ * Transport-independent: nothing here assumes the MCP stdio mount — it works
21
+ * identically for a future HTTP/SSE transport. Every dependency is injectable
22
+ * for tests; production wires `process.on` / `process.exit` / `process.stderr`.
23
+ */
24
+ import type { Logger } from '@groundnuty/macf-core';
25
+ import type { LifecycleTracker } from './lifecycle.js';
26
+ /**
27
+ * Hard cap on the graceful-deregister attempt inside a crash handler. The
28
+ * process is already dying; we give the deregister a bounded best-effort window
29
+ * then exit regardless, so a wedged registry call can never strand the handler.
30
+ */
31
+ export declare const DEFAULT_CRASH_DEREGISTER_TIMEOUT_MS = 5000;
32
+ export type CrashKind = 'uncaught_exception' | 'unhandled_rejection';
33
+ export interface RegisterCrashHandlersDeps {
34
+ readonly logger: Logger;
35
+ readonly lifecycle: Pick<LifecycleTracker, 'snapshot'>;
36
+ /**
37
+ * Returns the shutdown `cleanup` (instance-id-guarded deregister + server
38
+ * stop) if it has been wired yet, else `undefined`. A getter — not the
39
+ * function directly — because a crash can fire during early startup BEFORE
40
+ * `registerShutdownHandler` has run, in which case there is nothing to
41
+ * deregister and the handler skips cleanup.
42
+ */
43
+ readonly getCleanup?: () => (() => Promise<unknown>) | undefined;
44
+ /** Hard deregister timeout (ms); defaults to {@link DEFAULT_CRASH_DEREGISTER_TIMEOUT_MS}. */
45
+ readonly deregisterTimeoutMs?: number;
46
+ /** Injectable for tests; defaults to `process.exit`. */
47
+ readonly exit?: (code: number) => void;
48
+ /** Injectable for tests; defaults to `process.stderr.write`. */
49
+ readonly stderrWrite?: (msg: string) => void;
50
+ /** Injectable for tests; defaults to `process.on`. */
51
+ readonly register?: (event: 'uncaughtException' | 'unhandledRejection', handler: (err: unknown) => void) => void;
52
+ }
53
+ export interface CrashHandlers {
54
+ /** The shared handler — exported so tests can drive it deterministically. */
55
+ readonly handle: (kind: CrashKind, err: unknown) => Promise<void>;
56
+ }
57
+ export declare function registerCrashHandlers(deps: RegisterCrashHandlersDeps): CrashHandlers;
58
+ //# sourceMappingURL=crash-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crash-handlers.d.ts","sourceRoot":"","sources":["../src/crash-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AAEzD,MAAM,MAAM,SAAS,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IACvD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IACjE,6FAA6F;IAC7F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gEAAgE;IAChE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAClB,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,EACjD,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAC5B,IAAI,CAAC;CACX;AAED,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,aAAa,CA2GpF"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Hard cap on the graceful-deregister attempt inside a crash handler. The
3
+ * process is already dying; we give the deregister a bounded best-effort window
4
+ * then exit regardless, so a wedged registry call can never strand the handler.
5
+ */
6
+ export const DEFAULT_CRASH_DEREGISTER_TIMEOUT_MS = 5_000;
7
+ export function registerCrashHandlers(deps) {
8
+ const timeoutMs = deps.deregisterTimeoutMs ?? DEFAULT_CRASH_DEREGISTER_TIMEOUT_MS;
9
+ const exit = deps.exit ?? ((code) => { process.exit(code); });
10
+ const stderrWrite = deps.stderrWrite ?? ((msg) => { process.stderr.write(msg); });
11
+ const register = deps.register ??
12
+ ((event, handler) => {
13
+ process.on(event, handler);
14
+ });
15
+ let handling = false;
16
+ function safeLogError(event, data) {
17
+ try {
18
+ deps.logger.error(event, data);
19
+ }
20
+ catch {
21
+ // The file sink itself failed (e.g. disk full) — stderr below is the
22
+ // backstop. Never let the diagnostic emitter mask the crash.
23
+ }
24
+ }
25
+ function safeStderr(msg) {
26
+ try {
27
+ stderrWrite(msg);
28
+ }
29
+ catch {
30
+ // Nothing left — stderr is gone too. Swallow so we still reach exit().
31
+ }
32
+ }
33
+ async function runCleanupWithTimeout(cleanup) {
34
+ let timer;
35
+ try {
36
+ const outcome = await Promise.race([
37
+ cleanup().then(() => ({ kind: 'done' }), (error) => ({ kind: 'failed', error })),
38
+ new Promise((resolve) => {
39
+ timer = setTimeout(() => resolve({ kind: 'timeout' }), timeoutMs);
40
+ timer.unref?.();
41
+ }),
42
+ ]);
43
+ if (outcome.kind === 'timeout') {
44
+ safeLogError('crash_cleanup_timeout', { timeout_ms: timeoutMs });
45
+ safeStderr(`macf-channel-server: crash cleanup exceeded ${String(timeoutMs)}ms — ` +
46
+ 'exiting without a confirmed clean deregister.\n');
47
+ }
48
+ else if (outcome.kind === 'failed') {
49
+ safeLogError('crash_cleanup_failed', {
50
+ error: outcome.error instanceof Error ? outcome.error.message : String(outcome.error),
51
+ });
52
+ }
53
+ }
54
+ finally {
55
+ if (timer !== undefined)
56
+ clearTimeout(timer);
57
+ }
58
+ }
59
+ async function handle(kind, err) {
60
+ if (handling) {
61
+ // A crash WHILE handling a crash — don't loop or re-run cleanup; force exit.
62
+ safeStderr(`macf-channel-server: re-entrant ${kind} during crash handling — forcing exit.\n`);
63
+ exit(1);
64
+ return;
65
+ }
66
+ handling = true;
67
+ const error = err instanceof Error ? err.message : String(err);
68
+ const stack = err instanceof Error ? (err.stack ?? '') : '';
69
+ const snap = deps.lifecycle.snapshot();
70
+ // File-logger half (load-bearing — survives a non-draining stdout pipe).
71
+ safeLogError(kind, {
72
+ error,
73
+ stack,
74
+ lifecycle_phase: snap.phase,
75
+ uptime_ms: snap.uptime_ms,
76
+ pid: process.pid,
77
+ });
78
+ // stderr half (loud — the file sink may have failed; either may be the
79
+ // only surviving channel).
80
+ safeStderr(`macf-channel-server FATAL ${kind}: ${error}\n${stack}\n` +
81
+ ` lifecycle=${snap.phase} uptime_ms=${String(snap.uptime_ms)} pid=${String(process.pid)}\n`);
82
+ // Best-effort graceful deregister, bounded by a hard timeout.
83
+ const cleanup = deps.getCleanup?.();
84
+ if (cleanup !== undefined) {
85
+ await runCleanupWithTimeout(cleanup);
86
+ }
87
+ exit(1);
88
+ }
89
+ register('uncaughtException', (err) => {
90
+ void handle('uncaught_exception', err);
91
+ });
92
+ register('unhandledRejection', (reason) => {
93
+ void handle('unhandled_rejection', reason);
94
+ });
95
+ return { handle };
96
+ }
97
+ //# source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;IACzC,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,oBAAoB,EAAE,CAAC,MAAe,EAAE,EAAE;QACjD,KAAK,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { Logger } from '@groundnuty/macf-core';
2
+ /**
3
+ * Resolve the effective forensic-log path.
4
+ *
5
+ * 1. explicit, non-empty `MACF_LOG_PATH` → used as-is (back-compat).
6
+ * 2. `$XDG_STATE_HOME/macf/<agentName>-channel.log`
7
+ * 3. `$HOME/.local/state/macf/<agentName>-channel.log`
8
+ * 4. `<os-tmpdir>/macf/<agentName>-channel.log` (last-ditch — always writable)
9
+ *
10
+ * Pure: no filesystem side effects (the caller's logger creates parent dirs).
11
+ * `env` is injectable for tests.
12
+ */
13
+ export declare function resolveForensicLogPath(opts: {
14
+ readonly agentName: string;
15
+ readonly env?: NodeJS.ProcessEnv;
16
+ }): string;
17
+ export interface ForensicLogger {
18
+ /** The structured logger (file sink, or stderr-only if the file failed). */
19
+ readonly logger: Logger;
20
+ /** The resolved forensic-log path (even if the file sink failed to open). */
21
+ readonly logPath: string;
22
+ /** Whether the file sink is active (false → degraded to stderr-only). */
23
+ readonly fileActive: boolean;
24
+ }
25
+ /**
26
+ * Build the channel-server's forensic logger. Resolves the path, then attempts
27
+ * a real file logger; on any failure to open the file sink (unwritable dir,
28
+ * etc.) it logs a LOUD stderr warning and degrades to a stderr-only logger so
29
+ * the server still starts and still produces *some* trail.
30
+ */
31
+ export declare function createForensicLogger(opts: {
32
+ readonly agentName: string;
33
+ readonly debug: boolean;
34
+ readonly env?: NodeJS.ProcessEnv;
35
+ }): ForensicLogger;
36
+ //# sourceMappingURL=forensic-log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forensic-log.d.ts","sourceRoot":"","sources":["../src/forensic-log.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,GAAG,MAAM,CAOT;AAyBD,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,GAAG,cAAc,CAoBjB"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Guaranteed forensic log (groundnuty/macf#642).
3
+ *
4
+ * The per-agent channel-server runs as the Claude TUI's MCP stdio child. Under
5
+ * load Claude Code stops draining the stdio pipe, so stderr is an unreliable
6
+ * failure channel — and the macf-core logger NO-OPS entirely when
7
+ * `MACF_LOG_PATH` is unset. The net effect: the channel-server can die with no
8
+ * trail at all.
9
+ *
10
+ * This module makes a file-based forensic log the always-on default — defense-
11
+ * in-depth, never relying on `claude.sh` to have exported `MACF_LOG_PATH`. An
12
+ * explicitly-set `MACF_LOG_PATH` still wins (back-compat); otherwise we resolve
13
+ * a deterministic path under `$XDG_STATE_HOME` (or `$HOME/.local/state`, or the
14
+ * OS tmpdir as a last-ditch) so a forensic trail exists regardless of the
15
+ * launch environment.
16
+ *
17
+ * The safety net must never itself become the crash cause: `createForensicLogger`
18
+ * degrades to a stderr-only logger if the file sink can't be created (e.g. an
19
+ * unwritable state dir), reporting `fileActive: false` rather than throwing.
20
+ */
21
+ import { tmpdir } from 'node:os';
22
+ import { join } from 'node:path';
23
+ import { createLogger } from '@groundnuty/macf-core';
24
+ /**
25
+ * Resolve the effective forensic-log path.
26
+ *
27
+ * 1. explicit, non-empty `MACF_LOG_PATH` → used as-is (back-compat).
28
+ * 2. `$XDG_STATE_HOME/macf/<agentName>-channel.log`
29
+ * 3. `$HOME/.local/state/macf/<agentName>-channel.log`
30
+ * 4. `<os-tmpdir>/macf/<agentName>-channel.log` (last-ditch — always writable)
31
+ *
32
+ * Pure: no filesystem side effects (the caller's logger creates parent dirs).
33
+ * `env` is injectable for tests.
34
+ */
35
+ export function resolveForensicLogPath(opts) {
36
+ const env = opts.env ?? process.env;
37
+ const explicit = env['MACF_LOG_PATH'];
38
+ if (explicit !== undefined && explicit !== '')
39
+ return explicit;
40
+ const fileName = `${sanitizeAgentName(opts.agentName)}-channel.log`;
41
+ return join(forensicStateDir(env), 'macf', fileName);
42
+ }
43
+ /**
44
+ * The base state directory for the default forensic log, mirroring the XDG
45
+ * Base Directory spec (`$XDG_STATE_HOME`, else `$HOME/.local/state`). Falls back
46
+ * to the OS tmpdir so the path is always writable even in a degenerate
47
+ * environment (no HOME — e.g. some CI / container contexts).
48
+ */
49
+ function forensicStateDir(env) {
50
+ const xdg = env['XDG_STATE_HOME'];
51
+ if (xdg !== undefined && xdg !== '')
52
+ return xdg;
53
+ const home = env['HOME'];
54
+ if (home !== undefined && home !== '')
55
+ return join(home, '.local', 'state');
56
+ return tmpdir();
57
+ }
58
+ /**
59
+ * Sanitize an agent name into a filesystem-safe single path segment — guards
60
+ * against path traversal / separators in an unexpected `MACF_AGENT_NAME`.
61
+ */
62
+ function sanitizeAgentName(name) {
63
+ const cleaned = name.replace(/[^A-Za-z0-9._-]/g, '_');
64
+ return cleaned === '' ? 'agent' : cleaned;
65
+ }
66
+ /**
67
+ * Build the channel-server's forensic logger. Resolves the path, then attempts
68
+ * a real file logger; on any failure to open the file sink (unwritable dir,
69
+ * etc.) it logs a LOUD stderr warning and degrades to a stderr-only logger so
70
+ * the server still starts and still produces *some* trail.
71
+ */
72
+ export function createForensicLogger(opts) {
73
+ const logPath = resolveForensicLogPath({ agentName: opts.agentName, env: opts.env });
74
+ try {
75
+ // createLogger creates parent dirs + the file synchronously in its
76
+ // constructor, so a throw here means the file sink is unusable.
77
+ const logger = createLogger({ logPath, debug: opts.debug });
78
+ return { logger, logPath, fileActive: true };
79
+ }
80
+ catch (err) {
81
+ const msg = err instanceof Error ? err.message : String(err);
82
+ try {
83
+ process.stderr.write(`macf-channel-server: WARNING — could not open forensic log at ${logPath}: ${msg}. ` +
84
+ 'Falling back to stderr-only logging (no durable crash trail). See macf#642.\n');
85
+ }
86
+ catch {
87
+ /* nothing left — stderr itself is gone */
88
+ }
89
+ // Force the stderr sink on (debug:true) so the degraded logger still emits.
90
+ return { logger: createLogger({ debug: true }), logPath, fileActive: false };
91
+ }
92
+ }
93
+ //# sourceMappingURL=forensic-log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forensic-log.js","sourceRoot":"","sources":["../src/forensic-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAGtC;IACC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACpC,MAAM,QAAQ,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC;IACtC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,EAAE;QAAE,OAAO,QAAQ,CAAC;IAE/D,MAAM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EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,iEAAiE,OAAO,KAAK,GAAG,IAAI;gBAClF,+EAA+E,CAClF,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;QACD,4EAA4E;QAC5E,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;IAC/E,CAAC;AACH,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Lifecycle-phase tracker (groundnuty/macf#642).
3
+ *
4
+ * A tiny mutable holder for the channel-server's current startup/runtime phase
5
+ * plus process uptime. The crash handlers and the periodic alive-tick read its
6
+ * snapshot so the forensic log pinpoints WHERE the process was when it died —
7
+ * the difference between "crashed mid-boot" and "crashed while serving" is the
8
+ * first thing an operator needs.
9
+ *
10
+ * Free-form `phase` strings (not an enum) keep server.ts able to annotate any
11
+ * step without a schema round-trip; the canonical phases server.ts uses are
12
+ * boot → otel-bootstrapped → config-loaded → mcp-connected → port-bound →
13
+ * collision-checked → registered → serving.
14
+ */
15
+ export interface LifecycleSnapshot {
16
+ readonly phase: string;
17
+ readonly uptime_ms: number;
18
+ }
19
+ export interface LifecycleTracker {
20
+ /** Advance the current phase. */
21
+ readonly set: (phase: string) => void;
22
+ /** Read the current phase + uptime (now − startedAt). */
23
+ readonly snapshot: () => LifecycleSnapshot;
24
+ }
25
+ export declare function createLifecycleTracker(opts?: {
26
+ readonly initial?: string;
27
+ /** Injectable epoch-ms clock for tests; defaults to `Date.now`. */
28
+ readonly now?: () => number;
29
+ }): LifecycleTracker;
30
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,iBAAiB,CAAC;CAC5C;AAED,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B,GAAG,gBAAgB,CAanB"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Lifecycle-phase tracker (groundnuty/macf#642).
3
+ *
4
+ * A tiny mutable holder for the channel-server's current startup/runtime phase
5
+ * plus process uptime. The crash handlers and the periodic alive-tick read its
6
+ * snapshot so the forensic log pinpoints WHERE the process was when it died —
7
+ * the difference between "crashed mid-boot" and "crashed while serving" is the
8
+ * first thing an operator needs.
9
+ *
10
+ * Free-form `phase` strings (not an enum) keep server.ts able to annotate any
11
+ * step without a schema round-trip; the canonical phases server.ts uses are
12
+ * boot → otel-bootstrapped → config-loaded → mcp-connected → port-bound →
13
+ * collision-checked → registered → serving.
14
+ */
15
+ export function createLifecycleTracker(opts) {
16
+ const now = opts?.now ?? (() => Date.now());
17
+ const startedAt = now();
18
+ let phase = opts?.initial ?? 'boot';
19
+ return {
20
+ set(next) {
21
+ phase = next;
22
+ },
23
+ snapshot() {
24
+ return { phase, uptime_ms: now() - startedAt };
25
+ },
26
+ };
27
+ }
28
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,MAAM,UAAU,sBAAsB,CAAC,IAItC;IACC,MAAM,GAAG,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,GAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC;IACxB,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,IAAI,MAAM,CAAC;IAEpC,OAAO;QACL,GAAG,CAAC,IAAY;YACd,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,QAAQ;YACN,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/server.js CHANGED
@@ -9,7 +9,6 @@ import { bootstrapOtel } from './otel.js';
9
9
  import { SpanKind, SpanStatusCode } from '@opentelemetry/api';
10
10
  import { getTracer, SpanNames } from './tracing.js';
11
11
  import { loadConfig } from '@groundnuty/macf-core';
12
- import { createLogger } from '@groundnuty/macf-core';
13
12
  import { createMcpChannel } from './mcp.js';
14
13
  import { createHealthState } from './health.js';
15
14
  import { createHttpsServer } from './https.js';
@@ -19,6 +18,10 @@ import { PACKAGE_VERSION } from './package-version.js';
19
18
  import { createRegistry, createRegistryFromConfig } from '@groundnuty/macf-core';
20
19
  import { checkCollision, CollisionError, RegisterRaceError } from './collision.js';
21
20
  import { registerShutdownHandler } from './shutdown.js';
21
+ import { createForensicLogger } from './forensic-log.js';
22
+ import { createLifecycleTracker } from './lifecycle.js';
23
+ import { registerCrashHandlers } from './crash-handlers.js';
24
+ import { createAliveTicker } from './alive-ticker.js';
22
25
  import { createRegistryHeartbeat, resolveHeartbeatIntervalMs } from './registry-heartbeat.js';
23
26
  import { createTokenRefresher } from './token-refresh.js';
24
27
  import { createRefreshAwareClient } from './refresh-aware-client.js';
@@ -40,10 +43,53 @@ async function main() {
40
43
  // the SDK packages + registers the global provider. See macf#196.
41
44
  await bootstrapOtel();
42
45
  const config = loadConfig();
43
- const logger = createLogger({
44
- logPath: config.logPath,
46
+ // macf#642: a GUARANTEED forensic file log. The macf-core logger NO-OPS when
47
+ // MACF_LOG_PATH is unset, and stderr is unreliable (Claude Code stops draining
48
+ // the stdio pipe under load) — so the channel-server could die with no trail.
49
+ // createForensicLogger defaults the path to $XDG_STATE_HOME / $HOME/.local/state
50
+ // when the launcher didn't export MACF_LOG_PATH (defense-in-depth; an explicit
51
+ // MACF_LOG_PATH still wins), and degrades to stderr-only rather than crashing if
52
+ // the file sink can't be opened.
53
+ const { logger, logPath: forensicLogPath, fileActive } = createForensicLogger({
54
+ agentName: config.agentName,
45
55
  debug: config.debug,
46
56
  });
57
+ // Loud startup forensic line — file AND stderr regardless of debug — so the
58
+ // resolved log path is discoverable + the first line bounds the process start.
59
+ logger.info('forensic_log_active', {
60
+ log_path: forensicLogPath,
61
+ file_active: fileActive,
62
+ pid: process.pid,
63
+ version: PACKAGE_VERSION,
64
+ });
65
+ process.stderr.write(`macf-channel-server: forensic log → ${forensicLogPath}` +
66
+ (fileActive ? '' : ' (file sink UNAVAILABLE — stderr only)') +
67
+ ` [pid ${String(process.pid)}, v${PACKAGE_VERSION}]\n`);
68
+ // macf#642: lifecycle-phase tracker — the crash handlers + alive-tick read this
69
+ // so the forensic log pinpoints WHERE the process was when it died.
70
+ const lifecycle = createLifecycleTracker({ initial: 'boot' });
71
+ // macf#642: top-level crash handlers, registered EARLY (before the rest of
72
+ // startup) so an uncaughtException / unhandledRejection during boot still lands
73
+ // in the forensic log + attempts a bounded graceful deregister, then exits 1.
74
+ // The shutdown `cleanup` is wired later (it needs the registry + HTTPS server);
75
+ // the getter returns undefined until then, so an early crash logs + exits
76
+ // without a deregister it has nothing to perform.
77
+ let shutdownCleanup;
78
+ registerCrashHandlers({
79
+ logger,
80
+ lifecycle,
81
+ getCleanup: () => shutdownCleanup,
82
+ });
83
+ // macf#642: record the process exit code in the forensic log. The 'exit' event
84
+ // allows only synchronous work — logger.info uses appendFileSync (sync), so the
85
+ // line is durably written before the process is gone.
86
+ process.on('exit', (code) => {
87
+ logger.info('process_exit', {
88
+ code,
89
+ pid: process.pid,
90
+ lifecycle_phase: lifecycle.snapshot().phase,
91
+ });
92
+ });
47
93
  // macf#473 piece 2 (DR-025): the authoritative write-ahead comms-ledger,
48
94
  // a SIBLING of channel.log derived from MACF_LOG_PATH. A no-op when
49
95
  // logPath is unset (mirrors `logger`). The `appendEdge` writer is
@@ -90,7 +136,27 @@ async function main() {
90
136
  // DR-030 E1: read the comms-ledger (sibling of logPath) for last_processed.
91
137
  logPath: config.logPath,
92
138
  });
139
+ // macf#642: a boundary try/catch around the /notify delivery path. https.ts
140
+ // already catches at the request boundary (→ 500), but a dedicated catch here
141
+ // attributes the failure to the notify handler (payload type + stack) AND guards
142
+ // the fire-and-forget sub-calls (e.g. wakeViaTmux) so nothing can escape as an
143
+ // unhandledRejection. Re-thrown so the request boundary still returns 500 — the
144
+ // delivery genuinely failed; this only adds a louder, attributed log.
93
145
  const onNotify = async (payload) => {
146
+ try {
147
+ await deliverNotification(payload);
148
+ }
149
+ catch (err) {
150
+ logger.error('notify_handler_error', {
151
+ type: payload.type,
152
+ issue: payload.issue_number,
153
+ error: err instanceof Error ? err.message : String(err),
154
+ stack: err instanceof Error ? (err.stack ?? '') : '',
155
+ });
156
+ throw err;
157
+ }
158
+ };
159
+ async function deliverNotification(payload) {
94
160
  const meta = { type: payload.type };
95
161
  if (payload.issue_number !== undefined) {
96
162
  meta['issue_number'] = String(payload.issue_number);
@@ -197,7 +263,7 @@ async function main() {
197
263
  detail: 'MACF_WORKSPACE_DIR unset',
198
264
  });
199
265
  }
200
- };
266
+ }
201
267
  // P2: Build the project registry + (GitHub-mode only) /sign varsClient.
202
268
  //
203
269
  // Pre-macf#317 this section also called `await generateToken()` to
@@ -473,8 +539,10 @@ async function main() {
473
539
  });
474
540
  // P1: Connect MCP channel
475
541
  await mcp.connect();
542
+ lifecycle.set('mcp-connected'); // macf#642 forensic phase marker
476
543
  // P1: Bind port
477
544
  const { actualPort } = await httpsServer.start(config.port, config.host);
545
+ lifecycle.set('port-bound'); // macf#642 forensic phase marker
478
546
  // P2: Collision detection. The HTTPS server is already bound + serving
479
547
  // (P1 above), so a version-aware takeover (groundnuty/macf#424) only fires
480
548
  // for an instance that can actually serve — a crash-on-boot newer instance
@@ -489,6 +557,7 @@ async function main() {
489
557
  agentCertPath: config.agentCertPath,
490
558
  agentKeyPath: config.agentKeyPath,
491
559
  }, PACKAGE_VERSION, logger);
560
+ lifecycle.set('collision-checked'); // macf#642 forensic phase marker
492
561
  if (collisionResult.action === 'abort') {
493
562
  await httpsServer.stop();
494
563
  throw new CollisionError(config.routingLabel, collisionResult.existing.host, collisionResult.existing.port);
@@ -520,6 +589,7 @@ async function main() {
520
589
  await httpsServer.stop();
521
590
  throw new RegisterRaceError(config.routingLabel, registerResult.current);
522
591
  }
592
+ lifecycle.set('registered'); // macf#642 forensic phase marker
523
593
  logger.info('registered', {
524
594
  agent: config.routingLabel,
525
595
  host: config.advertiseHost,
@@ -548,7 +618,10 @@ async function main() {
548
618
  // carries OUR instance_id, so a newer instance that took over the slot
549
619
  // (groundnuty/macf#424) while we ran is never clobbered on our exit. Also
550
620
  // clears the registry-heartbeat interval (DR-031) on the way out.
551
- registerShutdownHandler({
621
+ // macf#642: capture the returned cleanup so the top-level crash handlers can
622
+ // attempt the same instance-id-guarded graceful deregister (behind a hard
623
+ // timeout) on an uncaughtException / unhandledRejection.
624
+ shutdownCleanup = registerShutdownHandler({
552
625
  agentName: config.routingLabel,
553
626
  registry,
554
627
  instanceId: config.instanceId,
@@ -559,13 +632,23 @@ async function main() {
559
632
  });
560
633
  // Start the periodic heartbeat now that its stop() is wired into shutdown.
561
634
  registryHeartbeat.start();
635
+ lifecycle.set('serving'); // macf#642 forensic phase marker
562
636
  logger.info('server_started', {
563
637
  port: actualPort,
564
638
  host: config.advertiseHost,
565
639
  agent: config.agentName,
566
640
  type: config.agentType,
567
641
  instance_id: config.instanceId,
642
+ pid: process.pid,
643
+ version: PACKAGE_VERSION,
644
+ log_path: forensicLogPath,
568
645
  });
646
+ // macf#642: periodic "alive" tick to the forensic log (every 60s, unref()'d so
647
+ // it can't pin the event loop). Its purpose is its ABSENCE — when the server
648
+ // dies a SILENT death (OOM / SIGKILL / power loss) no crash handler runs and
649
+ // the log just stops; the last `alive` line then bounds the death to a ≤60s
650
+ // window. Started last so the log shows the server reached steady state.
651
+ createAliveTicker({ logger, lifecycle }).start();
569
652
  } // end runStartup
570
653
  }
571
654
  main().catch((err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,mEAAmE;AACnE,kEAAkE;AAClE,2DAA2D;AAC3D,uEAAuE;AACvE,qEAAqE;AACrE,8CAA8C;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC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AAM,CAAC,KAAK,CAClB,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAC9D,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groundnuty/macf-channel-server",
3
- "version": "0.2.41",
3
+ "version": "0.2.43",
4
4
  "description": "MCP channel server for the Multi-Agent Coordination Framework. HTTPS + mTLS endpoint agents connect to for inter-agent messaging (notify), CI-completion routing, and /sign certificate issuance. Invoked by Claude Code's plugin via `npx -y @groundnuty/macf-channel-server` per DR-022.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "test:integration": "vitest run --config vitest.integration.config.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@groundnuty/macf-core": "0.2.41",
36
+ "@groundnuty/macf-core": "0.2.43",
37
37
  "@modelcontextprotocol/sdk": "~1.29.0",
38
38
  "@opentelemetry/api": "1.9.1",
39
39
  "@opentelemetry/core": "2.7.0",