FA-30081 / HTTP retries / Open access
File-backed request replay integrity: Mtime check violates retry transition semantics · case 01
Mtime check violates retry transition semantics
ROOT CAUSE
Mtime check violates retry transition semantics
THE FAILURE
Mtime check violates retry transition semantics
Unsuccessful approach: The attempted repair changes the faulty site to if current[0]!=snapshot[0]: but still violates a regression oracle.
Case contract
open(file identity,size,mtime,offset) snapshots file metadata and starting byte. inspect(current identity,size,mtime) records current metadata. read(count) advances bounded cursor only while valid. retry compares all snapshot metadata before rewinding; any mismatch permanently invalidates this body. close invalidates. New open resets validity. Return read byte counts and retry dispositions.
Why this case matters
Offline deterministic model of HTTP request retries.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
snapshot=None; current=None; origin=0; cursor=0; valid=False; out=[]
for e in events:
if e[0]=='open':
snapshot=tuple(e[1:4]); current=snapshot
origin=e[4]; cursor=origin
valid=True
elif e[0]=='inspect': current=tuple(e[1:4])
elif e[0]=='close': valid=False
elif e[0]=='read':
if not valid: out.append('invalid'); continue
amount=min(e[1],max(0,snapshot[1]-cursor))
cursor+=amount
out.append(amount)
elif e[0]=='retry':
if not valid: out.append('invalid'); continue
if current[:2]!=snapshot[:2]:
valid=False; out.append('changed'); continue
cursor=origin
out.append('rewound')
return [out,cursor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0])
check('1', solve([('open','a',N+5,1,2),('read',2),('read',N+9),('read',1),('retry',),('read',1)]), [[2,N+1,0,'rewound',1],3])
check('2', solve([('open','a',5,1,0),('inspect','b',5,1),('retry',),('read',1)]), [['changed','invalid'],0])
check('3', solve([('open','a',5,1,0),('inspect','a',6,1),('retry',),('retry',)]), [['changed','invalid'],0])
check('4', solve([('open','a',5,1,0),('inspect','a',5,2),('retry',),('inspect','a',5,1),('retry',)]), [['changed','invalid'],0])
check('5', solve([('open','a',0,1,0),('read',1),('retry',),('close',),('read',1),('retry',)]), [[0,'rewound','invalid','invalid'],0])
check('6', solve([('open','a',N+3,1,1),('close',),('open','b',2,2,1),('read',1)]), [[1],2])
check('7', solve([('open','a',N+3,1,1),('inspect','a',N+3,1),('retry',),('close',),('read',1),('retry',)]), [['rewound','invalid','invalid'],1])
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 |
|---|---|---|---|
| 0 | [[], 0] | [[], 0] | Passed |
| 1 | [[2, 2, 0, 'rewound', 1], 3] | [[2, 2, 0, 'rewound', 1], 3] | Passed |
| 2 | [['changed', 'invalid'], 0] | [['changed', 'invalid'], 0] | Passed |
| 3 | [['changed', 'invalid'], 0] | [['changed', 'invalid'], 0] | Passed |
| 4 | [['rewound', 'rewound'], 0] | [['changed', 'invalid'], 0] | Failed |
| 5 | [[0, 'rewound', 'invalid', 'invalid'], 0] | [[0, 'rewound', 'invalid', 'invalid'], 0] | Passed |
| 6 | [[1], 2] | [[1], 2] | Passed |
| 7 | [['rewound', 'invalid', 'invalid'], 1] | [['rewound', 'invalid', 'invalid'], 1] | Passed |
SHA-256 / 615703ae6b552a090a89aba8ef0b380ea586f739efbd1db1c91e7b2827ce625c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
snapshot=None; current=None; origin=0; cursor=0; valid=False; out=[]
for e in events:
if e[0]=='open':
snapshot=tuple(e[1:4]); current=snapshot
origin=e[4]; cursor=origin
valid=True
elif e[0]=='inspect': current=tuple(e[1:4])
elif e[0]=='close': valid=False
elif e[0]=='read':
if not valid: out.append('invalid'); continue
amount=min(e[1],max(0,snapshot[1]-cursor))
cursor+=amount
out.append(amount)
elif e[0]=='retry':
if not valid: out.append('invalid'); continue
if current[0]!=snapshot[0]:
valid=False; out.append('changed'); continue
cursor=origin
out.append('rewound')
return [out,cursor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0])
check('1', solve([('open','a',N+5,1,2),('read',2),('read',N+9),('read',1),('retry',),('read',1)]), [[2,N+1,0,'rewound',1],3])
check('2', solve([('open','a',5,1,0),('inspect','b',5,1),('retry',),('read',1)]), [['changed','invalid'],0])
check('3', solve([('open','a',5,1,0),('inspect','a',6,1),('retry',),('retry',)]), [['changed','invalid'],0])
check('4', solve([('open','a',5,1,0),('inspect','a',5,2),('retry',),('inspect','a',5,1),('retry',)]), [['changed','invalid'],0])
check('5', solve([('open','a',0,1,0),('read',1),('retry',),('close',),('read',1),('retry',)]), [[0,'rewound','invalid','invalid'],0])
check('6', solve([('open','a',N+3,1,1),('close',),('open','b',2,2,1),('read',1)]), [[1],2])
check('7', solve([('open','a',N+3,1,1),('inspect','a',N+3,1),('retry',),('close',),('read',1),('retry',)]), [['rewound','invalid','invalid'],1])
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 |
|---|---|---|---|
| 0 | [[], 0] | [[], 0] | Passed |
| 1 | [[2, 2, 0, 'rewound', 1], 3] | [[2, 2, 0, 'rewound', 1], 3] | Passed |
| 2 | [['changed', 'invalid'], 0] | [['changed', 'invalid'], 0] | Passed |
| 3 | [['rewound', 'rewound'], 0] | [['changed', 'invalid'], 0] | Failed |
| 4 | [['rewound', 'rewound'], 0] | [['changed', 'invalid'], 0] | Failed |
| 5 | [[0, 'rewound', 'invalid', 'invalid'], 0] | [[0, 'rewound', 'invalid', 'invalid'], 0] | Passed |
| 6 | [[1], 2] | [[1], 2] | Passed |
| 7 | [['rewound', 'invalid', 'invalid'], 1] | [['rewound', 'invalid', 'invalid'], 1] | Passed |
SHA-256 / 5cda7c90729f1e8b81f018fd4c99636d2ac335f71c77eec41ecc320ff12ed30a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 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
Stipulated bounded simulator, not a complete HTTP implementation or a standards conformance claim. 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:41:49.614133+00:00.
Case digest / 6d8ca272771c5c5833d9d3ad0f23ed2ff0125f83c0d8675ec0b040fd37fe8608