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,62 @@
# STATUS — eval phase
## Gate verification
### D1 — arithmetic
| Expression | Expected | Command | Observed |
|------------|----------|---------|----------|
| `2+3*4` | 14 | `python calc.py "2+3*4"` | `14` |
| `(2+3)*4` | 20 | `python calc.py "(2+3)*4"` | `20` |
| `8-3-2` | 3 | `python calc.py "8-3-2"` | `3` |
| `-2+5` | 3 | `python calc.py "-2+5"` | `3` |
| `2*-3` | -6 | `python calc.py "2*-3"` | `-6` |
**Result: PASS**
### D2 — division / EvalError
| Check | Command | Expected | Observed |
|-------|---------|----------|----------|
| True division | `python calc.py "7/2"` | `3.5` | `3.5` |
| Div-by-zero stderr + exit 1 | `python calc.py "1/0"` | error to stderr, exit 1 | `error: division by zero`, exit 1 |
| EvalError (not ZeroDivisionError) | unittest | EvalError raised | PASS (test_no_bare_zero_division_error) |
**Result: PASS**
### D3 — result type
| Check | Command | Expected | Observed |
|-------|---------|----------|----------|
| Whole result as int | `python calc.py "4/2"` | `2` (no `.0`) | `2` |
| Non-whole as float | `python calc.py "7/2"` | `3.5` | `3.5` |
**Result: PASS**
### D4 — CLI
| Check | Command | Expected | Observed |
|-------|---------|----------|----------|
| Valid expression → stdout + exit 0 | `python calc.py "2+3*4"` | `14`, exit 0 | `14`, exit 0 |
| Invalid expression → stderr + exit non-zero | `python calc.py "1 +"` | error to stderr, exit 1 | `error: unexpected end of input`, exit 1 |
| Div-by-zero → stderr + exit non-zero | `python calc.py "1/0"` | error to stderr, exit 1 | `error: division by zero`, exit 1 |
**Result: PASS**
### D5 — tests green + no regression
Command: `python -m unittest -q`
Expected: 0 failures, covers D1D3 + prior suite (lex + parse)
Observed:
```
----------------------------------------------------------------------
Ran 49 tests in 0.105s
OK
```
**Result: PASS**
## DONE