Commit 4f44d46
ABI Layer 5: end-to-end soundness capstone certificate (#38)
* abi: prove OneForOne restart invariant (Layer 2 semantic proof)
Add Otpiser.ABI.Semantics: a faithful Idris2 model of a one-for-one OTP
supervisor (children keyed by id, each Running/Failed) and a restart step,
with machine-checked proofs of the headline fault-tolerance invariant:
- restartPreservesChildSet: restarting any child leaves the ordered set
of supervised child ids unchanged (real propositional equality).
- restartLeavesOthersUntouched: every sibling whose id differs from the
target survives the restart byte-for-byte identical (Elem soundness).
- restartHeadRuns / RestartedRunning: the targeted child is set Running.
Positive controls exhibit concrete witnesses over a 3-worker supervisor;
the negative control (negativeSiblingNotReset) refutes, by machine, the
OneForAll-style claim that a failed sibling is reset — establishing the
property is non-vacuous. No believe_me / postulate / assert_total.
Registered in otpiser-abi.ipkg; ABI builds clean with zero warnings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
* abi: add Layer-3 rest-for-one invariants (idempotence + prefix-untouched)
Add Otpiser.ABI.Invariants, a second machine-checked theorem distinct from
and deeper than the Layer-2 one-for-one flagship. Reuses the Semantics model
(Child/ChildStatus/Supervisor) and reasons about the rest_for_one transition:
T1 IDEMPOTENCE (algebraic law): restForOne target . restForOne target
= restForOne target -- a genuine fixpoint, proven via a triggered-branch
lemma; not a restatement of "siblings untouched".
T2 child-id-set preservation across the rest-for-one transition.
T3 prefix-untouched: children strictly before the target survive identically
(the directional core of rest-for-one), via a BeforeTarget certificate.
T4 sound+complete Dec (decIsTargetHead) + certifier.
Five positive controls (concrete witnesses incl. Refl-checked transition shape
and idempotence) and three negative/non-vacuity controls (Not-Elem refutation,
decision refutation, not-the-identity). No believe_me/postulate/assert_total;
%default total; SPDX MPL-2.0. Registered last in otpiser-abi.ipkg. Clean build
(0 warnings); adversarial false-equality check rejected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
* Add Layer 4 FfiSeam proof sealing the ABI<->FFI seam
Prove the FFI result-code/enum encoding is sound: distinct ABI outcomes
never collide on the C wire (injectivity) and the wire integer faithfully
round-trips back to the ABI value (lossless decode).
- intToResult decoder + resultRoundTrip (Refl per constructor)
- resultToIntInjective derived from the round-trip (justInjective + cong)
- same treatment for SupervisorStrategy (reuses Types.strategyRoundTrip)
and ChildRestartType (new decoder + round-trip)
- positive controls (concrete decodes = Refl) and negative/non-vacuity
controls (distinct codes have distinct wire ints, machine-checked)
Genuine total proofs: no believe_me/postulate/assert_total/etc.
%default total; zero build warnings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
* Add Layer-5 capstone: end-to-end ABI soundness certificate
Assemble the existing per-layer proofs into one inhabited value
`abiContractDischarged : ABISound`, tying manifest semantics ->
ABI proofs (flagship one-for-one + rest-for-one idempotence) ->
FFI seam injectivity into a single end-to-end soundness statement.
Fields reuse only already-exported witnesses/theorems:
- Layer 2 (Semantics): positiveTargetRunning, positiveSiblingUntouched
- Layer 3 (Invariants): restForOneIdempotent
- Layer 4 (FfiSeam): resultToIntInjective
The value typechecks iff every prior layer is sound. An adversarial
false certificate (bogus sibling witness) is rejected by the type
checker, confirming non-vacuity. No believe_me/postulate/assert_total.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
---------
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5d14cb4 commit 4f44d46
2 files changed
Lines changed: 101 additions & 0 deletions
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
0 commit comments