agents: add tool policy conformance snapshot (no runtime behavior change) (#6011)

This commit is contained in:
Vignesh
2026-02-01 01:57:49 -08:00
committed by GitHub
parent 1f3afa38e8
commit 35dc417b18
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { describe, expect, test } from "vitest";
import { TOOL_POLICY_CONFORMANCE } from "./tool-policy.conformance.js";
import { TOOL_GROUPS } from "./tool-policy.js";
describe("TOOL_POLICY_CONFORMANCE", () => {
test("matches exported TOOL_GROUPS exactly", () => {
expect(TOOL_POLICY_CONFORMANCE.toolGroups).toEqual(TOOL_GROUPS);
});
test("is JSON-serializable", () => {
expect(() => JSON.stringify(TOOL_POLICY_CONFORMANCE)).not.toThrow();
});
});

View File

@@ -0,0 +1,17 @@
/**
* Conformance snapshot for tool policy.
*
* Security note:
* - This is static, build-time information (no runtime I/O, no network exposure).
* - Intended for CI/tools to detect drift between the implementation policy and
* the formal models/extractors.
*/
import { TOOL_GROUPS } from "./tool-policy.js";
// Tool name aliases are intentionally not exported from tool-policy today.
// Keep the conformance snapshot focused on exported policy constants.
export const TOOL_POLICY_CONFORMANCE = {
toolGroups: TOOL_GROUPS,
} as const;