FA-441 / Consensus / Open access
Admit a leader log append: Conflict truncation removes a committed entry · case 01
The append log operation is admitted even though conflict truncation removes a committed entry.
ROOT CAUSE
The admission path omits the commit protected invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['commit_protected'][0] > r['commit_protected'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the commit protected check repairs the reported defect, but replacing the adjacent contiguous indexes check loses that independent invariant.
Case contract
Return a Boolean admission decision for admit a leader log append. The record r must satisfy all of: r['leader_term'][0] >= r['leader_term'][1]; r['prefix_exists'][0] <= r['prefix_exists'][1]; r['prefix_term'][0] == r['prefix_term'][1]; r['commit_protected'][0] > r['commit_protected'][1]; r['contiguous_indexes'][1] == list(range(r['contiguous_indexes'][0]+1, r['contiguous_indexes'][0]+1+len(r['contiguous_indexes'][1]))). Extra tracing fields are ignored; validation does not mutate the record.
Why this case matters
A deterministic local contract for consensus. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['leader_term'][0] >= r['leader_term'][1]) and (r['prefix_exists'][0] <= r['prefix_exists'][1]) and (r['prefix_term'][0] == r['prefix_term'][1]) and (r['contiguous_indexes'][1] == list(range(r['contiguous_indexes'][0]+1, r['contiguous_indexes'][0]+1+len(r['contiguous_indexes'][1]))))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}
check('valid operation', solve(r), True)
check('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)
check('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)
check('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)
check('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)
check('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| An old leader appends entries after a term change | False | False | Passed |
| An append references a missing predecessor index | False | False | Passed |
| An append attaches to a conflicting predecessor term | False | False | Passed |
| Conflict truncation removes a committed entry | True | False | Failed |
| Incoming log entries contain an index gap | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / f3f562823de8bef1c7247d20bef81c8892871dc55e4a78d9922fd08c9e8a8b83
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['leader_term'][0] >= r['leader_term'][1]) and (r['prefix_exists'][0] <= r['prefix_exists'][1]) and (r['prefix_term'][0] == r['prefix_term'][1]) and (r['commit_protected'][0] > r['commit_protected'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}
check('valid operation', solve(r), True)
check('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)
check('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)
check('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)
check('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)
check('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| An old leader appends entries after a term change | False | False | Passed |
| An append references a missing predecessor index | False | False | Passed |
| An append attaches to a conflicting predecessor term | False | False | Passed |
| Conflict truncation removes a committed entry | False | False | Passed |
| Incoming log entries contain an index gap | True | False | Failed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 62e5b4f299981c746e2498402f76c5416073e85f825929e6d588a351d6e885c2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['leader_term'][0] >= r['leader_term'][1]) and (r['prefix_exists'][0] <= r['prefix_exists'][1]) and (r['prefix_term'][0] == r['prefix_term'][1]) and (r['commit_protected'][0] > r['commit_protected'][1]) and (r['contiguous_indexes'][1] == list(range(r['contiguous_indexes'][0]+1, r['contiguous_indexes'][0]+1+len(r['contiguous_indexes'][1]))))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}
check('valid operation', solve(r), True)
check('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)
check('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)
check('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)
check('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)
check('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| An old leader appends entries after a term change | False | False | Passed |
| An append references a missing predecessor index | False | False | Passed |
| An append attaches to a conflicting predecessor term | False | False | Passed |
| Conflict truncation removes a committed entry | False | False | Passed |
| Incoming log entries contain an index gap | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 5350b1bdc82529bb867eb2c75f9bb239c5ba62b89234776c879f0824a3b2919d
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:36:53.118349+00:00.
Case digest / fa773da68d0e423e2fb9699bed7a52f660fb9399121fe203e2971d5a012225b2