ABI Layer 5: end-to-end soundness capstone certificate#76
Merged
Conversation
Add Iseriser.ABI.Semantics proving the headline domain property: a generated -iser scaffold is Conformant exactly when all five required components (Manifest, Idris2 ABI, Zig FFI, Codegen, Rust CLI) are present. Conformant is built from genuine Data.List.Elem membership obligations with no catch-all constructor, so a scaffold missing any component has no witness. Includes a sound+complete decConformant : (s) -> Dec (Conformant s), a soundness fact certifyConformantSound, a positive control (completeIsConformant via explicit Elem positions), and a negative control (ffiMissingNotConformant : Not (Conformant ffiMissing)). Non-vacuity confirmed: a deliberately-false Has Ffi witness for the FFI-missing scaffold is rejected by idris2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Add Iseriser.ABI.Invariants over the existing Layer-2 Semantics model
(Component/Scaffold/Has/Conformant). Two new, deeper, distinct theorems:
1. Generation soundness (correct-by-construction): genScaffold provably
emits (s ** Conformant s) for any LanguageModel, with a corollary
tying it back to the Layer-2 certifier (conformantCertifies).
2. Upward-closure / monotonicity: conformantStable proves Conformance is
preserved under extension, via a genuine Elem-weakening lemma
(elemAppendRight) — an algebraic closure law, not the Layer-2 decision.
Includes a sound+complete Dec (decExtendConformant), a positive control
(extendedGeneratedConformant) and a non-vacuity negative control
(extendedBrokenNotConformant : Not ...). Builds clean with zero warnings;
adversarial false proof rejected. No believe_me/postulate/assert_total.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Add Iseriser.ABI.FfiSeam proving the resultToInt encoding is sound: - intToResult decoder + resultRoundTrip (lossless/faithful encoding) - resultToIntInjective derived from round-trip (distinct outcomes never collide on the wire) - positive controls (concrete decodes by Refl) and a machine-checked non-vacuity control (resultToInt Ok /= resultToInt Error) Genuine total proof: no believe_me/postulate/assert_total/etc. Registered in iseriser-abi.ipkg; package builds clean with zero warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Assemble the existing Layer-2/3/4 ABI proofs into one inhabited value,
Iseriser.ABI.Capstone.abiContractDischarged : ABISound, with fields:
- flagship : Conformant Semantics.completeScaffold
(reuses Semantics.completeIsConformant)
- invariant : Conformant (extend [Manifest] generatedScaffold)
(reuses Invariants.extendedGeneratedConformant)
- ffiInjective : resultToInt injectivity
(reuses FfiSeam.resultToIntInjective)
Pure composition of already-exported witnesses: if any prior layer were
unsound the capstone would not typecheck. Adversarial check confirms a
wrong-type witness in the flagship slot is rejected. %default total, SPDX,
zero warnings. ipkg updated (Capstone listed last).
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 scaffold conformance), the deeper invariant (L3 generation soundness), 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