You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EXPLAINME.adoc
+50-15Lines changed: 50 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,37 +7,72 @@ The README makes claims. This file backs them up.
7
7
8
8
[quote, README]
9
9
____
10
-
Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
10
+
Ochránce is a neurosymbolic filesystem verification framework built with Idris2 dependent types. It provides mathematically proven guarantees about filesystem integrity through A2ML (Attestation & Audit Markup Language), verified Merkle trees with size-indexed proofs, and linear type repair operations.
11
11
____
12
12
13
-
== Technology Choices
13
+
Three components orchestrate this: A2ML parser/validator (parses filesystem manifests), verified Merkle trees (compile-time structure proofs), and ECHIDNA integration (neural proof synthesis for verification).
14
14
15
-
[cols="1,2"]
16
-
|===
17
-
| Technology | Learn More
15
+
== Two Verifiable Claims from How-It-Works
18
16
19
-
| **Zig** | https://ziglang.org
20
-
| **Idris2 ABI** | https://www.idris-lang.org
21
-
|===
17
+
=== Claim 1: A2ML Lexer and Parser Are Structurally Recursive and Total
18
+
19
+
**Location**: `/var/mnt/eclipse/repos/ochrance/ochrance-core/A2ML/Lexer.idr` and `/var/mnt/eclipse/repos/ochrance/ochrance-core/A2ML/Parser.idr` (Idris2 modules)
20
+
21
+
**How verified**: Both modules use the `%default total` directive, requiring all functions to be total (no partial match, no undefined behavior). The lexer is structurally recursive: it tokenizes input by consuming characters and recursing on the remainder (proof: input size strictly decreases). The parser is similarly total: it parses tokens using sized types (`List (n : Nat)`) to guarantee termination (proof: token list shrinks). README (§Overview) claims "A2ML Parser/Validator" with compile-time structure proofs; this is verified by the Idris2 type checker itself — if either module had a partial function, `idris2 --check` would reject it with an error, not compile.
22
+
23
+
**Caveat**: Idris2 totality checking is a sound approximation but not perfect. Deeply nested mutual recursion can escape detection in rare cases, though practice shows this is extremely rare.
24
+
25
+
=== Claim 2: Verified Merkle Tree Size Guarantees Are Compile-Time Proofs
26
+
27
+
**Location**: `/var/mnt/eclipse/repos/ochrance/ochrance-core/Framework/Merkle.idr` (Idris2 Merkle tree with size-indexed types)
28
+
29
+
**How verified**: The Merkle tree is defined as a size-indexed binary tree: `MerkleTree : (size : Nat) → Type`. At compile time, Idris2 verifies that all leaf nodes are at depth `log2(size)`. The tree operations (leaf insertion, hash computation, proof generation) take dependent proofs that structure is maintained. README (§Architecture) claims "Verified Merkle trees — Size-indexed binary trees with compile-time structure proofs." This is proven by the type signature itself: if you try to construct a tree of size 8 with only 7 leaves, the type checker rejects it because the dependent type `MerkleTree 8` requires exactly 8 leaves.
30
+
31
+
**Caveat**: The placeholder hash functions in `Merkle.idr` use XOR, not cryptographic hashes (BLAKE3/SHA-256). This is noted in the CLAUDE.md as a critical TODO. The structure proofs are valid but cryptographic strength is absent.
22
32
23
33
== Dogfooded Across The Account
24
34
25
-
Uses the hyperpolymath ABI/FFI standard (Idris2 + Zig). Same pattern used across
26
-
https://github.com/hyperpolymath/proven[proven],
27
-
https://github.com/hyperpolymath/burble[burble], and
Ochránce uses the hyperpolymath ABI/FFI standard: Idris2 specs → Zig FFI → C bindings. The filesystem module is the reference VerifiedSubsystem implementation for the ochrance-framework (which defines an abstract interface for Filesystem, Memory, Network, Crypto modules). This pattern is reused across proven (formally verified library) and feedback-o-tron (Idris2 ABI for submitter credentials).
36
+
37
+
Also integrates with ECHIDNA for neural proof synthesis — FFI calls to libechidna.so via Zig.
29
38
30
39
== File Map
31
40
32
41
[cols="1,2"]
33
42
|===
34
43
| Path | What's There
35
44
36
-
| `src/` | Source code
37
-
| `ffi/` | Foreign function interface
38
-
| `test(s)/` | Test suite
45
+
| `ochrance-core/A2ML/Lexer.idr` | Structurally recursive, total lexer for A2ML markup (tokenizes manifest)
46
+
| `ochrance-core/A2ML/Parser.idr` | Sized-type parser: parses tokens to AST with compile-time termination proof
0 commit comments