test(review-loop-run): CR-7/8/9 handles + fixtures, gated behind CR789_IMPL_READY (bug 5352fe72)

Default run: 40 passed + SKIP. CR789_IMPL_READY=1: 10 red until implementation.

Claude-Session: https://claude.ai/code/session_01G3SkMRBRWXyiGuMGs8WVas
This commit is contained in:
Paul O'Reilly
2026-09-16 14:51:04 +12:00
parent 01ae924292
commit 131486e0ff
6 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# Review
## Count by severity
| Severity | Count |
|----------|-------|
| CRITICAL | 0 |
| HIGH | 1 (H-R3-1: gate bypass) |
| MEDIUM | 2 (M-1, M-2) |
| LOW | 0 |

View File

@@ -0,0 +1,5 @@
# Review
## Count by severity
- HIGH: 1 (H-R3-1)

View File

@@ -0,0 +1,12 @@
# Review
## Count by severity
| Severity | Count |
|----------|-------|
| CRITICAL | 0 |
| HIGH | 2 |
| MEDIUM | 0 |
| LOW | 0 |
Note: the earlier bug reported MEDIUM=404 seen on 2026-09-13.

View File

@@ -0,0 +1,9 @@
# Review
## critical
There is a serious problem described here, but this section does not
follow the declaration-line or table conventions the parser expects,
so no severity value can be extracted from it.
Further prose continues without any line starting with a severity word.

View File

@@ -0,0 +1,9 @@
# Review
## CRITICAL
There is a serious problem described here, but this section does not
follow the declaration-line or table conventions the parser expects,
so no severity value can be extracted from it.
Further prose continues without any line starting with a severity word.

View File

@@ -80,6 +80,36 @@ assert_exit "no count block derives, exits 4" 4 "$rc"
assert_contains "no count block counts" "CRITICAL=1 HIGH=2 MEDIUM=0 LOW=0" "$out"
assert_contains "no count block marked derived" "(derived)" "$out"
echo "review-loop-run — counts (CR-7/CR-8/CR-9, bug 5352fe72)"
if [[ "${CR789_IMPL_READY:-0}" != "1" ]]; then
echo " SKIP CR-7/CR-8/CR-9 counts tests (set CR789_IMPL_READY=1 once implemented)"
else
out=$("$SCRIPT" counts "$FIXTURES/annotated-table-cell.md"); rc=$?
assert_contains "counts annotated table cell" "CRITICAL=0 HIGH=1 MEDIUM=2 LOW=0" "$out"
out=$("$SCRIPT" counts "$FIXTURES/annotated-table-cell.md"); rc=$?
assert_exit "counts annotated cell exits 4" 4 "$rc"
out=$("$SCRIPT" counts "$FIXTURES/prose-historic-quote.md"); rc=$?
assert_contains "counts prose historic quote ignored" "CRITICAL=0 HIGH=2 MEDIUM=0 LOW=0" "$out"
assert_exit "counts prose historic quote ignored exit 4" 4 "$rc"
out=$("$SCRIPT" counts "$FIXTURES/suspect-derived.md"); rc=$?
assert_contains "counts suspect derived zero marks suspect" "CRITICAL=0 HIGH=0 MEDIUM=0 LOW=0 (suspect)" "$out"
# companion handle (not in spec matrix): asserts the negative -- no (derived) marker on a suspect result
[[ "$out" == *"(derived)"* ]] && { printf " ${RED}FAIL${NC} %s\n unexpected: (derived) present\n" "counts suspect derived zero not marked derived"; FAIL=$((FAIL+1)); } || { printf " ${GREEN}PASS${NC} %s\n" "counts suspect derived zero not marked derived"; PASS=$((PASS+1)); }
out=$("$SCRIPT" counts "$FIXTURES/suspect-derived.md"); rc=$?
assert_exit "counts suspect derived zero exits 4" 4 "$rc"
out=$("$SCRIPT" counts "$FIXTURES/suspect-derived-lower.md"); rc=$?
assert_contains "counts suspect derived zero case insensitive" "CRITICAL=0 HIGH=0 MEDIUM=0 LOW=0 (suspect)" "$out"
assert_exit "counts suspect derived zero case insensitive exit 4" 4 "$rc"
out=$("$SCRIPT" counts "$FIXTURES/declaration-with-annotation.md"); rc=$?
assert_contains "counts declaration line annotation rejected" "CRITICAL=0 HIGH=0 MEDIUM=0 LOW=0 (derived)" "$out"
# companion handle (not in spec matrix): exit-code check for the same declaration-line-annotation-rejected case
assert_exit "counts declaration line annotation rejected exits 0" 0 "$rc"
fi
echo "review-loop-run — status"
printf 'x\nexit=0\n' > "$REVIEW_LOOP_RUN_DIR/t-r1-stdout.txt"
out=$("$SCRIPT" status --name t 2>&1); rc=$?