FA-26931 / HTTP ranges / Open access
A packed-object origin maps logical byte requests to immutable backing objects: negative mapped counts are invalid rather than empty spans · case 01
A packed-object origin maps logical byte requests to immutable backing objects: negative mapped counts are invalid rather than empty spans.
ROOT CAUSE
The packed-origin-map-negative-count decision uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or physical<0: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']).
THE FAILURE
The packed-origin-map-negative-count decision uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or physical<0: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']).
Unsuccessful approach: The partial repair uses cells={} for logical,handle,physical,count in x['extents']: if count==0: continue if logical<0 or physical<0 or count<-1: return None if handle not in x['packs']: return None pack=x['packs'][handle] if physical+count>len(pack): return None for i in range(count): at=logical+i if at in cells: return None cells[at]=pack[physical+i] if any(at not in cells for at in x['requested']): return None return ''.join(cells[at] for at in x['requested']), which still violates the stated contract.
Case contract
x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.
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):
cells={}
for logical,handle,physical,count in x['extents']:
if count==0: continue
if logical<0 or physical<0: return None
if handle not in x['packs']: return None
pack=x['packs'][handle]
if physical+count>len(pack): return None
for i in range(count):
at=logical+i
if at in cells: return None
cells[at]=pack[physical+i]
if any(at not in cells for at in x['requested']): return None
return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-count fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-count fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-count fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-count fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-count fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-count fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-count fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| negative-count fixture 0 | axbycz | axbycz | Passed |
| negative-count fixture 1 | cac | cac | Passed |
| negative-count fixture 2 | None | None | Passed |
| negative-count fixture 3 | None | None | Passed |
| negative-count fixture 4 | a | a | Passed |
| negative-count fixture 5 | None | None | Passed |
| negative-count fixture 6 | None | None | Passed |
| negative-count fixture 7 | | None | Failed |
| negative-count fixture 8 | None | None | Passed |
| negative-count fixture 9 | None | None | Passed |
| negative-count fixture 10 | | | Passed |
| negative-count fixture 11 | p | p | Passed |
SHA-256 / d2ad11e76d11c93973bd7918ac107483b9a3eb9d0fa885cde73c29ed7d820c23
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
cells={}
for logical,handle,physical,count in x['extents']:
if count==0: continue
if logical<0 or physical<0 or count<-1: return None
if handle not in x['packs']: return None
pack=x['packs'][handle]
if physical+count>len(pack): return None
for i in range(count):
at=logical+i
if at in cells: return None
cells[at]=pack[physical+i]
if any(at not in cells for at in x['requested']): return None
return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-count fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-count fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-count fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-count fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-count fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-count fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-count fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| negative-count fixture 0 | axbycz | axbycz | Passed |
| negative-count fixture 1 | cac | cac | Passed |
| negative-count fixture 2 | None | None | Passed |
| negative-count fixture 3 | None | None | Passed |
| negative-count fixture 4 | a | a | Passed |
| negative-count fixture 5 | None | None | Passed |
| negative-count fixture 6 | None | None | Passed |
| negative-count fixture 7 | | None | Failed |
| negative-count fixture 8 | None | None | Passed |
| negative-count fixture 9 | None | None | Passed |
| negative-count fixture 10 | | | Passed |
| negative-count fixture 11 | p | p | Passed |
SHA-256 / 3d70d0a7a5b87711719067218ea58d7bd66f28dbb205e88c7504d1121c4fc04b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 12 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
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:20.415939+00:00.
Case digest / f68274db33a23190da6547cc62ee1e1e5dae876e1a8649f8325ffefec9bd2f4d