fix(tools)!: simplify direct invocation and harden boundary contracts (#555)

Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures.

Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation.

BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
This commit is contained in:
morluto
2026-10-05 20:16:44 +08:00
committed by GitHub
parent 4f099a10f8
commit b5e98915c6
350 changed files with 5347 additions and 10599 deletions
+18 -19
View File
@@ -86,37 +86,36 @@ describe("process CLI errors", () => {
});
expect(await captureProcessScenarioFile(invalid)).toEqual({
error: "Process command failed",
code: "invalid_request",
category: "invalid_input",
message:
"Process scenario is invalid. Check its required fields and limits, then try again.",
message: "Analysis input is invalid. Check the arguments and try again.",
retryable: true,
remediation: { action: "Correct the listed arguments and retry." },
details: expect.objectContaining({
operation: "capture_process_scenario",
issues: expect.arrayContaining([
expect.objectContaining({ path: ["executable"] }),
]),
}),
});
});
it("reports the exact process-capture policy recovery", async () => {
it("captures the minimal executable-and-arguments scenario", async () => {
const root = await fixture();
const scenario = join(root, "scenario.json");
await writeFile(
scenario,
JSON.stringify({
executable: "/bin/sh",
working_directory: "/tmp",
executable: process.execPath,
arguments: ["-e", "process.stdout.write('minimal-capture')"],
}),
);
expect(await captureProcessScenarioFile(scenario)).toMatchObject({
error: "Process command failed",
code: "permission_required",
category: "permission_required",
message:
"This operation needs additional local permission. Review the requested scope and remediation.",
details: {
capability: "process_capture",
ceiling: null,
},
remediation: {
restart_required: false,
elicitation_supported: false,
},
const evidence = await captureProcessScenarioFile(scenario);
expect(evidence).toMatchObject({
predicate_type: "rea.process-capture",
operation: "capture_process_scenario",
});
expect(JSON.stringify(evidence)).toContain("minimal-capture");
});
it("rejects unrelated capture evidence", async () => {