FA-30701 / HTTP retries / Open access
Retry advice across wall and monotonic clocks: Advice retain violates retry transition semantics · case 01
Advice retain violates retry transition semantics
ROOT CAUSE
Advice retain violates retry transition semantics
THE FAILURE
Advice retain violates retry transition semantics
Unsuccessful approach: The attempted repair changes the faulty site to advice.insert(0,(e[0],e[1])); advice[:]=advice[:1] but still violates a regression oracle.
Case contract
Controlled decoded Retry-After model. response(server Date or None,Age,received monotonic,local wall at receive) resets advice. delta(nonnegative seconds) or date(absolute seconds) records one advice; multiple advice values are rejected. For date, estimate server time as Date+Age, or local wall if Date absent. Project remaining server delay onto receive monotonic clock. advance moves monotonic time forward. schedule returns remaining wait or missing/ambiguous; no network requests or full header parsing.
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):
server=None; age=0; received=0; wall=0; now=0; advice=[]; out=[]
for e in events:
if e[0]=='response':
server=e[1]; age=e[2]; received=e[3]; wall=e[4]; now=received; advice=[]
elif e[0] in ('delta','date'): advice[:]=[(e[0],e[1])]
elif e[0]=='advance': now=max(now,e[1])
elif e[0]=='schedule':
if not advice: out.append('missing'); continue
if len(advice)!=1: out.append('ambiguous'); continue
kind,value=advice[0]
if kind=='delta': due=received+value
else:
reference=server+age if server is not None else wall
due=received+max(0,value-reference)
out.append(max(0,due-now))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [])
check('1', solve([('response',100,0,N,200),('schedule',)]), ['missing'])
check('2', solve([('response',100,5,N,200),('date',110),('schedule',),('advance',N+2),('schedule',)]), [5,3])
check('3', solve([('response',None,99,N,200),('date',207),('schedule',)]), [7])
check('4', solve([('response',100,0,N,200),('delta',5),('advance',N+2),('schedule',),('advance',N),('schedule',)]), [3,3])
check('5', solve([('response',100,0,N,200),('delta',5),('delta',5),('schedule',),('response',100,0,N+1,200),('schedule',)]), ['ambiguous','missing'])
check('6', solve([('response',100,0,N,200),('date',90),('schedule',),('advance',N+10),('schedule',)]), [0,0])
check('7', solve([('response',100,13,N,200),('date',120),('schedule',)]), [7])
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 | [] | [] | Passed |
| 1 | ['missing'] | ['missing'] | Passed |
| 2 | [5, 3] | [5, 3] | Passed |
| 3 | [7] | [7] | Passed |
| 4 | [3, 3] | [3, 3] | Passed |
| 5 | [5, 'missing'] | ['ambiguous', 'missing'] | Failed |
| 6 | [0, 0] | [0, 0] | Passed |
| 7 | [7] | [7] | Passed |
SHA-256 / 1c6bf0a6748b156f0f707c8be560b18ceda2d1f616da1db8a603817203eb5012
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
server=None; age=0; received=0; wall=0; now=0; advice=[]; out=[]
for e in events:
if e[0]=='response':
server=e[1]; age=e[2]; received=e[3]; wall=e[4]; now=received; advice=[]
elif e[0] in ('delta','date'): advice.insert(0,(e[0],e[1])); advice[:]=advice[:1]
elif e[0]=='advance': now=max(now,e[1])
elif e[0]=='schedule':
if not advice: out.append('missing'); continue
if len(advice)!=1: out.append('ambiguous'); continue
kind,value=advice[0]
if kind=='delta': due=received+value
else:
reference=server+age if server is not None else wall
due=received+max(0,value-reference)
out.append(max(0,due-now))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [])
check('1', solve([('response',100,0,N,200),('schedule',)]), ['missing'])
check('2', solve([('response',100,5,N,200),('date',110),('schedule',),('advance',N+2),('schedule',)]), [5,3])
check('3', solve([('response',None,99,N,200),('date',207),('schedule',)]), [7])
check('4', solve([('response',100,0,N,200),('delta',5),('advance',N+2),('schedule',),('advance',N),('schedule',)]), [3,3])
check('5', solve([('response',100,0,N,200),('delta',5),('delta',5),('schedule',),('response',100,0,N+1,200),('schedule',)]), ['ambiguous','missing'])
check('6', solve([('response',100,0,N,200),('date',90),('schedule',),('advance',N+10),('schedule',)]), [0,0])
check('7', solve([('response',100,13,N,200),('date',120),('schedule',)]), [7])
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 | [] | [] | Passed |
| 1 | ['missing'] | ['missing'] | Passed |
| 2 | [5, 3] | [5, 3] | Passed |
| 3 | [7] | [7] | Passed |
| 4 | [3, 3] | [3, 3] | Passed |
| 5 | [5, 'missing'] | ['ambiguous', 'missing'] | Failed |
| 6 | [0, 0] | [0, 0] | Passed |
| 7 | [7] | [7] | Passed |
SHA-256 / 098c669a209323763fc40fb2a943e88c9f88e485a4a7187880b721e293949d94
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:55.470382+00:00.
Case digest / 65b26b6da1867bf6788a27cddd22c8be13216ba9dc9aabeb3142feafd4686ba6