FAILURE MAP
← Case archive

FA-27401 / HTTP ranges / Open access

An upload status endpoint reports committed byte coverage: the exclusive complete length is not itself a committed byte · case 01

An upload status endpoint reports committed byte coverage: the exclusive complete length is not itself a committed byte.

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

ROOT CAUSE

The upload-coverage-probe-eof-offset decision uses positions=sorted(set(x['committed'])) if any(p<0 or p>x['total'] for p in positions): return None runs=[] for p in positions: if runs and p==runs[-1][1]+1: runs[-1][1]=p else: runs.append([p,p]) field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None prefix=0 for p in positions: if p!=prefix: break prefix+=1 state='complete' if len(positions)==x['total'] else 'partial' return [state,field,prefix].

VERIFIED REPAIR

Apply the bounded decision exactly: positions=sorted(set(x['committed'])) if any(p<0 or p>=x['total'] for p in positions): return None runs=[] for p in positions: if runs and p==runs[-1][1]+1: runs[-1][1]=p else: runs.append([p,p]) field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None prefix=0 for p in positions: if p!=prefix: break prefix+=1 state='complete' if len(positions)==x['total'] else 'partial' return [state,field,prefix]

Unsuccessful approach: The partial repair uses positions=sorted(set(x['committed'])) if any(p<0 or p>x['total']+1 for p in positions): return None runs=[] for p in positions: if runs and p==runs[-1][1]+1: runs[-1][1]=p else: runs.append([p,p]) field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None prefix=0 for p in positions: if p!=prefix: break prefix+=1 state='complete' if len(positions)==x['total'] else 'partial' return [state,field,prefix], which still violates the stated contract.

Case contract

x has a nonnegative complete length and committed byte offsets, which may repeat or arrive unordered. Reject offsets outside the representation. Return [complete|partial,acknowledged-range-field-or-null,next-missing-prefix-offset]. The local acknowledged field uses bytes= followed by comma-separated inclusive runs. Empty coverage has null header; an empty representation is complete. next-missing is the end of the committed contiguous prefix, not the highest written offset.

Why this case matters

Range responses combine representation identity, conditional requests, framing, and partial-object state.

1 / The failure

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

N = 1
observations = []
def solve(x):
    positions=sorted(set(x['committed']))
    if any(p<0 or p>x['total'] for p in positions): return None
    runs=[]
    for p in positions:
        if runs and p==runs[-1][1]+1:
            runs[-1][1]=p
        else:
            runs.append([p,p])
    field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None
    prefix=0
    for p in positions:
        if p!=prefix: break
        prefix+=1
    state='complete' if len(positions)==x['total'] else 'partial'
    return [state,field,prefix]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('eof-offset fixture 0', json.loads(json.dumps(solve({'total':7,'committed':[4,0,1,5,1]}))), json.loads(json.dumps(['partial','bytes=0-1,4-5',2])))
check('eof-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('eof-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('eof-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('eof-offset fixture 4', json.loads(json.dumps(solve({'total':4,'committed':[0,2]}))), json.loads(json.dumps(['partial','bytes=0-0,2-2',1])))
check('eof-offset fixture 5', json.loads(json.dumps(solve({'total':N+1,'committed':list(range(N))}))), json.loads(json.dumps(['partial',"bytes=0-"+str(N-1),N])))
check('eof-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 8', json.loads(json.dumps(solve({'total':3,'committed':[]}))), json.loads(json.dumps(['partial',None,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
eof-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
eof-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
eof-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
eof-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
eof-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
eof-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
eof-offset fixture 6['partial', 'bytes=3-3', 0]NoneFailed
eof-offset fixture 7NoneNonePassed
eof-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / 1f232bd0c91c84c729a23e8628a4b30c9f23a28060e28f0d668624e6a7a9800b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    positions=sorted(set(x['committed']))
    if any(p<0 or p>x['total']+1 for p in positions): return None
    runs=[]
    for p in positions:
        if runs and p==runs[-1][1]+1:
            runs[-1][1]=p
        else:
            runs.append([p,p])
    field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None
    prefix=0
    for p in positions:
        if p!=prefix: break
        prefix+=1
    state='complete' if len(positions)==x['total'] else 'partial'
    return [state,field,prefix]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('eof-offset fixture 0', json.loads(json.dumps(solve({'total':7,'committed':[4,0,1,5,1]}))), json.loads(json.dumps(['partial','bytes=0-1,4-5',2])))
check('eof-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('eof-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('eof-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('eof-offset fixture 4', json.loads(json.dumps(solve({'total':4,'committed':[0,2]}))), json.loads(json.dumps(['partial','bytes=0-0,2-2',1])))
check('eof-offset fixture 5', json.loads(json.dumps(solve({'total':N+1,'committed':list(range(N))}))), json.loads(json.dumps(['partial',"bytes=0-"+str(N-1),N])))
check('eof-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 8', json.loads(json.dumps(solve({'total':3,'committed':[]}))), json.loads(json.dumps(['partial',None,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
eof-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
eof-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
eof-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
eof-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
eof-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
eof-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
eof-offset fixture 6['partial', 'bytes=3-3', 0]NoneFailed
eof-offset fixture 7NoneNonePassed
eof-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / ce969033d030957337dd2b02b52ce3634ed793588b6cd47b514c87e83af66617

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    positions=sorted(set(x['committed']))
    if any(p<0 or p>=x['total'] for p in positions): return None
    runs=[]
    for p in positions:
        if runs and p==runs[-1][1]+1:
            runs[-1][1]=p
        else:
            runs.append([p,p])
    field='bytes='+','.join(str(a)+'-'+str(b) for a,b in runs) if runs else None
    prefix=0
    for p in positions:
        if p!=prefix: break
        prefix+=1
    state='complete' if len(positions)==x['total'] else 'partial'
    return [state,field,prefix]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('eof-offset fixture 0', json.loads(json.dumps(solve({'total':7,'committed':[4,0,1,5,1]}))), json.loads(json.dumps(['partial','bytes=0-1,4-5',2])))
check('eof-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('eof-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('eof-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('eof-offset fixture 4', json.loads(json.dumps(solve({'total':4,'committed':[0,2]}))), json.loads(json.dumps(['partial','bytes=0-0,2-2',1])))
check('eof-offset fixture 5', json.loads(json.dumps(solve({'total':N+1,'committed':list(range(N))}))), json.loads(json.dumps(['partial',"bytes=0-"+str(N-1),N])))
check('eof-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('eof-offset fixture 8', json.loads(json.dumps(solve({'total':3,'committed':[]}))), json.loads(json.dumps(['partial',None,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
eof-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
eof-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
eof-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
eof-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
eof-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
eof-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
eof-offset fixture 6NoneNonePassed
eof-offset fixture 7NoneNonePassed
eof-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / ed4477fe394dc44ac15c564d31d6fba08822515271063acf8c9e2efc64022190

Verification & scope

Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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:24.707151+00:00.

Case digest / a3f9c775a22fd4491022891c425c5cb85475f02473d7c5eb59b98b7a9cccf767