fix(ghidra): expose terminal-call boundary assumptions
Preserve observed terminal-call sites and callee flags across function views, raw bridge responses, Evidence, and snapshot replay. Version analysis profiles so older unqualified results cannot be reused. Qualify Ghidra function extents without changing external no-return flags or claiming recovery of excluded code. Validation: 76 focused tests, check:fast, docs:check, formatting, and the full Ghidra 12.1.4 host lane pass. Real CLI and all five stdio MCP function views retain the terminal-call evidence; returning puts calls remain unflagged. The reported stripped Rust ELF and Windows host remain unverified. Fixes #1658
This commit is contained in:
@@ -562,6 +562,31 @@ describe("Ghidra result projection", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("projects terminal-call facts from the function bridge into execution limitations", async () => {
|
||||
const limitation =
|
||||
"Ghidra Listing reports a terminal call at 0x401020 to 0x7f001000 __tls_get_addr (external=true, thunk=false, hasNoReturn=true); fallthrough is excluded by Ghidra's flow model. This records Ghidra's FunctionManager flag, not an independent verification that the callee cannot return.";
|
||||
const ghidra = provider(installationHost(), () => ({
|
||||
start: () => Promise.resolve(ok(sessionInfo())),
|
||||
callTool: () =>
|
||||
Promise.resolve(
|
||||
ok({ value: "void main() {}", limitations: [limitation] }),
|
||||
),
|
||||
close: () => Promise.resolve(ok(null)),
|
||||
}));
|
||||
const client = await createElfClient(ghidra);
|
||||
const execution = await client.execute("procedure_pseudo_code", {
|
||||
procedure: "main",
|
||||
});
|
||||
if (!execution.ok) throw execution.error;
|
||||
expect(execution.value.result).toBe("void main() {}");
|
||||
expect(execution.value.limitations).toContain(limitation);
|
||||
expect(execution.value.rawResult).toEqual({
|
||||
value: "void main() {}",
|
||||
limitations: [limitation],
|
||||
});
|
||||
await client.close();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["invalid_request", "AnalysisInputError"],
|
||||
["not_found", "AnalysisInputError"],
|
||||
|
||||
Reference in New Issue
Block a user