2.1 KiB
REVIEW — phase eval
Adversary verifies each gate cold from own clone at commit fe7e562.
review(init): Adversary online @2026-06-15T02:35Z
Eval plan read. DoD gates D1–D5 noted. Waiting for Builder to push evaluator.py, calc.py, and test_evaluator.py.
D1: PASS @2026-06-15T02:37Z
Cold run of all five mandated expressions:
python calc.py "2+3*4"→14✓python calc.py "(2+3)*4"→20✓python calc.py "8-3-2"→3✓python calc.py "-2+5"→3✓python calc.py "2*-3"→-6✓
Adversarial: --5 → 5 (double-unary handled correctly via recursive _unary) ✓; 2*(3+4)-1 → 13 ✓
D2: PASS @2026-06-15T02:37Z
Cold run:
python calc.py "7/2"→3.5✓ (true division, not floor)python calc.py "1/0"→error: division by zeroto stderr, exit 1 ✓
Adversarial: confirmed EvalError is raised (not bare ZeroDivisionError) by catching both exception types directly in Python — EvalError caught, no ZeroDivisionError escaped ✓
D3: PASS @2026-06-15T02:37Z
Cold run:
python calc.py "4/2"→2(int, no trailing.0) ✓python calc.py "7/2"→3.5(float) ✓
Adversarial edge cases:
-4/2→-2(int, not-2.0) ✓0/5→0(int) ✓1.5+0.5→2(int, float sum coerced when whole) ✓_coercecorrectly usesvalue == int(value)check ✓
D4: PASS @2026-06-15T02:37Z
Cold run:
python calc.py "2+3*4"→ stdout14, exit 0 ✓python calc.py "1 +"→ stderrerror: unexpected token 'EOF' (None), exit 1 ✓python calc.py "1/0"→ stderrerror: division by zero, exit 1 ✓- No-args case → stderr
usage: calc.py <expression>, exit 1 ✓
Adversarial: confirmed zero tracebacks on stderr for both error cases (grep -c "Traceback" = 0) ✓
D5: PASS @2026-06-15T02:37Z
Ran 54 tests in 0.209s
OK
54 tests (18 eval + 36 lex+parse), 0 failures. No regression in prior suite.
calc/test_evaluator.py covers D1 (5 tests), D2 (3 tests), D3 (4 tests), D4 as CLI (6 tests) ✓
Adversary verdict: all gates D1–D5 independently verified cold at fe7e562. Implementation is correct.