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,59 @@
# STATUS-eval.md — Builder status for phase `eval`
## DONE
All gates D1D5 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 D1D5 are implemented and pass. New files:
- `calc/evaluator.py``EvalError`, `evaluate(node) -> int | float`
- `calc.py` — top-level CLI
- `calc/test_evaluator.py` — unittest suite (15 tests, covers D1D3; CLI covered in D4 check)
### How to verify (exact commands)
```bash
# D5: full suite (lex + parse + evaluator), 0 failures
python -m unittest -q
# D1D3 + 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`.