FAILURE MAP
← Case archive

FA-26801 / HTTP ranges / Open access

A longer boundary prefix is not mistaken for the chosen delimiter · case 01

A longer boundary prefix is not mistaken for the chosen delimiter.

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

ROOT CAUSE

The multipart-client-boundary-token-end decision uses return "part" if line.startswith("--"+boundary) else "payload".

VERIFIED REPAIR

Apply the bounded decision exactly: return "close" if line=="--"+boundary+"--" else ("part" if line=="--"+boundary else "payload")

Unsuccessful approach: The partial repair uses return "close" if line.endswith("--") else ("part" if line=="--"+boundary else "payload"), which still violates the stated contract.

Case contract

A delimiter line equals --boundary or --boundary--; lines are already stripped of CRLF. Return part, close, or payload.

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(line, boundary):
    return "part" if line.startswith("--"+boundary) else "payload"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-boundary-token-end fixture 0', solve("--b"+str(N)+"x","b"+str(N)), "payload")
check('multipart-client-boundary-token-end fixture 1', solve("unrelated--","b"), "payload")
check('multipart-client-boundary-token-end fixture 2', solve("--b--","b"), "close")
check('multipart-client-boundary-token-end fixture 3', solve("--b","b"), "part")
check('multipart-client-boundary-token-end fixture 4', solve("","b"), "payload")
check('multipart-client-boundary-token-end fixture 5', solve("--b-x","b"), "payload")
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
multipart-client-boundary-token-end fixture 0partpayloadFailed
multipart-client-boundary-token-end fixture 1payloadpayloadPassed
multipart-client-boundary-token-end fixture 2partcloseFailed
multipart-client-boundary-token-end fixture 3partpartPassed
multipart-client-boundary-token-end fixture 4payloadpayloadPassed
multipart-client-boundary-token-end fixture 5partpayloadFailed

SHA-256 / 352b7456195614d6a2db9bfb9cf80a9f95b3b285d944020bad944ba94fe0db10

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(line, boundary):
    return "close" if line.endswith("--") else ("part" if line=="--"+boundary else "payload")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-boundary-token-end fixture 0', solve("--b"+str(N)+"x","b"+str(N)), "payload")
check('multipart-client-boundary-token-end fixture 1', solve("unrelated--","b"), "payload")
check('multipart-client-boundary-token-end fixture 2', solve("--b--","b"), "close")
check('multipart-client-boundary-token-end fixture 3', solve("--b","b"), "part")
check('multipart-client-boundary-token-end fixture 4', solve("","b"), "payload")
check('multipart-client-boundary-token-end fixture 5', solve("--b-x","b"), "payload")
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
multipart-client-boundary-token-end fixture 0payloadpayloadPassed
multipart-client-boundary-token-end fixture 1closepayloadFailed
multipart-client-boundary-token-end fixture 2closeclosePassed
multipart-client-boundary-token-end fixture 3partpartPassed
multipart-client-boundary-token-end fixture 4payloadpayloadPassed
multipart-client-boundary-token-end fixture 5payloadpayloadPassed

SHA-256 / 8720c05e4e1d92d1fbc2100fbaf96f4f91544aa966b0ef61486ff638b1ee11c9

3 / The verified repair

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

N = 1
observations = []
def solve(line, boundary):
    return "close" if line=="--"+boundary+"--" else ("part" if line=="--"+boundary else "payload")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-boundary-token-end fixture 0', solve("--b"+str(N)+"x","b"+str(N)), "payload")
check('multipart-client-boundary-token-end fixture 1', solve("unrelated--","b"), "payload")
check('multipart-client-boundary-token-end fixture 2', solve("--b--","b"), "close")
check('multipart-client-boundary-token-end fixture 3', solve("--b","b"), "part")
check('multipart-client-boundary-token-end fixture 4', solve("","b"), "payload")
check('multipart-client-boundary-token-end fixture 5', solve("--b-x","b"), "payload")
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
multipart-client-boundary-token-end fixture 0payloadpayloadPassed
multipart-client-boundary-token-end fixture 1payloadpayloadPassed
multipart-client-boundary-token-end fixture 2closeclosePassed
multipart-client-boundary-token-end fixture 3partpartPassed
multipart-client-boundary-token-end fixture 4payloadpayloadPassed
multipart-client-boundary-token-end fixture 5payloadpayloadPassed

SHA-256 / 72bd7b2d6e3c9b9d87f4cca07a22c07cd8bafce2cc20f19b88d298e31b617af4

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

Case digest / 51867721cd1f3370dd602086e6ab2bb6c1bf25c8f98e14c53a4ce3be0e65f2cd