Commit 8d1c48e
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#31)
* 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 Idris2 ABI proofs so they genuinely compile and verify
The src/interface/abi ABI files were scaffolded from a template and never
compiler-checked. This makes the whole ABI build clean under Idris2 0.7.0
(idris2 --build otpiser-abi.ipkg: zero errors, zero warnings) with genuine
proofs throughout (no believe_me/assert/postulate/holes).
Types.idr:
- Replace the non-compiling `decEq _ _ = No absurd` catch-alls with explicit
off-diagonal cases (No (\case Refl impossible)) for SupervisorStrategy and
the 7-constructor Result enum; add `import Decidable.Equality`.
- Fix createHandle smart constructor to discharge the {auto 0 nonNull} proof
via `choose (ptr /= 0)`.
- Replace `thisPlatform = %runElab ...` (needs ElabReflection) with a plain
value (Linux).
- Reorder ChildType before ChildSpec (use-before-definition).
- Fix HasWorkers.HasChildWorker unbindable implicit by naming the tail vector.
- Fix CPtr: `Bits (ptrSize p)` is ill-typed (Bits is an interface); map each
platform to a concrete pointer-width integer type.
- Make treeSize/workerCount/treeDepth pass totality with explicit structural
folds over the child Vect (recursion through `map` was not seen as total).
Layout.idr:
- paddingFor: replace `alignment - (...)` (Nat has no Neg) with `minus`;
import Data.Nat.
- Add sound `decDivides`/`decFieldsAligned` decision procedures; rewrite
`checkCABI` to use them instead of a `?fieldsAlignedProof` hole.
- Make `alignUpDivides`/`verifyLayout` discharge the StructLayout obligations
via `choose` + `decDivides` (division never reduces under Refl).
- Supply concrete StructLayout proofs explicitly: {sizeCorrect = Oh} and
{aligned = DivideBy k Refl}.
- offsetInBounds: change the unsound universally-quantified `So (...)` to a
decidable `Maybe (So (...))` via `choose`.
- Rename shadowing implicit `n` bindings to `k`.
Foreign.idr:
- Move the prim__getString foreign declaration above its first use so its
`Bits64 -> String` type is in scope (forward ref was resolving to the
support `Ptr String` variant and failing to unify).
Proofs.idr (new): machine-checked theorems —
- supervisorNodeCompliant / childSpecCompliant / genServerCallbackCompliant:
direct FieldsAligned witnesses (one DivideBy per field) proving each
concrete layout is C-ABI compliant.
- okIsZero, nullPointerIsFour, okDistinctFromMalformed: pin the Result wire
encoding; strategyEncodingRoundTrips re-exports the round-trip theorem.
Buildability: move flat files to Otpiser/ABI/ nested layout; add
otpiser-abi.ipkg; ignore Idris build artefacts (**/build/, *.ttc, *.ttm).
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 a54e3e7 commit 8d1c48e
6 files changed
Lines changed: 298 additions & 56 deletions
File tree
- src/interface/abi
- Otpiser/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: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
| |||
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 251 | + | |
| 252 | + | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
| |||
Lines changed: 70 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
38 | 54 | | |
39 | 55 | | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
43 | 59 | | |
44 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
45 | 65 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 66 | + | |
| 67 | + | |
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
| |||
77 | 96 | | |
78 | 97 | | |
79 | 98 | | |
80 | | - | |
| 99 | + | |
81 | 100 | | |
82 | 101 | | |
83 | 102 | | |
| |||
86 | 105 | | |
87 | 106 | | |
88 | 107 | | |
89 | | - | |
| 108 | + | |
90 | 109 | | |
91 | 110 | | |
92 | 111 | | |
93 | | - | |
| 112 | + | |
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
97 | 116 | | |
98 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
99 | 120 | | |
100 | | - | |
| 121 | + | |
101 | 122 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
106 | 132 | | |
107 | 133 | | |
108 | 134 | | |
| |||
133 | 159 | | |
134 | 160 | | |
135 | 161 | | |
| 162 | + | |
| 163 | + | |
136 | 164 | | |
137 | 165 | | |
138 | 166 | | |
| |||
157 | 185 | | |
158 | 186 | | |
159 | 187 | | |
| 188 | + | |
| 189 | + | |
160 | 190 | | |
161 | 191 | | |
162 | 192 | | |
| |||
185 | 215 | | |
186 | 216 | | |
187 | 217 | | |
| 218 | + | |
| 219 | + | |
188 | 220 | | |
189 | 221 | | |
190 | 222 | | |
| |||
215 | 247 | | |
216 | 248 | | |
217 | 249 | | |
218 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
219 | 263 | | |
220 | 264 | | |
221 | 265 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
233 | 269 | | |
234 | 270 | | |
235 | 271 | | |
| |||
243 | 279 | | |
244 | 280 | | |
245 | 281 | | |
246 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
247 | 285 | | |
248 | | - | |
249 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 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 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
0 commit comments