FAILURE MAP
← Case archive

FA-30556 / HTTP retries / Open access

Bounded body spooling for replay: Spill boundary violates retry transition semantics · case 01

Spill boundary violates retry transition semantics

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

ROOT CAUSE

Spill boundary violates retry transition semantics

THE FAILURE

Spill boundary violates retry transition semantics

Unsuccessful approach: The attempted repair changes the faulty site to len(chunk)>threshold but still violates a regression oracle.

Case contract

open(memory threshold,total limit) begins capturing byte-list chunks. append stores an entire chunk only if total limit permits; crossing memory threshold spills all prior memory and new chunk to modeled disk. fail_disk invalidates captured body. seal finalizes; replay returns captured bytes only when sealed and valid. Overflow is terminal until next open. Return replay decisions and storage mode.

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):
    threshold=0; limit=0; memory=[]; disk=[]; size=0; mode='memory'; state='idle'; out=[]
    for e in events:
        if e[0]=='open':
            threshold=e[1]; limit=e[2]; memory=[]; disk=[]; size=0; mode='memory'; state='capturing'
        elif e[0]=='append':
            if state!='capturing': continue
            chunk=list(e[1])
            if size+len(chunk)>limit:
                state='overflow'; memory=[]; disk=[]; continue
            if mode=='memory' and size+len(chunk)>=threshold:
                disk=list(memory); memory=[]; mode='disk'
            if mode=='disk': disk.extend(chunk)
            else: memory.extend(chunk)
            size+=len(chunk)
        elif e[0]=='seal':
            if state=='capturing': state='sealed'
        elif e[0]=='fail_disk':
            if mode=='disk': state='io-error'; memory=[]; disk=[]
        elif e[0]=='replay':
            if state!='sealed': out.append(state); continue
            out.append(list(disk if mode=='disk' else memory))
    return [out,mode]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],'memory'])
check('1', solve([('open',3,8),('append',[N,N+1]),('append',[N+2]),('seal',),('replay',)]), [[[N,N+1,N+2]],'memory'])
check('2', solve([('open',2,8),('append',[N,N+1]),('append',[N+2,N+3]),('append',[N+4]),('seal',),('replay',)]), [[[N,N+1,N+2,N+3,N+4]],'disk'])
check('3', solve([('open',2,3),('append',[N,N+1]),('append',[N+2]),('append',[N+3]),('seal',),('replay',)]), [['overflow'],'disk'])
check('4', solve([('open',0,4),('append',[N]),('fail_disk',),('seal',),('replay',),('open',4,4),('append',[N+1]),('seal',),('replay',)]), [['io-error',[N+1]],'memory'])
check('5', solve([('open',2,2),('append',[N]),('replay',),('seal',),('append',[N+1]),('replay',)]), [['capturing',[N]],'memory'])
check('6', solve([('open',0,0),('append',[]),('seal',),('replay',)]), [[[]],'memory'])
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[[], 'memory'][[], 'memory']Passed
1[[[1, 2, 3]], 'disk'][[[1, 2, 3]], 'memory']Failed
2[[[1, 2, 3, 4, 5]], 'disk'][[[1, 2, 3, 4, 5]], 'disk']Passed
3[['overflow'], 'disk'][['overflow'], 'disk']Passed
4[['io-error', [2]], 'memory'][['io-error', [2]], 'memory']Passed
5[['capturing', [1]], 'memory'][['capturing', [1]], 'memory']Passed
6[[[]], 'disk'][[[]], 'memory']Failed

SHA-256 / c13c47f7f035871ea4511f4a85f7703c2a0c99479aeb2efedfc0466e9413fa42

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events):
    threshold=0; limit=0; memory=[]; disk=[]; size=0; mode='memory'; state='idle'; out=[]
    for e in events:
        if e[0]=='open':
            threshold=e[1]; limit=e[2]; memory=[]; disk=[]; size=0; mode='memory'; state='capturing'
        elif e[0]=='append':
            if state!='capturing': continue
            chunk=list(e[1])
            if size+len(chunk)>limit:
                state='overflow'; memory=[]; disk=[]; continue
            if mode=='memory' and len(chunk)>threshold:
                disk=list(memory); memory=[]; mode='disk'
            if mode=='disk': disk.extend(chunk)
            else: memory.extend(chunk)
            size+=len(chunk)
        elif e[0]=='seal':
            if state=='capturing': state='sealed'
        elif e[0]=='fail_disk':
            if mode=='disk': state='io-error'; memory=[]; disk=[]
        elif e[0]=='replay':
            if state!='sealed': out.append(state); continue
            out.append(list(disk if mode=='disk' else memory))
    return [out,mode]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([]), [[],'memory'])
check('1', solve([('open',3,8),('append',[N,N+1]),('append',[N+2]),('seal',),('replay',)]), [[[N,N+1,N+2]],'memory'])
check('2', solve([('open',2,8),('append',[N,N+1]),('append',[N+2,N+3]),('append',[N+4]),('seal',),('replay',)]), [[[N,N+1,N+2,N+3,N+4]],'disk'])
check('3', solve([('open',2,3),('append',[N,N+1]),('append',[N+2]),('append',[N+3]),('seal',),('replay',)]), [['overflow'],'disk'])
check('4', solve([('open',0,4),('append',[N]),('fail_disk',),('seal',),('replay',),('open',4,4),('append',[N+1]),('seal',),('replay',)]), [['io-error',[N+1]],'memory'])
check('5', solve([('open',2,2),('append',[N]),('replay',),('seal',),('append',[N+1]),('replay',)]), [['capturing',[N]],'memory'])
check('6', solve([('open',0,0),('append',[]),('seal',),('replay',)]), [[[]],'memory'])
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[[], 'memory'][[], 'memory']Passed
1[[[1, 2, 3]], 'memory'][[[1, 2, 3]], 'memory']Passed
2[[[1, 2, 3, 4, 5]], 'memory'][[[1, 2, 3, 4, 5]], 'disk']Failed
3[['overflow'], 'memory'][['overflow'], 'disk']Failed
4[['io-error', [2]], 'memory'][['io-error', [2]], 'memory']Passed
5[['capturing', [1]], 'memory'][['capturing', [1]], 'memory']Passed
6[[[]], 'memory'][[[]], 'memory']Passed

SHA-256 / f237c29343a3b0904a59e87322cf15386e082ec93e6335fce3fbb69ddd5858b1

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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:54.320954+00:00.

Case digest / ce005350f8f0908faf3baaf9c8509f086ff35b669ee0061bec5bb31dda98f08e