Files
Charles Wiltgen 30dc90ffa8 feat(hooks): Swift guardrail series — warn tier, @Relationship check, Python migration
Migrate swift-guardrails.sh → standalone swift-guardrails.py (invoked via python3),
ending the bash-with-embedded-`python3 -c` approach. Same harness-agnostic input
boundary (Claude Code file_path + Codex apply_patch, cwd-relative) and JSON output.

- Two tiers: add_block (stops the edit) + add_warn (advisory, no decision field), driven
  by a _CHECKS registry so each rule is one entry (name, tier, detector, header).
- @State without an access level stays a BLOCK; SwiftData to-many @Relationship without a
  default is a new WARN (warn-first — a new regex check earns block by proving precision).
- Per-rule `// axiom-ignore:<name>` escape hatch; Set<T>/Array<T> recall; a multi-line
  string false-positive guard; UTF-8-safe JSON escaping.
- build-codex emits the .py; codex-hooks transform + pre-deploy §12l updated off the old
  .sh name; codex-hooks.test fixtures updated. 46 behavioral tests.
2026-06-25 14:01:33 -07:00

4.9 KiB