FA-27486 / HTTP ranges / Open access
A row-range endpoint builds byte-addressable line record metadata: repeat row selectors retain repeated response bodies · case 01
A row-range endpoint builds byte-addressable line record metadata: repeat row selectors retain repeated response bodies.
ROOT CAUSE
The record-range-byte-index-selection-multiplicity decision uses data=x['text'].encode('utf-8') pos=3 if data.startswith(b'\xef\xbb\xbf') else 0 entries=[] bodies=[] while pos<len(data): end=data.find(b'\n',pos) final=end<0 end=len(data) if final else end content_end=end-1 if not final and end>pos and data[end-1]==13 else end terminator=0 if final else end-content_end+1 body=data[pos:content_end] if body: if len(body)>x['cap']: return None entries.append([pos,len(body),terminator]) bodies.append(body.hex()) pos=len(data) if final else end+1 if any(i<0 or i>=len(bodies) for i in x['select']): return None return [entries,[bodies[i] for i in sorted(set(x['select']))]].
VERIFIED REPAIR
Apply the bounded decision exactly: data=x['text'].encode('utf-8') pos=3 if data.startswith(b'\xef\xbb\xbf') else 0 entries=[] bodies=[] while pos<len(data): end=data.find(b'\n',pos) final=end<0 end=len(data) if final else end content_end=end-1 if not final and end>pos and data[end-1]==13 else end terminator=0 if final else end-content_end+1 body=data[pos:content_end] if body: if len(body)>x['cap']: return None entries.append([pos,len(body),terminator]) bodies.append(body.hex()) pos=len(data) if final else end+1 if any(i<0 or i>=len(bodies) for i in x['select']): return None return [entries,[bodies[i] for i in x['select']]]
Unsuccessful approach: The partial repair uses data=x['text'].encode('utf-8') pos=3 if data.startswith(b'\xef\xbb\xbf') else 0 entries=[] bodies=[] while pos<len(data): end=data.find(b'\n',pos) final=end<0 end=len(data) if final else end content_end=end-1 if not final and end>pos and data[end-1]==13 else end terminator=0 if final else end-content_end+1 body=data[pos:content_end] if body: if len(body)>x['cap']: return None entries.append([pos,len(body),terminator]) bodies.append(body.hex()) pos=len(data) if final else end+1 if any(i<0 or i>=len(bodies) for i in x['select']): return None return [entries,[bodies[i] for i in dict.fromkeys(x['select'])]], which still violates the stated contract.
Case contract
Build a bounded row index over UTF-8 text. A leading UTF-8 BOM is excluded from records but occupies3 representation bytes. LF or CRLF terminates a row; blank rows are ignored. A final unterminated nonempty row is included. Return [entries,selected-hex-bodies], with each entry [absolute-byte-start,content-byte-count,terminator-byte-count]. Enforce a per-record byte cap and nonnegative selected row indices. Selection order and multiplicity are meaningful.
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):
data=x['text'].encode('utf-8')
pos=3 if data.startswith(b'\xef\xbb\xbf') else 0
entries=[]
bodies=[]
while pos<len(data):
end=data.find(b'\n',pos)
final=end<0
end=len(data) if final else end
content_end=end-1 if not final and end>pos and data[end-1]==13 else end
terminator=0 if final else end-content_end+1
body=data[pos:content_end]
if body:
if len(body)>x['cap']: return None
entries.append([pos,len(body),terminator])
bodies.append(body.hex())
pos=len(data) if final else end+1
if any(i<0 or i>=len(bodies) for i in x['select']): return None
return [entries,[bodies[i] for i in sorted(set(x['select']))]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selection-multiplicity fixture 0', json.loads(json.dumps(solve({'text':'a\r\nb\n\ncd','cap':5,'select':[2,0,2]}))), json.loads(json.dumps([[[0,1,2],[3,1,1],[6,2,0]],['6364','61','6364']])))
check('selection-multiplicity fixture 1', json.loads(json.dumps(solve({'text':'\ufeffa\n','cap':1,'select':[0]}))), json.loads(json.dumps([[[3,1,1]],['61']])))
check('selection-multiplicity fixture 2', json.loads(json.dumps(solve({'text':'\n\r\n','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 3', json.loads(json.dumps(solve({'text':'abc','cap':2,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 4', json.loads(json.dumps(solve({'text':'é','cap':1,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 5', json.loads(json.dumps(solve({'text':"é"*N+"\n",'cap':2*N,'select':[0]}))), json.loads(json.dumps([[[0,2*N,1]],["c3a9"*N]])))
check('selection-multiplicity fixture 6', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[-1]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 7', json.loads(json.dumps(solve({'text':'','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 8', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[1]}))), json.loads(json.dumps(None)))
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 |
|---|---|---|---|
| selection-multiplicity fixture 0 | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['61', '6364']] | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['6364', '61', '6364']] | Failed |
| selection-multiplicity fixture 1 | [[[3, 1, 1]], ['61']] | [[[3, 1, 1]], ['61']] | Passed |
| selection-multiplicity fixture 2 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 3 | None | None | Passed |
| selection-multiplicity fixture 4 | None | None | Passed |
| selection-multiplicity fixture 5 | [[[0, 2, 1]], ['c3a9']] | [[[0, 2, 1]], ['c3a9']] | Passed |
| selection-multiplicity fixture 6 | None | None | Passed |
| selection-multiplicity fixture 7 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 8 | None | None | Passed |
SHA-256 / 1a2ad30c849ac6573238d9056a34309f8c26de64bb0f122a242da3496e7d6667
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
data=x['text'].encode('utf-8')
pos=3 if data.startswith(b'\xef\xbb\xbf') else 0
entries=[]
bodies=[]
while pos<len(data):
end=data.find(b'\n',pos)
final=end<0
end=len(data) if final else end
content_end=end-1 if not final and end>pos and data[end-1]==13 else end
terminator=0 if final else end-content_end+1
body=data[pos:content_end]
if body:
if len(body)>x['cap']: return None
entries.append([pos,len(body),terminator])
bodies.append(body.hex())
pos=len(data) if final else end+1
if any(i<0 or i>=len(bodies) for i in x['select']): return None
return [entries,[bodies[i] for i in dict.fromkeys(x['select'])]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selection-multiplicity fixture 0', json.loads(json.dumps(solve({'text':'a\r\nb\n\ncd','cap':5,'select':[2,0,2]}))), json.loads(json.dumps([[[0,1,2],[3,1,1],[6,2,0]],['6364','61','6364']])))
check('selection-multiplicity fixture 1', json.loads(json.dumps(solve({'text':'\ufeffa\n','cap':1,'select':[0]}))), json.loads(json.dumps([[[3,1,1]],['61']])))
check('selection-multiplicity fixture 2', json.loads(json.dumps(solve({'text':'\n\r\n','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 3', json.loads(json.dumps(solve({'text':'abc','cap':2,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 4', json.loads(json.dumps(solve({'text':'é','cap':1,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 5', json.loads(json.dumps(solve({'text':"é"*N+"\n",'cap':2*N,'select':[0]}))), json.loads(json.dumps([[[0,2*N,1]],["c3a9"*N]])))
check('selection-multiplicity fixture 6', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[-1]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 7', json.loads(json.dumps(solve({'text':'','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 8', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[1]}))), json.loads(json.dumps(None)))
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 |
|---|---|---|---|
| selection-multiplicity fixture 0 | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['6364', '61']] | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['6364', '61', '6364']] | Failed |
| selection-multiplicity fixture 1 | [[[3, 1, 1]], ['61']] | [[[3, 1, 1]], ['61']] | Passed |
| selection-multiplicity fixture 2 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 3 | None | None | Passed |
| selection-multiplicity fixture 4 | None | None | Passed |
| selection-multiplicity fixture 5 | [[[0, 2, 1]], ['c3a9']] | [[[0, 2, 1]], ['c3a9']] | Passed |
| selection-multiplicity fixture 6 | None | None | Passed |
| selection-multiplicity fixture 7 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 8 | None | None | Passed |
SHA-256 / a3165bff4b54ee89e658b0e7f758e62cfc4572e9f1f3eb4cad175d270b5e4bc5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
data=x['text'].encode('utf-8')
pos=3 if data.startswith(b'\xef\xbb\xbf') else 0
entries=[]
bodies=[]
while pos<len(data):
end=data.find(b'\n',pos)
final=end<0
end=len(data) if final else end
content_end=end-1 if not final and end>pos and data[end-1]==13 else end
terminator=0 if final else end-content_end+1
body=data[pos:content_end]
if body:
if len(body)>x['cap']: return None
entries.append([pos,len(body),terminator])
bodies.append(body.hex())
pos=len(data) if final else end+1
if any(i<0 or i>=len(bodies) for i in x['select']): return None
return [entries,[bodies[i] for i in x['select']]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selection-multiplicity fixture 0', json.loads(json.dumps(solve({'text':'a\r\nb\n\ncd','cap':5,'select':[2,0,2]}))), json.loads(json.dumps([[[0,1,2],[3,1,1],[6,2,0]],['6364','61','6364']])))
check('selection-multiplicity fixture 1', json.loads(json.dumps(solve({'text':'\ufeffa\n','cap':1,'select':[0]}))), json.loads(json.dumps([[[3,1,1]],['61']])))
check('selection-multiplicity fixture 2', json.loads(json.dumps(solve({'text':'\n\r\n','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 3', json.loads(json.dumps(solve({'text':'abc','cap':2,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 4', json.loads(json.dumps(solve({'text':'é','cap':1,'select':[]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 5', json.loads(json.dumps(solve({'text':"é"*N+"\n",'cap':2*N,'select':[0]}))), json.loads(json.dumps([[[0,2*N,1]],["c3a9"*N]])))
check('selection-multiplicity fixture 6', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[-1]}))), json.loads(json.dumps(None)))
check('selection-multiplicity fixture 7', json.loads(json.dumps(solve({'text':'','cap':0,'select':[]}))), json.loads(json.dumps([[],[]])))
check('selection-multiplicity fixture 8', json.loads(json.dumps(solve({'text':'a\n','cap':1,'select':[1]}))), json.loads(json.dumps(None)))
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 |
|---|---|---|---|
| selection-multiplicity fixture 0 | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['6364', '61', '6364']] | [[[0, 1, 2], [3, 1, 1], [6, 2, 0]], ['6364', '61', '6364']] | Passed |
| selection-multiplicity fixture 1 | [[[3, 1, 1]], ['61']] | [[[3, 1, 1]], ['61']] | Passed |
| selection-multiplicity fixture 2 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 3 | None | None | Passed |
| selection-multiplicity fixture 4 | None | None | Passed |
| selection-multiplicity fixture 5 | [[[0, 2, 1]], ['c3a9']] | [[[0, 2, 1]], ['c3a9']] | Passed |
| selection-multiplicity fixture 6 | None | None | Passed |
| selection-multiplicity fixture 7 | [[], []] | [[], []] | Passed |
| selection-multiplicity fixture 8 | None | None | Passed |
SHA-256 / 504c62cb357f512ea2d43270acc07a458878282e808fa5f49bbb858f0cf4a9be
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:25.498230+00:00.
Case digest / 7c60d65519452e7f54f0895844b45c7ea523ba04548d31838825c6d8acb0adfa