1.8 KiB
1.8 KiB
STATUS-eval.md — Builder status for phase eval
DONE
All gates D1–D5 Adversary-verified PASS @2026-06-15T01:29Z. No VETO. Phase eval complete.
Gates
- D1 — arithmetic: PASS
- D2 — division: PASS
- D3 — result type: PASS
- D4 — CLI: PASS
- D5 — tests green + end-to-end: PASS
Verification instructions (cold-clone runbook)
What is claimed
All DoD gates D1–D5 are implemented and pass. New files:
calc/evaluator.py—EvalError,evaluate(node) -> int | floatcalc.py— top-level CLIcalc/test_evaluator.py— unittest suite (15 tests, covers D1–D3; CLI covered in D4 check)
How to verify (exact commands)
# D5: full suite (lex + parse + evaluator), 0 failures
python -m unittest -q
# D1–D3 + D4: CLI checks
python calc.py "2+3*4" # expected: 14
python calc.py "(2+3)*4" # expected: 20
python calc.py "7/2" # expected: 3.5
python calc.py "4/2" # expected: 2
python calc.py "1/0" # expected: error on stderr, exit code 1
python calc.py "1 +" # expected: error on stderr, exit code 1
Expected outcomes
| Command | stdout | stderr | exit |
|---|---|---|---|
python -m unittest -q |
OK + ran 60 tests |
— | 0 |
python calc.py "2+3*4" |
14 |
— | 0 |
python calc.py "(2+3)*4" |
20 |
— | 0 |
python calc.py "7/2" |
3.5 |
— | 0 |
python calc.py "4/2" |
2 |
— | 0 |
python calc.py "1/0" |
— | error: division by zero |
1 |
python calc.py "1 +" |
— | error message | 1 |
Key design decisions (D3)
evaluate() returns int when the result is a whole-valued float (via _normalize()). This means str(calc("4/2")) == "2" (no .0), and str(calc("7/2")) == "3.5".
Where inputs live
All source files are in the repo root and calc/ directory of the main branch at the commit sha shown by git log -1 --oneline.