@mneme-ai/core 2.19.70 → 2.19.71-lite
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/warmcall/server.d.ts +5 -0
- package/dist/warmcall/server.d.ts.map +1 -1
- package/dist/warmcall/server.js +44 -7
- package/dist/warmcall/server.js.map +1 -1
- package/dist/warmcall/server.test.d.ts +44 -0
- package/dist/warmcall/server.test.d.ts.map +1 -0
- package/dist/warmcall/server.test.js +237 -0
- package/dist/warmcall/server.test.js.map +1 -0
- package/package.json +2 -5
|
@@ -51,5 +51,10 @@ export declare function startWarmCallServer(opts: {
|
|
|
51
51
|
/** Called whenever an unexpected error happens — typically a
|
|
52
52
|
* malformed frame from a buggy client. Best-effort logging. */
|
|
53
53
|
onError?: (err: unknown) => void;
|
|
54
|
+
/** Override the socket path. Defaults to warmcallSocketPath() (the
|
|
55
|
+
* per-user, per-OS canonical location the bin shim talks to). Tests
|
|
56
|
+
* pass a unique tmp path here to avoid colliding with a real daemon
|
|
57
|
+
* + with other parallel tests. */
|
|
58
|
+
socketPath?: string;
|
|
54
59
|
}): Promise<WarmCallServer>;
|
|
55
60
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/warmcall/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;yEAEyE;AACzE,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C;;;qDAGiD;IACjD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC;qEACiE;IACjE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/warmcall/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;yEAEyE;AACzE,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C;;;qDAGiD;IACjD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC;qEACiE;IACjE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;;uCAGmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,cAAc,CAAC,CAyB1B"}
|
package/dist/warmcall/server.js
CHANGED
|
@@ -42,7 +42,7 @@ import { warmcallSocketPath, encodeFrame, parseFrames, isWarmCallSafe } from "./
|
|
|
42
42
|
* to stop it cleanly during daemon shutdown. Idempotent + safe to
|
|
43
43
|
* call multiple times (subsequent calls return the existing server). */
|
|
44
44
|
export async function startWarmCallServer(opts) {
|
|
45
|
-
const socketPath = warmcallSocketPath();
|
|
45
|
+
const socketPath = opts.socketPath ?? warmcallSocketPath();
|
|
46
46
|
// POSIX: stale socket files survive crashes; unlink first. Windows
|
|
47
47
|
// named pipes are auto-cleaned when the holding process dies.
|
|
48
48
|
if (process.platform !== "win32" && existsSync(socketPath)) {
|
|
@@ -161,12 +161,25 @@ async function runRequestFrame(sock, req, opts) {
|
|
|
161
161
|
process.env[k] = v;
|
|
162
162
|
}
|
|
163
163
|
// Intercept process.exit so a misbehaving tool can't kill the daemon.
|
|
164
|
+
// Captured-exit-code is stashed on the interceptor; the throw is purely
|
|
165
|
+
// a control-flow signal — NOT a real error. See N6 bug report
|
|
166
|
+
// 2026-05-19: prior versions wrote that signal to stderr, leaking
|
|
167
|
+
// "warmcall: warmcall: process.exit intercepted" on every `mneme
|
|
168
|
+
// --version` (commander calls exit(0) after printing the version,
|
|
169
|
+
// which the interceptor would translate into a fake stderr line).
|
|
164
170
|
const exitInterceptor = installExitInterceptor((code) => { exitCode = code; });
|
|
165
171
|
try {
|
|
166
172
|
await opts.run(["node", "mneme", ...req.argv]);
|
|
167
173
|
}
|
|
168
174
|
catch (err) {
|
|
169
|
-
if (err
|
|
175
|
+
if (err instanceof WarmCallExitSignal) {
|
|
176
|
+
// N6 fix — the exit-intercept signal is daemon-internal control
|
|
177
|
+
// flow, not an error. The exit code is ALREADY set via onExit
|
|
178
|
+
// when the interceptor was triggered; do NOT overwrite it, do NOT
|
|
179
|
+
// write anything to stderr.
|
|
180
|
+
// Keep exitCode as captured (already updated by onExit).
|
|
181
|
+
}
|
|
182
|
+
else if (err && typeof err === "object" && "exitCode" in err && typeof err.exitCode === "number") {
|
|
170
183
|
// commander.exitOverride throws a CommanderError with .exitCode.
|
|
171
184
|
exitCode = err.exitCode;
|
|
172
185
|
}
|
|
@@ -209,17 +222,41 @@ function writeFrameSafe(sock, frame) {
|
|
|
209
222
|
}
|
|
210
223
|
catch { /* swallow — peer may have disconnected */ }
|
|
211
224
|
}
|
|
225
|
+
/** N6 fix (v2.19.71) — sentinel class for the exit-intercept control
|
|
226
|
+
* signal. Distinguishing it from a generic Error means the catch
|
|
227
|
+
* block in `runRequestFrame` can recognise it as INTERNAL mechanism
|
|
228
|
+
* and suppress the stderr leak that previously appeared on every
|
|
229
|
+
* `mneme --version` invocation through the warm path.
|
|
230
|
+
*
|
|
231
|
+
* IMPORTANT: this class is NOT exported. Subclassing it from outside
|
|
232
|
+
* the module would let a hostile tool inside the daemon's heap fake
|
|
233
|
+
* a clean exit. The class is module-local so only the interceptor
|
|
234
|
+
* can construct it. */
|
|
235
|
+
class WarmCallExitSignal extends Error {
|
|
236
|
+
capturedExitCode;
|
|
237
|
+
constructor(code) {
|
|
238
|
+
super(`warmcall internal: process.exit(${code}) intercepted`);
|
|
239
|
+
this.name = "WarmCallExitSignal";
|
|
240
|
+
this.capturedExitCode = code;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
212
243
|
/** Install a process.exit() trap that captures the exit code without
|
|
213
|
-
* actually exiting the daemon. Uninstall() restores the real exit.
|
|
244
|
+
* actually exiting the daemon. Uninstall() restores the real exit.
|
|
245
|
+
*
|
|
246
|
+
* The trap throws a WarmCallExitSignal (sentinel class) so the
|
|
247
|
+
* surrounding `runRequestFrame` catch block can distinguish it from
|
|
248
|
+
* a genuine error and suppress the misleading stderr leak. */
|
|
214
249
|
function installExitInterceptor(onExit) {
|
|
215
250
|
const original = process.exit.bind(process);
|
|
216
251
|
// Cast through unknown so TypeScript doesn't complain about the
|
|
217
252
|
// type-level signature change.
|
|
218
253
|
process.exit = ((code) => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
//
|
|
222
|
-
|
|
254
|
+
const captured = typeof code === "number" ? code : 0;
|
|
255
|
+
onExit(captured);
|
|
256
|
+
// Throw the sentinel — not a generic Error — so the warmcall
|
|
257
|
+
// catch block recognises this as internal control flow and does
|
|
258
|
+
// NOT prefix-decorate the message into stderr.
|
|
259
|
+
throw new WarmCallExitSignal(captured);
|
|
223
260
|
});
|
|
224
261
|
return {
|
|
225
262
|
uninstall: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/warmcall/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AAOtG;;yEAEyE;AACzE,MAAM,CAAC,KAAK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AI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC,CAAC,0CAA0C,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;wBASwB;AACxB,MAAM,kBAAmB,SAAQ,KAAK;IACpB,gBAAgB,CAAS;IACzC,YAAY,IAAY;QACtB,KAAK,CAAC,mCAAmC,IAAI,eAAe,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AAED;;;;;+DAK+D;AAC/D,SAAS,sBAAsB,CAAC,MAA8B;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,gEAAgE;IAChE,+BAA+B;IAC9B,OAAyD,CAAC,IAAI,GAAG,CAAC,CAAC,IAAa,EAAE,EAAE;QACnF,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjB,6DAA6D;QAC7D,gEAAgE;QAChE,+CAA+C;QAC/C,MAAM,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,CAAwC,CAAC;IAC1C,OAAO;QACL,SAAS,EAAE,GAAG,EAAE;YACb,OAAgD,CAAC,IAAI,GAAG,QAAQ,CAAC;QACpE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.19.71 — server-side WARM CALL tests focused on the N6 stderr-leak
|
|
3
|
+
* bug class.
|
|
4
|
+
*
|
|
5
|
+
* N6 (user-reported 2026-05-19): every `mneme --version` invocation
|
|
6
|
+
* through the WARM CALL path emitted a phantom stderr line:
|
|
7
|
+
*
|
|
8
|
+
* $ mneme --version
|
|
9
|
+
* 2.19.69
|
|
10
|
+
* warmcall: warmcall: process.exit intercepted
|
|
11
|
+
*
|
|
12
|
+
* Root cause: the exit-interceptor threw a generic Error whose
|
|
13
|
+
* `.message` started with "warmcall:". The catch block in
|
|
14
|
+
* runRequestFrame then re-prefixed it as `warmcall: <message>` and
|
|
15
|
+
* piped that to the client as a stderr frame. Worst case: also
|
|
16
|
+
* overwrote the captured exit code (0 for `--version`) with 1.
|
|
17
|
+
*
|
|
18
|
+
* v2.19.71 introduces a private sentinel class `WarmCallExitSignal`,
|
|
19
|
+
* thrown by the interceptor and matched by `instanceof` in the catch.
|
|
20
|
+
* The catch swallows the sentinel (it's daemon-internal control flow,
|
|
21
|
+
* not an error) and preserves the exit code captured by `onExit`.
|
|
22
|
+
*
|
|
23
|
+
* The tests below spin up a REAL server on a per-test temp socket,
|
|
24
|
+
* talk to it with a real socket client, and assert:
|
|
25
|
+
* 1. `process.exit(0)` from the run() body → exit frame {code:0},
|
|
26
|
+
* ZERO stderr frames
|
|
27
|
+
* 2. `process.exit(7)` from the run() body → exit frame {code:7},
|
|
28
|
+
* ZERO stderr frames
|
|
29
|
+
* 3. commander-style throw (`{exitCode: 2}`) → exit frame {code:2},
|
|
30
|
+
* ZERO stderr frames
|
|
31
|
+
* 4. genuine throw (`throw new Error("boom")`) → exit frame {code:1},
|
|
32
|
+
* EXACTLY ONE stderr frame matching /warmcall: boom\n/
|
|
33
|
+
* 5. stdout writes from the run() body → exit frame {code:0},
|
|
34
|
+
* ZERO stderr frames (the success path)
|
|
35
|
+
* 6. allowlist refusal (non-allowlisted argv) → exit frame {code:99},
|
|
36
|
+
* ONE stderr frame with the refusal message
|
|
37
|
+
*
|
|
38
|
+
* Test #4 verifies the bug class FOR genuine errors is NOT regressed
|
|
39
|
+
* — we still want stderr noise when something real goes wrong.
|
|
40
|
+
* Tests #1-3+5 verify the N6 bug class is extinct for the internal
|
|
41
|
+
* exit-intercept mechanism (the "control flow that should be quiet").
|
|
42
|
+
*/
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=server.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.d.ts","sourceRoot":"","sources":["../../src/warmcall/server.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.19.71 — server-side WARM CALL tests focused on the N6 stderr-leak
|
|
3
|
+
* bug class.
|
|
4
|
+
*
|
|
5
|
+
* N6 (user-reported 2026-05-19): every `mneme --version` invocation
|
|
6
|
+
* through the WARM CALL path emitted a phantom stderr line:
|
|
7
|
+
*
|
|
8
|
+
* $ mneme --version
|
|
9
|
+
* 2.19.69
|
|
10
|
+
* warmcall: warmcall: process.exit intercepted
|
|
11
|
+
*
|
|
12
|
+
* Root cause: the exit-interceptor threw a generic Error whose
|
|
13
|
+
* `.message` started with "warmcall:". The catch block in
|
|
14
|
+
* runRequestFrame then re-prefixed it as `warmcall: <message>` and
|
|
15
|
+
* piped that to the client as a stderr frame. Worst case: also
|
|
16
|
+
* overwrote the captured exit code (0 for `--version`) with 1.
|
|
17
|
+
*
|
|
18
|
+
* v2.19.71 introduces a private sentinel class `WarmCallExitSignal`,
|
|
19
|
+
* thrown by the interceptor and matched by `instanceof` in the catch.
|
|
20
|
+
* The catch swallows the sentinel (it's daemon-internal control flow,
|
|
21
|
+
* not an error) and preserves the exit code captured by `onExit`.
|
|
22
|
+
*
|
|
23
|
+
* The tests below spin up a REAL server on a per-test temp socket,
|
|
24
|
+
* talk to it with a real socket client, and assert:
|
|
25
|
+
* 1. `process.exit(0)` from the run() body → exit frame {code:0},
|
|
26
|
+
* ZERO stderr frames
|
|
27
|
+
* 2. `process.exit(7)` from the run() body → exit frame {code:7},
|
|
28
|
+
* ZERO stderr frames
|
|
29
|
+
* 3. commander-style throw (`{exitCode: 2}`) → exit frame {code:2},
|
|
30
|
+
* ZERO stderr frames
|
|
31
|
+
* 4. genuine throw (`throw new Error("boom")`) → exit frame {code:1},
|
|
32
|
+
* EXACTLY ONE stderr frame matching /warmcall: boom\n/
|
|
33
|
+
* 5. stdout writes from the run() body → exit frame {code:0},
|
|
34
|
+
* ZERO stderr frames (the success path)
|
|
35
|
+
* 6. allowlist refusal (non-allowlisted argv) → exit frame {code:99},
|
|
36
|
+
* ONE stderr frame with the refusal message
|
|
37
|
+
*
|
|
38
|
+
* Test #4 verifies the bug class FOR genuine errors is NOT regressed
|
|
39
|
+
* — we still want stderr noise when something real goes wrong.
|
|
40
|
+
* Tests #1-3+5 verify the N6 bug class is extinct for the internal
|
|
41
|
+
* exit-intercept mechanism (the "control flow that should be quiet").
|
|
42
|
+
*/
|
|
43
|
+
import { describe, it, expect, afterEach } from "vitest";
|
|
44
|
+
import { createConnection } from "node:net";
|
|
45
|
+
import { existsSync, unlinkSync } from "node:fs";
|
|
46
|
+
import { tmpdir } from "node:os";
|
|
47
|
+
import { join } from "node:path";
|
|
48
|
+
import { startWarmCallServer } from "./server.js";
|
|
49
|
+
/** Per-test unique socket path so we don't collide with a real
|
|
50
|
+
* daemon running on the dev machine + don't collide with other
|
|
51
|
+
* parallel vitest workers. Windows named-pipes have no fs
|
|
52
|
+
* presence so unique pipe names work the same way. */
|
|
53
|
+
function uniqueTestSocketPath() {
|
|
54
|
+
const tag = `${process.pid}-${Date.now()}-${Math.floor(Math.random() * 1e6)}`;
|
|
55
|
+
return process.platform === "win32"
|
|
56
|
+
? `\\\\.\\pipe\\mneme-warmcall-test-${tag}`
|
|
57
|
+
: join(tmpdir(), `mneme-warmcall-test-${tag}.sock`);
|
|
58
|
+
}
|
|
59
|
+
/** Collect every frame a client receives from the server, resolving
|
|
60
|
+
* once the daemon closes the socket. */
|
|
61
|
+
async function callWarmCallServer(server, argv) {
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const client = createConnection(server.socketPath);
|
|
64
|
+
let buf = "";
|
|
65
|
+
const frames = [];
|
|
66
|
+
let resolved = false;
|
|
67
|
+
const settle = (closed) => {
|
|
68
|
+
if (resolved)
|
|
69
|
+
return;
|
|
70
|
+
resolved = true;
|
|
71
|
+
try {
|
|
72
|
+
client.destroy();
|
|
73
|
+
}
|
|
74
|
+
catch { /* */ }
|
|
75
|
+
resolve({ frames, closed });
|
|
76
|
+
};
|
|
77
|
+
const timer = setTimeout(() => {
|
|
78
|
+
if (!resolved)
|
|
79
|
+
reject(new Error("warmcall test: server did not respond within 5s"));
|
|
80
|
+
}, 5000);
|
|
81
|
+
client.setEncoding("utf8");
|
|
82
|
+
client.on("connect", () => {
|
|
83
|
+
client.write(JSON.stringify({ v: 1, type: "run", cwd: process.cwd(), argv, env: {} }) + "\n");
|
|
84
|
+
});
|
|
85
|
+
client.on("data", (chunk) => {
|
|
86
|
+
buf += chunk;
|
|
87
|
+
let nl;
|
|
88
|
+
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
89
|
+
const line = buf.slice(0, nl);
|
|
90
|
+
buf = buf.slice(nl + 1);
|
|
91
|
+
if (!line.trim())
|
|
92
|
+
continue;
|
|
93
|
+
try {
|
|
94
|
+
frames.push(JSON.parse(line));
|
|
95
|
+
}
|
|
96
|
+
catch { /* drop garbage */ }
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
client.on("end", () => { clearTimeout(timer); settle(true); });
|
|
100
|
+
client.on("close", () => { clearTimeout(timer); settle(true); });
|
|
101
|
+
client.on("error", (err) => {
|
|
102
|
+
clearTimeout(timer);
|
|
103
|
+
if (!resolved)
|
|
104
|
+
reject(err);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function stdoutFrames(frames) {
|
|
109
|
+
return frames.filter((f) => f.type === "stdout").map((f) => f.data);
|
|
110
|
+
}
|
|
111
|
+
function stderrFrames(frames) {
|
|
112
|
+
return frames.filter((f) => f.type === "stderr").map((f) => f.data);
|
|
113
|
+
}
|
|
114
|
+
function exitFrame(frames) {
|
|
115
|
+
const last = frames[frames.length - 1];
|
|
116
|
+
if (last && last.type === "exit")
|
|
117
|
+
return last;
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
describe("WARM CALL — server end-to-end (N6 stderr-leak suite)", () => {
|
|
121
|
+
let activeServer = null;
|
|
122
|
+
afterEach(async () => {
|
|
123
|
+
if (activeServer) {
|
|
124
|
+
try {
|
|
125
|
+
activeServer.close();
|
|
126
|
+
}
|
|
127
|
+
catch { /* */ }
|
|
128
|
+
// Belt-and-suspenders: unlink stale POSIX socket so next test
|
|
129
|
+
// gets a fresh bind.
|
|
130
|
+
if (process.platform !== "win32" && existsSync(activeServer.socketPath)) {
|
|
131
|
+
try {
|
|
132
|
+
unlinkSync(activeServer.socketPath);
|
|
133
|
+
}
|
|
134
|
+
catch { /* */ }
|
|
135
|
+
}
|
|
136
|
+
activeServer = null;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
it("process.exit(0) inside run() → exit code 0 + ZERO stderr frames (the headline N6 fix)", async () => {
|
|
140
|
+
activeServer = await startWarmCallServer({
|
|
141
|
+
socketPath: uniqueTestSocketPath(),
|
|
142
|
+
run: async () => {
|
|
143
|
+
// Simulate commander.exitOverride. Commander prints something
|
|
144
|
+
// first, then calls process.exit(0). Our interceptor throws a
|
|
145
|
+
// WarmCallExitSignal which the catch block must SWALLOW.
|
|
146
|
+
process.stdout.write("2.19.71\n");
|
|
147
|
+
process.exit(0);
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
const { frames } = await callWarmCallServer(activeServer, ["welcome"]);
|
|
151
|
+
expect(exitFrame(frames)?.code, `frames: ${JSON.stringify(frames)}`).toBe(0);
|
|
152
|
+
expect(stdoutFrames(frames).join("")).toContain("2.19.71");
|
|
153
|
+
expect(stderrFrames(frames), "N6 invariant: stderr MUST be empty on intercepted exit").toEqual([]);
|
|
154
|
+
});
|
|
155
|
+
it("process.exit(7) inside run() → exit code 7 preserved + ZERO stderr frames", async () => {
|
|
156
|
+
activeServer = await startWarmCallServer({
|
|
157
|
+
socketPath: uniqueTestSocketPath(),
|
|
158
|
+
run: async () => {
|
|
159
|
+
process.exit(7);
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
const { frames } = await callWarmCallServer(activeServer, ["welcome"]);
|
|
163
|
+
expect(exitFrame(frames)?.code).toBe(7);
|
|
164
|
+
expect(stderrFrames(frames)).toEqual([]);
|
|
165
|
+
});
|
|
166
|
+
it("commander-style {exitCode: 2} throw → exit code 2 + ZERO stderr frames", async () => {
|
|
167
|
+
activeServer = await startWarmCallServer({
|
|
168
|
+
socketPath: uniqueTestSocketPath(),
|
|
169
|
+
run: async () => {
|
|
170
|
+
// commander.exitOverride throws a CommanderError instance with
|
|
171
|
+
// `.exitCode` — we treat that exactly like an intercepted exit.
|
|
172
|
+
const err = new Error("(outputHelp)");
|
|
173
|
+
err.exitCode = 2;
|
|
174
|
+
throw err;
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const { frames } = await callWarmCallServer(activeServer, ["welcome"]);
|
|
178
|
+
expect(exitFrame(frames)?.code).toBe(2);
|
|
179
|
+
expect(stderrFrames(frames)).toEqual([]);
|
|
180
|
+
});
|
|
181
|
+
it("genuine throw → exit code 1 + EXACTLY ONE stderr frame with `warmcall: ` prefix (not regressed)", async () => {
|
|
182
|
+
activeServer = await startWarmCallServer({
|
|
183
|
+
socketPath: uniqueTestSocketPath(),
|
|
184
|
+
run: async () => { throw new Error("boom"); },
|
|
185
|
+
});
|
|
186
|
+
const { frames } = await callWarmCallServer(activeServer, ["welcome"]);
|
|
187
|
+
expect(exitFrame(frames)?.code).toBe(1);
|
|
188
|
+
const stderr = stderrFrames(frames);
|
|
189
|
+
expect(stderr.length).toBe(1);
|
|
190
|
+
// The genuine-error path MUST still report through stderr — that's
|
|
191
|
+
// what users expect when something actually breaks. Exactly one
|
|
192
|
+
// `warmcall: ` prefix (not double-prefixed like the N6 bug).
|
|
193
|
+
expect(stderr[0]).toBe("warmcall: boom\n");
|
|
194
|
+
});
|
|
195
|
+
it("success path with stdout writes → exit code 0 + ZERO stderr frames", async () => {
|
|
196
|
+
activeServer = await startWarmCallServer({
|
|
197
|
+
socketPath: uniqueTestSocketPath(),
|
|
198
|
+
run: async () => {
|
|
199
|
+
process.stdout.write('{"v":1,"data":"ok"}\n');
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
const { frames } = await callWarmCallServer(activeServer, ["welcome"]);
|
|
203
|
+
expect(exitFrame(frames)?.code).toBe(0);
|
|
204
|
+
expect(stdoutFrames(frames).join("")).toBe('{"v":1,"data":"ok"}\n');
|
|
205
|
+
expect(stderrFrames(frames)).toEqual([]);
|
|
206
|
+
});
|
|
207
|
+
it("argv not on allowlist → exit code 99 + ONE refusal stderr frame", async () => {
|
|
208
|
+
let runCalled = false;
|
|
209
|
+
activeServer = await startWarmCallServer({
|
|
210
|
+
socketPath: uniqueTestSocketPath(),
|
|
211
|
+
run: async () => { runCalled = true; },
|
|
212
|
+
});
|
|
213
|
+
const { frames } = await callWarmCallServer(activeServer, ["upgrade"]); // NOT on allowlist
|
|
214
|
+
expect(runCalled, "server MUST refuse non-allowlisted commands before invoking run()").toBe(false);
|
|
215
|
+
expect(exitFrame(frames)?.code).toBe(99);
|
|
216
|
+
expect(stderrFrames(frames).length).toBe(1);
|
|
217
|
+
expect(stderrFrames(frames)[0]).toMatch(/not on allowlist/);
|
|
218
|
+
});
|
|
219
|
+
it("string `--version` flag → exit code 0 + version-like stdout + ZERO stderr", async () => {
|
|
220
|
+
// Real-world repro of the N6 bug. Commander handles --version by
|
|
221
|
+
// printing the version then calling process.exit(0). Pre-N6-fix
|
|
222
|
+
// this leaked "warmcall: warmcall: process.exit intercepted" on
|
|
223
|
+
// every `mneme --version` over the warm path.
|
|
224
|
+
activeServer = await startWarmCallServer({
|
|
225
|
+
socketPath: uniqueTestSocketPath(),
|
|
226
|
+
run: async () => {
|
|
227
|
+
process.stdout.write("2.19.71\n");
|
|
228
|
+
process.exit(0);
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
const { frames } = await callWarmCallServer(activeServer, ["--version"]);
|
|
232
|
+
expect(exitFrame(frames)?.code).toBe(0);
|
|
233
|
+
expect(stdoutFrames(frames).join("").trim()).toBe("2.19.71");
|
|
234
|
+
expect(stderrFrames(frames)).toEqual([]);
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
//# sourceMappingURL=server.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["../../src/warmcall/server.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAU,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAuB,MAAM,aAAa,CAAC;AAGvE;;;uDAGuD;AACvD,SAAS,oBAAoB;IAC3B,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;IAC9E,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QACjC,CAAC,CAAC,oCAAoC,GAAG,EAAE;QAC3C,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,uBAAuB,GAAG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
|
{
|
|
2
2
|
"name": "@mneme-ai/core",
|
|
3
|
-
"version": "2.19.
|
|
4
|
-
"description": "Core indexing, retrieval, and graph engine for Mneme",
|
|
3
|
+
"version": "2.19.71-lite",
|
|
4
|
+
"description": "Core indexing, retrieval, and graph engine for Mneme — LITE variant (no bundled WASM embedder, no native deps).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -69,8 +69,5 @@
|
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=22.13.0 <25.0.0"
|
|
72
|
-
},
|
|
73
|
-
"optionalDependencies": {
|
|
74
|
-
"z3-solver": "^4.16.0"
|
|
75
72
|
}
|
|
76
73
|
}
|