broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, scheme, source, explicit, upgrades, allow_relative):
    return {'request': request, 'decision': [scheme.lower(), bool(scheme) or allow_relative, scheme.lower() not in ('', 'http', 'https'), source == 'http' and scheme.lower() == 'https', 'https' if source in upgrades else source]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'HtTpS', 'http', False, ['http'], False), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', True, False, True, 'https']})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'https', True, ['https'], True), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', True, False, False, 'https']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '', 'http', True, ['http'], True), {'request': '/requests/' + str(N) + '/2', 'decision': ['', True, False, False, 'http']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '', 'http', False, [], False), {'request': '/requests/' + str(N) + '/3', 'decision': ['', False, False, False, 'http']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'data', 'https', True, [], True), {'request': '/requests/' + str(N) + '/4', 'decision': ['data', True, True, False, 'https']})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'http', 'https', False, [], False), {'request': '/requests/' + str(N) + '/5', 'decision': ['http', True, False, False, 'https']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, scheme, source, explicit, upgrades, allow_relative):
    return {'request': request, 'decision': [scheme.lower(), bool(scheme) or allow_relative, scheme.lower() not in ('', 'http', 'https'), source == 'http' and scheme.lower() == 'https', 'https' if not explicit else source]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'HtTpS', 'http', False, ['http'], False), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', True, False, True, 'https']})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'https', True, ['https'], True), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', True, False, False, 'https']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '', 'http', True, ['http'], True), {'request': '/requests/' + str(N) + '/2', 'decision': ['', True, False, False, 'http']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '', 'http', False, [], False), {'request': '/requests/' + str(N) + '/3', 'decision': ['', False, False, False, 'http']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'data', 'https', True, [], True), {'request': '/requests/' + str(N) + '/4', 'decision': ['data', True, True, False, 'https']})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'http', 'https', False, [], False), {'request': '/requests/' + str(N) + '/5', 'decision': ['http', True, False, False, 'https']})
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 explicit scheme is overwritten by automatic upgrade policy.

Apply a configured HTTP redirect scheme policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [0 if preserved else cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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:
Replay rewinds to the stream origin instead of the request segment origin.

Prepare a redirect replay from a bounded upload cursor. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, length-cursor, preserved and consumed and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, length, preserved and consumed and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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:
A segment-relative cursor is treated as an absolute count.

Prepare a redirect replay from a bounded upload cursor. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), preserved and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), consumed and not seekable, length if preserved else 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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:
An untouched one-shot body or a discarded body is rejected.

Prepare a redirect replay from a bounded upload cursor. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, length, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, 0, preserved and seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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:
A body-dropping redirect advertises the old payload length.

Prepare a redirect replay from a bounded upload cursor. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, length if preserved else 0, preserved and seekable]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, cursor, start, length, seekable, consumed, preserved):
    return {'request': request, 'decision': [start if preserved else cursor, max(0, length - (cursor-start)), preserved and consumed and not seekable, length if preserved else 0, seekable and cursor != start]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 7, 3, 10, True, True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [3, 6, False, 10, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 3, 3, 10, True, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [3, 10, False, 10, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 5, 3, 10, False, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [3, 8, True, 10, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 3, 3, 10, False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [3, 10, False, 10, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 3, 10, False, True, False), {'request': '/requests/' + str(N) + '/4', 'decision': [5, 8, False, 0, False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 5, 3, 10, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [5, 8, False, 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:
A seek is issued when replay does not require it.

Prepare a redirect replay from a bounded upload cursor. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [headers, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() == 'content-length')}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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:
Removing only Content-Length leaves stale entity metadata attached to a rewritten request.

Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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:
Reconstructing multipart headers chooses a new boundary although the replayed wire bytes still contain the old boundary.

Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and size != 0, ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD'), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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:
The new request starts an upload handshake after its method or body emptiness makes that handshake inapplicable.

Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['dispatch','abort-upload','clear-entity'] if drop else ['dispatch','rewind-upload'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('chunked' if size is None else 'length')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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:
Dispatch races the cancellation of the obsolete upload source.

Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else ('length' if size else 'chunked')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, headers, drop, changed, boundary, next_boundary, size, method):
    return {'request': request, 'decision': [{k:v for k,v in headers.items() if not(drop and k.lower() in ('content-length','content-type','transfer-encoding','expect','trailer'))}, next_boundary if changed else boundary, not drop and method not in ('GET','HEAD') and (size is None or size>0), ['abort-upload','clear-entity','dispatch'] if drop else ['rewind-upload','dispatch'], 'none' if drop else 'length']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, True, True, 'A', 'B', 3, 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [{'X': 'keep'}, 'B', False, ['abort-upload', 'clear-entity', 'dispatch'], 'none']})
check('fixture 2', solve('/requests/' + str(N) + '/1', {'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, False, False, 'A', 'B', 3, 'POST'), {'request': '/requests/' + str(N) + '/1', 'decision': [{'Content-Length': '3', 'Content-Type': 'multipart', 'Transfer-Encoding': 'chunked', 'Expect': '100-continue', 'Trailer': 'X-Sum', 'X': 'keep'}, 'A', True, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 3', solve('/requests/' + str(N) + '/2', {}, False, True, 'B', 'C', None, 'PUT'), {'request': '/requests/' + str(N) + '/2', 'decision': [{}, 'C', True, ['rewind-upload', 'dispatch'], 'chunked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', {}, False, False, 'B', 'C', 0, 'POST'), {'request': '/requests/' + str(N) + '/3', 'decision': [{}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 5', solve('/requests/' + str(N) + '/4', {'X': 'keep'}, False, False, 'B', 'C', 3, 'HEAD'), {'request': '/requests/' + str(N) + '/4', 'decision': [{'X': 'keep'}, 'B', False, ['rewind-upload', 'dispatch'], 'length']})
check('fixture 6', solve('/requests/' + str(N) + '/5', {}, True, False, 'X', 'Y', None, 'POST'), {'request': '/requests/' + str(N) + '/5', 'decision': [{}, 'X', False, ['abort-upload', 'clear-entity', 'dispatch'], '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:
An unknown replay length and a known zero-byte body are assigned the same framing.

Prepare upload metadata and handoff sequencing after a redirect decision. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': ['//' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': ['://' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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:
Reject malformed redirect authorities without interpreting path text as an authority: the authority presence branch emits an incorrect decision.

Reject malformed redirect authorities without interpreting path text as an authority. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).netloc, not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).netloc.lower(), not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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:
Reject malformed redirect authorities without interpreting path text as an authority: the host lowercase branch emits an incorrect decision.

Reject malformed redirect authorities without interpreting path text as an authority. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', True, urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', bool(urlsplit(target).scheme), urlsplit(target).path, urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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:
Reject malformed redirect authorities without interpreting path text as an authority: the network path host branch emits an incorrect decision.

Reject malformed redirect authorities without interpreting path text as an authority. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path.lower(), urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path.upper(), urlsplit(target).path or '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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:
Reject malformed redirect authorities without interpreting path text as an authority: the path remains case sensitive branch emits an incorrect decision.

Reject malformed redirect authorities without interpreting path text as an authority. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, urlsplit(target).path]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, target):
    return {'request': request, 'decision': [target.startswith('//') or '://' in target, urlsplit(target).hostname or '', not target.startswith('//') or bool(urlsplit(target).netloc), urlsplit(target).path, '/']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https://EXAMPLE.test:8443/A'), {'request': '/requests/' + str(N) + '/0', 'decision': [True, 'example.test', True, '/A', '/A']})
check('fixture 2', solve('/requests/' + str(N) + '/1', '//other.test/B'), {'request': '/requests/' + str(N) + '/1', 'decision': [True, 'other.test', True, '/B', '/B']})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a//b'), {'request': '/requests/' + str(N) + '/2', 'decision': [False, '', True, '/a//b', '/a//b']})
check('fixture 4', solve('/requests/' + str(N) + '/3', '///missing'), {'request': '/requests/' + str(N) + '/3', 'decision': [True, '', False, '/missing', '/missing']})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https://h.test'), {'request': '/requests/' + str(N) + '/4', 'decision': [True, 'h.test', True, '', '/']})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/MiXeD?q=x'), {'request': '/requests/' + str(N) + '/5', 'decision': [False, '', True, '/MiXeD', '/MiXeD']})
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:
Reject malformed redirect authorities without interpreting path text as an authority: the empty path request target branch emits an incorrect decision.

Reject malformed redirect authorities without interpreting path text as an authority. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [port or (443 if scheme == 'https' else 80), port == 0, port is not None and port > 65535, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [port if port is not None else 80, port == 0, port is not None and port > 65535, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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:
Validate a redirect port against an explicit bounded port policy: the omission default branch emits an incorrect decision.

Validate a redirect port against an explicit bounded port policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, False, port is not None and port > 65535, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, not port, port is not None and port > 65535, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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:
Validate a redirect port against an explicit bounded port policy: the zero port rejection branch emits an incorrect decision.

Validate a redirect port against an explicit bounded port policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, port is not None and port >= 65535, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, False, port is not None and port < 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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:
Validate a redirect port against an explicit bounded port policy: the port upper bound branch emits an incorrect decision.

Validate a redirect port against an explicit bounded port policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, port is not None and port > 65535, False, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, port is not None and port > 65535, port is not None and port <= 0, port is None or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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:
Validate a redirect port against an explicit bounded port policy: the negative port rejection branch emits an incorrect decision.

Validate a redirect port against an explicit bounded port policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, port is not None and port > 65535, port is not None and port < 0, not port or port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, port, scheme, permitted):
    return {'request': request, 'decision': [(443 if scheme == 'https' else 80) if port is None else port, port == 0, port is not None and port > 65535, port is not None and port < 0, port in permitted]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', None, 'https', [443]), {'request': '/requests/' + str(N) + '/0', 'decision': [443, False, False, False, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 'https', [443]), {'request': '/requests/' + str(N) + '/1', 'decision': [0, True, False, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 65535, 'http', [65535]), {'request': '/requests/' + str(N) + '/2', 'decision': [65535, False, False, False, True]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 65536, 'http', [80]), {'request': '/requests/' + str(N) + '/3', 'decision': [65536, False, True, False, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', -1, 'http', [-1]), {'request': '/requests/' + str(N) + '/4', 'decision': [-1, False, False, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 8443, 'https', [8443]), {'request': '/requests/' + str(N) + '/5', 'decision': [8443, False, False, False, 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:
Validate a redirect port against an explicit bounded port policy: the explicit port allowlist branch emits an incorrect decision.

Validate a redirect port against an explicit bounded port policy. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [unquote(path).split('/'), path.partition('?')[0], path.replace('%20',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
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
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.replace('%2F','/').split('/'), path.partition('?')[0], path.replace('%20',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
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:
Keep encoded path structure distinct from redirect routing structure: the encoded slash preservation branch emits an incorrect decision.

Keep encoded path structure distinct from redirect routing structure. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access