Skip to content

State 2026 05 26

hyperpolymath edited this page May 26, 2026 · 1 revision

AffineScript State Snapshot — 2026-05-26

⚠️ Mirror of docs/STATE-2026-05-26.adoc. When the repo doc and this wiki page disagree, the repo doc wins.

One-paragraph summary

AffineScript is in Stage D — the current frontier of its five-stage build-out. Stages A (core affine spine), B (grammar), and C (stdlib AOT) are closed. Stage D — base-language soundness completion (CORE-01) plus the INT-01..04 ecosystem substrate — is active. Stage E (typed-wasm convergence widening) is planned and begins when D's substrate closes.

Today's gate baseline: 327 tests, 0 failures under dune runtest --force. Up from 260 (the 2026-05-19 reconstruction reference). The +67 tests across one week reflect the borrow-checker NLL Slices A/B/C-light, the ADR-014 module-qualified-paths grammar, the Phase 2c migration-assistant walker, parser improvements (record-spread, trailing comma, fn-type with effect arrow, underscore idents), and stdlib wiring (env_at / arg_at, string_length builtin).

The single named base-language soundness gap (issue #177 / CORE-01, borrow-checker Phase-3) is substantially complete — Parts 1 + 2 + Slices A + B + C-light have all landed; residual is the ADR-gated Slice C-full (Polonius origin/region variables), Slice C′ (loop soundness), Slice D (quantity-checker integration for captured linears), and ref-to-ref binding.

Repo state by the numbers

Metric Value
Test gate (dune runtest --force) 327 tests, 0 failures
Open issues 21
Open PRs 13
PRs merged 2026-05-24..26 ~28
Mechanized proofs in this repo 0 (operational soundness only)
believe_me / sorry / Admitted in this repo 0
Soundness story Borrow-checker (lib/borrow.ml) + CI gate; no .v / .idr / .agda / .lean

Stage map

Stage Scope Status
A Core affine spine — QTT semiring wired into the CLI; affine types + linear arrows enforced; BUG-001..005 closed CLOSED
B Grammar conformance + conflict elimination — ADR-009, #215, ADR-012 disposition CLOSED
C Stdlib AOT — every stdlib file resolve → typecheck → codegen, CI-gated CLOSED 2026-05-18
D Base-language soundness + ecosystem connective tissue — CORE-01, INT-01..12, satellite registry, ADR-014 ACTIVE — current frontier
E typed-wasm convergence hardening — the AffineScript ↔ typed-wasm contract widened from L7+L10 toward L1–6 / L13–16; multi-producer ABI planned

CORE-01 (issue #177) — borrow-checker Phase-3

Landed slices:

  • Part 1 (PR #240) — BorrowOutlivesOwner, shared-XOR-exclusive at use sites, ownership from param type, call-arg borrows temporary.
  • Part 2 — return-escapereturn e rooted at callee-owned binding now flagged.
  • Part 2 — &mut e parser surface — zero Menhir conflict delta; shared-XOR-exclusive rules now reachable from source.
  • Part 3 Slice A — NLL last-use expiry — forward pre-pass + per-block ref-binding expiry on death.
  • Part 3 Slice B — flow-sensitive escape via re-assignmentouter = &y pre-releases held borrow + re-binds ref-graph entry.
  • Part 3 Slice C-light (PR #358) — CFG-join for ExprHandle/ExprTry catch arms via snapshot-restore-merge.

Residual:

  • Slice C-full — true Polonius origin/region variables (architectural change, ADR-gated, multi-week).
  • Slice C′ — loop soundness 2-iteration check.
  • Slice D — captured-linears quantity-checker integration.
  • Ref-to-ref binding (r = some_other_ref_var).

Section status

CORE

ID Sev Status
CORE-01 S1 Parts 1+2 + Slices A+B+C-light LANDED; residual = Slice C-full (Polonius) + C′ + D + ref-to-ref
CORE-02 S2 CLOSED 2026-05-19 — CPS line + ADR-016 end-to-end
CORE-03 S1 Grammar MERGED (PR #241); estate scope = ~84 files / 12 repos
CORE-04 S2 partial — traits, where-clauses, coherence
CORE-05 S3 parse-only — dependent/refinement types

STDLIB

ID Sev Status
STDLIB-AOT S1 CLOSED (Stage C)
STDLIB-01 S2 DONEHttp.fetch (#160 + #225)
STDLIB-02 S2 LANDEDJson
STDLIB-03 S2 LANDEDDict / Map

INT — Stage D ecosystem substrate

ID Sev Status
INT-02 S1 PROVEN + locked — host-agnostic loader bridge
INT-03 S1→S6a open (#180, ADR-015) — WASI preview2 / host I/O
INT-04 S2 READY (#181) — JSR/npm packaging (dry-run green)
INT-07 S2 shippedaffinescript-tea runtime + run loop
INT-08 S2 implemented — DOM reconciler
INT-10 S2 DONE end-to-end live — LSP distribution

CONV — Stage E pre-emptive bookkeeping

ID Sev Status
CONV-01 S2 open (#235) — estate-wide closure-ABI re-validation under real wasm engine
CONV-02 S2 CLOSED 2026-05-19 — async-boundary recogniser
CONV-03 S1 partial — ABI matured "shared with Ephapax"
CONV-04 S2 L13 DONE; L1–6 / L14–16 need new carrier section (multi-producer ABI proposal, cross-repo)
CONV-05 S1 planned — INT-12 fixtures into typed-wasm cross_compat.rs

Proof debt

This is important and routinely misunderstood.

  • No mechanized proofs in this repo. Zero .v / .idr / .agda / .lean files.
  • The verification/proofs/ template directories in RSR scaffolding are NOT obligations — they are template residue being removed as the embedded affinescript-* subtrees are extracted (issue #392 umbrella; road-skate was the first, PR #391).
  • AffineScript's soundness story is operational: the borrow checker in lib/borrow.ml + regression fixtures + CI gate. The OCaml is its own oracle.
  • "Proof debt" in AffineScript terms = closing CORE-01 residual + cross-validation via the typed-wasm contract (Stage E). Mechanized cross-validation lives in hyperpolymath/typed-wasm — emitted wasm must satisfy that repo's verifier rules, where the Idris2 proofs of agreement live.

Distance to 1.0

Per ROADMAP.adoc:

Phase Goal Target Status
Current Core features working 85% substantially achieved
Phase 1 (Q1 2026) Complete core language 90% Stages A–C closed; D in flight
Phase 2 (Q2 2026) Advanced features 95% needs CORE-01 residual + INT-03/04 closure
Phase 3 (Q3 2026) Production ready 1.0 needs Stage E (typed-wasm contract widening — cross-repo)

Critical-path summary to 1.0

  1. CORE-01 Slice C-full (Polonius) — ADR-gated, multi-week architectural change. The dominant single item.
  2. CORE-01 Slices C′ + D + ref-to-ref — PR-sized each, ~3–4 PRs total.
  3. Cross-repo: CONV-04 multi-producer ABI proposal — filed with typed-wasm; needs owner-coordinated decision before AffineScript can widen enforcement beyond L7 + L10 + L13.
  4. #229 estate-wide ReScript elimination — 84 files / 12 repos, mechanical-ish, coordination-heavy.
  5. INT-03 (WASI host I/O beyond stdout) — ADR-015 filed; PR-sized work to land.
  6. INT-04 JSR/npm publish — READY; needs version-coordination switch flipped.

Rough wall-clock effort: CORE-01 Slice C-full alone is ~6–12 weeks if Polonius is reimplemented cleanly. Everything else is parallel-friendly and adds maybe another 4–8 weeks if the typed-wasm cross-repo decision lands promptly.

Recent velocity (2026-05-24..26)

~28 PRs merged in 3 days, including: CORE-01 Slice C-light, Phase 2c migration walker (six anti-patterns), parser features (trailing-comma, fn-type with effect arrow, underscore idents, record-update spread, builtin/qualified paths), stdlib wiring (string_length, env_at/arg_at), tidy stack T-1..T-7, CI unblock, road-skate extraction (first of the embedded-subtree extractions), disambiguation hooks (README + CLAUDE.md + AGENTIC.a2ml).

Active and productive — not a stalled project.

Refresh protocol

Refresh this page on any of:

  • Stage-status change (e.g., CORE-01 closes, Stage E starts).
  • Issue-count or PR-count change of >5 relative to the snapshot.
  • Gate-baseline change (the 327-tests number).
  • Otherwise: monthly, or whenever someone reads it and finds it stale.

Re-derive numbers from live sources — dune runtest --force, gh issue list --state open, gh pr list --state opennot from this file.


Last revised: 2026-05-26.