FA-381 / Consensus / Open access
Transfer leadership to a chosen voter: The target lacks the leader final log entry · case 01
The leader transfer operation is admitted even though the target lacks the leader final log entry.
ROOT CAUSE
The admission path omits the log caught up invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['log_caught_up'][0] >= r['log_caught_up'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the log caught up check repairs the reported defect, but replacing the adjacent transfer term check loses that independent invariant.
Case contract
Return a Boolean admission decision for transfer leadership to a chosen voter. The record r must satisfy all of: r['target_voter'][0] in r['target_voter'][1]; r['log_caught_up'][0] >= r['log_caught_up'][1]; r['transfer_term'][0] == r['transfer_term'][1]; r['transfer_deadline'][0] < r['transfer_deadline'][1]; r['writes_drained'] == 0. 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['target_voter'][0] in r['target_voter'][1]) and (r['transfer_term'][0] == r['transfer_term'][1]) and (r['transfer_deadline'][0] < r['transfer_deadline'][1]) and (r['writes_drained'] == 0)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'target_voter': ['b', ['a', 'b']], 'log_caught_up': [12, 12], 'transfer_term': [4, 4], 'transfer_deadline': [9, 10], 'writes_drained': 0}
check('valid operation', solve(r), True)
check('Leadership is handed to a learner', solve(dict(r, **{'target_voter': ['c', ['a', 'b']]})), False)
check('The target lacks the leader final log entry', solve(dict(r, **{'log_caught_up': [11, 12]})), False)
check('A delayed handoff names an obsolete term', solve(dict(r, **{'transfer_term': [3, 4]})), False)
check('The handoff arrives after its transfer deadline', solve(dict(r, **{'transfer_deadline': [10, 10]})), False)
check('A transfer races outstanding leader writes', solve(dict(r, **{'writes_drained': 1})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'target_voter': ['c', ['a', 'b']], 'log_caught_up': [11, 12], 'transfer_term': [3, 4], 'transfer_deadline': [10, 10], 'writes_drained': 1}
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 |
| Leadership is handed to a learner | False | False | Passed |
| The target lacks the leader final log entry | True | False | Failed |
| A delayed handoff names an obsolete term | False | False | Passed |
| The handoff arrives after its transfer deadline | False | False | Passed |
| A transfer races outstanding leader writes | 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 / 02da96ec2caf05b751084053113a8c66752a3924b909375c5a73715755eb3aff
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['target_voter'][0] in r['target_voter'][1]) and (r['log_caught_up'][0] >= r['log_caught_up'][1]) and (r['transfer_deadline'][0] < r['transfer_deadline'][1]) and (r['writes_drained'] == 0)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'target_voter': ['b', ['a', 'b']], 'log_caught_up': [12, 12], 'transfer_term': [4, 4], 'transfer_deadline': [9, 10], 'writes_drained': 0}
check('valid operation', solve(r), True)
check('Leadership is handed to a learner', solve(dict(r, **{'target_voter': ['c', ['a', 'b']]})), False)
check('The target lacks the leader final log entry', solve(dict(r, **{'log_caught_up': [11, 12]})), False)
check('A delayed handoff names an obsolete term', solve(dict(r, **{'transfer_term': [3, 4]})), False)
check('The handoff arrives after its transfer deadline', solve(dict(r, **{'transfer_deadline': [10, 10]})), False)
check('A transfer races outstanding leader writes', solve(dict(r, **{'writes_drained': 1})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'target_voter': ['c', ['a', 'b']], 'log_caught_up': [11, 12], 'transfer_term': [3, 4], 'transfer_deadline': [10, 10], 'writes_drained': 1}
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 |
| Leadership is handed to a learner | False | False | Passed |
| The target lacks the leader final log entry | False | False | Passed |
| A delayed handoff names an obsolete term | True | False | Failed |
| The handoff arrives after its transfer deadline | False | False | Passed |
| A transfer races outstanding leader writes | 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 / 434e8a342ee7dee463074ffaa39156934720e37b49f35a26eb417fc81be6f5ef
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['target_voter'][0] in r['target_voter'][1]) and (r['log_caught_up'][0] >= r['log_caught_up'][1]) and (r['transfer_term'][0] == r['transfer_term'][1]) and (r['transfer_deadline'][0] < r['transfer_deadline'][1]) and (r['writes_drained'] == 0)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'target_voter': ['b', ['a', 'b']], 'log_caught_up': [12, 12], 'transfer_term': [4, 4], 'transfer_deadline': [9, 10], 'writes_drained': 0}
check('valid operation', solve(r), True)
check('Leadership is handed to a learner', solve(dict(r, **{'target_voter': ['c', ['a', 'b']]})), False)
check('The target lacks the leader final log entry', solve(dict(r, **{'log_caught_up': [11, 12]})), False)
check('A delayed handoff names an obsolete term', solve(dict(r, **{'transfer_term': [3, 4]})), False)
check('The handoff arrives after its transfer deadline', solve(dict(r, **{'transfer_deadline': [10, 10]})), False)
check('A transfer races outstanding leader writes', solve(dict(r, **{'writes_drained': 1})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'target_voter': ['c', ['a', 'b']], 'log_caught_up': [11, 12], 'transfer_term': [3, 4], 'transfer_deadline': [10, 10], 'writes_drained': 1}
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 |
| Leadership is handed to a learner | False | False | Passed |
| The target lacks the leader final log entry | False | False | Passed |
| A delayed handoff names an obsolete term | False | False | Passed |
| The handoff arrives after its transfer deadline | False | False | Passed |
| A transfer races outstanding leader writes | 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 / 4ce9e53377245e383b22d77dc0c1cb278b244dc64ac833b4e8de485fbcbfaf8f
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:52.595817+00:00.
Case digest / cf6c9677c34381ead6a83f149be185177bd38110ae9271768b0f866b9ca8d0ed