auto-claude: subtask-5-5 - Write unit tests for policy engine

- Created comprehensive test suite with 26 tests covering:
  - Policy parsing success and failure cases
  - Confidence threshold enforcement (0.7)
  - Input validation (empty, too short)
  - Response parsing (JSON, markdown-wrapped JSON)
  - Policy structure validation (types, operators, actions)
  - Batch policy parsing with error handling
  - Policy validation helper functions
  - Error handling and recovery
  - Policy ID generation uniqueness
  - Format output for display
- All tests use mock Claude client for controlled testing
- Follows test harness patterns from clawsec-suite
- Tests pass: 26/26

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
David Abutbul
2026-02-27 21:38:23 +02:00
parent 2cc0284481
commit 56b36480e0
File diff suppressed because it is too large Load Diff