FAILURE MAP
← Case archive

FA-471 / Consensus / Open access

Serve a linearizable read at a confirmed index: A read completes after the leader observed a higher term · case 01

The read index operation is admitted even though a read completes after the leader observed a higher term.

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

ROOT CAUSE

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

VERIFIED REPAIR

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

Unsuccessful approach: Adding the term stability check repairs the reported defect, but replacing the adjacent current term commit check loses that independent invariant.

Case contract

Return a Boolean admission decision for serve a linearizable read at a confirmed index. The record r must satisfy all of: r['current_term_commit'][0] == r['current_term_commit'][1]; len(set(r['quorum_confirmation'][0])) * 2 > r['quorum_confirmation'][1]; r['applied_floor'][0] >= r['applied_floor'][1]; r['context_binding'][0] == r['context_binding'][1]; r['term_stability'][0] == r['term_stability'][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['current_term_commit'][0] == r['current_term_commit'][1]) and (len(set(r['quorum_confirmation'][0])) * 2 > r['quorum_confirmation'][1]) and (r['applied_floor'][0] >= r['applied_floor'][1]) and (r['context_binding'][0] == r['context_binding'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'current_term_commit': [5, 5], 'quorum_confirmation': [[1, 2], 3], 'applied_floor': [9, 9], 'context_binding': ['r2', 'r2'], 'term_stability': [5, 5]}
check('valid operation', solve(r), True)
check('A leader reads before committing an entry in its term', solve(dict(r, **{'current_term_commit': [4, 5]})), False)
check('A read uses a response set lacking a voting majority', solve(dict(r, **{'quorum_confirmation': [[1], 3]})), False)
check('The state machine has not applied the confirmed read index', solve(dict(r, **{'applied_floor': [8, 9]})), False)
check('A delayed response confirms another read request', solve(dict(r, **{'context_binding': ['r1', 'r2']})), False)
check('A read completes after the leader observed a higher term', solve(dict(r, **{'term_stability': [5, 6]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'current_term_commit': [4, 5], 'quorum_confirmation': [[1], 3], 'applied_floor': [8, 9], 'context_binding': ['r1', 'r2'], 'term_stability': [5, 6]}
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
A leader reads before committing an entry in its termFalseFalsePassed
A read uses a response set lacking a voting majorityFalseFalsePassed
The state machine has not applied the confirmed read indexFalseFalsePassed
A delayed response confirms another read requestFalseFalsePassed
A read completes after the leader observed a higher termTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / cef54b18ac8d935401404a728b082219b075ad42409215494ae14349c5ab021b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (len(set(r['quorum_confirmation'][0])) * 2 > r['quorum_confirmation'][1]) and (r['applied_floor'][0] >= r['applied_floor'][1]) and (r['context_binding'][0] == r['context_binding'][1]) and (r['term_stability'][0] == r['term_stability'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'current_term_commit': [5, 5], 'quorum_confirmation': [[1, 2], 3], 'applied_floor': [9, 9], 'context_binding': ['r2', 'r2'], 'term_stability': [5, 5]}
check('valid operation', solve(r), True)
check('A leader reads before committing an entry in its term', solve(dict(r, **{'current_term_commit': [4, 5]})), False)
check('A read uses a response set lacking a voting majority', solve(dict(r, **{'quorum_confirmation': [[1], 3]})), False)
check('The state machine has not applied the confirmed read index', solve(dict(r, **{'applied_floor': [8, 9]})), False)
check('A delayed response confirms another read request', solve(dict(r, **{'context_binding': ['r1', 'r2']})), False)
check('A read completes after the leader observed a higher term', solve(dict(r, **{'term_stability': [5, 6]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'current_term_commit': [4, 5], 'quorum_confirmation': [[1], 3], 'applied_floor': [8, 9], 'context_binding': ['r1', 'r2'], 'term_stability': [5, 6]}
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
A leader reads before committing an entry in its termTrueFalseFailed
A read uses a response set lacking a voting majorityFalseFalsePassed
The state machine has not applied the confirmed read indexFalseFalsePassed
A delayed response confirms another read requestFalseFalsePassed
A read completes after the leader observed a higher termFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 620a55b6ec6138d32735fef43268c1d6da5cdd733b98cc6269fcdd01fdaff807

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(r):
    return (r['current_term_commit'][0] == r['current_term_commit'][1]) and (len(set(r['quorum_confirmation'][0])) * 2 > r['quorum_confirmation'][1]) and (r['applied_floor'][0] >= r['applied_floor'][1]) and (r['context_binding'][0] == r['context_binding'][1]) and (r['term_stability'][0] == r['term_stability'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'current_term_commit': [5, 5], 'quorum_confirmation': [[1, 2], 3], 'applied_floor': [9, 9], 'context_binding': ['r2', 'r2'], 'term_stability': [5, 5]}
check('valid operation', solve(r), True)
check('A leader reads before committing an entry in its term', solve(dict(r, **{'current_term_commit': [4, 5]})), False)
check('A read uses a response set lacking a voting majority', solve(dict(r, **{'quorum_confirmation': [[1], 3]})), False)
check('The state machine has not applied the confirmed read index', solve(dict(r, **{'applied_floor': [8, 9]})), False)
check('A delayed response confirms another read request', solve(dict(r, **{'context_binding': ['r1', 'r2']})), False)
check('A read completes after the leader observed a higher term', solve(dict(r, **{'term_stability': [5, 6]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'current_term_commit': [4, 5], 'quorum_confirmation': [[1], 3], 'applied_floor': [8, 9], 'context_binding': ['r1', 'r2'], 'term_stability': [5, 6]}
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
A leader reads before committing an entry in its termFalseFalsePassed
A read uses a response set lacking a voting majorityFalseFalsePassed
The state machine has not applied the confirmed read indexFalseFalsePassed
A delayed response confirms another read requestFalseFalsePassed
A read completes after the leader observed a higher termFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 3ba0ad3cc61c4a29fa15605b0116a26627bdcc2f1c54c1bb7e0968a75e3a0290

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

Case digest / 29d3fbb5df0c9f29443156ba3b12aeb9043c2017eb5ff80d883bc54ac166c7df