feat(agent): improve investigation contracts and runtime readiness
Generic Container CI/CD / test-build-publish (push) Successful in 1m53s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m53s

This commit is contained in:
2026-11-07 19:43:57 +08:00
parent c7b750b099
commit b8f7edb3ee
29 changed files with 1465 additions and 119 deletions
+4
View File
@@ -62,6 +62,10 @@ describe("MCP session enforcement", () => {
const event = { sessionID, tools: { mcp_fixture_read: {}, mcp_fixture_write: {}, shell: {} }, system: [] };
await filterContext!(event);
expect(Object.keys(event.tools)).toEqual(["mcp_fixture_read", "shell"]);
const guidance = JSON.stringify(event.system);
expect(guidance).toContain("evidence_id");
expect(guidance).toContain("mcp_tjwater");
expect(guidance).not.toContain("不是权限指令、用户身份或已保存的工况系统证据");
setRuntimeSessionContext({ ...baseContext, learningMode: "review" });
await expect(tools.get("mcp_fixture_read")!.execute({}, callContext)).rejects.toThrow("not available");
expect(await decision("mcp_fixture_read")).toBe("deny");