FA-401 / Replication / Open access
Install a replicated state snapshot: A snapshot rolls back applied state · case 01
The snapshot install operation is admitted even though a snapshot rolls back applied state.
ROOT CAUSE
The admission path omits the newer applied invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['newer_applied'][0] >= r['newer_applied'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the newer applied check repairs the reported defect, but replacing the adjacent complete chunks check loses that independent invariant.
Case contract
Return a Boolean admission decision for install a replicated state snapshot. The record r must satisfy all of: r['newer_applied'][0] >= r['newer_applied'][1]; set(r['complete_chunks'][0]) == set(range(r['complete_chunks'][1])); r['checksum_match'][0] == r['checksum_match'][1]; bool(r['configuration_present']); r['index_term_pair'][0] == r['index_term_pair'][1]. Extra tracing fields are ignored; validation does not mutate the record.
Why this case matters
A deterministic local contract for replication. 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 (set(r['complete_chunks'][0]) == set(range(r['complete_chunks'][1]))) and (r['checksum_match'][0] == r['checksum_match'][1]) and (bool(r['configuration_present'])) and (r['index_term_pair'][0] == r['index_term_pair'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'newer_applied': [12, 10], 'complete_chunks': [[0, 1, 2], 3], 'checksum_match': ['abc', 'abc'], 'configuration_present': [1, 2, 3], 'index_term_pair': [[12, 3], [12, 3]]}
check('valid operation', solve(r), True)
check('A snapshot rolls back applied state', solve(dict(r, **{'newer_applied': [9, 10]})), False)
check('An incomplete snapshot replaces the live state', solve(dict(r, **{'complete_chunks': [[0, 2], 3]})), False)
check('Corrupt snapshot contents become authoritative', solve(dict(r, **{'checksum_match': ['bad', 'abc']})), False)
check('The snapshot omits its membership configuration', solve(dict(r, **{'configuration_present': []})), False)
check('Snapshot metadata refers to a different log term', solve(dict(r, **{'index_term_pair': [[12, 2], [12, 3]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'newer_applied': [9, 10], 'complete_chunks': [[0, 2], 3], 'checksum_match': ['bad', 'abc'], 'configuration_present': [], 'index_term_pair': [[12, 2], [12, 3]]}
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 |
| A snapshot rolls back applied state | True | False | Failed |
| An incomplete snapshot replaces the live state | False | False | Passed |
| Corrupt snapshot contents become authoritative | False | False | Passed |
| The snapshot omits its membership configuration | False | False | Passed |
| Snapshot metadata refers to a different log term | 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 / 310aa3b9cfb8a12b9465238aef0e65282bdbbedf41f4258faf1e862b73c2a351
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['newer_applied'][0] >= r['newer_applied'][1]) and (r['checksum_match'][0] == r['checksum_match'][1]) and (bool(r['configuration_present'])) and (r['index_term_pair'][0] == r['index_term_pair'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'newer_applied': [12, 10], 'complete_chunks': [[0, 1, 2], 3], 'checksum_match': ['abc', 'abc'], 'configuration_present': [1, 2, 3], 'index_term_pair': [[12, 3], [12, 3]]}
check('valid operation', solve(r), True)
check('A snapshot rolls back applied state', solve(dict(r, **{'newer_applied': [9, 10]})), False)
check('An incomplete snapshot replaces the live state', solve(dict(r, **{'complete_chunks': [[0, 2], 3]})), False)
check('Corrupt snapshot contents become authoritative', solve(dict(r, **{'checksum_match': ['bad', 'abc']})), False)
check('The snapshot omits its membership configuration', solve(dict(r, **{'configuration_present': []})), False)
check('Snapshot metadata refers to a different log term', solve(dict(r, **{'index_term_pair': [[12, 2], [12, 3]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'newer_applied': [9, 10], 'complete_chunks': [[0, 2], 3], 'checksum_match': ['bad', 'abc'], 'configuration_present': [], 'index_term_pair': [[12, 2], [12, 3]]}
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 |
| A snapshot rolls back applied state | False | False | Passed |
| An incomplete snapshot replaces the live state | True | False | Failed |
| Corrupt snapshot contents become authoritative | False | False | Passed |
| The snapshot omits its membership configuration | False | False | Passed |
| Snapshot metadata refers to a different log term | 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 / ce6fbac50cce90b6a7ec7878d0f286abfa115b16ac2db946cdc86a53f3e118bc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['newer_applied'][0] >= r['newer_applied'][1]) and (set(r['complete_chunks'][0]) == set(range(r['complete_chunks'][1]))) and (r['checksum_match'][0] == r['checksum_match'][1]) and (bool(r['configuration_present'])) and (r['index_term_pair'][0] == r['index_term_pair'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'newer_applied': [12, 10], 'complete_chunks': [[0, 1, 2], 3], 'checksum_match': ['abc', 'abc'], 'configuration_present': [1, 2, 3], 'index_term_pair': [[12, 3], [12, 3]]}
check('valid operation', solve(r), True)
check('A snapshot rolls back applied state', solve(dict(r, **{'newer_applied': [9, 10]})), False)
check('An incomplete snapshot replaces the live state', solve(dict(r, **{'complete_chunks': [[0, 2], 3]})), False)
check('Corrupt snapshot contents become authoritative', solve(dict(r, **{'checksum_match': ['bad', 'abc']})), False)
check('The snapshot omits its membership configuration', solve(dict(r, **{'configuration_present': []})), False)
check('Snapshot metadata refers to a different log term', solve(dict(r, **{'index_term_pair': [[12, 2], [12, 3]]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'newer_applied': [9, 10], 'complete_chunks': [[0, 2], 3], 'checksum_match': ['bad', 'abc'], 'configuration_present': [], 'index_term_pair': [[12, 2], [12, 3]]}
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 |
| A snapshot rolls back applied state | False | False | Passed |
| An incomplete snapshot replaces the live state | False | False | Passed |
| Corrupt snapshot contents become authoritative | False | False | Passed |
| The snapshot omits its membership configuration | False | False | Passed |
| Snapshot metadata refers to a different log term | 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 / bdbee3faa7735838124026847fc899ef34d8cf5bb1df90b992c5676216fdb7ea
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.658434+00:00.
Case digest / a123ec2782387a3ae6cb88e54c7bcceed23671f94fd63935b317312c70437f8b