Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(analysis): report call-edge truncation

morluto6039b92be7af
diff --git a/src/application/CallPathTracing.ts b/src/application/CallPathTracing.ts
index 7840cece6..58c42f060 100644
--- a/src/application/CallPathTracing.ts
+++ b/src/application/CallPathTracing.ts
@@ -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,
diff --git a/tests/enhancedTools.test.ts b/tests/enhancedTools.test.ts
index 65552d7d0..f1118db69 100644
--- a/tests/enhancedTools.test.ts
+++ b/tests/enhancedTools.test.ts
@@ -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,