Commit 8b65384
proof+docs: LevelAttestationW + WitnessCertificate + comprehensive docs sweep (standards#130 long-tail + 2026-05-27 proof-debt pass) (#80)
## Summary
Three stacked slices, now in a single PR because the stacked-PR base
auto-merged immediately on the unprotected branch:
1. **`LevelAttestationW` (originally #80 sole content)** — closes the
standards#130 long-tail residual from the 2026-05-18 PROOF-NEEDS
reconciliation banner: "Stronger 'attestation entails the level's
semantic property' (needs `LevelAttestation` reindexed by witness)
remains tracked future work under standards#130." 15 constructors, 15
smart ctors, 15 extractors, legacy bridge, 15 round-trip `Refl`s,
uniform achievement lemma.
2. **`WitnessCertificate` (folded in from #83)** — extends the
per-attestation witness retention to the WHOLE certificate via an
existential wrapper `SomeAttestationW`. `record WitnessCertificate`
mirrors `ProofCertificate` with witness-carrying levels, plus
`composeWitness`, `WitnessAchieved` predicate, and composition-compat
lemma `composeWitnessLegacyAgree`.
3. **Comprehensive docs sweep (folded in from #84)** — covers PRs #79 +
#80 across every relevant surface: CHANGELOG, PROOF-NEEDS, LEVEL-STATUS,
TEST-NEEDS, README.adoc, docs/supplementary/proof-inventory.adoc,
.machine_readable/6a2/STATE.a2ml, wiki (Home + Phase-0-Status + README +
NEW Proof-Debt-Status.md).
## Design
Mirror of #79's pattern on `VerifierSpec.idr`: constructors carry the
witness, trust-injection moves to construction, downstream consumers get
total extractors instead of `believe_me`-discharged claims.
```idris
-- Slice 1: per-attestation witness retention
data LevelAttestationW : (n : Nat) -> Type where
AttestL7W : {s : Schema}
-> (w : ExclusiveWitness s)
-> LevelAttestationW 7
-- … 14 more, one per level
attestL7W_EntailsAliasFree :
LevelAttestationW 7
-> (s : Schema ** ExclusiveWitness s)
attestL7W_EntailsAliasFree (AttestL7W {s} w) = (s ** w)
-- Slice 2: certificate-level witness retention via existential
data SomeAttestationW : Type where
MkSomeAttW : {n : Nat} -> LevelAttestationW n -> SomeAttestationW
record WitnessCertificate where
constructor MkWitnessCert
witnessLevels : List SomeAttestationW
witnessHighestProven : Nat
witnessMultiModule : List CompatCertificate
witnessToLegacy : WitnessCertificate -> ProofCertificate
composeWitness : WitnessCertificate -> WitnessCertificate -> WitnessCertificate
WitnessAchieved : (n : Nat) -> WitnessCertificate -> Type
```
## What's in the PR
### Slice 1 (LevelAttestationW)
- `data LevelAttestationW : (n : Nat) -> Type` — 15 ctors
- 15 `attestLNW_*` smart constructors
- 15 `attestLNW_Entails<Property>` extractors
- `toLegacy : {n : Nat} -> LevelAttestationW n -> LevelAttestation`
bridge
- 15 round-trip `Refl` equalities
- `attestLW_AchievedIn` uniform achievement lemma
### Slice 2 (WitnessCertificate)
- `data SomeAttestationW` existential wrapper + `someAttLevel` /
`someAttToLegacy` projections
- `record WitnessCertificate` mirror of `ProofCertificate`
- `witnessLevelsToLegacy` (explicit recursion)
- `witnessToLegacy` bridge
- `composeWitness`
- `witnessLevelsToLegacyAppend` (mapAppend-style helper)
- `composeWitnessLegacyAgree` — composing legacy projections equals
projecting witness composition
- `WitnessAchieved` lifted via the bridge; `witnessAchievedIsLegacy`
definitional `Refl`
- `emptyWitnessCertificate`, `singletonWitnessCertificate`, `someAtt`
smart ctors
- `emptyWitnessToLegacy` `Refl` round-trip
### Slice 3 (docs)
- **CHANGELOG.md** — 2026-05-27 proof-debt closure pass section
- **PROOF-NEEDS.md** — 2026-05-27 banner for #79 (items 7+8 closure)
above the existing 2026-05-27 banner for #80 (standards#130 closure)
- **LEVEL-STATUS.md** — extended `Proofs.idr` row; new
`VerifierSpec.idr` row; "Post-codegen verifier (Rust)" §"Spec-of-record
alignment" paragraph
- **TEST-NEEDS.md** — source modules 21 → 22, proof regression 25 → 107
- **README.adoc** — NOTE callout pointing to VerifierSpec +
Proof-Debt-Status wiki
- **docs/supplementary/proof-inventory.adoc** — two new theorem entries
(`thm-verifier-spec-agreement`,
`thm-attestation-entails-semantic-property`)
- **.machine_readable/6a2/STATE.a2ml** — last-updated, session note,
test-surface 545 → 627, 3 new milestones, new
`[proof-debt-closure-pass-2026-05-27]` +
`[long-tail-open-after-2026-05-27]` sections
- **docs/wiki/Home.md** — status + architecture mentions
- **docs/wiki/Phase-0-Status.md** — new tail section
- **docs/wiki/Proof-Debt-Status.md** — NEW comprehensive proof-debt
inventory page
- **docs/wiki/README.md** — page-inventory update
## Erasure / reduction notes
- Type-level indices on the `LevelAttestationW` ctors are
RUNTIME-AVAILABLE (no `{0}`) so extractors can project both the witness
AND the indices.
- `SomeAttestationW`'s `n` is RETAINED for projection via
`someAttLevel`.
- `witnessLevelsToLegacy` is recursive rather than `map`-eta because
Idris2 0.8.0 doesn't reduce `map f []` past the eta-reduced reference.
- `emptyWitnessToLegacy` inlines its LHS (`MkWitnessCert [] 0 []`)
because `let`-bound top-level values don't unfold through `Refl` in
Idris2 0.8.0.
## What this does NOT change
`LevelAttestation`, `MkAttestation`, `attestLN_*`, `attestLN_Sound`,
`LevelAchievedIn`, `composeCertificates`, `ProofCertificate` — all
unchanged.
## Build oracle
```
IDRIS2_PREFIX=\$IDRIS2/0.8.0 idris2 --build src/abi/typed-wasm.ipkg
```
21/21 modules on this branch (VerifierSpec.idr comes from PR #79; once
both #79 and #80 land, count becomes 22/22). rc=0. Zero new `believe_me`
/ `assert_total` / `postulate` / `sorry` / `assert_smaller`. `%default
total` preserved.
## Regression
`tests/proof/regression.mjs` gains 49 Layer 1 assertions covering both
source slices.
## Relationship to other open PRs
- **PR #79** (VerifierSpec items 7/8 bodies) — independent; both close
different post-A10 items. No file overlap on source (different module).
Docs slice mentions both for context.
- **PR #72** (items 5a/5b/A12) — additive overlap on `Proofs.idr` and
`PROOF-NEEDS.md`; mechanical rebase.
- **PR #74** — closed as superseded.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cb7ade0 commit 8b65384
13 files changed
Lines changed: 1310 additions & 16 deletions
File tree
- .machine_readable/6a2
- docs
- supplementary
- wiki
- src/abi/TypedWasm/ABI
- tests/proof
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
| |||
107 | 129 | | |
108 | 130 | | |
109 | 131 | | |
110 | | - | |
111 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
112 | 137 | | |
113 | 138 | | |
114 | 139 | | |
| |||
117 | 142 | | |
118 | 143 | | |
119 | 144 | | |
120 | | - | |
| 145 | + | |
121 | 146 | | |
122 | 147 | | |
123 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
13 | 89 | | |
14 | 90 | | |
15 | 91 | | |
| |||
0 commit comments