Files
llm-intelligence/scripts/review/review_action_guard_test.sh
2026-05-29 18:48:48 +08:00

48 lines
870 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT
BAD_REPORT="$TMP_DIR/bad-review.md"
cat > "$BAD_REPORT" <<'EOF'
## Context
- no delta
## Evidence
- one finding
## Outcome
- still blocked
## Next
- keep watching
EOF
set +e
bash scripts/review/review_action_guard.sh "$BAD_REPORT" >/tmp/review_action_bad.out 2>&1
BAD_RC=$?
set -e
[[ "$BAD_RC" -ne 0 ]]
grep -q 'missing actionable next step' /tmp/review_action_bad.out
GOOD_REPORT="$TMP_DIR/good-review.md"
cat > "$GOOD_REPORT" <<'EOF'
## Context
- no delta
## Evidence
- one finding
## Outcome
- still blocked
## Next
- 处理问题 11新增 review action guard 并接入 review 生成链
EOF
bash scripts/review/review_action_guard.sh "$GOOD_REPORT" >/tmp/review_action_good.out 2>&1