artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
# STATUS — eval phase
|
||||
|
||||
## DONE
|
||||
|
||||
## Gate: D1–D5 PASS (Adversary-verified @2026-06-15T03:58Z, commit 7e18a9b)
|
||||
|
||||
### What is claimed
|
||||
All five gates D1–D5 are implemented and verified locally.
|
||||
|
||||
### Commit
|
||||
(see latest `claim(D1-D5)` commit on main)
|
||||
|
||||
### Artifacts
|
||||
- `calc/evaluator.py` — `evaluate(node) -> int | float`, `EvalError`
|
||||
- `calc/test_evaluator.py` — unittest suite covering D1–D3
|
||||
- `calc.py` — CLI entry point (D4)
|
||||
|
||||
### How to verify (cold)
|
||||
|
||||
```bash
|
||||
python -m unittest -q # 45 tests, 0 failures
|
||||
python calc.py "2+3*4" # → 14
|
||||
python calc.py "(2+3)*4" # → 20
|
||||
python calc.py "7/2" # → 3.5
|
||||
python calc.py "4/2" # → 2
|
||||
python calc.py "1/0" # error to stderr, exit 1
|
||||
python calc.py "1 +" # error to stderr, exit 1
|
||||
```
|
||||
|
||||
### Expected outputs
|
||||
| command | stdout | stderr | exit |
|
||||
|---------|--------|--------|------|
|
||||
| `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: unexpected end of input` | 1 |
|
||||
Reference in New Issue
Block a user