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:
Mykola Dementiev
2026-10-11 22:52:16 +08:00
committed by GitHub
parent 554cb45f7f
commit d3e9ee5505
15 changed files with 753 additions and 21 deletions
+10 -7
View File
@@ -3,6 +3,7 @@ import { z } from "zod";
import type {
AnalysisOperation,
AnalysisOperationPort,
ExecutionOptions,
} from "./AnalysisProvider.js";
import type { EnhancedToolName } from "../contracts/enhancedInputs.js";
import { enhancedInputSchemas } from "../contracts/enhancedInputs.js";
@@ -163,8 +164,8 @@ export class EnhancedTools {
);
case "trace_call_path":
return traceCallPath(
(name, arguments_, operationSignal) =>
this.#call(name, arguments_, operationSignal),
(name, arguments_, operationSignal, selectorOrigin) =>
this.#call(name, arguments_, operationSignal, selectorOrigin),
call.input,
signal,
);
@@ -267,6 +268,7 @@ export class EnhancedTools {
"procedure_pseudo_code",
{ procedure: resolved.ok ? resolved.value : address },
signal,
resolved.ok ? "provider" : undefined,
);
if (!result.ok)
return {
@@ -361,6 +363,7 @@ export class EnhancedTools {
tool,
{ procedure: current.address },
signal,
"provider",
);
if (!result.ok) {
graph[level].push({
@@ -518,13 +521,13 @@ export class EnhancedTools {
name: AnalysisOperation,
arguments_: Readonly<Record<string, JsonValue>>,
signal?: AbortSignal,
selectorOrigin?: ExecutionOptions["selectorOrigin"],
): Promise<Result<JsonValue, AnalysisError>> {
if (isAborted(signal)) return err(new AnalysisCancelledError(name));
const execution = await this.analysis.execute(
name,
arguments_,
signal === undefined ? {} : { signal },
);
const execution = await this.analysis.execute(name, arguments_, {
...(signal === undefined ? {} : { signal }),
...(selectorOrigin === undefined ? {} : { selectorOrigin }),
});
if (isAborted(signal)) return err(new AnalysisCancelledError(name));
return execution.ok ? ok(execution.value.result) : execution;
}