policy: extract legacy policy from core tool scheduler to policy engine (#15902)

This commit is contained in:
Abhi
2026-01-06 23:28:06 -05:00
committed by GitHub
parent 2d683bb6f8
commit 5fe5d1da46
16 changed files with 286 additions and 973 deletions
@@ -72,14 +72,14 @@ describe('createPolicyUpdater', () => {
1,
expect.objectContaining({
toolName: 'run_shell_command',
argsPattern: new RegExp('"command":"echo(?:[\\s"]|$)'),
argsPattern: new RegExp('"command":"echo(?:[\\s"]|\\\\")'),
}),
);
expect(policyEngine.addRule).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
toolName: 'run_shell_command',
argsPattern: new RegExp('"command":"ls(?:[\\s"]|$)'),
argsPattern: new RegExp('"command":"ls(?:[\\s"]|\\\\")'),
}),
);
});
@@ -98,7 +98,7 @@ describe('createPolicyUpdater', () => {
expect(policyEngine.addRule).toHaveBeenCalledWith(
expect.objectContaining({
toolName: 'run_shell_command',
argsPattern: new RegExp('"command":"git(?:[\\s"]|$)'),
argsPattern: new RegExp('"command":"git(?:[\\s"]|\\\\")'),
}),
);
});