Skip to content

Commit 2e36ad6

Browse files
author
Claude
committed
fix(framework): complete and wire in the Progressive assurance proofs
Ochrance.Framework.Progressive was a dead orphan (not in any ipkg) with an incomplete Ord instance ('-- ... [Remaining cases]') and an undefined 'atLeast', so its SatisfiesMinimum / attestedSatisfiesLax threshold proof could not check. - Define rank/atLeast, add Eq, complete the Ord instance (the same fix already landed in ochrance-framework). - Add the module to ochrance.ipkg so the threshold proof is now built and CI-verified rather than dead code. Verified: ochrance.ipkg builds 16/16; attestedSatisfiesLax and atLeast are total.
1 parent 0a35a28 commit 2e36ad6

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

ochrance-core/Ochrance/Framework/Progressive.idr

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,29 @@ module Ochrance.Framework.Progressive
2323
public export
2424
data VerificationMode = Lax | Checked | Attested
2525

26-
||| ORDERING: Defines the relationship Lax < Checked < Attested.
26+
||| RANK: numeric strictness, with Lax < Checked < Attested.
27+
public export
28+
rank : VerificationMode -> Nat
29+
rank Lax = 0
30+
rank Checked = 1
31+
rank Attested = 2
32+
33+
||| Is `mode` at least as strict as `threshold`?
34+
public export
35+
atLeast : (threshold : VerificationMode) -> (mode : VerificationMode) -> Bool
36+
atLeast threshold mode = rank threshold <= rank mode
37+
38+
public export
39+
Eq VerificationMode where
40+
Lax == Lax = True
41+
Checked == Checked = True
42+
Attested == Attested = True
43+
_ == _ = False
44+
45+
||| ORDERING: Defines the relationship Lax < Checked < Attested via `rank`.
2746
public export
2847
Ord VerificationMode where
29-
compare Lax Lax = EQ
30-
compare Lax _ = LT
31-
compare Checked Attested = LT
32-
-- ... [Remaining cases]
48+
compare x y = compare (rank x) (rank y)
3349

3450
--------------------------------------------------------------------------------
3551
-- Proof Witnesses

ochrance.ipkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ modules = Ochrance.A2ML.Types
1717
, Ochrance.Framework.Interface
1818
, Ochrance.Framework.Proof
1919
, Ochrance.Framework.Error
20+
, Ochrance.Framework.Progressive
2021
, Ochrance.FFI.Crypto
2122
, Ochrance.Util.Hex
2223
, Ochrance.Filesystem.Types

0 commit comments

Comments
 (0)