Commit cb0826d
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#42)
* Add SPDX header to LICENSE and set Cargo.toml license field
The governance/licence-consistency check requires an SPDX-License-Identifier
header on the LICENSE file and a `license` field in the manifest. The LICENSE
body is MPL-2.0 text, so stamp `SPDX-License-Identifier: MPL-2.0` (matching the
actual body) and set `license = "MPL-2.0"` (replacing `license-file`).
Verified with standards/scripts/check-licence-consistency.sh (passes).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Normalize licensing to MPL-2.0 (code) + CC-BY-SA-4.0 (docs)
Make the repo's licensing single and consistent, matching the wokelangiser
reference policy and the merged iseriser pattern:
- Remove contradictory PMPL-1.0-or-later / Palimpsest self-claims from README
badges/footers, QUICKSTART, RSR_OUTLINE, STATE-VISUALIZER, and machine-readable
governance (META, stapeln, deny.toml allow-list, copilot/AGENTIC SPDX
directives, Trust/Must LICENSE-content checks, per-project CLAUDE.md).
- Encode the docs split in REUSE dep5: *.adoc/*.md/docs/** -> CC-BY-SA-4.0,
everything else -> MPL-2.0.
- READMEs show MPL-2.0 (code) + CC-BY-SA-4.0 (docs) badges; full texts live in
LICENSES/; root LICENSE stays MPL-2.0 for GitHub's licence chip.
Preserves legitimate non-self references: cargo-deny's AGPL deny-list, the
"never use AGPL" estate policy, and the Contributor Covenant CoC.
Verified: standards/scripts/check-licence-consistency.sh passes; no residual
PMPL/Palimpsest self-claims remain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Fix k9iser Idris2 ABI proofs to genuinely compile and verify
The src/interface/abi ABI was scaffolded from a template and never
compiler-checked. Make it build clean under Idris2 0.7.0 with real proofs.
Types.idr:
- Replace %runElab thisPlatform stub (needed ElabReflection) with plain Linux.
- DecEq Result: replace non-compiling `decEq _ _ = No absurd` with all 56
explicit off-diagonal `No (\case Refl impossible)` cases over 8 constructors.
- createHandle: solve the auto `So (ptr /= 0)` via `choose` instead of leaving
the MkHandle nonNull proof unsolved.
- validationConsistent: was an unsound universally-quantified `So`; change to a
decided `Maybe (So ...)` via choose.
- CPtr: `Bits (ptrSize p)` does not typecheck (Bits is a class); represent a
pointer as CSize p (pointer-sized integer).
- cSizeOf/cAlignOf: drop the invalid `CInt _`/`CSize _` type-alias matches;
the aliases reduce to Bits32/Bits64 handled by concrete clauses.
- Annotate FFI format-code literals as Bits32.
Layout.idr:
- paddingFor: use Nat `minus` instead of `-` (Nat has no Neg).
- Replace alignUpCorrect (`DivideBy ... Refl` on symbolic input) with sound
decDivides + alignUpDivides.
- Concrete StructLayouts: supply erased proofs {sizeCorrect = Oh} and
{aligned = DivideBy k Refl} (40 = 5*8, 32 = 4*8).
- checkCABI: implement via decFieldsAligned (was a ?hole).
- verifyLayout: used nonexistent decSo and dropped the aligned obligation;
reimplement returning Maybe with both obligations discharged.
- offsetInBounds: was an unsound universal `So`; change to decided Maybe.
- fieldOffset: return Maybe (Nat, Field) (the `(n : Nat ** Field)` auto-bound
a stray implicit).
- Rename Vect n -> Vect k to avoid shadowing warnings.
Proofs.idr (new): machine-checked theorems —
- k9ContractCompliant, validationResultCompliant, mustRuleCompliant built
directly from per-field DivideBy witnesses (offset = k * alignment).
- okIsZero, trustFailureIsSeven (result-code encoding the FFI depends on).
- kennelIsZero, tiersOrdered (safety-tier ordering).
Build:
- Move flat files to src/interface/abi/K9iser/ABI/ so paths match namespaces.
- Add src/interface/abi/k9iser-abi.ipkg.
- Ignore Idris2 build artifacts (**/build/, *.ttc, *.ttm).
`idris2 --build k9iser-abi.ipkg` exits 0 with zero warnings and zero errors.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
---------
Co-authored-by: Jonathan D.A. Jewell <paraordinate@yahoo.co.uk>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent fb79ccc commit cb0826d
6 files changed
Lines changed: 296 additions & 54 deletions
File tree
- src/interface/abi
- K9iser/ABI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
Lines changed: 83 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
| 31 | + | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
42 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
43 | 63 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
47 | 67 | | |
48 | 68 | | |
49 | 69 | | |
| |||
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
78 | | - | |
| 98 | + | |
79 | 99 | | |
80 | 100 | | |
81 | 101 | | |
| |||
84 | 104 | | |
85 | 105 | | |
86 | 106 | | |
87 | | - | |
| 107 | + | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
91 | | - | |
| 111 | + | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
96 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
97 | 133 | | |
98 | | - | |
| 134 | + | |
99 | 135 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
104 | 145 | | |
105 | 146 | | |
106 | 147 | | |
| |||
132 | 173 | | |
133 | 174 | | |
134 | 175 | | |
| 176 | + | |
| 177 | + | |
135 | 178 | | |
136 | 179 | | |
137 | 180 | | |
| |||
156 | 199 | | |
157 | 200 | | |
158 | 201 | | |
| 202 | + | |
| 203 | + | |
159 | 204 | | |
160 | 205 | | |
161 | 206 | | |
| |||
176 | 221 | | |
177 | 222 | | |
178 | 223 | | |
| 224 | + | |
| 225 | + | |
179 | 226 | | |
180 | 227 | | |
181 | 228 | | |
| |||
206 | 253 | | |
207 | 254 | | |
208 | 255 | | |
209 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
210 | 259 | | |
211 | 260 | | |
212 | 261 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
219 | 265 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
224 | 269 | | |
225 | 270 | | |
226 | 271 | | |
227 | 272 | | |
228 | 273 | | |
229 | 274 | | |
230 | 275 | | |
231 | | - | |
| 276 | + | |
232 | 277 | | |
233 | 278 | | |
234 | | - | |
| 279 | + | |
235 | 280 | | |
236 | 281 | | |
237 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
238 | 286 | | |
239 | | - | |
240 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 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 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
0 commit comments