FAILURE MAP
← Case archive

FA-391 / Consensus / Open access

Transfer leadership to a chosen voter: The handoff arrives after its transfer deadline · case 01

The leader transfer operation is admitted even though the handoff arrives after its transfer deadline.

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

ROOT CAUSE

The admission path omits the transfer deadline invariant while validating the other operation preconditions.

THE FAILURE

The admission path omits the transfer deadline invariant while validating the other operation preconditions.

Unsuccessful approach: Adding the transfer deadline check repairs the reported defect, but replacing the adjacent writes drained 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['log_caught_up'][0] >= r['log_caught_up'][1]) and (r['transfer_term'][0] == r['transfer_term'][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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
Leadership is handed to a learnerFalseFalsePassed
The target lacks the leader final log entryFalseFalsePassed
A delayed handoff names an obsolete termFalseFalsePassed
The handoff arrives after its transfer deadlineTrueFalseFailed
A transfer races outstanding leader writesFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 11307476581146910e903345b855ab6584c2b00095415caef4cb95031a52b4e7

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_term'][0] == r['transfer_term'][1]) and (r['transfer_deadline'][0] < r['transfer_deadline'][1])
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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
Leadership is handed to a learnerFalseFalsePassed
The target lacks the leader final log entryFalseFalsePassed
A delayed handoff names an obsolete termFalseFalsePassed
The handoff arrives after its transfer deadlineFalseFalsePassed
A transfer races outstanding leader writesTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 86676ed60b426f29fbdf75068c1b7cf2aa0b05be78e98ccb715231a0fa752b13

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 9af5c4f7fba9591f14d24e38eadc5b9bae64bfd36c925ee2c1ec936be670023b