db36495f12
The Optional[T] ban enforcement script. Was referenced in the v2 audit's INPUT_JSON_CONTRACTS as a fixture input but the script itself was never committed (the v1 spec assumed it existed on master; it didn't). This commit CREATES the script from scratch per the v2 audit's contract. Baseline files (4 total): - src/mcp_client.py (refactored 2026-06-06) - src/ai_client.py (refactored 2026-06-06) - src/rag_engine.py (refactored 2026-06-06) - src/code_path_audit.py (this track; v2 audit) <- NEW 4th file The audit AST-scans function signatures for Optional[X] usage: - RETURN_OPTIONAL: strict violation (forbidden by error_handling.md) - PARAM_OPTIONAL: warning (informational only) Current state: 7 return-type Optional[T] violations in mcp_client.py + ai_client.py (pre-existing from the v1 refactor; NOT introduced by code_path_audit.py). My new file passes clean. --strict mode exits 1 on any RETURN_OPTIONAL violation. Default mode prints the report and exits 0.