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,98 @@
# STATUS-lex.md
## DONE
All DoD gates Adversary-verified PASS. Phase `lex` complete.
- D1: PASS @2026-06-15T04:34:35Z
- D2: PASS @2026-06-15T04:34:35Z
- D3: PASS @2026-06-15T04:40:18Z (AF-1 fixed: bare `.` now raises LexError)
- D4: PASS @2026-06-15T04:40:18Z (21 tests, 0 failures)
Fix commit: f40a364
---
## Gate D1 — Numbers CLAIMED
**WHAT:** `tokenize()` converts integers and floats to `NUMBER` tokens with numeric values.
**HOW to verify:**
```bash
python -c "from calc.lexer import tokenize; r=tokenize('42'); print(r[0].kind, r[0].value, type(r[0].value).__name__)"
python -c "from calc.lexer import tokenize; r=tokenize('3.14'); print(r[0].kind, r[0].value, type(r[0].value).__name__)"
python -c "from calc.lexer import tokenize; r=tokenize('.5'); print(r[0].kind, r[0].value)"
python -c "from calc.lexer import tokenize; r=tokenize('10.'); print(r[0].kind, r[0].value, type(r[0].value).__name__)"
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('42')])"
```
**EXPECTED:**
- `NUMBER 42 int`
- `NUMBER 3.14 float`
- `NUMBER 0.5`
- `NUMBER 10.0 float`
- `[('NUMBER', 42), ('EOF', None)]`
**WHERE:** `calc/lexer.py`, commit fb03159
---
## Gate D2 — Operators & Parens CLAIMED
**WHAT:** `+ - * / ( )` tokenize to correct kinds; `"1+2*3"` → NUMBER PLUS NUMBER STAR NUMBER EOF.
**HOW to verify:**
```bash
python -c "from calc.lexer import tokenize; print([t.kind for t in tokenize('1+2*3')])"
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('+-*/()')] )"
```
**EXPECTED:**
- `['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF']`
- `[('PLUS', '+'), ('MINUS', '-'), ('STAR', '*'), ('SLASH', '/'), ('LPAREN', '('), ('RPAREN', ')'), ('EOF', None)]`
**WHERE:** `calc/lexer.py`, commit fb03159
---
## Gate D3 — Whitespace & Errors RE-CLAIMED (AF-1 fixed)
**WHAT:** Spaces/tabs skipped; ALL invalid inputs raise `LexError` (including bare `.`).
**Fix applied:** Wrapped `float(raw)` / `int(raw)` conversion in try/except; raises `LexError` on bad numeric literals. Added `test_bare_dot_raises_lex_error` to test suite.
**HOW to verify:**
```bash
python -m unittest -q
python -c "from calc.lexer import tokenize; print([t.kind for t in tokenize(' 12 + 3 ')])"
python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"
python -c "from calc.lexer import tokenize; tokenize('.')"
```
**EXPECTED:**
- `Ran 21 tests in 0.000s\nOK`
- `['NUMBER', 'PLUS', 'NUMBER', 'EOF']`
- Raises `calc.lexer.LexError: unexpected character '@' at position 2`
- Raises `calc.lexer.LexError: invalid number literal '.' at position 0`
**WHERE:** `calc/lexer.py`, `calc/test_lexer.py` (see fix commit)
---
## Gate D4 — Tests Green CLAIMED
**WHAT:** `calc/test_lexer.py` passes under `python -m unittest` with 0 failures.
**HOW to verify:**
```bash
python -m unittest -q
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('3.5*(1-2)')])"
python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"
```
**EXPECTED:**
- `Ran 20 tests in 0.000s\nOK`
- `[('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]`
- Raises `LexError`
**WHERE:** `calc/test_lexer.py`, commit fb03159