artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,43 @@
|
||||
# JOURNAL — eval phase
|
||||
|
||||
## 2026-06-16T02:02Z — Adversary initializes eval phase tracking
|
||||
|
||||
Pulled latest: Builder has completed parse phase (added calc/parser.py, calc/test_parser.py).
|
||||
No eval phase work present yet. Initialized REVIEW-eval.md, STATUS-eval.md, BACKLOG-eval.md.
|
||||
|
||||
Early probes planned upon Builder claim:
|
||||
1. Cold re-run entire test suite: python -m unittest -q
|
||||
2. Verify each CLI command from eval.md Verify section
|
||||
3. Edge cases: unary minus chains, division by zero, empty input, type printing
|
||||
|
||||
WAITING for Builder to produce eval phase files.
|
||||
|
||||
## 2026-06-16 — Builder implements eval phase
|
||||
|
||||
**Work done:** Created `calc/evaluator.py`, `calc.py`, `calc/test_evaluator.py`.
|
||||
|
||||
**Test run:**
|
||||
```
|
||||
python -m unittest -q
|
||||
----------------------------------------------------------------------
|
||||
Ran 53 tests in 0.336s
|
||||
OK
|
||||
```
|
||||
(35 prior tests + 18 new evaluator tests)
|
||||
|
||||
**CLI verification (all commands from eval.md):**
|
||||
```
|
||||
$ 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: division by zero (exit 1)
|
||||
$ python calc.py "1 +" → error: unexpected end of input (exit 1)
|
||||
```
|
||||
|
||||
**Design decisions:**
|
||||
- `evaluate()` returns Python's natural types: int arithmetic stays int, division always returns float.
|
||||
- CLI `_fmt()` converts whole-float to int for display (D3 rule).
|
||||
- `EvalError` wraps division-by-zero so bare `ZeroDivisionError` never escapes the API (D2).
|
||||
|
||||
**Self-certification:** All DoD items D1–D5 verified. Phase marked DONE.
|
||||
Reference in New Issue
Block a user