FAILURE MAP
← Case archive

FA-30061 / HTTP retries / Open access

File-backed request replay integrity: Open valid violates retry transition semantics · case 01

Open valid violates retry transition semantics

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

ROOT CAUSE

Open valid violates retry transition semantics

THE FAILURE

Open valid violates retry transition semantics

Unsuccessful approach: The attempted repair changes the faulty site to valid=snapshot[1]>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=False
        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!=snapshot:
                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 fixtureActualExpectedOutcome
0[[], 0][[], 0]Passed
1[['invalid', 'invalid', 'invalid', 'invalid', 'invalid'], 2][[2, 2, 0, 'rewound', 1], 3]Failed
2[['invalid', 'invalid'], 0][['changed', 'invalid'], 0]Failed
3[['invalid', 'invalid'], 0][['changed', 'invalid'], 0]Failed
4[['invalid', 'invalid'], 0][['changed', 'invalid'], 0]Failed
5[['invalid', 'invalid', 'invalid', 'invalid'], 0][[0, 'rewound', 'invalid', 'invalid'], 0]Failed
6[['invalid'], 1][[1], 2]Failed
7[['invalid', 'invalid', 'invalid'], 1][['rewound', 'invalid', 'invalid'], 1]Failed

SHA-256 / a8504aa1030b19fada4738c3430bf1a69130a4694d5aa5fb95b675513b8f9bc0

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=snapshot[1]>0
        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!=snapshot:
                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 fixtureActualExpectedOutcome
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[['changed', 'invalid'], 0][['changed', 'invalid'], 0]Passed
5[['invalid', 'invalid', 'invalid', 'invalid'], 0][[0, 'rewound', 'invalid', 'invalid'], 0]Failed
6[[1], 2][[1], 2]Passed
7[['rewound', 'invalid', 'invalid'], 1][['rewound', 'invalid', 'invalid'], 1]Passed

SHA-256 / aaed94797405989127661e4df350ba7ca36eabae5976af2f016dc5895276857f

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 / 3c70abb2669c2fdd17177883b65501240d023c20a6a9a70e1358e5288a8cb0a3