review_patch
Review a unified git diff against Zero-Framework-Tolerance rules, scan changed files for violations on newly introduced lines, and return a PASS/REVIEW/FAIL verdict.
Instructions
Review a unified diff (git diff / gh pr diff output) against the Zero-Framework-Tolerance rules. Every changed code file is scanned with the full engine union (CodebaseCSI, constitution prose rules, Python AST, tree-sitter xast) and findings are attributed to the lines the change introduces; pre-existing debt in touched files is counted separately and never fails the gate. Supply files (path -> full new-version content) for full-fidelity AST analysis; without it, added lines are scanned as fragments. Returns JSON: verdict (FAIL/REVIEW/PASS), per-file findings with new-file line numbers, totals, and the engines that ran. Deterministic and offline: fetch the diff yourself (e.g. gh pr diff) and post reviews yourself. A PASS gates nothing but markers - gates G1-G5 remain the reviewer's responsibility.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | Yes | Unified diff text, e.g. from `git diff` or `gh pr diff`. | |
| files | No | Optional map of changed-file path (new version) to its complete file content, enabling full-file AST analysis instead of fragment scanning. | |
| exclude | No | Optional fnmatch globs for paths the gate must not judge: detector rule definitions and test fixture corpora contain hunted patterns as data. | |
| test_globs | No | Project-specific test path globs added to the built-in conventions (tests/*, test_*.py, *.spec.ts, *_test.go, ...). | |
| require_tests | No | C-03 enforcement: flag production-logic changes when the diff touches no test files. 'warn' surfaces them for judgement, 'fail' gates the verdict. Default off; the reviewing agent should normally pass 'warn'. |