Point this CLI at any Python repo and a YAML contract — it walks every .py file's AST and fails the build on the exact line that breaks your rule.
Declare your boundaries. Example: ui must not import db, jobs may only import shared. Plain YAML, checked into your repo.
One command: python arch_check.py . contract.yaml. Exit 0 = clean. Exit 1 = violations with exact file:line. Exit 2 = config error. Drop it into your GitHub Actions or pre-commit hook.
No more "I thought ui wasn't supposed to touch db" code-review comments. The rule is in the repo; the check is automatic.