Commit 4b36de2
test(faces): prove a Python-face program runs end-to-end (face → wasm → result) (#684)
## What
The README's headline is *"faces are the product"* — write a familiar
surface, get the affine core underneath, compiled to wasm. That path had
**never been exercised as running code**, only parsed (the scan flagged
"faces exist but no face-authored program is proven end-to-end to
wasm"). This closes that.
- `test/e2e/fixtures/python_face_runnable.pyaff` — Python-shaped source
(`def`, `if/else`, recursion) with a `# face: python` pragma.
- `test/e2e/python_face_e2e.sh` — compiles it **through the Python
face** to core-WASM and asserts `main() === 5170` (`fac(5)=120 +
sum_to(100)=5050`). Skips loudly without the compiler/node;
`AFFINESCRIPT_BIN` overrides the path.
```
Compiled fixtures/python_face_runnable.pyaff -> pf.wasm (WASM)
main() = 5170 (expected 5170)
PASS: Python-face program ran end-to-end (face → wasm → correct result)
```
## Two real bugs the faces path surfaced (filed)
Recursion is used deliberately, because proving this found:
- **#683** — the Python face drops the trailing `;` on the last
statement of a `while`/`for` body (tail-position detection doesn't
distinguish loop bodies from value bodies), so face-authored **loops**
don't yet compile. Recursion's tail line is a value expression, which
the face handles correctly.
- **#682** — `total` is rejected as a variable name in `let`-binding /
assignment position (the `TOTAL` soft-keyword's ident-recovery is
incomplete).
An honest end-to-end proof of the face→wasm path *today*, a regression
lock, with the loop gap tracked in #683.
## Gates
`dune build` 0 · face e2e PASS · doc-truthing OK · soundness ledger
all-5 OK.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4a6a31f commit 4b36de2
2 files changed
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments