Skip to content

Commit e7b74ed

Browse files
hyperpolymathclaude
andcommitted
fix(proofs/idris2): RMO.idr hardwareEraseIrreversible single-line signature (parse fix)
The pre-existing multi-line signature hardwareEraseIrreversible : (proof : HardwareEraseProof) -> -- No recovery function exists (recovery : () -> Filesystem) -> Void failed to parse under Idris2 0.8.0 with "Expected a type declaration" at the trailing colon of `hardwareEraseIrreversible :`. Sanity check (replacing the body with `hardwareEraseIrreversible : Bool`) confirmed the parser proceeded past the declaration, isolating the failure to this specific multi-line shape. Suspected trigger: the combination of a `--` line comment inside the type signature plus a `() -> ...` parameter, which the 0.8.0 parser mis-recovers from. The single-line signature avoids both potential triggers and parses cleanly. Same semantics: hardwareEraseIrreversible : HardwareEraseProof -> (Unit -> Filesystem) -> Void Switched `()` to `Unit` to be explicit (both denote the same type; `Unit` is the more conventional form for a parameter type). The body is unchanged (still `?hardwareEraseIrreversibleProof` — separate proof debt tracked under #89's parked sub-markers). Verified locally: `idris2 --build` now proceeds past `hardwareEraseIrreversible`. The next pre-existing parse error is at the `AuditEntry` record's dependent `proof : ObliterationProof path` field (separate sub-issue, addressed in parallel). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9895bb4 commit e7b74ed

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

  • proofs/idris2/src/Filesystem

proofs/idris2/src/Filesystem/RMO.idr

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,13 @@ data HardwareEraseProof : Type where
203203
(timestamp : Integer) ->
204204
HardwareEraseProof
205205

206-
||| Hardware erase is absolutely irreversible
207-
|||
206+
||| Hardware erase is absolutely irreversible.
208207
||| Even with physical access to the device, data cannot be recovered.
208+
||| The recovery function is parameterised by `Unit` so it represents
209+
||| any nullary recovery procedure ("just try and reconstruct").
209210
export
210-
hardwareEraseIrreversible :
211-
(proof : HardwareEraseProof) ->
212-
-- No recovery function exists
213-
(recovery : () -> Filesystem) ->
214-
Void
215-
hardwareEraseIrreversible (MkHardwareEraseProof device method ts) recovery =
216-
-- Physical impossibility: data is gone at the hardware level
217-
-- Magnetic domains/flash cells are reset
218-
-- This is guaranteed by hardware specifications (NIST SP 800-88 Purge/Destroy)
211+
hardwareEraseIrreversible : HardwareEraseProof -> (Unit -> Filesystem) -> Void
212+
hardwareEraseIrreversible (MkHardwareEraseProof _ _ _) _ =
219213
?hardwareEraseIrreversibleProof
220214

221215
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)