From fb94a1aa6106abed579d5751ad253405ca690157 Mon Sep 17 00:00:00 2001 From: carlos-alm Date: Mon, 8 Jun 2026 15:27:49 -0600 Subject: [PATCH 1/2] fix(native): promote native this-dispatch scope tests from todo to active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The class-scoped this-dispatch fix (edge_builder.rs #1343) is now present in the Rust source and compiled by CI for every PR. Remove the engine guard that was skipping three negative assertions for native and the comment that referenced the v3.11.2 binary gap. All four this-dispatch-scope assertions now run for both wasm and native: - emits Shape.describe → Shape.area (positive case) - does NOT emit Shape.describe → Calculator.area (false-positive guard) - does NOT emit Shape.describe → Formatter.area (false-positive guard) - does NOT emit Caller.run → Sibling.area (single-match false-positive guard) Closes #1413 --- tests/integration/this-dispatch-scope.test.ts | 69 ++++++++----------- 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/tests/integration/this-dispatch-scope.test.ts b/tests/integration/this-dispatch-scope.test.ts index 0ef6e290..537e29bd 100644 --- a/tests/integration/this-dispatch-scope.test.ts +++ b/tests/integration/this-dispatch-scope.test.ts @@ -72,47 +72,36 @@ describe.each(ENGINES)('this-dispatch scope (%s)', (engine) => { ).toBeDefined(); }); - // Native binary v3.11.2 does not include the edge_builder.rs fix for issue #1324 yet. - // These assertions are active for WASM and will be re-enabled for native once a new - // binary is published that includes the Rust fix. - if (engine === 'native') { - it.todo('does NOT emit Shape.describe → Calculator.area (native binary gap #1324)'); - it.todo('does NOT emit Shape.describe → Formatter.area (native binary gap #1324)'); - it.todo( - 'does NOT emit Caller.run → Sibling.area (single-match false-positive, native binary gap #1324)', + it('does NOT emit Shape.describe → Calculator.area (unrelated class, same method name)', () => { + const edge = callEdges.find( + (e) => e.caller_name === 'Shape.describe' && e.callee_name === 'Calculator.area', ); - } else { - it('does NOT emit Shape.describe → Calculator.area (unrelated class, same method name)', () => { - const edge = callEdges.find( - (e) => e.caller_name === 'Shape.describe' && e.callee_name === 'Calculator.area', - ); - expect( - edge, - `Expected NO Shape.describe → Calculator.area edge (false-positive from same-file scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, - ).toBeUndefined(); - }); + expect( + edge, + `Expected NO Shape.describe → Calculator.area edge (false-positive from same-file scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, + ).toBeUndefined(); + }); - it('does NOT emit Shape.describe → Formatter.area (unrelated class, same method name)', () => { - const edge = callEdges.find( - (e) => e.caller_name === 'Shape.describe' && e.callee_name === 'Formatter.area', - ); - expect( - edge, - `Expected NO Shape.describe → Formatter.area edge (false-positive from same-file scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, - ).toBeUndefined(); - }); + it('does NOT emit Shape.describe → Formatter.area (unrelated class, same method name)', () => { + const edge = callEdges.find( + (e) => e.caller_name === 'Shape.describe' && e.callee_name === 'Formatter.area', + ); + expect( + edge, + `Expected NO Shape.describe → Formatter.area edge (false-positive from same-file scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, + ).toBeUndefined(); + }); - // single-sibling.ts: only one class (Sibling) has area(); Caller does not. - // The single-match arm must still check the caller's own class — Caller.run - // must not gain a false edge to Sibling.area. - it('does NOT emit Caller.run → Sibling.area (single-match false-positive, same-file scan)', () => { - const edge = callEdges.find( - (e) => e.caller_name === 'Caller.run' && e.callee_name === 'Sibling.area', - ); - expect( - edge, - `Expected NO Caller.run → Sibling.area edge (false-positive from single-match suffix scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, - ).toBeUndefined(); - }); - } + // single-sibling.ts: only one class (Sibling) has area(); Caller does not. + // The single-match arm must still check the caller's own class — Caller.run + // must not gain a false edge to Sibling.area. + it('does NOT emit Caller.run → Sibling.area (single-match false-positive, same-file scan)', () => { + const edge = callEdges.find( + (e) => e.caller_name === 'Caller.run' && e.callee_name === 'Sibling.area', + ); + expect( + edge, + `Expected NO Caller.run → Sibling.area edge (false-positive from single-match suffix scan).\nActual edges:\n${JSON.stringify(callEdges, null, 2)}`, + ).toBeUndefined(); + }); }); From 6b79cb2f6f209543bd477bac42dfb7e83458e998 Mon Sep 17 00:00:00 2001 From: carlos-alm Date: Tue, 9 Jun 2026 20:11:11 -0600 Subject: [PATCH 2/2] fix(test): catch HF fetch timeout in embedding-regression on Windows CI (#1423) buildEmbeddings wraps all HuggingFace load failures as EngineError (code: ENGINE_UNAVAILABLE), which causes the original ETIMEDOUT errno to be lost. The Windows CI runner timed out downloading the ONNX model, but the existing network-error guard only matched on raw errno codes, so the error was re-thrown and failed the test suite. Add msg.toLowerCase().includes('timeout') to also catch HF's 'Request timeout error occurred' message propagated through the EngineError wrapper. --- tests/search/embedding-regression.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/search/embedding-regression.test.ts b/tests/search/embedding-regression.test.ts index 6ec5df0c..dd8e8de7 100644 --- a/tests/search/embedding-regression.test.ts +++ b/tests/search/embedding-regression.test.ts @@ -68,9 +68,12 @@ describe.skipIf(!hasTransformers)('embedding regression (real model)', () => { dbPath = path.join(tmpDir, '.codegraph', 'graph.db'); // Build embeddings with the smallest/fastest model. - // Skip gracefully when HuggingFace rate-limits the model download (HTTP 429) - // or when the network is unavailable (ECONNRESET, ETIMEDOUT, ENOTFOUND, - // ECONNREFUSED, ERR_HTTP2_STREAM_CANCEL, ERR_HTTP2_SESSION_ERROR). + // Skip gracefully when HuggingFace rate-limits the model download (HTTP 429), + // when the network is unavailable (ECONNRESET, ETIMEDOUT, ENOTFOUND, + // ECONNREFUSED, ERR_HTTP2_STREAM_CANCEL, ERR_HTTP2_SESSION_ERROR), or when + // HF's fetch layer times out. buildEmbeddings wraps HF failures as EngineError + // (code: ENGINE_UNAVAILABLE), losing the original errno, so we also match the + // "timeout" substring from HF's "Request timeout error occurred" message. try { await buildEmbeddings(tmpDir, 'minilm', dbPath); } catch (err: unknown) { @@ -78,6 +81,7 @@ describe.skipIf(!hasTransformers)('embedding regression (real model)', () => { const code = (err as NodeJS.ErrnoException).code ?? ''; const isNetworkError = msg.includes('429') || + msg.toLowerCase().includes('timeout') || code === 'ECONNRESET' || code === 'ETIMEDOUT' || code === 'ENOTFOUND' ||