feat: implement archeflow-review.sh for Guardian-only diff review

Standalone bash script that extracts git diffs for af-review without
PDCA orchestration. Supports --branch, --commit, and uncommitted modes.
Reports stats (files/lines changed) to stderr, diff to stdout.
This commit is contained in:
2026-04-04 18:39:06 +02:00
parent 6309614bfa
commit 1bf1376a80
2 changed files with 213 additions and 11 deletions

View File

@@ -37,23 +37,28 @@ af-review --evidence # Enable evidence-gating (stricter)
### Step 1: Get the Diff
```bash
# Uncommitted changes
DIFF=$(git diff HEAD)
Use `lib/archeflow-review.sh` to extract the diff and stats:
# Branch diff
DIFF=$(git diff main...HEAD)
```bash
# Uncommitted changes (default)
DIFF=$(bash lib/archeflow-review.sh)
# Branch diff against main
DIFF=$(bash lib/archeflow-review.sh --branch feat/batch-api)
# Commit range
DIFF=$(git diff HEAD~3..HEAD)
DIFF=$(bash lib/archeflow-review.sh --commit HEAD~3..HEAD)
# If diff is too large (>500 lines), split by file
if [[ $(echo "$DIFF" | wc -l) -gt 500 ]]; then
# Review per-file to keep context focused
FILES=$(git diff --name-only HEAD)
fi
# Override base branch
DIFF=$(bash lib/archeflow-review.sh --branch feat/x --base develop)
# Stats only (no diff output)
bash lib/archeflow-review.sh --stat-only
```
The script prints the diff to stdout and stats to stderr. It exits 1 if the diff
is empty (nothing to review). For large diffs (>500 lines), it warns on stderr.
### Step 2: Spawn Reviewers
Default: Guardian only (fastest, highest ROI).