perf(javascript): reuse graph buckets and query indexes

Append overlapping observations to node buckets instead of recopying groups, and share one node index across semantic seed admission and traversal. Preserve merged provenance and absent-seed behavior.
This commit is contained in:
morluto
2026-10-11 01:54:36 +08:00
parent e52c0a72c5
commit cf346368c4
4 changed files with 37 additions and 16 deletions
@@ -316,6 +316,20 @@ it("returns every relevant unknown inline", () => {
expect(result.unknowns).toHaveLength(1);
});
it("does not admit a semantic-node seed absent from the graph", () => {
const result = queryJavaScriptSemanticGraph(fixtureGraph(), {
seed: { kind: "semantic-node", node_id: `jsrg_node_${"f".repeat(64)}` },
direction: "forward-influence",
});
expect(result).toMatchObject({
status: "no-match",
seed_node_ids: [],
nodes: [],
summary: { total_seed_matches: 0, traversed_nodes: 0 },
});
});
it("returns the complete deterministic forward influence result inline", () => {
const graph = fixtureGraph();
const input = {