Files
git.stella-ops.org/docs/features/checked/vexlens/vexlens-truth-table-tests.md
2026-02-14 09:11:48 +02:00

34 lines
1.8 KiB
Markdown

# VexLens Truth Table Tests
## Module
VexLens
## Status
IMPLEMENTED
## Description
Systematic truth table tests for VEX lattice merge correctness. Comprehensive VexLatticeTruthTableTests class covers all VEX status transition combinations with 75 tests.
## Implementation Details
- **Truth table tests**: `src/VexLens/__Tests/StellaOps.VexLens.Tests/Consensus/VexLatticeTruthTableTests.cs` -- 75 tests covering exhaustive truth table combinations
- **Lattice order verification**: All 4 statuses verified in correct order (Affected=0, UnderInvestigation=1, Fixed=2, NotAffected=3)
- **Two-statement merge**: All 16 status pair combinations (4x4 matrix) with reverse order for commutativity
- **Commutativity**: merge(A,B) == merge(B,A) proven for 4 cross-status pairs
- **Associativity**: merge(merge(A,B),C) == merge(A,merge(B,C)) proven for 3 triple combinations
- **Idempotency**: merge(A,A) == A proven for all 4 statuses
- **Weighted vote truth table**: 5 cases for majority/tie resolution + weight aggregation
- **Highest weight truth table**: 3 cases for single highest weight selection
- **Conflict detection**: 4 cases for conflict/no-conflict detection
- **Outcome classification**: Unanimous, ConflictResolved, Majority, NoData
- **Edge cases**: Single statement, empty statements, all below threshold
- **Determinism**: Same input produces same output
- **Source**: Feature matrix scan + QA verification run-001
## E2E Test Plan
- [x] Verify all 16 two-statement lattice merge combinations produce correct most-conservative status
- [x] Test commutativity: merge(A,B) equals merge(B,A) for all cross-status pairs
- [x] Test idempotency: merge(A,A) equals A for all 4 statuses
- [x] Test associativity: merge(merge(A,B),C) for triple combinations
- [x] Verify weighted vote and highest weight modes
- [x] Verify conflict detection and outcome classification