FAILURE MAP
← Case archive

FA-27406 / HTTP ranges / Open access

An upload status endpoint reports committed byte coverage: negative offsets cannot appear in acknowledged ranges · case 01

An upload status endpoint reports committed byte coverage: negative offsets cannot appear in acknowledged ranges.

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

ROOT CAUSE

The upload-coverage-probe-negative-offset decision uses positions=sorted(set(x['committed'])) if any(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<-1 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], 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>=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('negative-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('negative-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('negative-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('negative-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('negative-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('negative-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('negative-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('negative-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('negative-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
negative-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
negative-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
negative-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
negative-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
negative-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
negative-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
negative-offset fixture 6NoneNonePassed
negative-offset fixture 7['partial', 'bytes=-1--1', 0]NoneFailed
negative-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / 84df39a8fcbf8ba7d34c0ec1237237b373abc08f836b5ee6e3790ca8b54aa321

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<-1 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('negative-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('negative-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('negative-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('negative-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('negative-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('negative-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('negative-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('negative-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('negative-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
negative-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
negative-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
negative-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
negative-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
negative-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
negative-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
negative-offset fixture 6NoneNonePassed
negative-offset fixture 7['partial', 'bytes=-1--1', 0]NoneFailed
negative-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / b8660efce1f3e1c7df6804901161aee72e876727e6a9c19d55fd8476314fe914

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('negative-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('negative-offset fixture 1', json.loads(json.dumps(solve({'total':3,'committed':[2,0,1]}))), json.loads(json.dumps(['complete','bytes=0-2',3])))
check('negative-offset fixture 2', json.loads(json.dumps(solve({'total':0,'committed':[]}))), json.loads(json.dumps(['complete',None,0])))
check('negative-offset fixture 3', json.loads(json.dumps(solve({'total':4,'committed':[2,3]}))), json.loads(json.dumps(['partial','bytes=2-3',0])))
check('negative-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('negative-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('negative-offset fixture 6', json.loads(json.dumps(solve({'total':3,'committed':[3]}))), json.loads(json.dumps(None)))
check('negative-offset fixture 7', json.loads(json.dumps(solve({'total':3,'committed':[-1]}))), json.loads(json.dumps(None)))
check('negative-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
negative-offset fixture 0['partial', 'bytes=0-1,4-5', 2]['partial', 'bytes=0-1,4-5', 2]Passed
negative-offset fixture 1['complete', 'bytes=0-2', 3]['complete', 'bytes=0-2', 3]Passed
negative-offset fixture 2['complete', None, 0]['complete', None, 0]Passed
negative-offset fixture 3['partial', 'bytes=2-3', 0]['partial', 'bytes=2-3', 0]Passed
negative-offset fixture 4['partial', 'bytes=0-0,2-2', 1]['partial', 'bytes=0-0,2-2', 1]Passed
negative-offset fixture 5['partial', 'bytes=0-0', 1]['partial', 'bytes=0-0', 1]Passed
negative-offset fixture 6NoneNonePassed
negative-offset fixture 7NoneNonePassed
negative-offset fixture 8['partial', None, 0]['partial', None, 0]Passed

SHA-256 / 79f737ec2003c3f41eefa682a19e459527d8e93ba9ffc4b86a3b5c497ba53f32

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.728965+00:00.

Case digest / a623d0815a2eb152129f31206273eeaf623d7cfaff4f4271588adb40a6ae3cf1