fix(analysis): report call-edge truncation

This commit is contained in:
morluto committed 2026-07-24 14:14:26 +00:00
1 parent 24b3dc41df
commit 6039b92be7
2 files changed
+9 -2

No files matched your search

+5 -1
View File
@@ -181,7 +181,11 @@ const recordEdge = (
const targetAddress =
input.direction === "forward" ? edge.relatedAddress : edge.address;
const edgeKey = `${sourceAddress}\u0000${targetAddress}`;
if (state.edges.has(edgeKey) || state.edges.size >= input.max_nodes) return;
if (state.edges.has(edgeKey)) return;
if (state.edges.size >= input.max_nodes) {
state.residual.add("Call-path traversal reached the edge limit.");
return;
}
state.edges.set(edgeKey, {
source_address: sourceAddress,
target_address: targetAddress,
+4 -1
View File
@@ -318,7 +318,10 @@ describe("enhanced MCP tools", () => {
nodes: [{ address: "0x1", depth: 0 }],
frontier: ["0x2"],
truncated: true,
residual_unknowns: [expect.stringContaining("reached the node limit")],
residual_unknowns: expect.arrayContaining([
expect.stringContaining("reached the node limit"),
expect.stringContaining("reached the edge limit"),
]),
limits: {
max_nodes: 1,
nodes_visited: 1,