From b7b6773f9a64ceeabf358d3cc4789ca6194821b6 Mon Sep 17 00:00:00 2001 From: Abhijit Balaji Date: Fri, 20 Feb 2026 15:47:21 -0800 Subject: [PATCH] docs: remove TDD notes and irrelevant comments from policy tests --- packages/core/src/policy/toml-loader.test.ts | 4 ++-- packages/core/src/policy/utils.test.ts | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/core/src/policy/toml-loader.test.ts b/packages/core/src/policy/toml-loader.test.ts index 2fccb7faa9..b3ab11588b 100644 --- a/packages/core/src/policy/toml-loader.test.ts +++ b/packages/core/src/policy/toml-loader.test.ts @@ -111,7 +111,7 @@ priority = 100 expect(result.errors).toHaveLength(0); }); - it('should match if ^ is used in commandRegex (TDD: currently fails)', async () => { + it('should match if ^ is used in commandRegex', async () => { const result = await runLoadPoliciesFromToml(` [[rule]] toolName = "run_shell_command" @@ -121,7 +121,7 @@ priority = 100 `); expect(result.rules).toHaveLength(1); - // After the fix, this should match correctly + // The generated pattern is "command":"^git status expect( result.rules[0].argsPattern?.test('{"command":"git status"}'), ).toBe(true); diff --git a/packages/core/src/policy/utils.test.ts b/packages/core/src/policy/utils.test.ts index 6313552f31..61bfe20811 100644 --- a/packages/core/src/policy/utils.test.ts +++ b/packages/core/src/policy/utils.test.ts @@ -145,16 +145,15 @@ describe('policy/utils', () => { }); describe('commandRegex anchors', () => { - it('should transform ^ anchor correctly (TDD: currently failing to match)', () => { + it('should transform ^ anchor correctly', () => { const patterns = buildArgsPatterns(undefined, undefined, '^git status'); const regex = new RegExp(patterns[0]!); // JSON stringified command: {"command":"git status"} const json = '{"command":"git status"}'; - // This CURRENTLY fails because the pattern is "command":"^git status expect(regex.test(json)).toBe(true); }); - it('should transform $ anchor correctly (TDD: currently failing to match)', () => { + it('should transform $ anchor correctly', () => { const patterns = buildArgsPatterns( undefined, undefined, @@ -162,11 +161,10 @@ describe('policy/utils', () => { ); const regex = new RegExp(patterns[0]!); const json = '{"command":"tmux send-keys -t superpowers:6 C-c"}'; - // This CURRENTLY fails because $ matches end of JSON string, not end of command value expect(regex.test(json)).toBe(true); }); - it('should handle $ anchor when other fields follow (TDD: currently failing)', () => { + it('should handle $ anchor when other fields follow', () => { const patterns = buildArgsPatterns(undefined, undefined, 'git status$'); const regex = new RegExp(patterns[0]!); const json = '{"command":"git status","dir_path":"/tmp"}';