Red Rabbit

A fire drill for agent-written code

All green. Four promises broken.

28 tests pass and cover 99.3% of the parser. We planted a bug against each of its 6 promises. The tests caught 2/6. Kiro's reviewer agent caught 6/6.

Spot the Rabbit

Round 1 of 4

Read the promise. Read the change. Ship it, or block it.

Without a script each round opens its own answer below it.

10

Round 1

AC-2 Promise id from source label

WHEN a numbered criterion carries an explicit bracket label (e.g. [AC-3]) in the source, the parser SHALL use that label verbatim as the promise id

skeleton/redrabbit/parser.py

111 112 def _legacy_id(label: str | None, number: str) -> str: - return label or number 113 + return label.upper() if label else number 114 115 116 def parse_requirements(text: str) -> ParseResult:
Show the answer

This change is a planted bug. The promise id from a bracket label is upper-cased instead of used verbatim.

  • Tests ESCAPED examples, full
  • Kiro reviewer CAUGHT `_legacy_id` now <redacted> bracket labels, so `[ac-3]` becomes `AC-3` instead of being used verbatim.

AC-2 Promise id from source label

WHEN a numbered criterion carries an explicit bracket label (e.g. [AC-3]) in the source, the parser SHALL use that label verbatim as the promise id; AND WHEN no bracket label is present, the parser SHALL use the bare number (e.g. 3) as the promise id.

This change is a planted bug. The promise id from a bracket label is upper-cased instead of used verbatim.

  • Tests ESCAPED examples, full
  • Kiro reviewer CAUGHT `_legacy_id` now <redacted> bracket labels, so `[ac-3]` becomes `AC-3` instead of being used verbatim.

AC-2 Promise id from source label

WHEN a numbered criterion carries an explicit bracket label (e.g. [AC-3]) in the source, the parser SHALL use that label verbatim as the promise id; AND WHEN no bracket label is present, the parser SHALL use the bare number (e.g. 3) as the promise id.

Round 2

AC-7 Empty or missing Acceptance Criteria section

WHEN a requirements.md file contains no Acceptance Criteria section, the parser SHALL return an empty promise list and one ParseWarning whose message describes the missing section.

skeleton/redrabbit/parser.py

166 index += 1 167 168 if not found: - result.warnings.append(ParseWarning(message=_NO_SECTION, lines=[])) 169 return result 170 171 # Native ids must be unique across the file. A repeated number in the source (a typo
Show the answer

This change is a planted bug. A requirements file with no Acceptance Criteria section returns no promises and no ParseWarning.

  • Tests CAUGHT examples, full
  • Kiro reviewer CAUGHT The diff deletes the `ParseWarning(message=_NO_SECTION)` append in the `if not found` branch of `parse_requirements`. A document with no Acceptance Criteria section now returns zero warnings, but AC-7 requires exactly one warning describing the missing section. I read the worktree copy, which still has the line, so I judged this from the diff alone.

AC-7 Empty or missing Acceptance Criteria section

WHEN a requirements.md file contains no Acceptance Criteria section, the parser SHALL return an empty promise list and one ParseWarning whose message describes the missing section. WHEN the section is present but empty (contains only blank lines), the parser SHALL return an empty promise list and zero warnings.

This change is a planted bug. A requirements file with no Acceptance Criteria section returns no promises and no ParseWarning.

  • Tests CAUGHT examples, full
  • Kiro reviewer CAUGHT The diff deletes the `ParseWarning(message=_NO_SECTION)` append in the `if not found` branch of `parse_requirements`. A document with no Acceptance Criteria section now returns zero warnings, but AC-7 requires exactly one warning describing the missing section. I read the worktree copy, which still has the line, so I judged this from the diff alone.

AC-7 Empty or missing Acceptance Criteria section

WHEN a requirements.md file contains no Acceptance Criteria section, the parser SHALL return an empty promise list and one ParseWarning whose message describes the missing section. WHEN the section is present but empty (contains only blank lines), the parser SHALL return an empty promise list and zero warnings.

Round 3

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers

skeleton/redrabbit/parser.py

- result.warnings.append( - ParseWarning( - message=f"Indented line outside any criterion: {line!r}", - lines=[number], - ) - ) 95 index += 1
Show the answer

This change is a planted bug. An indented line that belongs to no criterion is dropped without a ParseWarning.

  • Tests ESCAPED examples, full
  • Kiro reviewer CAUGHT The change removes the `ParseWarning` for an indented line with no open criterion, so `_scan` now skips that line silently. This happens at the start of the section, after a sub-heading or horizontal rule, or after an <redacted> line. AC-6 says no line from the Acceptance Criteria section may be silently discarded.

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers; AND it SHALL still return all promises it could successfully parse; AND it SHALL never silently discard any line from the Acceptance Criteria section. Only indented lines (lines starting with at least one whitespace character) continue a criterion; an unindented non-header line inside the Acceptance Criteria section SHALL produce a ParseWarning. The one exception is a sub-heading (a line starting with three or more # followed by whitespace) and a horizontal rule (a line of three or more -): each ends the current criterion without a warning. The requirements.md of this spec SHALL parse with zero warnings.

This change is a planted bug. An indented line that belongs to no criterion is dropped without a ParseWarning.

  • Tests ESCAPED examples, full
  • Kiro reviewer CAUGHT The change removes the `ParseWarning` for an indented line with no open criterion, so `_scan` now skips that line silently. This happens at the start of the section, after a sub-heading or horizontal rule, or after an <redacted> line. AC-6 says no line from the Acceptance Criteria section may be silently discarded.

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers; AND it SHALL still return all promises it could successfully parse; AND it SHALL never silently discard any line from the Acceptance Criteria section. Only indented lines (lines starting with at least one whitespace character) continue a criterion; an unindented non-header line inside the Acceptance Criteria section SHALL produce a ParseWarning. The one exception is a sub-heading (a line starting with three or more # followed by whitespace) and a horizontal rule (a line of three or more -): each ends the current criterion without a warning. The requirements.md of this spec SHALL parse with zero warnings.

Round 4

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers

skeleton/redrabbit/parser.py

67 if stop.match(line): 68 break - if not line.strip(): 69 + if line.strip() == "": 70 if current_id is not None: 71 pending_blanks.append((line, endings[index])) 72 index += 1
Show the answer

This change is clean. equivalent expression: 'not line.strip()' written as 'line.strip() == ""'

  • Kiro reviewer ESCAPED `line.strip() == ""` is equivalent to `not line.strip()`, no behavior change

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers; AND it SHALL still return all promises it could successfully parse; AND it SHALL never silently discard any line from the Acceptance Criteria section. Only indented lines (lines starting with at least one whitespace character) continue a criterion; an unindented non-header line inside the Acceptance Criteria section SHALL produce a ParseWarning. The one exception is a sub-heading (a line starting with three or more # followed by whitespace) and a horizontal rule (a line of three or more -): each ends the current criterion without a warning. The requirements.md of this spec SHALL parse with zero warnings.

This change is clean. equivalent expression: 'not line.strip()' written as 'line.strip() == ""'

  • Kiro reviewer ESCAPED `line.strip() == ""` is equivalent to `not line.strip()`, no behavior change

AC-6 Unparseable content reported, not dropped

WHEN the parser encounters content inside the Acceptance Criteria section that it cannot classify as a numbered criterion, it SHALL add a ParseWarning to the result describing the offending lines and their line numbers; AND it SHALL still return all promises it could successfully parse; AND it SHALL never silently discard any line from the Acceptance Criteria section. Only indented lines (lines starting with at least one whitespace character) continue a criterion; an unindented non-header line inside the Acceptance Criteria section SHALL produce a ParseWarning. The one exception is a sub-heading (a line starting with three or more # followed by whitespace) and a horizontal rule (a line of three or more -): each ends the current criterion without a warning. The requirements.md of this spec SHALL parse with zero warnings.

Line coverage of the parser

Before 99.3%
After 99.3%

140/141 lines ran, before and after.

Promises guarded

Before 2/6 BLIND IN PLACES
After 6/6 AWAKE

Coverage did not see the gap. The drill did.

What the records say

The same gates, on the same rounds and on every promise of the self-drill.

The rounds, as recorded (this spoils the game)
RoundPromiseTestsKiro reviewer
Round 1Promise AC-2 Promise id from source label
A planted bug.
Tests ESCAPEDKiro reviewer CAUGHT
Round 2Promise AC-7 Empty or missing Acceptance Criteria section
A planted bug.
Tests CAUGHTKiro reviewer CAUGHT
Round 3Promise AC-6 Unparseable content reported, not dropped
A planted bug.
Tests ESCAPEDKiro reviewer CAUGHT
Round 4Promise AC-6 Unparseable content reported, not dropped
A clean change.
Tests Not drilled on clean changes.Kiro reviewer ESCAPED

Three proofs

Line

  • Promises guarded 2/6 → 6/6
  • Tests 28 → 42
  • Coverage 140/141 → 140/141

Open the page

Guard Drill

  • P-RULES-DEL LET THROUGH → HELD
  • Holes still open 4 OPEN
  • Comparison exit code 1

Open the page

cachetools

  • Test gates 4/4
  • Reviewer, run 1 3/4 and 1 DID_NOT_RUN
  • Reviewer, run 2 4/4

Open the page