broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(member):
    p=member.split("-")
    return p[:2] if len(p)>=2 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-member-dash-count fixture 0', solve("0-1-"+str(N)), None)
check('range-member-dash-count fixture 1', solve("-"), None)
check('range-member-dash-count fixture 2', solve("0-"+str(N)), ["0",str(N)])
check('range-member-dash-count fixture 3', solve("-"+str(N)), ["",str(N)])
check('range-member-dash-count fixture 4', solve(str(N)+"-"), [str(N),""])
check('range-member-dash-count fixture 5', solve(str(N)), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(member):
    p=member.split("-",1)
    return p if len(p)==2 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-member-dash-count fixture 0', solve("0-1-"+str(N)), None)
check('range-member-dash-count fixture 1', solve("-"), None)
check('range-member-dash-count fixture 2', solve("0-"+str(N)), ["0",str(N)])
check('range-member-dash-count fixture 3', solve("-"+str(N)), ["",str(N)])
check('range-member-dash-count fixture 4', solve(str(N)+"-"), [str(N),""])
check('range-member-dash-count fixture 5', solve(str(N)), 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)

prompt:
A range member has exactly one separator dash.

Return the two text components for exactly one dash, allowing empty one-sided forms but rejecting both empty. Otherwise None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit, full, part):
    return [206,part]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-unsupported-unit-ignore fixture 0', solve("items","f"*N,"p"), [200,"f"*N])
check('range-unsupported-unit-ignore fixture 1', solve("bytes","fff","p"*N), [206,"p"*N])
check('range-unsupported-unit-ignore fixture 2', solve("other","abc","b"), [200,"abc"])
check('range-unsupported-unit-ignore fixture 3', solve("","abc","b"), [200,"abc"])
check('range-unsupported-unit-ignore fixture 4', solve("bytes","",""), [206,""])
check('range-unsupported-unit-ignore fixture 5', solve("lines","",""), [200,""])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit, full, part):
    return [416,""] if unit!="bytes" else [206,part]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-unsupported-unit-ignore fixture 0', solve("items","f"*N,"p"), [200,"f"*N])
check('range-unsupported-unit-ignore fixture 1', solve("bytes","fff","p"*N), [206,"p"*N])
check('range-unsupported-unit-ignore fixture 2', solve("other","abc","b"), [200,"abc"])
check('range-unsupported-unit-ignore fixture 3', solve("","abc","b"), [200,"abc"])
check('range-unsupported-unit-ignore fixture 4', solve("bytes","",""), [206,""])
check('range-unsupported-unit-ignore fixture 5', solve("lines","",""), [200,""])
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)

prompt:
Unsupported range units fall back to the full representation.

This server implements only bytes. Unknown units are ignored with [200,full], bytes returns [206,part]. Unit tokens are already lowercase.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit):
    return "bytes" if "".join(unit.split()).lower()=="bytes" else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-unit-whitespace fixture 0', solve("by tes"), None)
check('range-unit-whitespace fixture 1', solve(" \tBYTES \t"), "bytes")
check('range-unit-whitespace fixture 2', solve("bytes"), "bytes")
check('range-unit-whitespace fixture 3', solve("items"), None)
check('range-unit-whitespace fixture 4', solve("bytes"+" "*N), "bytes")
check('range-unit-whitespace fixture 5', solve("byte\ns"), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit):
    return "bytes" if unit.lower()=="bytes" else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-unit-whitespace fixture 0', solve("by tes"), None)
check('range-unit-whitespace fixture 1', solve(" \tBYTES \t"), "bytes")
check('range-unit-whitespace fixture 2', solve("bytes"), "bytes")
check('range-unit-whitespace fixture 3', solve("items"), None)
check('range-unit-whitespace fixture 4', solve("bytes"+" "*N), "bytes")
check('range-unit-whitespace fixture 5', solve("byte\ns"), 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)

prompt:
Only outer optional whitespace is accepted around range unit tokens.

Trim spaces and tabs around unit; return bytes only for exact case-insensitive bytes token afterward, otherwise None. Interior whitespace is invalid.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(members, limit):
    return "accept" if len(set(members))<=limit else "reject"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-count-before-coalescing fixture 0', solve( ["0-1"]*(N+1),N), "reject")
check('range-count-before-coalescing fixture 1', solve(["0-1"]*N,N), "accept")
check('range-count-before-coalescing fixture 2', solve([],0), "accept")
check('range-count-before-coalescing fixture 3', solve(["0-1"],0), "reject")
check('range-count-before-coalescing fixture 4', solve(["0-1","2-3"],2), "accept")
check('range-count-before-coalescing fixture 5', solve(["0-1"],3), "accept")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(members, limit):
    return "accept" if len(members)<limit else "reject"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-count-before-coalescing fixture 0', solve( ["0-1"]*(N+1),N), "reject")
check('range-count-before-coalescing fixture 1', solve(["0-1"]*N,N), "accept")
check('range-count-before-coalescing fixture 2', solve([],0), "accept")
check('range-count-before-coalescing fixture 3', solve(["0-1"],0), "reject")
check('range-count-before-coalescing fixture 4', solve(["0-1","2-3"],2), "accept")
check('range-count-before-coalescing fixture 5', solve(["0-1"],3), "accept")
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)

prompt:
Request member limits apply before deduplication.

Return accept iff raw parsed member count<=limit, reject otherwise; repeated ranges still consume parser budget.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(digits, limit):
    return int(digits) if len(str(int(digits)))<=limit else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-digit-budget-before-conversion fixture 0', solve("0"*(N+1),N), None)
check('range-digit-budget-before-conversion fixture 1', solve("0"*N,N), 0)
check('range-digit-budget-before-conversion fixture 2', solve("1",1), 1)
check('range-digit-budget-before-conversion fixture 3', solve("001",2), None)
check('range-digit-budget-before-conversion fixture 4', solve("001",3), 1)
check('range-digit-budget-before-conversion fixture 5', solve("9",0), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(digits, limit):
    return int(digits) if len(digits.lstrip("0"))<=limit else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-digit-budget-before-conversion fixture 0', solve("0"*(N+1),N), None)
check('range-digit-budget-before-conversion fixture 1', solve("0"*N,N), 0)
check('range-digit-budget-before-conversion fixture 2', solve("1",1), 1)
check('range-digit-budget-before-conversion fixture 3', solve("001",2), None)
check('range-digit-budget-before-conversion fixture 4', solve("001",3), 1)
check('range-digit-budget-before-conversion fixture 5', solve("9",0), 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)

prompt:
Numeric token budgets count leading zeroes before integer conversion.

Inputs contain only ASCII digits and are nonempty. Reject tokens longer than limit with None; otherwise return integer. Budget counts syntax not numeric magnitude.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parsed):
    return [p for p in parsed if p is not None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-list-invalid-member-policy fixture 0', solve([[0,N],None]), None)
check('range-list-invalid-member-policy fixture 1', solve([None]), None)
check('range-list-invalid-member-policy fixture 2', solve([]), None)
check('range-list-invalid-member-policy fixture 3', solve([[0,N]]), [[0,N]])
check('range-list-invalid-member-policy fixture 4', solve([[0,0],[2,3]]), [[0,0],[2,3]])
check('range-list-invalid-member-policy fixture 5', solve([[N,N],[0,1]]), [[N,N],[0,1]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parsed):
    return parsed if parsed else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-list-invalid-member-policy fixture 0', solve([[0,N],None]), None)
check('range-list-invalid-member-policy fixture 1', solve([None]), None)
check('range-list-invalid-member-policy fixture 2', solve([]), None)
check('range-list-invalid-member-policy fixture 3', solve([[0,N]]), [[0,N]])
check('range-list-invalid-member-policy fixture 4', solve([[0,0],[2,3]]), [[0,0],[2,3]])
check('range-list-invalid-member-policy fixture 5', solve([[N,N],[0,1]]), [[N,N],[0,1]])
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)

prompt:
A malformed member invalidates the whole stipulated strict range list.

Parsed entries are valid [start,end] pairs or None. Return list intact when nonempty and all valid; otherwise None, never silently filter malformed members.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit, members, limit):
    return sum(map(len,members))<=limit
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-header-complete-budget fixture 0', solve("bytes",["0-"+str(N)],3), False)
check('range-header-complete-budget fixture 1', solve("bytes",["0-1","2-3"],10), False)
check('range-header-complete-budget fixture 2', solve("bytes",["0-1"],9), True)
check('range-header-complete-budget fixture 3', solve("bytes",[],6), True)
check('range-header-complete-budget fixture 4', solve("bytes",[],5), False)
check('range-header-complete-budget fixture 5', solve("x",["a"],3), True)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(unit, members, limit):
    return len(",".join(members))<=limit
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-header-complete-budget fixture 0', solve("bytes",["0-"+str(N)],3), False)
check('range-header-complete-budget fixture 1', solve("bytes",["0-1","2-3"],10), False)
check('range-header-complete-budget fixture 2', solve("bytes",["0-1"],9), True)
check('range-header-complete-budget fixture 3', solve("bytes",[],6), True)
check('range-header-complete-budget fixture 4', solve("bytes",[],5), False)
check('range-header-complete-budget fixture 5', solve("x",["a"],3), True)
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)

prompt:
Range header budgets include commas and unit prefix bytes.

ASCII wire field is unit=comma-joined-members. Return within iff total field byte length<=limit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, total):
    return f"bytes {start}-{end}/{total}"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unknown-total fixture 0', solve(0,N,None), "bytes 0-"+str(N)+"/*")
check('content-range-unknown-total fixture 1', solve(0,0,0), "bytes 0-0/0")
check('content-range-unknown-total fixture 2', solve(0,N,N+1), "bytes 0-"+str(N)+"/"+str(N+1))
check('content-range-unknown-total fixture 3', solve(1,2,3), "bytes 1-2/3")
check('content-range-unknown-total fixture 4', solve(N,N,None), "bytes "+str(N)+"-"+str(N)+"/*")
check('content-range-unknown-total fixture 5', solve(0,0,1), "bytes 0-0/1")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, total):
    return f"bytes {start}-{end}/{total or chr(42)}"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unknown-total fixture 0', solve(0,N,None), "bytes 0-"+str(N)+"/*")
check('content-range-unknown-total fixture 1', solve(0,0,0), "bytes 0-0/0")
check('content-range-unknown-total fixture 2', solve(0,N,N+1), "bytes 0-"+str(N)+"/"+str(N+1))
check('content-range-unknown-total fixture 3', solve(1,2,3), "bytes 1-2/3")
check('content-range-unknown-total fixture 4', solve(N,N,None), "bytes "+str(N)+"-"+str(N)+"/*")
check('content-range-unknown-total fixture 5', solve(0,0,1), "bytes 0-0/1")
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)

prompt:
Unknown complete lengths serialize as an asterisk.

Serialize already valid bounds as bytes start-end/total; None total serializes as *. Zero is a known total in this formatting-only unit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(length):
    return f"bytes 0-{length-1}/{length}"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unsatisfied-format fixture 0', solve(N), "bytes */"+str(N))
check('content-range-unsatisfied-format fixture 1', solve(0), "bytes */0")
check('content-range-unsatisfied-format fixture 2', solve(2*N), "bytes */"+str(2*N))
check('content-range-unsatisfied-format fixture 3', solve(1), "bytes */1")
check('content-range-unsatisfied-format fixture 4', solve(10), "bytes */10")
check('content-range-unsatisfied-format fixture 5', solve(100+N), "bytes */"+str(100+N))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(length):
    return f"bytes */{length}" if length else "bytes */*"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unsatisfied-format fixture 0', solve(N), "bytes */"+str(N))
check('content-range-unsatisfied-format fixture 1', solve(0), "bytes */0")
check('content-range-unsatisfied-format fixture 2', solve(2*N), "bytes */"+str(2*N))
check('content-range-unsatisfied-format fixture 3', solve(1), "bytes */1")
check('content-range-unsatisfied-format fixture 4', solve(10), "bytes */10")
check('content-range-unsatisfied-format fixture 5', solve(100+N), "bytes */"+str(100+N))
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)

prompt:
Unsatisfied range metadata reports the complete length without invented endpoints.

For known nonnegative complete length return bytes */length, including empty representations.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, total):
    return start>=0 and end>=start
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-total-beyond-end fixture 0', solve(0,N,N), False)
check('content-range-total-beyond-end fixture 1', solve(0,N,N+1), True)
check('content-range-total-beyond-end fixture 2', solve(0,N,None), True)
check('content-range-total-beyond-end fixture 3', solve(N,0,N+1), False)
check('content-range-total-beyond-end fixture 4', solve(-1,N,N+1), False)
check('content-range-total-beyond-end fixture 5', solve(0,0,0), False)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, total):
    return start>=0 and end>=start and (total is None or total>=end)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-total-beyond-end fixture 0', solve(0,N,N), False)
check('content-range-total-beyond-end fixture 1', solve(0,N,N+1), True)
check('content-range-total-beyond-end fixture 2', solve(0,N,None), True)
check('content-range-total-beyond-end fixture 3', solve(N,0,N+1), False)
check('content-range-total-beyond-end fixture 4', solve(-1,N,N+1), False)
check('content-range-total-beyond-end fixture 5', solve(0,0,0), False)
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)

prompt:
Known complete length must extend beyond every returned endpoint.

Return valid for nonnegative ordered endpoints and either unknown total or total strictly greater than end. No interval slicing is performed.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(status, value):
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-status-placement fixture 0', solve(200,"r"+str(N)), None)
check('content-range-status-placement fixture 1', solve(416,"bytes */"+str(N)), "bytes */"+str(N))
check('content-range-status-placement fixture 2', solve(206,"r"), "r")
check('content-range-status-placement fixture 3', solve(304,"r"), None)
check('content-range-status-placement fixture 4', solve(412,"r"), None)
check('content-range-status-placement fixture 5', solve(500,"r"), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(status, value):
    return value if status==206 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-status-placement fixture 0', solve(200,"r"+str(N)), None)
check('content-range-status-placement fixture 1', solve(416,"bytes */"+str(N)), "bytes */"+str(N))
check('content-range-status-placement fixture 2', solve(206,"r"), "r")
check('content-range-status-placement fixture 3', solve(304,"r"), None)
check('content-range-status-placement fixture 4', solve(412,"r"), None)
check('content-range-status-placement fixture 5', solve(500,"r"), 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)

prompt:
Content-Range metadata is retained only for partial or unsatisfied responses.

This serializer emits value only for status206 or416; all other status codes remove it.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(body):
    return len(body)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-length-body-byte-unit fixture 0', solve("é"*N), 2*N)
check('content-length-body-byte-unit fixture 1', solve("😀"*N), 4*N)
check('content-length-body-byte-unit fixture 2', solve("a"*N), N)
check('content-length-body-byte-unit fixture 3', solve(""), 0)
check('content-length-body-byte-unit fixture 4', solve("aé"), 3)
check('content-length-body-byte-unit fixture 5', solve("e\u0301"), 3)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(body):
    return len(body.encode("utf-16-le"))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-length-body-byte-unit fixture 0', solve("é"*N), 2*N)
check('content-length-body-byte-unit fixture 1', solve("😀"*N), 4*N)
check('content-length-body-byte-unit fixture 2', solve("a"*N), N)
check('content-length-body-byte-unit fixture 3', solve(""), 0)
check('content-length-body-byte-unit fixture 4', solve("aé"), 3)
check('content-length-body-byte-unit fixture 5', solve("e\u0301"), 3)
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)

prompt:
Non-ASCII response bodies report UTF-8 byte length instead of character count.

The selected representation is UTF-8 text. Return wire octet length; no normalization or decoding after selection.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunked, length):
    return length
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-length-transfer-coding-removal fixture 0', solve(True,N), None)
check('content-length-transfer-coding-removal fixture 1', solve(False,0), 0)
check('content-length-transfer-coding-removal fixture 2', solve(False,N), N)
check('content-length-transfer-coding-removal fixture 3', solve(True,0), None)
check('content-length-transfer-coding-removal fixture 4', solve(False,2*N), 2*N)
check('content-length-transfer-coding-removal fixture 5', solve(True,2*N), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunked, length):
    return None if chunked or length==0 else length
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-length-transfer-coding-removal fixture 0', solve(True,N), None)
check('content-length-transfer-coding-removal fixture 1', solve(False,0), 0)
check('content-length-transfer-coding-removal fixture 2', solve(False,N), N)
check('content-length-transfer-coding-removal fixture 3', solve(True,0), None)
check('content-length-transfer-coding-removal fixture 4', solve(False,2*N), 2*N)
check('content-length-transfer-coding-removal fixture 5', solve(True,2*N), 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)

prompt:
Chunked transfer coding removes fixed body length metadata.

Return null Content-Length for chunked transport; otherwise preserve integer length including zero.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(values):
    return values[0] if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-duplicate-disagreement fixture 0', solve( ["r"+str(N),"other"]), None)
check('content-range-duplicate-disagreement fixture 1', solve(["r","r"]), "r")
check('content-range-duplicate-disagreement fixture 2', solve([]), None)
check('content-range-duplicate-disagreement fixture 3', solve(["r"]), "r")
check('content-range-duplicate-disagreement fixture 4', solve(["a","b","a"]), None)
check('content-range-duplicate-disagreement fixture 5', solve(["",""]), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(values):
    return values[-1] if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-duplicate-disagreement fixture 0', solve( ["r"+str(N),"other"]), None)
check('content-range-duplicate-disagreement fixture 1', solve(["r","r"]), "r")
check('content-range-duplicate-disagreement fixture 2', solve([]), None)
check('content-range-duplicate-disagreement fixture 3', solve(["r"]), "r")
check('content-range-duplicate-disagreement fixture 4', solve(["a","b","a"]), None)
check('content-range-duplicate-disagreement fixture 5', solve(["",""]), "")
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)

prompt:
Conflicting duplicate Content-Range fields cannot choose an arbitrary winner.

Parsed field values are normalized strings. Return sole agreed value if nonempty and all identical, else None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(expected_unit, actual_unit, body):
    return body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unit-mismatch fixture 0', solve("bytes","bytesx","p"*N), None)
check('content-range-unit-mismatch fixture 1', solve("bytes","items","p"), None)
check('content-range-unit-mismatch fixture 2', solve("bytes","bytes","p"*N), "p"*N)
check('content-range-unit-mismatch fixture 3', solve("items","items","p"), "p")
check('content-range-unit-mismatch fixture 4', solve("bytes","","p"), None)
check('content-range-unit-mismatch fixture 5', solve("bytes","bytes",""), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(expected_unit, actual_unit, body):
    return body if actual_unit.startswith(expected_unit) else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('content-range-unit-mismatch fixture 0', solve("bytes","bytesx","p"*N), None)
check('content-range-unit-mismatch fixture 1', solve("bytes","items","p"), None)
check('content-range-unit-mismatch fixture 2', solve("bytes","bytes","p"*N), "p"*N)
check('content-range-unit-mismatch fixture 3', solve("items","items","p"), "p")
check('content-range-unit-mismatch fixture 4', solve("bytes","","p"), None)
check('content-range-unit-mismatch fixture 5', solve("bytes","bytes",""), "")
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)

prompt:
A byte-range client rejects partial metadata in a different unit.

Parsed units are case-normalized tokens. Accept payload only when units match exactly; otherwise None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(full_digest, part_digest, partial):
    return full_digest
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-response-digest-selected-body fixture 0', solve("full"+str(N),"part"+str(N),True), "part"+str(N))
check('range-response-digest-selected-body fixture 1', solve("full",None,True), None)
check('range-response-digest-selected-body fixture 2', solve("full","part",False), "full")
check('range-response-digest-selected-body fixture 3', solve(None,"part",False), None)
check('range-response-digest-selected-body fixture 4', solve("full","",True), "")
check('range-response-digest-selected-body fixture 5', solve(None,None,True), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(full_digest, part_digest, partial):
    return (part_digest or full_digest) if partial else full_digest
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-response-digest-selected-body fixture 0', solve("full"+str(N),"part"+str(N),True), "part"+str(N))
check('range-response-digest-selected-body fixture 1', solve("full",None,True), None)
check('range-response-digest-selected-body fixture 2', solve("full","part",False), "full")
check('range-response-digest-selected-body fixture 3', solve(None,"part",False), None)
check('range-response-digest-selected-body fixture 4', solve("full","",True), "")
check('range-response-digest-selected-body fixture 5', solve(None,None,True), 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)

prompt:
A response digest describes the transferred slice instead of the whole object.

Select part_digest for partial responses; no fallback to full digest when part digest unavailable (None).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(whole, part):
    return [part,part]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-response-total-not-part-length fixture 0', solve(3*N,N), [N,3*N])
check('range-response-total-not-part-length fixture 1', solve(N,0), [0,N])
check('range-response-total-not-part-length fixture 2', solve(0,0), [0,0])
check('range-response-total-not-part-length fixture 3', solve(N,N), [N,N])
check('range-response-total-not-part-length fixture 4', solve(10,1), [1,10])
check('range-response-total-not-part-length fixture 5', solve(10,9), [9,10])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(whole, part):
    return [whole,whole]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('range-response-total-not-part-length fixture 0', solve(3*N,N), [N,3*N])
check('range-response-total-not-part-length fixture 1', solve(N,0), [0,N])
check('range-response-total-not-part-length fixture 2', solve(0,0), [0,0])
check('range-response-total-not-part-length fixture 3', solve(N,N), [N,N])
check('range-response-total-not-part-length fixture 4', solve(10,1), [1,10])
check('range-response-total-not-part-length fixture 5', solve(10,9), [9,10])
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)

prompt:
The representation length header does not collapse to the transferred fragment length.

Return [Content-Length,complete-length] as [part,whole] for a prevalidated single range response.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(status, prefix, body):
    return prefix+body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-full-response-truncate fixture 0', solve(200,"old"*N,"new"*N), "new"*N)
check('resume-full-response-truncate fixture 1', solve(416,"old","error"), "old")
check('resume-full-response-truncate fixture 2', solve(206,"a"*N,"b"*N), "a"*N+"b"*N)
check('resume-full-response-truncate fixture 3', solve(200,"old",""), "")
check('resume-full-response-truncate fixture 4', solve(500,"old","error"), "old")
check('resume-full-response-truncate fixture 5', solve(206,"","x"), "x")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(status, prefix, body):
    return body if status==200 else prefix+body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-full-response-truncate fixture 0', solve(200,"old"*N,"new"*N), "new"*N)
check('resume-full-response-truncate fixture 1', solve(416,"old","error"), "old")
check('resume-full-response-truncate fixture 2', solve(206,"a"*N,"b"*N), "a"*N+"b"*N)
check('resume-full-response-truncate fixture 3', solve(200,"old",""), "")
check('resume-full-response-truncate fixture 4', solve(500,"old","error"), "old")
check('resume-full-response-truncate fixture 5', solve(206,"","x"), "x")
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)

prompt:
A full fallback response replaces an existing download prefix.

For status200 replace prefix with full body; for206 append already validated continuation body. Other statuses preserve prefix.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved, returned_start, body):
    return ["append",body]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-content-range-start fixture 0', solve(N,N+1,"p"*N), ["restart",""])
check('resume-content-range-start fixture 1', solve(N+1,N,"p"), ["restart",""])
check('resume-content-range-start fixture 2', solve(N,N,"p"*N), ["append","p"*N])
check('resume-content-range-start fixture 3', solve(0,0,""), ["append",""])
check('resume-content-range-start fixture 4', solve(0,N,"p"), ["restart",""])
check('resume-content-range-start fixture 5', solve(N,0,"p"), ["restart",""])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved, returned_start, body):
    return ["append",body] if returned_start>=saved else ["restart",""]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-content-range-start fixture 0', solve(N,N+1,"p"*N), ["restart",""])
check('resume-content-range-start fixture 1', solve(N+1,N,"p"), ["restart",""])
check('resume-content-range-start fixture 2', solve(N,N,"p"*N), ["append","p"*N])
check('resume-content-range-start fixture 3', solve(0,0,""), ["append",""])
check('resume-content-range-start fixture 4', solve(0,N,"p"), ["restart",""])
check('resume-content-range-start fixture 5', solve(N,0,"p"), ["restart",""])
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)

prompt:
A continuation response must start at the saved prefix boundary.

Return [append,body] only when returned_start equals saved length; a mismatching start requests restart with empty output.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved, incoming, body):
    return body if incoming is None or incoming==saved else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-etag-must-be-present fixture 0', solve("v",None,"p"*N), None)
check('resume-etag-must-be-present fixture 1', solve("v","","p"), None)
check('resume-etag-must-be-present fixture 2', solve("v","v","p"*N), "p"*N)
check('resume-etag-must-be-present fixture 3', solve("v","w","p"), None)
check('resume-etag-must-be-present fixture 4', solve("", "", "p"), "p")
check('resume-etag-must-be-present fixture 5', solve("v","v",""), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved, incoming, body):
    return body if (incoming or saved)==saved else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-etag-must-be-present fixture 0', solve("v",None,"p"*N), None)
check('resume-etag-must-be-present fixture 1', solve("v","","p"), None)
check('resume-etag-must-be-present fixture 2', solve("v","v","p"*N), "p"*N)
check('resume-etag-must-be-present fixture 3', solve("v","w","p"), None)
check('resume-etag-must-be-present fixture 4', solve("", "", "p"), "p")
check('resume-etag-must-be-present fixture 5', solve("v","v",""), "")
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)

prompt:
Missing response validators cannot silently preserve a saved validator.

Resumption accepts only an explicitly present incoming validator equal to the saved strong tag; absent or changed tags yield None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved_length, returned_total):
    return "complete"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-416-does-not-prove-completion fixture 0', solve(N,N+1), "restart")
check('resume-416-does-not-prove-completion fixture 1', solve(N+1,N), "restart")
check('resume-416-does-not-prove-completion fixture 2', solve(N,N), "complete")
check('resume-416-does-not-prove-completion fixture 3', solve(N,None), "unverified")
check('resume-416-does-not-prove-completion fixture 4', solve(0,0), "complete")
check('resume-416-does-not-prove-completion fixture 5', solve(0,N), "restart")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved_length, returned_total):
    return "complete" if returned_total is not None and saved_length>=returned_total else "restart"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-416-does-not-prove-completion fixture 0', solve(N,N+1), "restart")
check('resume-416-does-not-prove-completion fixture 1', solve(N+1,N), "restart")
check('resume-416-does-not-prove-completion fixture 2', solve(N,N), "complete")
check('resume-416-does-not-prove-completion fixture 3', solve(N,None), "unverified")
check('resume-416-does-not-prove-completion fixture 4', solve(0,0), "complete")
check('resume-416-does-not-prove-completion fixture 5', solve(0,N), "restart")
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)

prompt:
An unsatisfied continuation proves completion only against equal known total length.

Return complete only if a known returned total exactly equals saved bytes; shorter or longer totals request restart; unknown totals remain unverified.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(base, offset, part):
    return base+part
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-file-offset-write fixture 0', solve("."*(N+3),N,"AB"), "."*N+"AB.")
check('resume-file-offset-write fixture 1', solve("....",0,"AB"), "AB..")
check('resume-file-offset-write fixture 2', solve("....",2,"AB"), "..AB")
check('resume-file-offset-write fixture 3', solve("abc",1,""), "abc")
check('resume-file-offset-write fixture 4', solve("abc",0,"XYZ"), "XYZ")
check('resume-file-offset-write fixture 5', solve("abc",1,"Z"), "aZc")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(base, offset, part):
    return base[:offset]+part+base[offset:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-file-offset-write fixture 0', solve("."*(N+3),N,"AB"), "."*N+"AB.")
check('resume-file-offset-write fixture 1', solve("....",0,"AB"), "AB..")
check('resume-file-offset-write fixture 2', solve("....",2,"AB"), "..AB")
check('resume-file-offset-write fixture 3', solve("abc",1,""), "abc")
check('resume-file-offset-write fixture 4', solve("abc",0,"XYZ"), "XYZ")
check('resume-file-offset-write fixture 5', solve("abc",1,"Z"), "aZc")
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)

prompt:
Out-of-order downloaded ranges write at their absolute positions.

ASCII base is a preallocated buffer; offset and part fit within it. Replace that exact span without inserting or appending.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(checkpoint, written, synced):
    return written
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-checkpoint-after-fsync fixture 0', solve(N,2*N,False), N)
check('resume-checkpoint-after-fsync fixture 1', solve(N,2*N,True), 2*N)
check('resume-checkpoint-after-fsync fixture 2', solve(0,0,False), 0)
check('resume-checkpoint-after-fsync fixture 3', solve(0,N,True), N)
check('resume-checkpoint-after-fsync fixture 4', solve(N,N,False), N)
check('resume-checkpoint-after-fsync fixture 5', solve(0,N,False), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(checkpoint, written, synced):
    return checkpoint
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-checkpoint-after-fsync fixture 0', solve(N,2*N,False), N)
check('resume-checkpoint-after-fsync fixture 1', solve(N,2*N,True), 2*N)
check('resume-checkpoint-after-fsync fixture 2', solve(0,0,False), 0)
check('resume-checkpoint-after-fsync fixture 3', solve(0,N,True), N)
check('resume-checkpoint-after-fsync fixture 4', solve(N,N,False), N)
check('resume-checkpoint-after-fsync fixture 5', solve(0,N,False), 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)

prompt:
Download checkpoints advance only after durable writes.

Return durable checkpoint: synced writes advance to written; unsynced writes retain prior checkpoint. written>=checkpoint.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(checkpoint, file_size):
    return checkpoint
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-local-file-truncation fixture 0', solve(N+1,N), 0)
check('resume-local-file-truncation fixture 1', solve(N,2*N), N)
check('resume-local-file-truncation fixture 2', solve(N,N), N)
check('resume-local-file-truncation fixture 3', solve(0,N), 0)
check('resume-local-file-truncation fixture 4', solve(N,0), 0)
check('resume-local-file-truncation fixture 5', solve(0,0), 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(checkpoint, file_size):
    return min(checkpoint,file_size)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-local-file-truncation fixture 0', solve(N+1,N), 0)
check('resume-local-file-truncation fixture 1', solve(N,2*N), N)
check('resume-local-file-truncation fixture 2', solve(N,N), N)
check('resume-local-file-truncation fixture 3', solve(0,N), 0)
check('resume-local-file-truncation fixture 4', solve(N,0), 0)
check('resume-local-file-truncation fixture 5', solve(0,0), 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)

prompt:
A checkpoint beyond local file size must be discarded before a range request.

Return checkpoint if checkpoint<=file_size else zero; nonnegative integers. Extra uncheckpointed file bytes do not advance checkpoint.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved_coding, response_coding, prefix, body):
    return prefix+body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-coding-change-restart fixture 0', solve("gzip","identity","a"*N,"b"), None)
check('resume-coding-change-restart fixture 1', solve("identity","gzip","a","b"), None)
check('resume-coding-change-restart fixture 2', solve("gzip","gzip","a"*N,"b"), "a"*N+"b")
check('resume-coding-change-restart fixture 3', solve("identity","identity","a","b"), "ab")
check('resume-coding-change-restart fixture 4', solve("br","gzip","a","b"), None)
check('resume-coding-change-restart fixture 5', solve("br","br","",""), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(saved_coding, response_coding, prefix, body):
    return prefix+body if response_coding=="identity" or response_coding==saved_coding else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-coding-change-restart fixture 0', solve("gzip","identity","a"*N,"b"), None)
check('resume-coding-change-restart fixture 1', solve("identity","gzip","a","b"), None)
check('resume-coding-change-restart fixture 2', solve("gzip","gzip","a"*N,"b"), "a"*N+"b")
check('resume-coding-change-restart fixture 3', solve("identity","identity","a","b"), "ab")
check('resume-coding-change-restart fixture 4', solve("br","gzip","a","b"), None)
check('resume-coding-change-restart fixture 5', solve("br","br","",""), "")
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)

prompt:
Saved byte positions cannot transfer across content encodings.

Equal representation codings permit concatenation; differing codings return None, including identity versus gzip.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(local, confirmed_total):
    return local
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-total-shrink-truncate fixture 0', solve("abc"*N,N), ("abc"*N)[:N])
check('resume-total-shrink-truncate fixture 1', solve("abc",0), "")
check('resume-total-shrink-truncate fixture 2', solve("abc",3), "abc")
check('resume-total-shrink-truncate fixture 3', solve("abc",5), "abc")
check('resume-total-shrink-truncate fixture 4', solve("",0), "")
check('resume-total-shrink-truncate fixture 5', solve("abcd",2), "ab")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(local, confirmed_total):
    return local[:confirmed_total] if confirmed_total else local
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-total-shrink-truncate fixture 0', solve("abc"*N,N), ("abc"*N)[:N])
check('resume-total-shrink-truncate fixture 1', solve("abc",0), "")
check('resume-total-shrink-truncate fixture 2', solve("abc",3), "abc")
check('resume-total-shrink-truncate fixture 3', solve("abc",5), "abc")
check('resume-total-shrink-truncate fixture 4', solve("",0), "")
check('resume-total-shrink-truncate fixture 5', solve("abcd",2), "ab")
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)

prompt:
Confirmed shorter complete representations truncate stale local suffix bytes.

Return local prefix up to confirmed total; local buffers shorter than total remain as-is. This operation follows successful revision replacement.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(completed):
    return sum(map(len,completed))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-progress-union-not-sum fixture 0', solve([[0,N],[N,2*N]]), 3)
check('resume-progress-union-not-sum fixture 1', solve([[0],[N]]), 2)
check('resume-progress-union-not-sum fixture 2', solve([]), 0)
check('resume-progress-union-not-sum fixture 3', solve([[N],[N]]), 1)
check('resume-progress-union-not-sum fixture 4', solve([[],[]]), 0)
check('resume-progress-union-not-sum fixture 5', solve([[0,N,2*N]]), 3)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(completed):
    return max(map(len,completed),default=0)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-progress-union-not-sum fixture 0', solve([[0,N],[N,2*N]]), 3)
check('resume-progress-union-not-sum fixture 1', solve([[0],[N]]), 2)
check('resume-progress-union-not-sum fixture 2', solve([]), 0)
check('resume-progress-union-not-sum fixture 3', solve([[N],[N]]), 1)
check('resume-progress-union-not-sum fixture 4', solve([[],[]]), 0)
check('resume-progress-union-not-sum fixture 5', solve([[0,N,2*N]]), 3)
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)

prompt:
Completed byte positions count once across duplicate downloaded fragments.

Input is a list of explicit downloaded byte-offset lists, not intervals. Return count of distinct durable byte positions.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(tail, chunk, marker):
    p=chunk.find(marker)
    return [chunk[:p],chunk[p+len(marker):]] if p>=0 else ["",chunk]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-delimiter-split fixture 0', solve("a"*N+"--","bX","--b"), ["a"*N,"X"])
check('multipart-client-delimiter-split fixture 1', solve("a","b","--b"), ["","ab"])
check('multipart-client-delimiter-split fixture 2', solve("","abc--bZ","--b"), ["abc","Z"])
check('multipart-client-delimiter-split fixture 3', solve("","","--b"), ["",""])
check('multipart-client-delimiter-split fixture 4', solve("--b","X","--b"), ["","X"])
check('multipart-client-delimiter-split fixture 5', solve("x","--b--b","--b"), ["x","--b"])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(tail, chunk, marker):
    s=tail+chunk
    p=s.find(marker)
    return [s[:p],s[p+len(marker):]] if p>=0 else [s,""]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-delimiter-split fixture 0', solve("a"*N+"--","bX","--b"), ["a"*N,"X"])
check('multipart-client-delimiter-split fixture 1', solve("a","b","--b"), ["","ab"])
check('multipart-client-delimiter-split fixture 2', solve("","abc--bZ","--b"), ["abc","Z"])
check('multipart-client-delimiter-split fixture 3', solve("","","--b"), ["",""])
check('multipart-client-delimiter-split fixture 4', solve("--b","X","--b"), ["","X"])
check('multipart-client-delimiter-split fixture 5', solve("x","--b--b","--b"), ["x","--b"])
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)

prompt:
Multipart boundary detection retains an incomplete delimiter suffix across reads.

Return [complete-prefix,remainder] split at first complete marker in tail+chunk; if absent preserve the entire data as remainder for this bounded buffering model.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(body, boundary):
    return body.find("--"+boundary)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-line-anchoring fixture 0', solve("x--b"+str(N),"b"+str(N)), -1)
check('multipart-client-line-anchoring fixture 1', solve("--b"+str(N),"b"+str(N)), 0)
check('multipart-client-line-anchoring fixture 2', solve("abc\r\n--b","b"), 5)
check('multipart-client-line-anchoring fixture 3', solve("abc","b"), -1)
check('multipart-client-line-anchoring fixture 4', solve("","b"), -1)
check('multipart-client-line-anchoring fixture 5', solve("x--b\r\n--b","b"), 6)
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(body, boundary):
    return body.find("\r\n--"+boundary)+2 if "\r\n--"+boundary in body else -1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-line-anchoring fixture 0', solve("x--b"+str(N),"b"+str(N)), -1)
check('multipart-client-line-anchoring fixture 1', solve("--b"+str(N),"b"+str(N)), 0)
check('multipart-client-line-anchoring fixture 2', solve("abc\r\n--b","b"), 5)
check('multipart-client-line-anchoring fixture 3', solve("abc","b"), -1)
check('multipart-client-line-anchoring fixture 4', solve("","b"), -1)
check('multipart-client-line-anchoring fixture 5', solve("x--b\r\n--b","b"), 6)
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)

prompt:
Boundary-like substrings inside part bodies remain payload data.

Return position of first delimiter at start or immediately after CRLF, or -1. Delimiter bytes are --boundary; interior lookalikes are ignored.

split: open-access


broken_source:
"""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)

source:
"""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)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(data):
    p=data.rfind("\r\n\r\n")
    return [data[:p],data[p+4:]] if p>=0 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-header-terminator fixture 0', solve("H\r\n\r\n"+"p"*N+"\r\n\r\nX"), ["H","p"*N+"\r\n\r\nX"])
check('multipart-client-header-terminator fixture 1', solve("H\r\nX"), None)
check('multipart-client-header-terminator fixture 2', solve("H\r\n\r\nP"), ["H","P"])
check('multipart-client-header-terminator fixture 3', solve("\r\n\r\n"), ["",""])
check('multipart-client-header-terminator fixture 4', solve(""), None)
check('multipart-client-header-terminator fixture 5', solve("A\r\nB\r\n\r\nP"), ["A\r\nB","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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(data):
    p=data.find("\r\n")
    return [data[:p],data[p+2:]] if p>=0 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-header-terminator fixture 0', solve("H\r\n\r\n"+"p"*N+"\r\n\r\nX"), ["H","p"*N+"\r\n\r\nX"])
check('multipart-client-header-terminator fixture 1', solve("H\r\nX"), None)
check('multipart-client-header-terminator fixture 2', solve("H\r\n\r\nP"), ["H","P"])
check('multipart-client-header-terminator fixture 3', solve("\r\n\r\n"), ["",""])
check('multipart-client-header-terminator fixture 4', solve(""), None)
check('multipart-client-header-terminator fixture 5', solve("A\r\nB\r\n\r\nP"), ["A\r\nB","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)

prompt:
Part headers end at the first double CRLF.

Split buffered part at the first CRLFCRLF into [header,body], or None if incomplete. Body may contain additional double CRLF sequences.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(headers, name):
    return next((v for k,v in headers if k==name),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-header-case fixture 0', solve([["Content-Range","Bytes "+str(N)]],"content-range"), "Bytes "+str(N))
check('multipart-client-header-case fixture 1', solve([["content-type","Text/X"]],"CONTENT-TYPE"), "Text/X")
check('multipart-client-header-case fixture 2', solve([],"content-range"), None)
check('multipart-client-header-case fixture 3', solve([["x","A"]],"x"), "A")
check('multipart-client-header-case fixture 4', solve([["x","A"]],"y"), None)
check('multipart-client-header-case fixture 5', solve([["CONTENT-RANGE",""]],"content-range"), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(headers, name):
    return next((v.lower() for k,v in headers if k.lower()==name.lower()),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-header-case fixture 0', solve([["Content-Range","Bytes "+str(N)]],"content-range"), "Bytes "+str(N))
check('multipart-client-header-case fixture 1', solve([["content-type","Text/X"]],"CONTENT-TYPE"), "Text/X")
check('multipart-client-header-case fixture 2', solve([],"content-range"), None)
check('multipart-client-header-case fixture 3', solve([["x","A"]],"x"), "A")
check('multipart-client-header-case fixture 4', solve([["x","A"]],"y"), None)
check('multipart-client-header-case fixture 5', solve([["CONTENT-RANGE",""]],"content-range"), "")
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)

prompt:
Part header lookup normalizes names without rewriting values.

Parsed headers are [name,value], unique ignoring case. Return exact value of case-insensitive matching name, else None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parts):
    return [b for r,b in parts]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-missing-range fixture 0', solve([["r","a"*N],[None,"b"]]), None)
check('multipart-client-missing-range fixture 1', solve([[None,"a"]]), None)
check('multipart-client-missing-range fixture 2', solve([["r","a"*N]]), ["a"*N])
check('multipart-client-missing-range fixture 3', solve([]), [])
check('multipart-client-missing-range fixture 4', solve([["r",""],["s","b"]]), ["","b"])
check('multipart-client-missing-range fixture 5', solve([["r","a"],["s","b"]]), ["a","b"])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parts):
    return [b for r,b in parts] if not parts or parts[0][0] is not None else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-missing-range fixture 0', solve([["r","a"*N],[None,"b"]]), None)
check('multipart-client-missing-range fixture 1', solve([[None,"a"]]), None)
check('multipart-client-missing-range fixture 2', solve([["r","a"*N]]), ["a"*N])
check('multipart-client-missing-range fixture 3', solve([]), [])
check('multipart-client-missing-range fixture 4', solve([["r",""],["s","b"]]), ["","b"])
check('multipart-client-missing-range fixture 5', solve([["r","a"],["s","b"]]), ["a","b"])
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)

prompt:
Each received part needs its own explicit range metadata.

parts are [content-range-or-null,body]. Return bodies only when every part has range metadata; never inherit a preceding range.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parts, close_seen, eof):
    return ["complete",parts] if eof else ["waiting",parts]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-close-required fixture 0', solve( ["p"*N],False,True), ["truncated",[]])
check('multipart-client-close-required fixture 1', solve(["p"],True,False), ["complete",["p"]])
check('multipart-client-close-required fixture 2', solve(["p"],False,False), ["waiting",["p"]])
check('multipart-client-close-required fixture 3', solve([],True,True), ["complete",[]])
check('multipart-client-close-required fixture 4', solve([],False,True), ["truncated",[]])
check('multipart-client-close-required fixture 5', solve(["a","b"],True,True), ["complete",["a","b"]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(parts, close_seen, eof):
    return ["complete",parts] if close_seen else ["waiting",parts]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-close-required fixture 0', solve( ["p"*N],False,True), ["truncated",[]])
check('multipart-client-close-required fixture 1', solve(["p"],True,False), ["complete",["p"]])
check('multipart-client-close-required fixture 2', solve(["p"],False,False), ["waiting",["p"]])
check('multipart-client-close-required fixture 3', solve([],True,True), ["complete",[]])
check('multipart-client-close-required fixture 4', solve([],False,True), ["truncated",[]])
check('multipart-client-close-required fixture 5', solve(["a","b"],True,True), ["complete",["a","b"]])
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)

prompt:
End-of-stream without a closing delimiter leaves the response incomplete.

Return [complete,parts] only after closing delimiter; EOF without close is [truncated,empty], otherwise [waiting,parts].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(payload, epilogue, closed):
    return payload+epilogue
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-epilogue-not-payload fixture 0', solve("p"*N,"epilogue",True), "p"*N)
check('multipart-client-epilogue-not-payload fixture 1', solve("p","q",False), "pq")
check('multipart-client-epilogue-not-payload fixture 2', solve("","e",True), "")
check('multipart-client-epilogue-not-payload fixture 3', solve("p","",True), "p")
check('multipart-client-epilogue-not-payload fixture 4', solve("","x",False), "x")
check('multipart-client-epilogue-not-payload fixture 5', solve("","",False), "")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(payload, epilogue, closed):
    return payload
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-epilogue-not-payload fixture 0', solve("p"*N,"epilogue",True), "p"*N)
check('multipart-client-epilogue-not-payload fixture 1', solve("p","q",False), "pq")
check('multipart-client-epilogue-not-payload fixture 2', solve("","e",True), "")
check('multipart-client-epilogue-not-payload fixture 3', solve("p","",True), "p")
check('multipart-client-epilogue-not-payload fixture 4', solve("","x",False), "x")
check('multipart-client-epilogue-not-payload fixture 5', solve("","",False), "")
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)

prompt:
Bytes after the closing delimiter do not enter the last range body.

Return payload unchanged after close; before close, received bytes extend the still-open payload.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(preamble, parts):
    return [preamble]+parts
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-preamble-not-part fixture 0', solve("banner"*N,["p"]), ["p"])
check('multipart-client-preamble-not-part fixture 1', solve("",["p"]), ["p"])
check('multipart-client-preamble-not-part fixture 2', solve("banner",[]), [])
check('multipart-client-preamble-not-part fixture 3', solve("",[]), [])
check('multipart-client-preamble-not-part fixture 4', solve("x",["a","b"]), ["a","b"])
check('multipart-client-preamble-not-part fixture 5', solve("x",[""]), [""])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(preamble, parts):
    return [preamble]+parts if preamble else parts
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-preamble-not-part fixture 0', solve("banner"*N,["p"]), ["p"])
check('multipart-client-preamble-not-part fixture 1', solve("",["p"]), ["p"])
check('multipart-client-preamble-not-part fixture 2', solve("banner",[]), [])
check('multipart-client-preamble-not-part fixture 3', solve("",[]), [])
check('multipart-client-preamble-not-part fixture 4', solve("x",["a","b"]), ["a","b"])
check('multipart-client-preamble-not-part fixture 5', solve("x",[""]), [""])
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)

prompt:
Preamble bytes before the first delimiter do not form a range part.

Return only explicitly parsed part bodies; preamble is ignored even when nonempty.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(framed):
    return framed.strip()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-body-not-strip fixture 0', solve("p"*N+"\r\n\r\n"), "p"*N+"\r\n")
check('multipart-client-body-not-strip fixture 1', solve(" p \r\n"), " p ")
check('multipart-client-body-not-strip fixture 2', solve("\r\n"), "")
check('multipart-client-body-not-strip fixture 3', solve("p\r\n"), "p")
check('multipart-client-body-not-strip fixture 4', solve("p\n\r\n"), "p\n")
check('multipart-client-body-not-strip fixture 5', solve("p\r\r\n"), "p\r")
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(framed):
    return framed.rstrip("\r\n")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multipart-client-body-not-strip fixture 0', solve("p"*N+"\r\n\r\n"), "p"*N+"\r\n")
check('multipart-client-body-not-strip fixture 1', solve(" p \r\n"), " p ")
check('multipart-client-body-not-strip fixture 2', solve("\r\n"), "")
check('multipart-client-body-not-strip fixture 3', solve("p\r\n"), "p")
check('multipart-client-body-not-strip fixture 4', solve("p\n\r\n"), "p\n")
check('multipart-client-body-not-strip fixture 5', solve("p\r\r\n"), "p\r")
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)

prompt:
Range body whitespace remains byte-exact after framing removal.

framed ends with exactly one framing CRLF. Return all preceding payload bytes; do not trim payload whitespace.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';':
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quoted-semicolon fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quoted-semicolon fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quoted-semicolon fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quoted-semicolon fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quoted-semicolon fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quoted-semicolon fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quoted-semicolon fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quoted-semicolon fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and (not quoted or current.endswith('a')):
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quoted-semicolon fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quoted-semicolon fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quoted-semicolon fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quoted-semicolon fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quoted-semicolon fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quoted-semicolon fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quoted-semicolon fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quoted-semicolon fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quoted-semicolon fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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)

prompt:
Multipart boundary parameter parsing: quoted separator bytes stay inside the boundary.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+='\\'+c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quoted-escape fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quoted-escape fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quoted-escape fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quoted-escape fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quoted-escape fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quoted-escape fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quoted-escape fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quoted-escape fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quoted-escape fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quoted-escape fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c if c!='\\' else ''
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quoted-escape fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quoted-escape fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quoted-escape fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quoted-escape fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quoted-escape fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quoted-escape fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quoted-escape fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quoted-escape fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quoted-escape fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quoted-escape fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quoted-escape fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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)

prompt:
Multipart boundary parameter parsing: quoted escapes preserve the escaped character.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access