Skip to content

Find code by asking what it does. A CLI for coding agents that uses Jev to discover relevant files and source context.

Verify parser packaging and extend installed failure journeys

David Zhang51632c84b07c
diff --git a/package.json b/package.json
index 9e14fcb..8e8d185 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
"format": "oxfmt --write .",
"format:check": "oxfmt --check .",
"test:reference": "bash scripts/test-reference.sh",
- "test:parser": "bash scripts/test-reference.sh node --experimental-strip-types --test test/parser/source.test.ts",
+ "test:parser": "bash scripts/test-reference.sh node --experimental-strip-types --test test/parser/source.test.ts && bash scripts/test-installed.sh --test-name-pattern \"runtime has|parses Python\"",
"test:filesystem": "bash scripts/test-reference.sh bun test packages/core/test/filesystem.test.ts test/retrieval.test.ts",
"test:installed": "bash scripts/test-installed.sh",
"test:e2e": "bun run test:installed",
diff --git a/scripts/test-installed.sh b/scripts/test-installed.sh
index 898f274..03bf29d 100755
--- a/scripts/test-installed.sh
+++ b/scripts/test-installed.sh
@@ -23,7 +23,7 @@ while [[ $# -gt 0 ]]; do
[[ $# -ge 2 ]] || { echo "--case requires checkpoint, failures, or cache"; exit 1; }
case "$2" in
checkpoint) pattern="" ;;
- failures) pattern="provider|malformed|cancellation|interrupt|stdout pipe" ;;
+ failures) pattern="provider|malformed|invalid JSON|cancellation|interrupt|stdout pipe" ;;
cache) pattern="cache" ;;
*) echo "Unknown installed test case: $2"; exit 1 ;;
esac
diff --git a/specs/jevgrep/README.md b/specs/jevgrep/README.md
index 4a8bea5..51f69ba 100644
--- a/specs/jevgrep/README.md
+++ b/specs/jevgrep/README.md
@@ -35,7 +35,7 @@ verification before ending each pass. These commands are targets to implement,
not claims about the current scaffold.
- [x] [01 — Reference and real HTTP fixture](slices/01-reference.md)
-- [ ] [02 — Bundled parser parity](slices/02-parser.md)
+- [x] [02 — Bundled parser parity](slices/02-parser.md)
- [ ] [03 — Filesystem eligibility and snapshots](slices/03-filesystem.md)
- [ ] [04 — Installed CLI + skill + first real task](slices/04-checkpoint.md)
- [ ] [05 — Faults, cancellation and partial results](slices/05-failures.md)
diff --git a/specs/jevgrep/assets/integration-verification.md b/specs/jevgrep/assets/integration-verification.md
index 35b4b7f..ed9d067 100644
--- a/specs/jevgrep/assets/integration-verification.md
+++ b/specs/jevgrep/assets/integration-verification.md
@@ -51,3 +51,17 @@ This is not the complete slice 05 matrix yet.
A live `jg doctor` completed successfully through AI Gateway with the authorized
Duet staging credential, loaded through its existing dotenvx mechanism. No secret
was printed. This verifies live connectivity only; the official task remains next.
+
+Further focused installed checks pass: in-flight SIGINT exits 130 and stops
+requests; invalid JSON exhausts three attempts for each independent request and
+returns incomplete; a disconnected socket retries the same request and retains
+source after recovery. The malformed-JSON test initially assumed the entire
+search made one request. The fixture actually creates independent hierarchy
+batches, so the assertion now verifies the specified three-attempt bound per
+exact request body rather than imposing a global three-request search limit.
+A stalled-HTTP evaluator test uses the same timeout mechanism with a short injected
+duration and confirms three attempts, then a classified provider failure.
+
+`bun run test:parser` is now the combined named gate: conformance in Node plus
+pack/install and actual Python units in a runtime without development prerequisites.
+It passed all 15 conformance tests and both selected installed journeys.
diff --git a/specs/jevgrep/slices/02-parser.md b/specs/jevgrep/slices/02-parser.md
index cf4fc0e..c3640c3 100644
--- a/specs/jevgrep/slices/02-parser.md
+++ b/specs/jevgrep/slices/02-parser.md
@@ -1,6 +1,6 @@
# Bundle source inspection without Python
-Status: planned. Depends on: 01. Read [contracts](../contracts.md) first.
+Status: verified (2026-09-25). Depends on: 01. Read [contracts](../contracts.md) first.
## Contract and owner
@@ -19,6 +19,14 @@ already exist. CLI transcripts replace visual/screenshot gates for this product.
## Verification and verdict
+`bun run test:parser` passes: 15 Node parser conformance tests followed by two
+packed-runtime journeys, printing the Python declaration units read by the real
+SDK fixture. The runtime has no Python, Bun or compiler. The frozen-helper corpus
+and intentional grammar differences are documented in
+[parser conformance](../../../test/parser/README.md). This proves source inspection
+and installed asset loading, not downstream task quality.
+
+
Assert source text and line coordinates, meaningful comments, bounded oversized units and fallback behavior. Inspect representative source from the saved official task trees without copying personal repos. Ensure no shell-out to python/Bun/compiler and no runtime asset download.
## Delegated decisions
diff --git a/test/gateway.test.ts b/test/gateway.test.ts
index ff3ad7b..8a36e1d 100644
--- a/test/gateway.test.ts
+++ b/test/gateway.test.ts
@@ -140,3 +140,33 @@ test("Retry-After delays a retry before the provider can recover", async () => {
server.stop(true);
}
});
+
+test("stalled HTTP attempts time out without exceeding the evaluator attempt limit", async () => {
+ let calls = 0;
+ const server = Bun.serve({
+ port: 0,
+ fetch() {
+ calls++;
+ return new Promise<Response>(() => {});
+ },
+ });
+ try {
+ const evaluator = createEvaluator({
+ apiKey: "fixture",
+ baseURL: `http://127.0.0.1:${server.port}`,
+ signal: new AbortController().signal,
+ timeoutMs: 20,
+ retryDelayMs: 0,
+ });
+ await expect(
+ evaluator.evaluate({
+ state: "test",
+ questions: { q: { type: "boolean", instructions: "Relevant?" } },
+ }),
+ ).rejects.toMatchObject({ kind: "provider" });
+ expect(calls).toBe(3);
+ expect(evaluator.requests).toBe(3);
+ } finally {
+ server.stop(true);
+ }
+}, 2000);
diff --git a/test/installed.test.mjs b/test/installed.test.mjs
index bcd2b4e..726e4f1 100644
--- a/test/installed.test.mjs
+++ b/test/installed.test.mjs
@@ -94,6 +94,19 @@ async function context(t, mode = "healthy") {
}
assert.ok(requests.length < 256, "Synthetic search stopped making bounded forward progress");
requests.push({ body, raw });
+ if (mode === "disconnect" && requests.length === 1) {
+ response.destroy();
+ return;
+ }
+ if (mode === "invalid-json") {
+ response.writeHead(200, { "content-type": "application/json" });
+ response.end("{broken");
+ return;
+ }
+ if (mode === "interrupt") {
+ for (const child of children) child.kill("SIGINT");
+ return;
+ }
if (mode === "transient" && requests.length === 1) {
response.writeHead(500, { "content-type": "application/json" });
response.end(JSON.stringify({ error: "temporary fixture failure" }));
@@ -395,3 +408,32 @@ test("a transient provider failure retries the same request and completes instal
assert.deepEqual(fixture.requests[0].body, fixture.requests[1].body);
for (const [branch] of branches) assert.ok(result.stdout.includes(`py-evidence-${branch}:`));
});
+
+test("interrupting an in-flight installed search exits 130 and stops requests", async (t) => {
+ const fixture = await context(t, "interrupt");
+ const result = await fixture.run([query]);
+ assert.equal(result.code, 130);
+ assert.match(result.stdout, /Status: interrupted/);
+ assert.equal(fixture.requests.length, 1);
+});
+
+test("invalid JSON remains incomplete with at most three attempts per request", async (t) => {
+ const fixture = await context(t, "invalid-json");
+ const result = await fixture.run([query]);
+ assert.equal(result.code, 2);
+ assert.match(result.stdout, /Status: incomplete/);
+ const attempts = new Map();
+ for (const { raw } of fixture.requests) attempts.set(raw, (attempts.get(raw) ?? 0) + 1);
+ assert.ok(attempts.size > 0);
+ for (const count of attempts.values()) assert.equal(count, 3);
+ assert.ok(!result.stdout.includes("py-evidence-"));
+});
+
+test("a disconnected provider request retries without losing installed source evidence", async (t) => {
+ const fixture = await context(t, "disconnect");
+ const result = await fixture.run([query]);
+ assert.equal(result.code, 0);
+ assert.match(result.stdout, /Status: complete/);
+ assert.deepEqual(fixture.requests[0].body, fixture.requests[1].body);
+ for (const [branch] of branches) assert.ok(result.stdout.includes(`py-evidence-${branch}:`));
+});