fix(ida): report a procedure IDA cannot resolve as invalid input (#1785)
* test(ida): expect a missing procedure to be reported as invalid input * test(ida): name the invalid_request code and its category for a missing procedure * fix(ida): report a procedure IDA cannot resolve as invalid input * test(ida): pin the missing-procedure issue shape and the lookups that stay unreadable * fix(ida): treat a lookup answer for another query as a producer fault * test(ida): expect an argument-independent issue path and pin legacy error replies and escaping * fix(ida): report a missing procedure without naming an argument path * test(ida): expect provider-derived selectors to stay producer faults in composed workflows * fix(ida): keep provider-derived procedure selectors out of the caller's input errors * test(ida): cover session forwarding, parameter hygiene and structured derived-node errors * docs(ida): describe when procedure resolution blames the caller
This commit is contained in:
@@ -1114,3 +1114,41 @@ describe("no replacement start", () => {
|
||||
expect(session.status()).toMatchObject({ open: false });
|
||||
});
|
||||
});
|
||||
|
||||
describe("selector origin forwarding", () => {
|
||||
it("forwards the per-call selector origin to the provider client on both execution paths", async () => {
|
||||
const [first] = await createBinarySessionTargets();
|
||||
const seen: unknown[] = [];
|
||||
const session = createTestBinarySession(() => ({
|
||||
execute: (_operation, _parameters, options) => {
|
||||
seen.push(options?.selectorOrigin);
|
||||
return Promise.resolve(ok(null));
|
||||
},
|
||||
close: () => Promise.resolve(resultOk(null)),
|
||||
}));
|
||||
expect((await session.open(first)).ok, "the target opens").toBe(true);
|
||||
seen.length = 0;
|
||||
|
||||
await session.execute(
|
||||
"address_name",
|
||||
{ address: "0x1000" },
|
||||
{ selectorOrigin: "provider" },
|
||||
);
|
||||
await session.withAdmittedAnalysis(
|
||||
"binary_overview",
|
||||
undefined,
|
||||
(analysis) =>
|
||||
analysis.execute(
|
||||
"address_name",
|
||||
{ address: "0x2000" },
|
||||
{ selectorOrigin: "provider" },
|
||||
),
|
||||
);
|
||||
await session.execute("address_name", { address: "0x3000" });
|
||||
|
||||
expect(
|
||||
seen,
|
||||
"direct and admitted calls forward the origin; an unmarked call carries none",
|
||||
).toEqual(["provider", "provider", undefined]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user