FV-14: TLA+ faithfulness tests for Nim state machines

Add tests/tla_faithfulness.nim verifying Nim code against TLA+ invariants:
- Raft: ElectionSafety, LogMatching, CommittedIndexValid
- MVCC: NoDirtyReads, CommittedMustStart
- 2PC: Atomicity, RecoveryConsistency

Documented gap: Nim MVCC allows multiple committed versions per key,
while TLA+ spec enforces first-committer-wins (WriteWriteConflict).
This test ensures future changes to Nim code maintain alignment with specs.

Update PLAN.md (FV-14 done), CHANGELOG.md, test_all.nim includes new suite.
This commit is contained in:
2026-05-07 21:59:06 +03:00
parent 4791434cea
commit 8f87491eca
5 changed files with 198 additions and 1 deletions
+8
View File
@@ -2,6 +2,14 @@
## [1.2.0] — 2026-05-07
### Added (Software verification bridge)
- **tests/tla_faithfulness.nim** — Nim test suite verifying that Nim state machines obey TLA+ invariants:
- Raft: ElectionSafety, LogMatching, CommittedIndexValid
- MVCC: NoDirtyReads, CommittedMustStart
- 2PC: Atomicity, RecoveryConsistency
- Documented gap: Nim MVCC allows multiple committed versions per key (TLA+ enforces first-committer-wins)
### Added
- **raft.tla**: `Heartbeat`, `HeartbeatTimeout`, `LeaderLeaseExpired` actions — models leader step-down when quorum is lost
- **raft.tla**: `LeaderHasSelfHeartbeat` invariant — every leader must have a valid heartbeat in its own term