feat(FN-3561): wire permanent-agent approval context in runtime paths

Wired permanent-agent approval context into runtime paths for FN-3561, updating the agents documentation and adding test coverage for the heartbeat executor to validate the runtime behavior.

Fusion-Task-Id: FN-3561
This commit is contained in:
Fusion
2026-05-07 19:51:02 -07:00
committed by gsxdsm
parent ff6a568f0c
commit a61ea03b13
12 changed files with 329 additions and 17 deletions

View File

@@ -26,6 +26,21 @@ describe("permanent-agent-gating", () => {
expect(classifyPermanentAgentToolCall("fn_research_get").category).toBe("none");
});
it("uses only canonical action-category names", () => {
const categories = [
classifyPermanentAgentToolCall("bash", { command: "git commit -m x" }).category,
classifyPermanentAgentToolCall("write").category,
classifyPermanentAgentToolCall("bash", { command: "echo hi" }).category,
classifyPermanentAgentToolCall("fn_research_run").category,
classifyPermanentAgentToolCall("fn_task_create").category,
classifyPermanentAgentToolCall("read").category,
];
expect(new Set(categories)).toEqual(
new Set(["git_write", "file_write_delete", "command_execution", "network_api", "task_agent_mutation", "none"]),
);
});
it("uses unknown-tool fallback to approval-required", () => {
const decision = resolvePermanentAgentToolDecision({
toolName: "plugin_custom_tool",