Skip to content

Commit 9ebe867

Browse files
hyperpolymathclaude
andcommitted
feat(proofs): witness-requiring attestations (A7, PROOF-NEEDS §P1.1)
Replaces every ceremonial nullary attestation in Proofs.idr with an evidence-consuming variant. The top-level certificate can no longer be constructed from thin air — each level's attestation now requires a matching witness from its level module: attestL1_InstructionValid :: Schema -- Region.idr attestL2_RegionBound :: FieldIn name schema -- Region.idr attestL3_TypeCompat :: WasmTypeCompat a b -- MultiModule.idr attestL4_NullSafe :: Pointer.Ptr k s l NonNull attestL5_BoundsProof :: InBounds idx count -- Region.idr attestL6_ResultType :: AccessResult ty -- TypedAccess.idr attestL7_AliasFree :: ExclusiveWitness s -- Pointer.idr attestL8_EffectSafe :: EffectSubsumes d a -- Effects.idr (pre-existing) attestL9_LifetimeSafe :: Lifetime.Outlives rl sl attestL10_Linear :: CompletedProtocol tok -- Linear.idr simpleReadCert, fullCert12, and fullCert15 now take every required witness as an explicit argument and thread them through. Witnesses are compile-time-only (erased at runtime), so there is zero runtime cost — but the certificate cannot be built without real proof artefacts. Qualification: `Lifetime` / `Outlives` resolve to Lifetime.idr's propositional forms; Pointer.Ptr's lifetime parameter takes Levels.Lifetime, since Pointer.idr imports from Levels.idr. A short comment in Proofs.idr explains the name clash. Zero believe_me / assert_total / postulate / sorry; %default total preserved; panic-attack clean. PROOF-NEEDS.md §P1.1 marked DONE; LEVEL-STATUS.md Proofs.idr row updated with the new witness-taking API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 72e2901 commit 9ebe867

3 files changed

Lines changed: 259 additions & 88 deletions

File tree

LEVEL-STATUS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ toolchain remains future work.
9696
| SessionProtocol.idr | 0 | 0 | 0 | In package (v1.3 / L14) |
9797
| ResourceCapabilities.idr | 0 | 0 | 0 | In package (v1.4 / L15) |
9898
| Choreography.idr | 0 | 0 | 0 | In package (v1.5 / L16) |
99-
| Proofs.idr | 0 | 0 | 0 | In package |
99+
| Proofs.idr | 0 | 0 | 0 | In package. Attestation API hardened A7 (2026-04-18): every L1-L10 attestation now requires a witness from its level module (Schema / FieldIn / WasmTypeCompat / Ptr-NonNull / InBounds / AccessResult / ExclusiveWitness / EffectSubsumes / Lifetime.Outlives / CompletedProtocol). `simpleReadCert` / `fullCert12` / `fullCert15` thread witnesses per level; the certificate cannot be constructed without real proof artefacts. |
100100
| Tropical.idr | 0 | 0 | 0 | In package (A1, 2026-04-18) |
101101
| Epistemic.idr | 0 | 0 | 0 | In package (A1, 2026-04-18) |
102102
| Echo.idr | 0 | 0 | 0 | In package (A0, 2026-04-18) |

PROOF-NEEDS.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,36 @@ to sanity-check the statement before proving it.
233233
### P1 — Security (the parts where ceremony ≠ evidence)
234234

235235
**P1.1. Replace every ceremonial attestation in `Proofs.idr` with
236-
evidence-consuming versions.** Current state:
236+
evidence-consuming versions. ✅ DONE 2026-04-18 (A7).**
237+
238+
Every nullary attestation in `Proofs.idr` has been promoted to require
239+
a witness from its level's proof module:
240+
241+
| Attestation | Witness type | Source module |
242+
|---|---|---|
243+
| `attestL1_InstructionValid` | `Schema` | Region.idr |
244+
| `attestL2_RegionBound` | `FieldIn name schema` | Region.idr |
245+
| `attestL3_TypeCompat` | `WasmTypeCompat a b` | MultiModule.idr |
246+
| `attestL4_NullSafe` | `Pointer.Ptr k s l NonNull` | Pointer.idr |
247+
| `attestL5_BoundsProof` | `InBounds idx count` | Region.idr |
248+
| `attestL6_ResultType` | `AccessResult ty` | TypedAccess.idr |
249+
| `attestL7_AliasFree` | `ExclusiveWitness s` | Pointer.idr |
250+
| `attestL8_EffectSafe` | `EffectSubsumes declared actual` | Effects.idr (pre-existing) |
251+
| `attestL9_LifetimeSafe` | `Lifetime.Outlives rl sl` | Lifetime.idr |
252+
| `attestL10_Linear` | `CompletedProtocol tok` | Linear.idr |
253+
254+
`simpleReadCert`, `fullCert12`, and `fullCert15` now thread each of the
255+
required witnesses through their signatures. The top-level certificate
256+
cannot be constructed without a proof term for every level it claims.
257+
258+
Qualification note: `Lifetime` and `Outlives` are resolved as
259+
`Lifetime.Lifetime` / `Lifetime.Outlives` (from Lifetime.idr), while
260+
`Pointer.Ptr`'s lifetime parameter takes `Levels.Lifetime` (which is
261+
what Pointer.idr itself imports from Levels.idr). A small comment in
262+
Proofs.idr explains the qualification; both `Lifetime` types remain
263+
in the codebase for now.
264+
265+
**Original task description preserved for history:** Current state:
237266

238267
```
239268
attestL10_Linear : LevelAttestation

0 commit comments

Comments
 (0)