Skip to content

test(faces): prove a Python-face program runs end-to-end (face → wasm → result)#684

Merged
hyperpolymath merged 1 commit into
mainfrom
worktree-face-e2e-proof
Jul 7, 2026
Merged

test(faces): prove a Python-face program runs end-to-end (face → wasm → result)#684
hyperpolymath merged 1 commit into
mainfrom
worktree-face-e2e-proof

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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:

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

… → result)

The README's headline is "faces are the product" — a program in a familiar
surface, elaborated to the affine core, compiled to wasm. That path had never
been exercised as *running code*, only parsed. This proves it:

- test/e2e/fixtures/python_face_runnable.pyaff — Python-shaped source
  (`def`, `if/else`, recursion), `# 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 (exit 0) without the compiler or node; AFFINESCRIPT_BIN
  overrides the binary path.

Observed (node 26, dune 3.24 build):
  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)

Recursion, not a loop, on purpose: proving the face path surfaced two real
bugs, filed with minimal repros:
  - #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). The
    fixture avoids that name.

So this is an honest end-to-end proof of the face→wasm path today, and a
regression lock, with the known loop gap tracked in #683.

Gates: dune build 0; face e2e PASS; doc-truthing OK; soundness ledger all-5 OK.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) July 7, 2026 18:27
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@hyperpolymath hyperpolymath merged commit 4b36de2 into main Jul 7, 2026
17 checks passed
@hyperpolymath hyperpolymath deleted the worktree-face-e2e-proof branch July 7, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant