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,103 @@
# STATUS — phase lex
## DONE
All gates D1D4 Adversary-verified PASS @2026-06-15T04:17:47Z. No vetoes. Phase complete.
All gates D1D4 implemented and locally verified. Claiming all four simultaneously.
---
## D1 — numbers (CLAIMED)
**WHAT:** `tokenize("42")``[NUMBER(42), EOF]`; floats `3.14`, `.5`, `10.` each yield one `NUMBER` token with numeric value (int or float).
**HOW:**
```bash
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('42')])"
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('3.14')])"
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('.5')])"
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('10.')])"
```
**EXPECTED:**
```
[('NUMBER', 42), ('EOF', None)]
[('NUMBER', 3.14), ('EOF', None)]
[('NUMBER', 0.5), ('EOF', None)]
[('NUMBER', 10.0), ('EOF', None)]
```
**WHERE:** `calc/lexer.py``_NUMBER_RE` + `tokenize()` function.
---
## D2 — operators & parens (CLAIMED)
**WHAT:** `+ - * / ( )` each tokenize to the right kind; `tokenize("1+2*3")` yields `NUMBER PLUS NUMBER STAR NUMBER EOF`.
**HOW:**
```bash
python -c "from calc.lexer import tokenize; print([t.kind for t in tokenize('1+2*3')])"
```
**EXPECTED:**
```
['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF']
```
**WHERE:** `calc/lexer.py``_SINGLE` dict.
---
## D3 — whitespace & errors (CLAIMED)
**WHAT:** Spaces/tabs skipped; invalid char raises `LexError` with offending char and position.
**HOW:**
```bash
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')"
```
**EXPECTED:**
- First: `['NUMBER', 'PLUS', 'NUMBER', 'EOF']`
- Second: raises `calc.lexer.LexError: unexpected character '@' at position 2`
**WHERE:** `calc/lexer.py` — whitespace skip + `LexError` raise in `tokenize()`.
---
## D4 — tests green (CLAIMED)
**WHAT:** `python -m unittest -q` runs 17 tests, 0 failures.
**HOW:**
```bash
python -m unittest -q
```
**EXPECTED:**
```
----------------------------------------------------------------------
Ran 17 tests in 0.000s
OK
```
**WHERE:** `calc/test_lexer.py` — 17 tests across 4 test classes covering D1D3.
---
## Cold-verify commands (from plan)
```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 outputs:**
1. `Ran 17 tests ... OK`
2. `[('NUMBER', 3.5), ('STAR', None), ('LPAREN', None), ('NUMBER', 1), ('MINUS', None), ('NUMBER', 2), ('RPAREN', None), ('EOF', None)]`
3. Raises `LexError: unexpected character '@' at position 2`