Add the C++-aligned Lean disaster recovery model - #8277
Open
Amaury Chamayou (achamayou) wants to merge 8 commits into
Open
Add the C++-aligned Lean disaster recovery model#8277Amaury Chamayou (achamayou) wants to merge 8 commits into
Amaury Chamayou (achamayou) wants to merge 8 commits into
Conversation
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
September 4, 2026 09:18
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two newly added Lean source files are committed with CRLF line endings, which should be normalized to LF for consistency and to avoid future diff/tooling churn.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces a new, pinned Lean package under lean/disaster-recovery/ containing the canonical (C++-aligned) disaster recovery model plus associated safety/liveness proofs and executable “canonical checks”, and adds a dedicated GitHub Actions workflow to build and validate it on relevant PRs.
Changes:
- Add the Lean disaster recovery model (local + global semantics) and proof modules (invariants, quorum uniqueness, committed-prefix safety, temporal progress).
- Add an executable
canonical-checkstarget and an axiom/sorry gate (AxiomChecks.lean) for the project’sDisasterRecoverydeclarations. - Add a PR-scoped CI workflow to install Lean, restore Mathlib cache, build, and run canonical checks.
Custom instructions used:
.github/copilot-instructions.md
File summaries
| File | Description |
|---|---|
lean/disaster-recovery/README.md |
Package overview, proof scope/limits, and validation commands. |
lean/disaster-recovery/lean-toolchain |
Pins the Lean toolchain version for reproducible builds. |
lean/disaster-recovery/lakefile.toml |
Defines the Lean package, Mathlib dependency pin, and executable target. |
lean/disaster-recovery/lake-manifest.json |
Captures resolved Lake dependencies for reproducibility. |
lean/disaster-recovery/.gitignore |
Ignores Lake build artifacts. |
lean/disaster-recovery/DisasterRecovery.lean |
Top-level library module importing all package components. |
lean/disaster-recovery/DisasterRecovery/Protocol/Model.lean |
C++-aligned local state machine + transition function. |
lean/disaster-recovery/DisasterRecovery/Protocol/Temporal.lean |
Local temporal definitions and progress/safety lemmas. |
lean/disaster-recovery/DisasterRecovery/Protocol/Global.lean |
Global semantics (network/sent history/effects) over local transitions. |
lean/disaster-recovery/DisasterRecovery/Protocol/Invariants.lean |
Reachability and well-formedness invariants for global executions. |
lean/disaster-recovery/DisasterRecovery/Protocol/Quorum.lean |
Quorum invariants and quorum-opener uniqueness theorem. |
lean/disaster-recovery/DisasterRecovery/Protocol/Committed.lean |
TxID prefix order + committed-prefix preservation under explicit premises. |
lean/disaster-recovery/DisasterRecovery/Protocol/GlobalTemporal.lean |
Conditional global liveness/progress results under fairness premises. |
lean/disaster-recovery/CanonicalTests.lean |
Executable canonical behavior checks + small-state exploration. |
lean/disaster-recovery/AxiomChecks.lean |
Rejects sorryAx dependencies in DisasterRecovery.* declarations. |
.github/workflows/README.md |
Documents the new Lean DR workflow purpose and scope. |
.github/workflows/lean-disaster-recovery.yml |
Adds PR workflow to install Lean, build, reject sorryAx, and run canonical checks. |
Review details
- Files reviewed: 16/17 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 4, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Amaury Chamayou (achamayou)
force-pushed
the
achamayou-psychic-succotash
branch
from
September 4, 2026 23:05
6ab6f18 to
6151e0c
Compare
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
Part 1 of 4 replacing #8241 with a reviewable stack. This bottom layer adds the permanent canonical Lean package under
lean/disaster-recovery/: the C++-aligned transition model, local and global semantics, reachability invariants, quorum uniqueness, committed-prefix safety, and conditional liveness proofs.The package exposes only the permanent library and canonical executable checks. A dedicated pull-request workflow builds the package, rejects project
sorryAxdependencies, and runs the canonical behavior checks. It does not add the temporary legacy-equivalence bridge, Rust changes, implementation tracing, C++ instrumentation, or e2e wiring.Proof limits
DurableCommitandFullGossipSelectionpremises. A quorum opening alone does not establish full-gossip selection.BroadcastBeforeCompletionfor all-node termination. The proofs do not construct a scheduler satisfying those premises.Validation.acceptedandValidation.rejectedmodel the result of implementation validation; they do not prove quote, certificate, or other cryptographic checks.Files
Model and checks
DisasterRecovery/Protocol/Model.leanDisasterRecovery/Protocol/Global.leanCanonicalTests.leanAxiomChecks.leansorryAxrejectionProofs
DisasterRecovery/Protocol/Temporal.leanDisasterRecovery/Protocol/Invariants.leanDisasterRecovery/Protocol/Quorum.leanDisasterRecovery/Protocol/Committed.leanDisasterRecovery/Protocol/GlobalTemporal.leanReplacement stack
Later layers will add the temporary Lean/Stateright equivalence bridge, remove that bridge together with the legacy Rust model after equivalence is established, and finally add permanent implementation trace validation. The canonical model and proofs in this PR are intended to remain unchanged through those layers.
Validation
lake exe cache getlake buildlake env lean -DwarningAsError=true AxiomChecks.leanlake exe canonical-checksscripts/prettier-checks.sh -fscripts/ascii-checks.shscripts/ci-checks.sh