Commit 0911bc4
proof(consensus): fix + model-check the BFT consensus spec; wire TLC into CI
The TLA+ consensus spec had never been model-checked and was invalid:
* TypeOK violated -- Commit logs a vote snapshot incl "NONE" (commits fire
once the approval threshold is met, before all agents vote), but the log
type only allowed APPROVE/REJECT.
* Agreement mis-stated -- it asserted all committed actions are globally
DISTINCT (violated by a legitimate re-commit), not the consensus property.
* ByzantineSafety vacuous -- a constant-level formula (no state vars), so TLC
asserted nothing about the protocol.
Rewritten as a genuine single-round Byzantine quorum model (design decision
2026-06-14): per-agent commit views, an equivocating proposer (honest agents
may receive different values) + Byzantine voters. Safety now rests on QUORUM
INTERSECTION:
* Agreement -- no two honest agents commit different values for a round;
* Validity -- an honest commit is backed by a Threshold-quorum;
* ByzantineSafety -- a committed value cannot be forged by the Byzantine
minority alone (>= Threshold-|Byzantine| honest senders; Threshold > F).
Verified with TLC (N=4, F=1, Threshold=2F+1=3): positive run -- no error;
NEGATIVE run (Threshold=2 < 2F+1) -- Agreement violated, proving the quorum
threshold is load-bearing (invariants are not vacuous).
Adds .github/workflows/tla-consensus.yml: downloads tla2tools v1.8.0
(sha256-pinned), runs the positive gate + asserts the negative test fails.
https://claude.ai/code/session_01DQACj3RFmAPZaBPgR9SAaS1 parent 7dd9f3a commit 0911bc4
5 files changed
Lines changed: 186 additions & 192 deletions
File tree
- .github/workflows
- formal
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | | - | |
6 | 7 | | |
7 | | - | |
8 | | - | |
9 | 8 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
15 | 10 | | |
16 | | - | |
17 | | - | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
20 | | - | |
21 | | - | |
| 14 | + | |
22 | 15 | | |
23 | 16 | | |
24 | 17 | | |
25 | | - | |
26 | 18 | | |
27 | 19 | | |
28 | | - | |
29 | 20 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
0 commit comments