Skip to content

Commit b508599

Browse files
docs: seed proof-debt.adoc per standards#203 trusted-base policy (#164)
## Summary P0 adoption of [standards#203](https://github.com/hyperpolymath/standards/blob/main/docs/TRUSTED-BASE-REDUCTION-POLICY.adoc) (trusted-base reduction policy). Classifies every soundness-relevant escape hatch in this repo: - **(a) DISCHARGED**: 4 recent Qeds (`step_preserves_type`, `step_output_context_eq`, `region_shrink_preserves_typing`, `region_env_perm_typing`). - **(b) BUDGETED**: none — zero `unsafe` / `believe_me` / `assert_total` in soundness positions. The lone `believe_me` mention in `RegionLinear.idr:127` is a negation in a doc comment. - **(c) NECESSARY AXIOM**: none — `formal/Semantics.v` has zero Coq `Axiom` declarations. The "Axiom cases" comments at lines 8619/9225 refer to *axiomatic step rules*, not Coq `Axiom`s. - **(d) DEBT**: one entry — `preservation` `Admitted` at `Semantics.v:9175`. ## Load-bearing caveat The `(d)` entry is honest about the fact that `preservation` as stated on `main` is **not just unproven — it is FALSE**. `formal/Counterexample.v` on branch `proof/l1-region-threading-design` exhibits a verified counterexample (three lemmas `Qed`). The closure path is the four-layer redesign (L1→L2→L3→L4), not closing the remaining 11 admits on `main`. The document also enumerates the plan-items that are **out of scope for L1** (affine sublanguage mechanisation, Rust↔Coq correspondence, `Echo.v`, L4 mode elaboration) per `formal/PRESERVATION-DESIGN.md` §12.15.4, so downstream consumers do not overclaim ephapax soundness. ## Companion artefacts - standards#203 (merged) — the policy this PR adopts - `ROADMAP.adoc` § "Preservation closure plan" - `formal/PRESERVATION-HANDOFF.md` — per-PR diagnostic narrative ## Test plan - [x] AsciiDoc renders on GitHub (syntax-only — no build target for this file) - [x] GPG-signed commit (key 4A03639C…2867091E, noreply email) - [x] Auto-merge SQUASH enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 256c4b1 commit b508599

1 file changed

Lines changed: 187 additions & 0 deletions

File tree

docs/proof-debt.adoc

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
= Proof debt
4+
:policy: https://github.com/hyperpolymath/standards/blob/main/docs/TRUSTED-BASE-REDUCTION-POLICY.adoc
5+
:design: formal/PRESERVATION-DESIGN.md (on branch `proof/l1-region-threading-design`)
6+
:handoff: formal/PRESERVATION-HANDOFF.md
7+
:roadmap: ROADMAP.adoc § "Preservation closure plan"
8+
:counterexample: formal/Counterexample.v (on branch `proof/l1-region-threading-design`)
9+
10+
Per link:{policy}[standards#203] (trusted-base reduction policy), every
11+
soundness-relevant escape hatch in this repo is classified below as one
12+
of: (a) DISCHARGED, (b) BUDGETED, (c) NECESSARY AXIOM, or (d) DEBT.
13+
Disposition (d) is the only category that should shrink over time.
14+
15+
== (a) Discharged in this repo
16+
17+
No outstanding entries — discharged proofs are removed from this list
18+
when they land. Recent discharges of note (kept here for one release
19+
cycle for visibility):
20+
21+
* `formal/Semantics.v` `step_preserves_type` — Qed via Path 3 at-pre
22+
helper (2026-05-26, PR #146).
23+
* `formal/Semantics.v` `step_output_context_eq` — Qed via Path 3
24+
at-pre helper (2026-05-26, PR #146).
25+
* `formal/Semantics.v` `region_shrink_preserves_typing` — Qed
26+
upstream of the at-pre helper.
27+
* `formal/Semantics.v` `region_env_perm_typing`,
28+
`remove_first_then_cons_membership_eq` — Qed; plug-in lemmas for
29+
the S_Region_Step cross-case collapse.
30+
31+
== (b) Budgeted — tested with refutation budget
32+
33+
No entries. The ephapax core (Coq `formal/` + Rust `ephapax-linear/`
34+
+ Idris2 `src/formal/Ephapax/Formal/…/*.idr`) contains zero `unsafe`
35+
blocks, `unsafePerformIO`, `believe_me`, `assert_total`, or analogous
36+
escape hatches at soundness-relevant positions.
37+
38+
* `src/formal/Ephapax/Formal/RegionLinear.idr:127` mentions
39+
`believe_me` only in a documentation comment ("not `believe_me`")
40+
asserting the absence of the escape hatch — this is a negation, not
41+
a use.
42+
43+
If future FFI / extraction work introduces a `TRUSTED:` entry, the
44+
`boj-server` backend-assurance harness is the reference implementation
45+
for refutation budgets (`docs/proof-debt.adoc` §(b) in that repo).
46+
47+
== (c) Necessary axiom
48+
49+
`formal/Semantics.v` contains zero Coq `Axiom` declarations.
50+
51+
* The "Axiom cases" mentioned in comments at `formal/Semantics.v:8619`
52+
and `formal/Semantics.v:9225` refer to the *axiomatic step rules*
53+
`S_StringNew` / `S_StringConcat` (operational-semantics primitives
54+
that produce `ELoc l r` and require explicit reconstruction in
55+
preservation), not Coq `Axiom` declarations.
56+
57+
=== `idris2/src/Main.idr:21` — `%default partial`
58+
59+
* **Kind**: extraction-boundary IO non-termination. The
60+
ephapax-affine CLI driver `idris2/src/Main.idr` reads files,
61+
writes outputs, and exits via `System.exitWith`. None of these
62+
operations can be proven total within Idris2 0.8.0 without a
63+
foreign-totality oracle for system primitives.
64+
* **Justification**: standard practice for CLI `Main` modules in
65+
Idris2. The non-totality is structurally inherited from
66+
`System.File.*` and `System.exitWith`. Discharging would require
67+
oracles for the OS (file existence at read time, disk space at
68+
write time, process termination).
69+
* **Scope**: limited to the CLI driver entry point. The pure
70+
pipeline (`Ephapax.IR.*`, `Ephapax.Parse.*`,
71+
`Ephapax.Affine.Typecheck`, `Ephapax.Affine.Emit`) is total under
72+
the implicit (per-module) `%default total` of those modules.
73+
* **Citation**: this pattern matches the
74+
link:https://github.com/hyperpolymath/boj-server[boj-server]
75+
backend-assurance harness's handling of IO-bearing entry points
76+
— see `boj-server/docs/proof-debt.md` for the reference shape.
77+
78+
== (d) DEBT — actively to be closed
79+
80+
=== `formal/Semantics.v:9175` — `Admitted` `preservation`
81+
82+
* **Owner**: @hyperpolymath
83+
* **Status**: 1 `Admitted` blocking 11 cascading sub-goals on `main`.
84+
Reduced from 910 → 22 → 12 → 11 across PRs
85+
https://github.com/hyperpolymath/ephapax/pull/92[#92],
86+
https://github.com/hyperpolymath/ephapax/pull/102[#102],
87+
https://github.com/hyperpolymath/ephapax/pull/106[#106],
88+
https://github.com/hyperpolymath/ephapax/pull/114[#114],
89+
https://github.com/hyperpolymath/ephapax/pull/116[#116], and
90+
https://github.com/hyperpolymath/ephapax/pull/146[#146] (98.8 %
91+
reduction).
92+
See link:{handoff}[`formal/PRESERVATION-HANDOFF.md`] for the per-PR
93+
diagnostic narrative.
94+
* **Load-bearing caveat**: the `preservation` theorem as stated on
95+
`main` is *not just unproven — it is FALSE*.
96+
link:{counterexample}[`formal/Counterexample.v`] on branch
97+
`proof/l1-region-threading-design` exhibits a verified
98+
counterexample (three lemmas `Qed`): an expression
99+
`EPair (ERegion r1 (ELoc l0 r0)) (ELoc l1 r1)` that types at
100+
`[r0; r1]`, single-steps under the current rules, and the resulting
101+
expression does not type at any region environment derived from
102+
`[r0]`. Sibling sub-expressions in compound forms (`T_Pair`,
103+
`T_Let`, `T_App`, `T_StringConcat`, `T_If`, `T_Case`, …) share the
104+
same region environment `R`; if one sibling exits a region the next
105+
sibling depends on, the typing judgment has no place to record that
106+
dependency. Closing the remaining 11 sub-goals on `main` is
107+
therefore *not* the closure path.
108+
* **Plan**: the four-layer redesign at
109+
link:{design}[`formal/PRESERVATION-DESIGN.md`] (branch
110+
`proof/l1-region-threading-design`; owner interpretation B ratified
111+
2026-05-26 — Echo as L3 residue, with interpretation A "Echo as
112+
operational foundation" parked as a v2 research track in §12.16):
113+
+
114+
--
115+
** **L1** — restate `has_type` to thread `R_in / R_out` the same way
116+
the linearity context `G` is already threaded; reprove
117+
preservation; `Counterexample.v` becomes a regression test.
118+
In-flight on the design branch (PRs
119+
https://github.com/hyperpolymath/ephapax/pull/155[#155],
120+
https://github.com/hyperpolymath/ephapax/pull/157[#157],
121+
https://github.com/hyperpolymath/ephapax/pull/158[#158],
122+
https://github.com/hyperpolymath/ephapax/pull/159[#159],
123+
https://github.com/hyperpolymath/ephapax/pull/160[#160],
124+
https://github.com/hyperpolymath/ephapax/pull/161[#161],
125+
https://github.com/hyperpolymath/ephapax/pull/162[#162],
126+
https://github.com/hyperpolymath/ephapax/pull/163[#163]):
127+
`Semantics_L1.v` skeleton + `preservation_l1` stated; 29/33
128+
cases closed; region-env weakening + region-liveness invariant
129+
landed; 4 admits surface a residual R-weakening gap; 2 of 6
130+
weakening admits closed.
131+
** **L2** — modality parameter on `has_type` (`m ∈ {Linear,
132+
Affine}`) + Linear ⇒ Affine weakening lemma. This introduces a
133+
mechanised `ephapax-affine` judgment for the first time; without
134+
L2, the affine sublanguage has only Rust `AffineChecker`
135+
behavioural tests.
136+
** **L3** — `formal/Echo.v` (residue / proof-carrying region exit +
137+
drop). Theory upstream at `~/developer/repos/echo-types/`.
138+
** **L4** — dyadic mode-elaboration soundness (research-tier, months+,
139+
not in scope for the L1/L2/L3 chain).
140+
--
141+
* **Deadline**: INDEFINITE on `main` until PR
142+
https://github.com/hyperpolymath/ephapax/pull/153[#153] (the design
143+
+ L1 rollup) merges. After #153 lands, L1 closure deadline becomes
144+
2026-Q3 (3–6 weeks focused work per the design doc estimate).
145+
* **Cross-references**:
146+
link:{roadmap}[`ROADMAP.adoc` § "Preservation closure plan"],
147+
`formal/PRESERVATION-DESIGN.md` §12.15 (proof-debt status section),
148+
`formal/PRESERVATION-DESIGN.md` §12.15.4 (what L1 does *not*
149+
close — namely the affine side, which needs L2 + the weakening
150+
lemma).
151+
152+
== What this repo does *not* establish today
153+
154+
Per `formal/PRESERVATION-DESIGN.md` §12.15.4, even after the in-flight
155+
L1 work lands, the following remain open and are tracked here so
156+
downstream consumers do not overclaim:
157+
158+
* The `ephapax-affine` sublanguage is not separately mechanised.
159+
Rust `LinearChecker` and `AffineChecker` are independent
160+
(behavioural tests only); the Coq judgment covers a single
161+
judgment resembling linear discipline. The Linear ⇒ Affine lemma
162+
is L2 work, not L1.
163+
* No mechanised correspondence between the Rust checkers and the Coq
164+
judgment.
165+
* L3 `formal/Echo.v` does not exist; the theory lives upstream at
166+
`hyperpolymath/echo-types`.
167+
* L4 mode-elaboration soundness is a research track, not scheduled.
168+
169+
Per the policy schema, these are *plan items* rather than (d) DEBT
170+
entries — they have no current escape-hatch site to point at; they
171+
are future judgments that have not yet been written. They are listed
172+
here so that any reader using this document to gauge ephapax
173+
soundness sees the full picture, not just the Admitted-marker count.
174+
175+
== Cross-references
176+
177+
* link:{policy}[standards#203] — trusted-base reduction policy
178+
(canonical estate-wide definition)
179+
* link:{handoff}[`formal/PRESERVATION-HANDOFF.md`] — per-PR
180+
diagnostic narrative for the `preservation` closure
181+
* link:{roadmap}[`ROADMAP.adoc` § "Preservation closure plan"] —
182+
canonical 5-phase closure plan
183+
* `formal/PRESERVATION-DESIGN.md` (on branch
184+
`proof/l1-region-threading-design`) — four-layer redesign
185+
* `feedback_ephapax_affine_proofs_not_done` (user auto-memory) —
186+
recurring disambiguation: ephapax-affine ≠ AffineScript, and the
187+
affine side is not mechanised in this repo

0 commit comments

Comments
 (0)