|
Important
|
🛑 First-read disambiguation (human + machine readers)
This is Ephapax is not The only shared surface between Ephapax and AffineScript is that both target Internal naming trap: Ephapax itself is dyadic — it has two internal sublanguages:
Both live inside this repo ( If you arrived here with a lesson, snippet, fact, or tactic from Canonical disambiguation document (deeper detail, with side-by-side table): https://github.com/hyperpolymath/nextgen-languages/blob/main/docs/disambiguation/ephapax-vs-affinescript.md |
Ephapax is gestating — part-way through a deliberate second draft,
on two independent tracks (grammar and soundness proof), both landing.
For the why-this-is-healthy framing, read V1-TO-V2.adoc
first; this document is the operational map underneath it.
On 2026-05-26 a verified Coq counterexample (formal/Counterexample.v,
5 Qed lemmas) proved that preservation as stated in the legacy
single-judgment design (formal/Semantics.v) is unsound. Proving your
own first draft’s limit, before anyone depends on it, is the rare correct
move — and it named exactly the invariant the redesign needed. The work
since is not to close that theorem (no closure exists; the
Admitted is deliberate) but to build the four-layer principled
redesign (formal/PRESERVATION-DESIGN.md) where preservation is
re-derived per layer from explicit invariants. Three of the four
layers already carry Qed theorems.
This document maps what that means for the repo: which work is past
(the v1 lesson — read it, don’t build on it), which is present
(the v2 layers — active, extend), and which is future (next moves).
The two fenced-off v1 artefacts are narrow; everything in the v2 columns
is open and tractable. Read this before opening any .v file or any PR
comment dated before 2026-05-26.
These artefacts are the v1 first draft and the trail that proved its limit. Their value is real but specific: they are why the v2 redesign has the shape it has — the precise record of the missing invariant. Keep them readable as the lesson; do not build forward on them (the v2 layers below are where forward work goes).
| Artefact | What it is | Why archaeology |
|---|---|---|
|
The legacy preservation theorem. The judgment lacks the structural invariant the counterexample demands. |
Provably false. Marked |
|
Pre-discovery attempts to close legacy preservation through helper lemmas at the same-pre-step env framing. |
Targeted at the now-falsified theorem. Useful as a pathway record; not as instructions. |
PRs #92, #102, #104, #106, #114, #116, #117, #121, #146 |
The 910 → 12 admit-reduction trail under the legacy judgment. |
All pre-2026-05-26. Closed retrospectively as archaeology. |
|
The diagnostic record describing the obstacle that led to the counterexample discovery. |
Reads as a closure plan; isn’t one. Useful only for understanding why the redesign happened. |
Branch |
14 commits dated 2026-05-26, all attacking |
Audit + session notes cherry-picked to main; the |
|
Caution
|
Anti-patterns that have wasted real session time
|
The redesign separates four concerns that the legacy judgment conflated. Each layer has its own judgment, its own invariants, its own per-layer preservation theorem. The orthogonality matters: a fix at one layer must not require changes at another.
| Layer | Concern | File(s) | Status | Counts (Qed / Admitted) |
|---|---|---|---|---|
L1 |
Region capabilities, capability environment threading |
|
Substantially complete — judgment is 100%; semantics carries the pre-existing L1 structural debt + parallel mirrors |
|
L2 |
Structural modality (Linear vs Affine) |
|
Core landed via PRs #176 + #177. |
|
L3 |
Echo / residue — what was lost when an irreversible step fired |
|
Calculus + wiring both landed (slice 4, 2026-05-27).
|
|
L4 |
Dyadic interaction semantics (mother–child distinction) |
|
Phase A scaffold landed 2026-05-28. |
|
|
Note
|
Why this works
The legacy judgment conflated structural discipline + region capabilities + echo residue + dyadic mode. The counterexample exploits the gap that makes that conflation unsound: region exit invalidates sibling assumptions without the judgment tracking the dependency. The four-layer split makes those four concerns first-class and orthogonal. Each layer proves its own preservation theorem against its own invariants. The language gets the safety of all four without the unsoundness of the combined form. |
|
Important
|
Reading the L3 layer status (post-slice-4, 2026-05-27)
L3 wiring has landed. The |
-
Close the 3 outer
Admitted.markers informal/Semantics_L1.v(covering 5 internaladmit.cases). Per PROOF-NEEDS.md §4 these are pre-existing L1 structural debt + parallel mirrors:region_shrink_preserves_typing_l1_gen_m(list / multiset bridge),region_liveness_at_split_l1_gen(L2-effect-typedTFunper PRESERVATION-DESIGN.md §5.1), andpreservation_l1lambda-rigidity. Two of the five are mechanical parallel mirrors that close when their originals close. -
L3 wiring landed (slice 4, 2026-05-27). Remaining L3 work is Phase 3b Stage 2: state + prove the unconditional
preservation_l3(currently conditional on theregion_shrink_preserves_typing_l1_gen_madmit). Stages 1b / 3 / 4 also open perPRESERVATION-DESIGN.md §12.x. -
Per-layer preservation theorems: continue building
preservation_l1,preservation_l2,preservation_l3— each against its own judgment, using its own invariants. Do not try to re-derive the legacy theorem.
-
L4 Phase A landed 2026-05-28 (
formal/L4.v): three-constructorProgramModeenum (PModeLinear/PModeAffine/PModeBoundaryMix) +program_mode_to_modalityround-trip, definitions only. -
Future L4 work: surface-syntax integration (the
![ephapax_linear]/![ephapax_affine]/#![module_boundary_mix(…)]decls aren’t yet wired into the parser or borrow checker), plus the dyadic mother–child semantics perPRESERVATION-DESIGN.md §7.
The L3 calculus opens three superpowers proper reversible programming doesn’t have. Their relative status:
| Direction | Status | Notes |
|---|---|---|
Linear Echo + Region-Based Memory Management
(deterministic bulk free on |
Committed |
The high-assurance real-time / systems software use case. Bridges a real gap that tracing GC cannot fill — by design, tracing GC hides reclamation evidence; Linear Echo certifies it. |
Selective reversibility (thin-poset Linear ≤ Affine) |
Committed |
Linear discipline where you need reverse-running (backprop, audit trails); Affine where you don’t (inference, hot loops). Same code shape, different mode declaration. |
Debugging / provenance via Linear Echoes |
Committed |
Mandatory-observed echo = receipt that cannot be forgotten = a type-system guarantee that the preimage of a critical state change was retained. |
Linear discipline on deterministic drop (Rust-style) for critical resources (keys, sensitive buffers) requiring provable erasure |
Speculative |
Direction flagged; not committed in v1. Compatible with the L3 wiring above. |
GDPR-style certified erasure |
Direction |
Concrete compliance anchor: |
|
Warning
|
Echo Types are NOT a tracing-GC replacement
Echo Types do not solve reachability or cycles. They are not a "fire-and-forget" automatic memory manager. Their strength is accountability of irreversible reclamation in systems that already know when and how to deallocate (regions, explicit drop, deterministic ownership). Treating them as competition for mark-and-sweep is a category error. |
These are the guardrails — and they are deliberately narrow. Items 1–5 all fence off the one falsified v1 artefact (the legacy preservation theorem and attempts to close it). Items 6–7 are two design invariants that keep the v2 layers orthogonal. Nothing here closes off the live v2 work: the per-layer proofs and the grammar phases remain open. Read this as "mind these specific posts," not "the field is closed."
-
❌ Closing the legacy
Theorem preservationinformal/Semantics.v. It is FALSE. No proof closes it. -
❌ Adding lemmas to
formal/Semantics.vaimed at that closure (Lemma B variants, region-weakening predicates, strengthened substitution lemmas,step_preserves_type_at_pre-style helpers). -
❌ Closing residual admits in
formal/Semantics_L1.vby ad-hoc side conditions or proof tricks within the current judgment shape. -
❌ Following any pre-2026-05-26 "preservation closure plan" in PRs, branches, or comments.
-
❌ Patching the legacy
formal/Typing.vjudgment.Counterexample.vdepends on its falsity for the regression theorem. -
❌ Treating Echo Types as a tracing-GC replacement.
-
❌ Baking linearity directly into Echo Types. Echo semantics and structural discipline must remain orthogonal and compositional.
-
Design doctrine:
formal/PRESERVATION-DESIGN.md— the canonical four-layer architecture, the missing-invariant statement, the per-layer plan. -
Proof debt:
PROOF-NEEDS.md— what’s done, what’s todo, what’s banned, separated for ephapax-linear and ephapax-affine sublanguages. -
Agent guidance:
CLAUDE.md(root) — the 2026-05-27 owner directive, anti-pattern detector, escalation rule. -
Counterexample:
formal/Counterexample.v— the 5 Qed lemmas that pin the soundness gap. -
Upstream Echo foundation: https://github.com/hyperpolymath/echo-types — the Agda fiber/degrade/no-section calculus this repo’s L3 builds on.
-
formal/PRESERVATION-DESIGN.md §3— "The four orthogonal concerns". -
formal/PRESERVATION-DESIGN.md §6.2— "Two modes, one type former". -
formal/PRESERVATION-DESIGN.md §6.4— "What L3 demands that L1+L2 must not contradict". -
CLAUDE.md"Owner directive 2026-05-27 — preservation work" — the DO and DO-NOT lists this document derives from.