{"abstract":"The append log operation is admitted even though an old leader appends entries after a term change.","category":"Consensus","checks":9,"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.","evaluation_group":"xd-append-log","failed_approach":"Adding the leader term check repairs the reported defect, but replacing the adjacent prefix exists check loses that independent invariant.","family":"xd-append-log-leader_term","id":"FA-426","implementations":{"attempt":{"sha256":"dba31f50c18e5fdc6ac5fddc2442f946d94ab5482995ca3681d52ed91ffcc984","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['leader_term'][0] >= r['leader_term'][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]))))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}\ncheck('valid operation', solve(r), True)\ncheck('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)\ncheck('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)\ncheck('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)\ncheck('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)\ncheck('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"84cb18405a61721e4202773ca074ce52a1de1d6bdc92cfb0a0eea4e06f2df182","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (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]))))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}\ncheck('valid operation', solve(r), True)\ncheck('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)\ncheck('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)\ncheck('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)\ncheck('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)\ncheck('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"5350b1bdc82529bb867eb2c75f9bb239c5ba62b89234776c879f0824a3b2919d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    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]))))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'leader_term': [5, 5], 'prefix_exists': [8, 8], 'prefix_term': [4, 4], 'commit_protected': [9, 8], 'contiguous_indexes': [8, [9, 10, 11]]}\ncheck('valid operation', solve(r), True)\ncheck('An old leader appends entries after a term change', solve(dict(r, **{'leader_term': [4, 5]})), False)\ncheck('An append references a missing predecessor index', solve(dict(r, **{'prefix_exists': [9, 8]})), False)\ncheck('An append attaches to a conflicting predecessor term', solve(dict(r, **{'prefix_term': [3, 4]})), False)\ncheck('Conflict truncation removes a committed entry', solve(dict(r, **{'commit_protected': [8, 8]})), False)\ncheck('Incoming log entries contain an index gap', solve(dict(r, **{'contiguous_indexes': [8, [9, 11]]})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'leader_term': [4, 5], 'prefix_exists': [9, 8], 'prefix_term': [3, 4], 'commit_protected': [8, 8], 'contiguous_indexes': [8, [9, 11]]}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"xd-append-log-leader_term","generated_at":"2026-09-29T14:36:53.110790+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"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.","repair":"Require r['leader_term'][0] >= r['leader_term'][1] together with every other stated precondition before accepting the operation.","root_cause":"The admission path omits the leader term invariant while validating the other operation preconditions.","sha256":"d915e8e474063b2750f773e50df5201c5ff0719f6484549b215ce66824070b72","title":"Admit a leader log append: An old leader appends entries after a term change · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":33.739,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"An old leader appends entries after a term change","expected":false,"passed":true},{"actual":true,"check":"An append references a missing predecessor index","expected":false,"passed":false},{"actual":false,"check":"An append attaches to a conflicting predecessor term","expected":false,"passed":true},{"actual":false,"check":"Conflict truncation removes a committed entry","expected":false,"passed":true},{"actual":false,"check":"Incoming log entries contain an index gap","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An old leader appends entries after a term change\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"An append references a missing predecessor index\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"An append attaches to a conflicting predecessor term\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Conflict truncation removes a committed entry\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Incoming log entries contain an index gap\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.431,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":true,"check":"An old leader appends entries after a term change","expected":false,"passed":false},{"actual":false,"check":"An append references a missing predecessor index","expected":false,"passed":true},{"actual":false,"check":"An append attaches to a conflicting predecessor term","expected":false,"passed":true},{"actual":false,"check":"Conflict truncation removes a committed entry","expected":false,"passed":true},{"actual":false,"check":"Incoming log entries contain an index gap","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An old leader appends entries after a term change\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"An append references a missing predecessor index\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"An append attaches to a conflicting predecessor term\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Conflict truncation removes a committed entry\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Incoming log entries contain an index gap\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":35.259,"exit_code":0,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"An old leader appends entries after a term change","expected":false,"passed":true},{"actual":false,"check":"An append references a missing predecessor index","expected":false,"passed":true},{"actual":false,"check":"An append attaches to a conflicting predecessor term","expected":false,"passed":true},{"actual":false,"check":"Conflict truncation removes a committed entry","expected":false,"passed":true},{"actual":false,"check":"Incoming log entries contain an index gap","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"An old leader appends entries after a term change\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"An append references a missing predecessor index\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"An append attaches to a conflicting predecessor term\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Conflict truncation removes a committed entry\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Incoming log entries contain an index gap\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}