artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
# REVIEW — Phase parse (Adversary)
|
||||
|
||||
## Verdicts
|
||||
|
||||
### D1: PASS @2026-06-15T05:00Z
|
||||
Cold-ran: `python -c "from calc.lexer import tokenize; from calc.parser import parse; print(parse(tokenize('1+2*3')))"`
|
||||
Got: `BinOp(op='+', left=Num(value=1), right=BinOp(op='*', left=Num(value=2), right=Num(value=3)))`
|
||||
Matches expected exactly. Break-it: `3*2+1` → `BinOp(+, BinOp(*, 3, 2), 1)` (correct — `*` binds tighter from left too).
|
||||
|
||||
### D2: PASS @2026-06-15T05:00Z
|
||||
Cold-ran: `8-3-2` → `BinOp(-, BinOp(-, Num(8), Num(3)), Num(2))` ✓
|
||||
`8/4/2` → `BinOp(/, BinOp(/, Num(8), Num(4)), Num(2))` ✓
|
||||
Break-it: `10-3-2-1` → fully left-assoc triple nesting ✓. Grammar's while-loop guarantees left-assoc.
|
||||
|
||||
### D3: PASS @2026-06-15T05:00Z
|
||||
Cold-ran: `(1+2)*3` → `BinOp(*, BinOp(+, Num(1), Num(2)), Num(3))` ✓
|
||||
Break-it: `((2+3))*4` → `BinOp(*, BinOp(+, Num(2), Num(3)), Num(4))` ✓ (nested parens unwrap cleanly).
|
||||
|
||||
### D4: PASS @2026-06-15T05:00Z
|
||||
Cold-ran all three required cases:
|
||||
- `-5` → `Unary(op='-', operand=Num(value=5))` ✓
|
||||
- `-(1+2)` → `Unary(op='-', operand=BinOp(op='+', left=Num(value=1), right=Num(value=2)))` ✓
|
||||
- `3 * -2` → `BinOp(op='*', left=Num(value=3), right=Unary(op='-', operand=Num(value=2)))` ✓
|
||||
Break-it: `--5` → `Unary('-', Unary('-', Num(5)))` (recursive unary works, double-negation parses correctly).
|
||||
|
||||
### D5: PASS @2026-06-15T05:00Z
|
||||
Cold-ran all five required error cases — each raised `ParseError`, none raised a different exception:
|
||||
- `'1 +'` → `ParseError: unexpected token 'EOF' (None)` ✓
|
||||
- `'(1'` → `ParseError: unclosed parenthesis, got 'EOF'` ✓
|
||||
- `'1 2'` → `ParseError: unexpected token 'NUMBER' (2)` ✓
|
||||
- `')('` → `ParseError: unexpected token 'RPAREN' (')')` ✓
|
||||
- `''` → `ParseError: empty input` ✓
|
||||
Break-it: `1+2)` → `ParseError: unexpected token 'RPAREN' (')')` ✓ (trailing paren caught by EOF check).
|
||||
|
||||
### D6: PASS @2026-06-15T05:00Z
|
||||
Cold-ran: `python -m unittest -q`
|
||||
Output: `Ran 37 tests in 0.001s OK` (18 lexer + 19 parser, 0 failures) ✓
|
||||
|
||||
## No adversary findings — all DoD gates verified PASS
|
||||
|
||||
All D1–D6 gates verified independently. No defects found. Builder may mark DONE.
|
||||
Reference in New Issue
Block a user