Include tool aliases in conformance snapshot

This commit is contained in:
Simon Kim 2026-03-21 04:13:06 +09:00
parent d24ae43654
commit ce244decd0
4 changed files with 10 additions and 5 deletions

View File

@ -9,7 +9,7 @@ type ToolProfilePolicy = {
deny?: string[];
};
const TOOL_NAME_ALIASES: Record<string, string> = {
export const TOOL_NAME_ALIASES: Record<string, string> = {
bash: "exec",
"apply-patch": "apply_patch",
};

View File

@ -7,11 +7,9 @@
* 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.
import { TOOL_GROUPS, TOOL_NAME_ALIASES } from "./tool-policy.js";
export const TOOL_POLICY_CONFORMANCE = {
toolGroups: TOOL_GROUPS,
toolNameAliases: TOOL_NAME_ALIASES,
} as const;

View File

@ -136,6 +136,11 @@ describe("TOOL_POLICY_CONFORMANCE", () => {
expect(TOOL_POLICY_CONFORMANCE.toolGroups).toEqual(TOOL_GROUPS);
});
it("includes all exported policy constants needed for drift detection", async () => {
const { TOOL_NAME_ALIASES } = await import("./tool-policy.js");
expect(TOOL_POLICY_CONFORMANCE.toolNameAliases).toEqual(TOOL_NAME_ALIASES);
});
it("is JSON-serializable", () => {
expect(() => JSON.stringify(TOOL_POLICY_CONFORMANCE)).not.toThrow();
});

View File

@ -4,6 +4,7 @@ import {
normalizeToolName,
resolveToolProfilePolicy,
TOOL_GROUPS,
TOOL_NAME_ALIASES,
} from "./tool-policy-shared.js";
import type { AnyAgentTool } from "./tools/common.js";
export {
@ -12,6 +13,7 @@ export {
normalizeToolName,
resolveToolProfilePolicy,
TOOL_GROUPS,
TOOL_NAME_ALIASES,
} from "./tool-policy-shared.js";
export type { ToolProfileId } from "./tool-policy-shared.js";