Root cause: IF condition and EVALUATE WHEN parsing swallowed entire
line including THEN-body (e.g. '50 MOVE BIG...' instead of just '50').
Fix:
1. Single-line IF cond_text truncated at COBOL statement-starting keywords
(MOVE/DISPLAY/COMPUTE/ADD/...)
2. Multi-line IF continuation loop also breaks on these keywords (was
missing DISPLAY, READ, WRITE, CLOSE, OPEN, SEARCH, ...)
3. EVALUATE WHEN raw_val truncated at same keyword set
4. All raw-string escape sequences fixed (Python 3.12 SyntaxWarning)
Verification:
- IF single-line A>50: A=51(true)/12(false) previously A=01/00
- IF multi-line X>50: X=51(true)/12(false) previously not steered
- EVALUATE WHEN 1/2/OTHER: C=1/2/4 previously C=0/0/0
- IF AND compound: (A<=10,B<20), (A>10,B<20), (A>10,B>=20)
- IF >75: A=76(true)/12(false) previously not steered
R11 tests updated: BUG documentation replaced with real assertions.
13 suites / 0 FAIL.
Co-Authored-By: Claude <noreply@anthropic.com>
BREAKING CHANGE DISCOVERED: generate_data constraint steering is BROKEN
- apply_constraint does not steer field values to satisfy branch conditions
- All generate_data tests now DOCUMENT this as known bug
- Previous tests never caught this because they only checked 'is not None'
What R11 actually verifies:
1. AST structure: IF CondAnd leaves, EVAL WHEN count, CALL params,
SEARCH ALL flag, PERFORM type — verified by attribute equality
2. propagate_assignments: chain values verified (X=100, Y=105, INSPECT ALL L->X)
arithmetic chain ((0+5-2)*3/2 = 4)
3. GnuCOBOL: real compilation + execution output captured
HELLO WORLD, IF branch (DISPLAY 01), PERFORM loop (SUM=15)
4. gcov: --coverage compile, run, line rate measurement
5. Exception paths: bad syntax, empty sections, newlines, garbage bytes
6. pipeline: classify result non-empty
7. orchestrator: _done state machine with value assertions
Co-Authored-By: Claude <noreply@anthropic.com>