fix(ida): preserve non-x86 call edges and workflow uncertainty (#1906)

* test(ida): expect callee edges from the call graph on non-x86 targets

* fix(ida): read callee edges from the call graph on non-x86 targets

* test(ida): pin address order of call graph additions

* docs(ida): describe the call graph source for non-x86 callees

* test(ida): pin the x86 baseline, the call graph reader and its failure modes

* fix(ida): check the call graph root, scope truncation to the root and degrade without callgraph

* test(ida): expect managed PE off the x86 path, possible-truncation wording and a complete ARM64 traversal

* fix(ida): keep managed PE and x86 reads off the call graph path and qualify truncation

* test(ida): answer only expected leaf roots and assert the requested call graph roots

* test(ida): expect a call graph the producer cannot give consistently to fail the callee read

* fix(ida): fail the callee read when the call graph cannot be obtained consistently

* fix(ida): preserve call edge authority and workflow uncertainty

* fix(ida): preserve explicit root call graph caps

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Mykola Dementiev
2026-10-12 04:10:22 +08:00
committed by GitHub
co-authored by morluto
parent c2cf7dcb86
commit 0ae38e1e31
17 changed files with 1410 additions and 32 deletions
+71 -1
View File
@@ -14,6 +14,10 @@ const observe = (
address: string,
callees: readonly string[],
provider = "rea-workflow",
options: {
readonly evidenceLimitations?: readonly string[];
readonly dossierLimitations?: readonly string[];
} = {},
): Evidence => {
const value = functionDossierSchema.parse({
procedure: {
@@ -49,7 +53,7 @@ const observe = (
native_api: null,
native_value_flow: null,
basic_blocks: [],
limitations: [],
limitations: [...(options.dossierLimitations ?? [])],
});
return createEvidence(
{ path: "/tmp/a", sha256: "a".repeat(64), format: "mach-o" },
@@ -62,6 +66,9 @@ const observe = (
result: jsonValueSchema.parse(value),
confidence: "derived",
authority: "shipped-artifact",
...(options.evidenceLimitations === undefined
? {}
: { limitations: options.evidenceLimitations }),
},
);
};
@@ -126,6 +133,22 @@ describe("call path reconstruction", () => {
expect(unknown.limitations).toContain(
"No analyze_function Evidence covers reachable function 0x2000",
);
const limitedEmpty = run([
observe("0x1000", [], "rea-workflow", {
dossierLimitations: ["Call relationships are incomplete."],
}),
observe("0x4000", []),
]);
expect(limitedEmpty).toMatchObject({
status: "unknown",
search_scope: { exhaustive: false },
shortest_hops: null,
paths: [],
});
expect(limitedEmpty.limitations).toContain(
"Call relationships are incomplete.",
);
});
it("searches the complete supplied graph", () => {
@@ -182,6 +205,53 @@ describe("call path topology and capacity", () => {
);
});
it("keeps reached function limitations and marks expanded coverage incomplete", () => {
const evidenceLimitation = "Call graph output was truncated.";
const dossierLimitation = "One call target could not be resolved.";
const result = run([
observe("0x1000", ["0x4000"], "rea-workflow", {
evidenceLimitations: [evidenceLimitation],
dossierLimitations: [dossierLimitation],
}),
observe("0x4000", []),
]);
expect(result).toMatchObject({
status: "found",
shortest_hops: 1,
search_scope: { exhaustive: false },
paths: [
{
nodes: [{ address: "0x1000" }, { address: "0x4000" }],
},
],
});
expect(result.limitations).toEqual(
expect.arrayContaining([evidenceLimitation, dossierLimitation]),
);
});
it("retains goal dossier limitations without expanding the goal", () => {
const goalLimitation = "The goal dossier has partial outgoing references.";
const result = run([
observe("0x1000", ["0x4000"]),
observe("0x4000", ["0x5000"], "rea-workflow", {
dossierLimitations: [goalLimitation],
}),
]);
expect(result).toMatchObject({
status: "found",
shortest_hops: 1,
search_scope: { exhaustive: true },
});
expect(result.limitations).toContain(goalLimitation);
expect(result.explored.nodes).toBe(2);
expect(result.limitations).not.toContain(
"No analyze_function Evidence covers reachable function 0x5000",
);
});
it("returns a zero-hop path when start and goal are the same function", () => {
const result = run([observe("0x1000", ["0x2000"])], {
goal: { address: "0x1000" },