FAILURE MAP
← Case archive

FA-26396 / HTTP ranges / Open access

Range metadata uses the negotiated variant length · case 01

Range metadata uses the negotiated variant length.

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

ROOT CAUSE

The selected-length-metadata decision uses return [start,stop,len(plain)].

VERIFIED REPAIR

Apply the bounded decision exactly: return [start,stop,len(encoded if coding=="encoded" else plain)]

Unsuccessful approach: The partial repair uses return [start,stop,max(len(plain),len(encoded))], which still violates the stated contract.

Case contract

Return content-range metadata as [start,stop,selected-length] for already valid inclusive bounds; selected encoding is identity or encoded.

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(plain, encoded, coding, start, stop):
    return [start,stop,len(plain)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selected-length-metadata fixture 0', solve("abcdef"*N,"XYZ"*N,"encoded",0,1), [0,1,3*N])
check('selected-length-metadata fixture 1', solve("ab","WXYZ","identity",0,1), [0,1,2])
check('selected-length-metadata fixture 2', solve("abc","X","identity",0,0), [0,0,3])
check('selected-length-metadata fixture 3', solve("abc","X","encoded",0,0), [0,0,1])
check('selected-length-metadata fixture 4', solve("xy","XY","encoded",0,1), [0,1,2])
check('selected-length-metadata fixture 5', solve("abcd","XX","encoded",1,1), [1,1,2])
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
selected-length-metadata fixture 0[0, 1, 6][0, 1, 3]Failed
selected-length-metadata fixture 1[0, 1, 2][0, 1, 2]Passed
selected-length-metadata fixture 2[0, 0, 3][0, 0, 3]Passed
selected-length-metadata fixture 3[0, 0, 3][0, 0, 1]Failed
selected-length-metadata fixture 4[0, 1, 2][0, 1, 2]Passed
selected-length-metadata fixture 5[1, 1, 4][1, 1, 2]Failed

SHA-256 / 67048bea65843b6666327c93dfd2086a3ffcb4fcc5deb7d1acde11a0756c6807

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(plain, encoded, coding, start, stop):
    return [start,stop,max(len(plain),len(encoded))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selected-length-metadata fixture 0', solve("abcdef"*N,"XYZ"*N,"encoded",0,1), [0,1,3*N])
check('selected-length-metadata fixture 1', solve("ab","WXYZ","identity",0,1), [0,1,2])
check('selected-length-metadata fixture 2', solve("abc","X","identity",0,0), [0,0,3])
check('selected-length-metadata fixture 3', solve("abc","X","encoded",0,0), [0,0,1])
check('selected-length-metadata fixture 4', solve("xy","XY","encoded",0,1), [0,1,2])
check('selected-length-metadata fixture 5', solve("abcd","XX","encoded",1,1), [1,1,2])
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
selected-length-metadata fixture 0[0, 1, 6][0, 1, 3]Failed
selected-length-metadata fixture 1[0, 1, 4][0, 1, 2]Failed
selected-length-metadata fixture 2[0, 0, 3][0, 0, 3]Passed
selected-length-metadata fixture 3[0, 0, 3][0, 0, 1]Failed
selected-length-metadata fixture 4[0, 1, 2][0, 1, 2]Passed
selected-length-metadata fixture 5[1, 1, 4][1, 1, 2]Failed

SHA-256 / ff23ddc66117e9176ccb6694ae5f6a534e88bfeb0f85761f6e78403bc02d9158

3 / The verified repair

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

N = 1
observations = []
def solve(plain, encoded, coding, start, stop):
    return [start,stop,len(encoded if coding=="encoded" else plain)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('selected-length-metadata fixture 0', solve("abcdef"*N,"XYZ"*N,"encoded",0,1), [0,1,3*N])
check('selected-length-metadata fixture 1', solve("ab","WXYZ","identity",0,1), [0,1,2])
check('selected-length-metadata fixture 2', solve("abc","X","identity",0,0), [0,0,3])
check('selected-length-metadata fixture 3', solve("abc","X","encoded",0,0), [0,0,1])
check('selected-length-metadata fixture 4', solve("xy","XY","encoded",0,1), [0,1,2])
check('selected-length-metadata fixture 5', solve("abcd","XX","encoded",1,1), [1,1,2])
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
selected-length-metadata fixture 0[0, 1, 3][0, 1, 3]Passed
selected-length-metadata fixture 1[0, 1, 2][0, 1, 2]Passed
selected-length-metadata fixture 2[0, 0, 3][0, 0, 3]Passed
selected-length-metadata fixture 3[0, 0, 1][0, 0, 1]Passed
selected-length-metadata fixture 4[0, 1, 2][0, 1, 2]Passed
selected-length-metadata fixture 5[1, 1, 2][1, 1, 2]Passed

SHA-256 / f4da6d7695bd452657bad74a78a969ea234c83c6b376b2cc645f30bba66248ed

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

Case digest / 982dc45f89da5a1ff4fa6b2cc67e046631e284c80d691a98d6258f9eed810696