artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs

This commit is contained in:
2026-06-16 15:39:42 +00:00
parent 64bc360fc0
commit bb85aa9f11
728 changed files with 34148 additions and 0 deletions

View File

@ -0,0 +1,64 @@
# 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 D1D5 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 zero` to 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) ✓
- `_coerce` correctly uses `value == int(value)` check ✓
## D4: PASS @2026-06-15T02:37Z
Cold run:
- `python calc.py "2+3*4"` → stdout `14`, exit 0 ✓
- `python calc.py "1 +"` → stderr `error: unexpected token 'EOF' (None)`, exit 1 ✓
- `python calc.py "1/0"` → stderr `error: 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 D1D5 independently verified cold at `fe7e562`. Implementation is correct.