fix(review-loop-run): CR-10 — scope exits only on headings shallower-or-equal to start depth (8c865eb4-7fd1-4a8d-b51d-04d020ba41c0)

This commit is contained in:
Paul O'Reilly
2026-09-17 00:06:00 +12:00
parent b915dcc753
commit 7800503348
5 changed files with 66 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
# Review
## Count by Severity
| Severity | Count |
|----------|-------|
| CRITICAL | 0 |
| HIGH | 1 |
| MEDIUM | 2 |
| LOW | 0 |
## Next Section
This section is outside the count-by-severity scope and must be ignored.
### HIGH: 99
A trailing severity line that should not be picked up.

View File

@@ -0,0 +1,21 @@
# Review
Some review content above.
## Count by Severity
### CRITICAL: 0
No critical findings in this round.
### HIGH: 0
No high findings either.
### MEDIUM: 0
No medium findings.
### LOW: 0
Nothing to fix.

View File

@@ -105,6 +105,15 @@ 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"
echo "review-loop-run — counts (CR-10, bug 8c865eb4)"
out=$("$SCRIPT" counts "$FIXTURES/h3-subsections.md"); rc=$?
assert_contains "counts h3 subsections parse as zero" "CRITICAL=0 HIGH=0 MEDIUM=0 LOW=0" "$out"
assert_exit "counts h3 subsections exit 0" 0 "$rc"
out=$("$SCRIPT" counts "$FIXTURES/h2-terminates-scope.md"); rc=$?
assert_contains "counts h2 still terminates scope" "CRITICAL=0 HIGH=1 MEDIUM=2 LOW=0" "$out"
assert_exit "counts h2 termination exit 4" 4 "$rc"
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=$?