ABI Layer 5: end-to-end soundness capstone certificate#38
Merged
Conversation
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
…hed)
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
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Layer 5 (the capstone, completing the 5-layer proof track): a new
*.ABI.Capstonemodule importing every prior layer and assembling a single inhabitedABISoundcertificate (abiContractDischarged) from the real exported witnesses of the flagship property (L2 one-for-one restart), the deeper invariant (L3 rest-for-one idempotence), and the FFI-seam injectivity (L4). One end-to-end soundness statement.Genuine composition only — reuses real exported names.
Testing
Idris2 0.7.0
--build→ exit 0, zero warnings. Adversarial: a bogus-field certificate was rejected.build/removed. Nobelieve_me/postulate/sorry.🤖 Generated with Claude Code
https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Generated by Claude Code