#21140: test(security): add regression test for claude-opus-4-6 audit
size: XS
Cluster:
Test Coverage Enhancements
Fixes #10521.
## Description
This PR adds a regression test to `src/security/audit.test.ts` to ensure that `anthropic/claude-opus-4-6` is correctly identified as a strong/safe model in security audits.
## Verification
- Verified manually with `pnpm test src/security/audit.test.ts`.
- Confirmed existing regex handles the version string correctly.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds regression test verifying that `anthropic/claude-opus-4-6` is correctly recognized as a strong model (>= Claude 4.5) by the security audit system. The test confirms that the existing regex pattern in `src/security/audit-extra.sync.ts:162` properly matches the `claude-opus-4-6` version format and doesn't flag it with a "Below Claude 4.5" warning in the `models.hygiene` check.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with no risk
- This is a pure test addition that adds regression coverage for `claude-opus-4-6` model detection. The test follows existing patterns in the file, uses the same test structure as similar tests (lines 1189-1214), and verifies expected behavior without modifying any production code. The regex pattern in `audit-extra.sync.ts` already correctly handles the version format.
- No files require special attention
<sub>Last reviewed commit: bd7990e</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#9333: Tests: add test coverage for security/audit-fs.ts
by M00N7682 · 2026-02-05
75.6%
#19927: fix(agents): replace hardcoded Anthropic model IDs with pattern mat...
by Milofax · 2026-02-18
72.7%
#19690: fix: security audit suppression, MoE false positive, and hook prefi...
by adityuhkapoor · 2026-02-18
72.5%
#2806: [AI-Assisted] Fix: Repair tool_use/tool_result pairing for Claude o...
by Arthur742Ramos · 2026-01-27
70.8%
#22375: fix(audit): use human-readable labels for RegExp patterns in post-c...
by aldoeliacim · 2026-02-21
70.5%
#17900: refactor(security): extract shared normalizeAllowFromList into audi...
by iyoda · 2026-02-16
69.7%
#20496: test(utils): add comprehensive unit tests for utility functions
by masifislamm · 2026-02-19
69.6%
#22494: fix(post-compaction-audit): show readable label for missing regex r...
by Phineas1500 · 2026-02-21
69.5%
#15569: test: comprehensive test coverage expansion (57 new test files)
by tangcruz · 2026-02-13
69.3%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
69.2%