FAILURE MAP
← Case archive

FA-436 / Consensus / Open access

Admit a leader log append: An append attaches to a conflicting predecessor term · case 01

The append log operation is admitted even though an append attaches to a conflicting predecessor term.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The admission path omits the prefix term invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require r['prefix_term'][0] == r['prefix_term'][1] together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the prefix term check repairs the reported defect, but replacing the adjacent commit protected 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['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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
An old leader appends entries after a term changeFalseFalsePassed
An append references a missing predecessor indexFalseFalsePassed
An append attaches to a conflicting predecessor termTrueFalseFailed
Conflict truncation removes a committed entryFalseFalsePassed
Incoming log entries contain an index gapFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 68ab2f4b5b064389ac2d79a2546b0315e2caf98f64b89a450f3e571a00ec45dd

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['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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
An old leader appends entries after a term changeFalseFalsePassed
An append references a missing predecessor indexFalseFalsePassed
An append attaches to a conflicting predecessor termFalseFalsePassed
Conflict truncation removes a committed entryTrueFalseFailed
Incoming log entries contain an index gapFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / f3f562823de8bef1c7247d20bef81c8892871dc55e4a78d9922fd08c9e8a8b83

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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
An old leader appends entries after a term changeFalseFalsePassed
An append references a missing predecessor indexFalseFalsePassed
An append attaches to a conflicting predecessor termFalseFalsePassed
Conflict truncation removes a committed entryFalseFalsePassed
Incoming log entries contain an index gapFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

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.115596+00:00.

Case digest / 97e6ee0db86c37829401bd1c5598e4f59bc1d4f891b2576264a53b7bd1a61251