FA-30321 / HTTP retries / Open access
Challenge refresh without ordinary retry amplification: Network budget violates retry transition semantics · case 01
Network budget violates retry transition semantics
ROOT CAUSE
Network budget violates retry transition semantics
THE FAILURE
Network budget violates retry transition semantics
Unsuccessful approach: The attempted repair changes the faulty site to if ordinary<=1: but still violates a regression oracle.
Case contract
begin(ordinary retries,refresh allowance) starts a request. network_failure spends ordinary allowance, challenge spends refresh allowance only if no refresh in flight, refreshed(generation) completes only current refresh generation and records auth replay. While refreshing network failures wait. success terminates both budgets; late refresh is ignored. No credentials are represented.
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):
ordinary=0; refresh=0; generation=0; waiting=False; terminal=True; out=[]
for e in events:
if e[0]=='begin': ordinary=e[1]; refresh=e[2]; generation=0; waiting=False; terminal=False
elif e[0]=='success': terminal=True; waiting=False
elif e[0]=='network':
if terminal: out.append('terminal'); continue
if waiting: out.append('waiting'); continue
if ordinary<0: out.append('exhausted'); continue
ordinary-=1; out.append('retry')
elif e[0]=='challenge':
if terminal: out.append('terminal'); continue
if waiting: out.append('coalesced'); continue
if refresh==0: out.append('auth-exhausted'); continue
refresh-=1; generation+=1; waiting=True
out.append(['refresh',generation])
elif e[0]=='refreshed':
if terminal or not waiting or e[1]!=generation: out.append('stale'); continue
waiting=False; out.append('auth-replay')
return [out,ordinary,refresh]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0,0])
check('1', solve([('begin',2,1),('network',),('challenge',),('network',),('challenge',),('refreshed',1),('refreshed',1),('network',),('network',),('challenge',)]), [['retry',['refresh',1],'waiting','coalesced','auth-replay','stale','retry','exhausted','auth-exhausted'],0,0])
check('2', solve([('begin',0,2),('challenge',),('refreshed',1),('challenge',),('refreshed',1),('refreshed',3),('refreshed',2)]), [[['refresh',1],'auth-replay',['refresh',2],'stale','stale','auth-replay'],0,0])
check('3', solve([('begin',N,1),('challenge',),('success',),('refreshed',1),('network',),('challenge',)]), [[['refresh',1],'stale','terminal','terminal'],N,0])
check('4', solve([('begin',0,0),('network',),('challenge',)]), [['exhausted','auth-exhausted'],0,0])
check('5', solve([('begin',1,1),('challenge',),('begin',0,1),('challenge',),('refreshed',1)]), [[['refresh',1],['refresh',1],'auth-replay'],0,0])
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] | [[], 0, 0] | Passed |
| 1 | [['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'retry', 'auth-exhausted'], -1, 0] | [['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0] | Failed |
| 2 | [[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0] | [[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0] | Passed |
| 3 | [[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0] | [[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0] | Passed |
| 4 | [['retry', 'auth-exhausted'], -1, 0] | [['exhausted', 'auth-exhausted'], 0, 0] | Failed |
| 5 | [[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0] | [[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0] | Passed |
SHA-256 / 002a13e935444b9d9ca0fdc10e7ffed579e23c0a4bce086fde85e14597ea3a46
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
ordinary=0; refresh=0; generation=0; waiting=False; terminal=True; out=[]
for e in events:
if e[0]=='begin': ordinary=e[1]; refresh=e[2]; generation=0; waiting=False; terminal=False
elif e[0]=='success': terminal=True; waiting=False
elif e[0]=='network':
if terminal: out.append('terminal'); continue
if waiting: out.append('waiting'); continue
if ordinary<=1: out.append('exhausted'); continue
ordinary-=1; out.append('retry')
elif e[0]=='challenge':
if terminal: out.append('terminal'); continue
if waiting: out.append('coalesced'); continue
if refresh==0: out.append('auth-exhausted'); continue
refresh-=1; generation+=1; waiting=True
out.append(['refresh',generation])
elif e[0]=='refreshed':
if terminal or not waiting or e[1]!=generation: out.append('stale'); continue
waiting=False; out.append('auth-replay')
return [out,ordinary,refresh]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],0,0])
check('1', solve([('begin',2,1),('network',),('challenge',),('network',),('challenge',),('refreshed',1),('refreshed',1),('network',),('network',),('challenge',)]), [['retry',['refresh',1],'waiting','coalesced','auth-replay','stale','retry','exhausted','auth-exhausted'],0,0])
check('2', solve([('begin',0,2),('challenge',),('refreshed',1),('challenge',),('refreshed',1),('refreshed',3),('refreshed',2)]), [[['refresh',1],'auth-replay',['refresh',2],'stale','stale','auth-replay'],0,0])
check('3', solve([('begin',N,1),('challenge',),('success',),('refreshed',1),('network',),('challenge',)]), [[['refresh',1],'stale','terminal','terminal'],N,0])
check('4', solve([('begin',0,0),('network',),('challenge',)]), [['exhausted','auth-exhausted'],0,0])
check('5', solve([('begin',1,1),('challenge',),('begin',0,1),('challenge',),('refreshed',1)]), [[['refresh',1],['refresh',1],'auth-replay'],0,0])
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] | [[], 0, 0] | Passed |
| 1 | [['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'exhausted', 'exhausted', 'auth-exhausted'], 1, 0] | [['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'retry', 'exhausted', 'auth-exhausted'], 0, 0] | Failed |
| 2 | [[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0] | [[['refresh', 1], 'auth-replay', ['refresh', 2], 'stale', 'stale', 'auth-replay'], 0, 0] | Passed |
| 3 | [[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0] | [[['refresh', 1], 'stale', 'terminal', 'terminal'], 1, 0] | Passed |
| 4 | [['exhausted', 'auth-exhausted'], 0, 0] | [['exhausted', 'auth-exhausted'], 0, 0] | Passed |
| 5 | [[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0] | [[['refresh', 1], ['refresh', 1], 'auth-replay'], 0, 0] | Passed |
SHA-256 / ddc5c361cb6bdfc0696f4f3da705f1c9d990e3919fcc201a26ac56b136a9e4ed
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 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:52.351777+00:00.
Case digest / 638298e2f0614b7876801ff47ffa3588443d404cb80d3f0581737a5f3e00fb9f