Skip to content

Commit 877a2d8

Browse files
committed
Merge main into proofs/p43 — resolve Print Assumptions block conflict (#270 audit + this PR's canonical_*_l1_m blocks)
# Conflicts: # formal/Semantics_L1.v
2 parents 040d7e5 + 9520d23 commit 877a2d8

26 files changed

Lines changed: 2026 additions & 140 deletions

.github/workflows/coq-build.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,30 @@ jobs:
8484
needs: detect-relevant-changes
8585
if: needs.detect-relevant-changes.outputs.relevant == 'true'
8686
runs-on: ubuntu-latest
87-
# coq:8.18 matches the toolchain pinned by formal/Justfile and the
88-
# local developer setup. Pin to a digest later once a stable
89-
# known-good image is decided on; for now the floating tag mirrors
90-
# `make` semantics — "what the maintainer's machine has".
91-
container:
92-
image: coqorg/coq:8.18
93-
# actions/checkout's post-step writes to /__w/_temp/_runner_file_commands
94-
# via Node fs.writeFileSync. The coqorg/coq image defaults to the
95-
# non-root `coq` user (UID 1000), but the runner mounts /__w as the
96-
# host runner user — EACCES until checkout's saveState. Running the
97-
# container as root keeps the workspace-shared paths writable while
98-
# leaving the in-container build untouched (root in container is
99-
# still mapped to the runner host's runner user, not host-root).
100-
options: --user root
87+
# Coq 8.18 via Ubuntu 24.04 noble apt (coq 8.18.0+dfsg) exactly
88+
# matches the toolchain pinned by formal/Justfile and the local
89+
# developer setup.
90+
#
91+
# Why not the `coqorg/coq:8.18` container? Previously this job ran
92+
# it with `--user root` to dodge the EACCES from checkout writing
93+
# to a runner-user-owned /__w mount. But the image only configures
94+
# `coqc` on the non-root `coq` user's PATH (via opam env in their
95+
# .profile). With `--user root`, no opam env → `coqc: not found` →
96+
# exit 127 immediately at the version step. Several proof PRs were
97+
# silently blocked while main stayed green (path-filter skipped
98+
# main pushes that didn't touch formal/). See the proven 37s
99+
# pattern in [[reference_coqorg_image_apt_coq_simpler]] used by
100+
# verisimdb#87.
101101

102102
steps:
103103
- name: Checkout repository
104104
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105105

106+
- name: Install Coq 8.18 (noble apt)
107+
run: |
108+
sudo apt-get update -qq
109+
sudo apt-get install -y --no-install-recommends coq
110+
106111
- name: Coq version (provenance)
107112
run: |
108113
coqc --version

.github/workflows/governance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ permissions:
2222

2323
jobs:
2424
governance:
25-
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@d3f799c639420ac68ac7ed83d2166b625b4b73f0
25+
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@bf406d6f95c5212c34c30f6629be93d08c076339 # main 2026-06-01 (R5b version-string drift — standards#329)

0-AI-MANIFEST.a2ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ This is the AI manifest for **ephapax**. It declares:
1313

1414
### Machine-Readable Metadata: `.machine_readable/6a2/` ONLY
1515

16-
These 6 A2ML files MUST exist in `.machine_readable/6a2/` directory ONLY:
16+
These 7 A2ML files MUST exist in `.machine_readable/6a2/` directory ONLY:
1717
1. **STATE.a2ml** - Project state, progress, blockers
1818
2. **META.a2ml** - Architecture decisions, governance
1919
3. **ECOSYSTEM.a2ml** - Position in ecosystem, relationships
2020
4. **AGENTIC.a2ml** - AI agent interaction patterns
2121
5. **NEUROSYM.a2ml** - Neurosymbolic integration config
2222
6. **PLAYBOOK.a2ml** - Operational runbook
23+
7. **ANCHOR.a2ml** - Canonical authority + project recalibration trigger (SSG / cartridge / parent-relationship metadata; template from `hyperpolymath/standards`)
2324

2425
## CORE INVARIANTS
2526

CHANGELOG.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
<!-- SPDX-License-Identifier: PMPL-1.0-or-later -->
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
2+
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> -->
23
# Changelog
34

45
All notable changes to Ephapax are documented here.
56

67
## [Unreleased]
78

9+
### Phase 3b Stage 1a + 1b — L2 effect-typed TFun + L3 wiring conditional preservation (2026-05-30 → 2026-05-31)
10+
11+
- **Stage 1a (PR #252, merged 2026-05-30 17:42Z)**: `tfuneff_lambda_free`
12+
+ `Counterexample_L2_nested.v`. Admin-merged after local build oracle
13+
GREEN with no axiom slippage (only the known-good
14+
`region_liveness_at_split_l1_gen` axiom).
15+
- **Stage 1b (PR #253)**: L1/L2 plumbing for the effect-typed `TFun` track —
16+
`expr_closed_below` + closure helpers (Syntax.v), body-transfer + closed-
17+
value G-poly helpers, `subst_typing_gen_l1_m_tfuneff` Qed (zero axioms),
18+
and `preservation_l2` β-case for closed `TFunEff` substituents. Builds
19+
toward the unconditional `preservation_l2` track per
20+
`PRESERVATION-DESIGN.md §12.x`.
21+
22+
### L3 wiring + L4 Phase A scaffold (2026-05-27 → 2026-05-28)
23+
24+
- **L3 wiring (slice 4, 2026-05-27)**: `preservation_l3_region_active_echo`,
25+
`preservation_l3_drop_echo`, and the `preservation_l3` umbrella all Qed in
26+
`formal/Semantics_L1.v` — each conditional on the
27+
`region_shrink_preserves_typing_l1_gen_m` L1 structural admit. The
28+
avoidable `T_Region_L1_Echo` mirror was closed in the same slice. Zero new
29+
admits introduced.
30+
- **L4 Phase A scaffold (2026-05-28)**: `formal/L4.v` lands with `ProgramMode`
31+
(`PModeLinear` / `PModeAffine` / `PModeBoundaryMix`) and
32+
`program_mode_to_modality` round-trip. Definitions only by design — no
33+
theorems, no admits, no axioms.
34+
835
### Four-layer preservation redesign (2026-05-26 → 2026-05-27)
936

1037
- **L1 — region capabilities** (PRs #153-line, integration branch
1138
`proof/l1-region-threading-design`): introduces `has_type_l1` with
1239
R-threading in `formal/TypingL1.v`. Supporting lemmas in
1340
`formal/Semantics_L1.v`. Counterexample regression (`bad_input_untypable_l1`)
14-
Qed in `formal/Counterexample.v`. `preservation_l1` Admitted with 4
15-
residual admits in R-weakening territory.
41+
Qed in `formal/Counterexample.v`. `preservation_l1` Admitted with 1
42+
residual inner `admit.` covering App / Pair / StringConcat (lambda-
43+
rigidity gap per `PRESERVATION-DESIGN.md §4.8`).
1644
- **L2 — Linear/Affine modality** (PR #176, this entry): `has_type_l1`
1745
carries `m : Modality` parameter so a single judgment specialises to
1846
ephapax-linear AND ephapax-affine. New `formal/Modality.v` with K-free

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<!-- SPDX-License-Identifier: PMPL-1.0-or-later -->
2+
<!-- SPDX-License-Identifier: MPL-2.0 -->
23
<!-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> -->
4+
<!-- Author: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> -->
35

46
# CLAUDE.md — Ephapax repo agent guidance
57

@@ -36,14 +38,15 @@ https://github.com/hyperpolymath/nextgen-languages/blob/main/docs/disambiguation
3638

3739
## Machine-readable artefacts
3840

39-
Structured project metadata lives in `.machine_readable/6a2/`:
41+
Structured project metadata lives in `.machine_readable/6a2/` (7 files):
4042

4143
- `STATE.a2ml` — current project state and progress.
4244
- `META.a2ml` — architecture decisions and development practices.
4345
- `ECOSYSTEM.a2ml` — position in the ecosystem and related projects.
4446
- `AGENTIC.a2ml` — AI agent interaction patterns (also carries an `@disambiguation` block).
4547
- `NEUROSYM.a2ml` — neurosymbolic integration config.
4648
- `PLAYBOOK.a2ml` — operational runbook.
49+
- `ANCHOR.a2ml` — canonical authority and project recalibration trigger (template from `hyperpolymath/standards`); declares SSG / cartridge / parent-relationship metadata.
4750

4851
## The four orthogonal layers
4952

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ ephapax-package = { path = "src/ephapax-package" }
5252
ephapax-vram-cache = { path = "src/ephapax-vram-cache" }
5353

5454
# Sibling-repo crates.
55-
# NOTE: rev pin currently points at typed-wasm#65 branch HEAD for the
56-
# `typedwasm.ownership` section rename. RE-BUMP to the post-merge SHA
57-
# on `origin/main` before this PR merges.
55+
# NOTE: rev pin is the post-merge SHA of typed-wasm#65 on
56+
# `hyperpolymath/typed-wasm:origin/main` (renames the custom section
57+
# `affinescript.ownership` → `typedwasm.ownership`). This is the
58+
# canonical C7 pin (cf. CHANGELOG.md "Added" / "C7 (#72)"). Re-bump
59+
# only if a newer `typed-wasm-verify` API change is needed.
5860
typed-wasm-verify = { git = "https://github.com/hyperpolymath/typed-wasm", rev = "a1935c16176567e0470de2feedf9c37a87dc0158" }
5961

6062
# External dependencies

EXPLAINME.adoc

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// SPDX-License-Identifier: PMPL-1.0-or-later
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
23
= Ephapax — Show Me The Receipts
34
:toc:
45
:toclevels: 3
@@ -98,13 +99,15 @@ soundness invariant the legacy judgment was missing.
9899
carries the R-threading directly. Step relation at
99100
`formal/Semantics_L1.v`.
100101
* Design rationale at `formal/PRESERVATION-DESIGN.md §3-§4`.
101-
* Status: judgment landed; 9 L1 supporting-lemma admits remain as
102-
L2-integration debt (tracked in `PROOF-NEEDS.md`).
102+
* Status: judgment landed; `Semantics_L1.v` carries 3 outer
103+
`Admitted.` markers covering 5 inner `admit.` cases — pre-existing
104+
L1 structural debt + parallel mirrors (file:line breakdown in
105+
`PROOF-NEEDS.md §4`).
103106

104-
== Claim: Irreversibility residue is first-class (L3, planned)
107+
== Claim: Irreversibility residue is first-class (L3, wired)
105108

106-
*Evidence (planned)*: Operations that erase information (region
107-
exit, drop) will produce typed residue witnesses, following the
109+
*Evidence*: Operations that erase information (region exit, drop)
110+
produce typed residue witnesses, following the
108111
https://github.com/hyperpolymath/echo-types[echo-types]
109112
formulation. Linear mode requires the residue to be observed;
110113
Affine mode permits silent lowering.
@@ -115,9 +118,13 @@ Affine mode permits silent lowering.
115118
* Local mirror at `formal/Echo.v` — the L3 calculus is mechanised
116119
here (modes, `LEcho`, `weaken`, `degrade_mode`, all `Qed`).
117120
* Forward-looking design at `formal/PRESERVATION-DESIGN.md §6`.
118-
* Status: **planned** integration — `Echo.v` is wired up
119-
internally, but no ephapax typing rule yet introduces `TEcho`.
120-
The L3 extension follows L1's residual admit closure.
121+
* Status: **wiring landed** (slice 4, 2026-05-27).
122+
`preservation_l3_region_active_echo`, `preservation_l3_drop_echo`,
123+
and the `preservation_l3` umbrella in `Semantics_L1.v` are all
124+
Qed, each conditional on the
125+
`region_shrink_preserves_typing_l1_gen_m` L1 structural admit.
126+
Remaining L3 work is unconditional `preservation_l3` (Phase 3b
127+
Stage 2).
121128

122129
== Claim: Dyadic mode is project-level only (L4)
123130

@@ -242,33 +249,37 @@ theorem.
242249
| `formal/TypingL1.v` — modality-indexed, R-threaded
243250

244251
| L1 semantics
245-
| 🟡 15 Qed, 9 admits (L2-integration debt)
246-
| `formal/Semantics_L1.v` — 9 admits are bullet-structure rewrites for new Affine-only constructors, *not* legacy patching
252+
| 🟡 37 Qed, 3 Admitted (5 inner admits — pre-existing L1 structural debt + parallel mirrors)
253+
| `formal/Semantics_L1.v` — 3 outer `Admitted.` markers cover 5 internal `admit.` cases. Per `PROOF-NEEDS.md §4`: pre-existing L1 structural debt (multiset/list-perm bridge + L2 effect-typed `TFun` per PRESERVATION-DESIGN.md §5.1 + lambda-rigidity at `preservation_l1` body) and two parallel mirrors that close mechanically when their originals close.
247254

248255
| L2 modality (`Modality.v`)
249256
| ✅ Core landed (1 Qed, 0 axioms)
250257
| `formal/Modality.v` + `m : Modality` in `has_type_l1`. PRs #176 + #177. `linear_to_affine` Qed with zero axioms.
251258

252259
| L3 echo / residue calculus
253-
| ✅ 12 Qed, 0 admits (calculus); ⏳ integration pending
254-
| `formal/Echo.v` — one type former (fiber `Echo f y := Σ x. f x ≡ y`) + degrade map + no-section-collapse-to-residue proof. Not yet wired into `has_type_l1` or step rules.
260+
| ✅ Calculus 12 Qed + wiring landed (slice 4, 2026-05-27)
261+
| `formal/Echo.v` — one type former (fiber `Echo f y := Σ x. f x ≡ y`) + degrade map + no-section-collapse-to-residue proof. Wiring lemmas (`preservation_l3_region_active_echo`, `preservation_l3_drop_echo`, `preservation_l3` umbrella) in `Semantics_L1.v` — all Qed, conditional on `region_shrink_preserves_typing_l1_gen_m`.
255262

256263
| L4 dyadic interaction
257-
| 🔲 Not started
258-
| Design in `formal/PRESERVATION-DESIGN.md §7`.
264+
| ✅ Phase A scaffold landed (`formal/L4.v`, 2026-05-28); definitions only
265+
| `PModeLinear` / `PModeAffine` / `PModeBoundaryMix` enum + `program_mode_to_modality` round-trip. No theorems by design. Design in `formal/PRESERVATION-DESIGN.md §7`.
259266

260267
| Legacy `Theorem preservation` (`formal/Semantics.v`)
261268
| 🛑 Provably false (Admitted)
262269
| Pinned by `Counterexample.v`. **Do not attempt closure.** Archaeology.
263270
|===
264271

265272
What's done = `Modality.linear_to_affine` (Linear ⇒ Affine weakening,
266-
zero axioms), the L1 judgment, L3 fiber + degrade calculus, and the
267-
counterexample regression witness. What's todo = close the 9
268-
Semantics_L1 admits (L2-integration debt), wire L3 into the typing
269-
judgment + step rules, then state per-layer preservation. What's
270-
banned = closing the legacy theorem, adding new `Axiom` declarations
271-
to discharge L1/L2 gaps, conflating `ephapax-affine` (this repo's
273+
zero axioms), the L1 judgment, L3 fiber + degrade calculus, L3
274+
wiring into the L1 step rules (slice 4 — `preservation_l3` umbrella
275+
Qed conditional on the L1 structural admit), L4 Phase A scaffold
276+
(definitions only), and the counterexample regression witness.
277+
What's todo = close the 3 Semantics_L1 outer Admitteds (pre-existing
278+
L1 structural debt: multiset/list-perm bridge + L2-effect-typed
279+
`TFun` + lambda-rigidity at `preservation_l1`), then state
280+
unconditional `preservation_l3` (Phase 3b Stage 2). What's banned =
281+
closing the legacy theorem, adding new `Axiom` declarations to
282+
discharge L1/L2 gaps, conflating `ephapax-affine` (this repo's
272283
sublanguage) with `AffineScript` (a separate language at
273284
`hyperpolymath/affinescript`). Full per-sublanguage breakdown in
274285
`PROOF-NEEDS.md`.
@@ -341,7 +352,9 @@ total`.
341352

342353
== Test Evidence
343354

344-
~229 tests across ~19 crates, 0 failures. Key test categories:
355+
357 tests across 17 active workspace crates + `tests/fuzz`, 0
356+
failures (per `cargo test --all-targets`; see `TEST-NEEDS.md` for
357+
the per-crate breakdown). Key test categories:
345358

346359
* *Type checker dyadic tests*: `let` vs `let!` semantics, branch
347360
agreement, region exit (`ephapax-typing`)
@@ -352,8 +365,8 @@ total`.
352365
* *Discipline tests*: linear vs affine checker divergence
353366
(`ephapax-linear`)
354367
* *Integration tests*: parse → desugar → typecheck end-to-end
355-
* *Conformance tests*: `conformance/pass/` programs must type-check,
356-
`conformance/fail/` programs must be rejected
368+
* *Conformance tests*: `conformance/valid/` programs must type-check,
369+
`conformance/invalid/` programs must be rejected
357370

358371
== Design Documents
359372

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ lint:
4747

4848
# Run panic-attacker pre-commit scan
4949
assail:
50-
@command -v panic-attack >/dev/null 2>&1 && panic-attack assail . || echo "panic-attack not found — install from https://github.com/hyperpolymath/panic-attacker"
50+
@command -v panic-attack >/dev/null 2>&1 && panic-attack assail . || echo "panic-attack not found — install from https://github.com/hyperpolymath/panic-attack"
5151

5252
# Format code
5353
fmt:

PROOF-NEEDS.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- SPDX-License-Identifier: PMPL-1.0-or-later -->
1+
<!-- SPDX-License-Identifier: MPL-2.0 -->
22
<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> -->
33

44
# Proof needs — Ephapax (linear + affine sublanguages)
@@ -233,6 +233,15 @@ to the owner**:
233233

234234
## §4. Counts + file-by-file map
235235

236+
<!-- status-gate marker: do not move. scripts/status-gate.sh reads this line. -->
237+
Coq admitted proofs remaining: 4
238+
239+
(1 outer `Admitted.` in `formal/Semantics.v` — sacrosanct legacy
240+
preservation, provably false per `Counterexample.v` + 3 outer
241+
`Admitted.` markers in `formal/Semantics_L1.v` covering 5 internal
242+
`admit.` cases — all pre-existing L1 structural debt + parallel
243+
mirrors. See the per-file table and seam audit below.)
244+
236245
### Per-file Qed / Admitted summary (as of 2026-05-28)
237246

238247
| File | Qed | Admitted | Disposition |

0 commit comments

Comments
 (0)