feat(agent): improve investigation contracts and runtime readiness
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user