fix(analysis)!: scope call-graph caveats to their observed relationships
Return deduplicated execution caveats once and preserve provider-owned relationship diagnostics and completeness on graph nodes. Keep complete relationship reads exhaustive despite contextual caveats, including portable call-path reconstruction.
Preserve omitted diagnostic fields in historical Evidence and bind reported diagnostics into semantic identity. Revise graph workflow and Ghidra adapter profiles so old cached representations cannot replay under the new contracts.
Remove stale duplicate-lookup test claims and redundant fixture validation. Prune million-entry duplicate cases while retaining argument-stack and deep-chain regressions; bounded Flameox captures identified validation and canonical hashing costs.
Validation: static and architecture checks, generated docs, 364 focused tests before pruning, 21 call-path tests after pruning, public MCP schema validation and targeted profile tests. Real engine behavior was not locally exercised.
BREAKING CHANGE: get_call_graph normalized_result now contains { graph, limitations }; traversal-depth groups are under graph.
This commit is contained in:
+25
-16
@@ -62,6 +62,7 @@ export const unavailableCallGraph = (reason: string): CallGraphCallees => ({
|
||||
coverage: {
|
||||
status: "unknown",
|
||||
reason: `Upstream callgraph was unavailable (${reason}); callee edges remain unknown.`,
|
||||
diagnostics: [UNRECOGNIZED_CALLEE_LIMITATION],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -101,6 +102,7 @@ export const readCallGraphCallees = async (
|
||||
BigInt(left) < BigInt(right) ? -1 : BigInt(left) > BigInt(right) ? 1 : 0,
|
||||
);
|
||||
const limitations = [UNRECOGNIZED_CALLEE_LIMITATION];
|
||||
const diagnostics = [UNRECOGNIZED_CALLEE_LIMITATION];
|
||||
const coverageLimitations: string[] = [];
|
||||
const truncated =
|
||||
row.truncated === true ||
|
||||
@@ -124,11 +126,12 @@ export const readCallGraphCallees = async (
|
||||
try {
|
||||
const raw = await call("lookup_funcs", { queries: targets });
|
||||
const parsed = modernLookupBatchSchema.safeParse(raw);
|
||||
if (!parsed.success)
|
||||
limitations.push(
|
||||
"IDA observed callee addresses but returned an unreadable name lookup result; the addresses are retained.",
|
||||
);
|
||||
else {
|
||||
if (!parsed.success) {
|
||||
const limitation =
|
||||
"IDA observed callee addresses but returned an unreadable name lookup result; the addresses are retained.";
|
||||
limitations.push(limitation);
|
||||
diagnostics.push(limitation);
|
||||
} else {
|
||||
const rows = new Map<string, (typeof parsed.data)[number] | null>();
|
||||
for (const item of parsed.data) {
|
||||
const query = idaAddressSchema.safeParse(item.query);
|
||||
@@ -139,18 +142,19 @@ export const readCallGraphCallees = async (
|
||||
const item = rows.get(target);
|
||||
if (item?.fn?.address === target && item.error === null)
|
||||
names.set(target, item.fn.name);
|
||||
else
|
||||
limitations.push(
|
||||
`IDA observed callee address ${target} but could not resolve its name${item?.error == null ? "" : `: ${item.error}`}; the address is retained.`,
|
||||
);
|
||||
else {
|
||||
const limitation = `IDA observed callee address ${target} but could not resolve its name${item?.error == null ? "" : `: ${item.error}`}; the address is retained.`;
|
||||
limitations.push(limitation);
|
||||
diagnostics.push(limitation);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (cause: unknown) {
|
||||
if (cause instanceof AnalysisCancelledError) throw cause;
|
||||
if (!expectedReadFailure(cause)) throw cause;
|
||||
limitations.push(
|
||||
`IDA observed callee addresses but the name lookup failed (${errorReason(cause)}); the addresses are retained.`,
|
||||
);
|
||||
const limitation = `IDA observed callee addresses but the name lookup failed (${errorReason(cause)}); the addresses are retained.`;
|
||||
limitations.push(limitation);
|
||||
diagnostics.push(limitation);
|
||||
}
|
||||
}
|
||||
return {
|
||||
@@ -161,9 +165,14 @@ export const readCallGraphCallees = async (
|
||||
};
|
||||
}),
|
||||
limitations,
|
||||
coverage:
|
||||
coverageLimitations.length === 0
|
||||
? { status: "complete" }
|
||||
: { status: "partial", limitations: coverageLimitations },
|
||||
coverage: {
|
||||
...(coverageLimitations.length === 0
|
||||
? { status: "complete" as const }
|
||||
: {
|
||||
status: "partial" as const,
|
||||
limitations: coverageLimitations,
|
||||
}),
|
||||
diagnostics,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user