FAILURE MAP
← Case archive

FA-30326 / HTTP retries / Open access

Challenge refresh without ordinary retry amplification: Network charge violates retry transition semantics · case 01

Network charge violates retry transition semantics

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Network charge violates retry transition semantics

THE FAILURE

Network charge violates retry transition semantics

Unsuccessful approach: The attempted repair changes the faulty site to ordinary-=2 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=0; 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 fixtureActualExpectedOutcome
0[[], 0, 0][[], 0, 0]Passed
1[['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'exhausted', 'exhausted', 'auth-exhausted'], 0, 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 / 81526a4f084a810f59ef70502d37c1420b9e33a615ab416d05ad263fa1b3b1ff

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==0: out.append('exhausted'); continue
            ordinary-=2; 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 fixtureActualExpectedOutcome
0[[], 0, 0][[], 0, 0]Passed
1[['retry', ['refresh', 1], 'waiting', 'coalesced', 'auth-replay', 'stale', 'exhausted', 'exhausted', 'auth-exhausted'], 0, 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 / 92c7e0b4de32daacf2092999b01af8104d003b210199fe14904f3d35de1e3185

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 / 09fcc415cbf1738e0b2f8b674071adbf1ad34285753afe869c074be3c7ae4b6a