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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], entries, [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the permanence filter branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[1] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the affected source report branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], len(entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the removed entry count branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), entries, any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]!=partition], any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the partition exactness branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], bool(entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], not entries or any(e[0]==source for e in entries), source==target, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the empty invalidation no hit branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), any(e[1]==target for e in entries), [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), False, [e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the source target direction branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, sorted(e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, entries, source, target, partition, permanent):
    return {'request': request, 'decision': [[e for e in entries if e[0]!=source], [e for e in entries if not(e[0]==source and e[2]==partition)], [e for e in entries if e[1]!=target], [e for e in entries if e[3]==permanent], [e[0] for e in entries if e[1]==target], sum(e[0]==source and e[2]==partition for e in entries), [e for e in entries if e[2]==partition], any(e[0]==source for e in entries), source==target, list(reversed([e[0] for e in entries if e[0]!=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', [['/a', '/b', 'p', True], ['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/0', 'decision': [[['/b', '/c', 'p', False]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/b', '/c', 'p', False], ['/a', '/x', 'q', True]], [['/a', '/b', 'p', True], ['/a', '/x', 'q', True]], ['/a'], 1, [['/a', '/b', 'p', True], ['/b', '/c', 'p', False]], True, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], '/a', '/b', 'p', False), {'request': '/requests/' + str(N) + '/1', 'decision': [[['/x', '/b', 'p', True]], [['/x', '/b', 'p', True]], [], [['/a', '/b', 'p', False]], ['/a', '/x'], 1, [['/a', '/b', 'p', False], ['/x', '/b', 'p', True]], True, False, ['/x']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', '/b', 'p', True), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], [], [], [], 0, [], False, False, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], '/a', '/b', 'q', True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [['/a', '/b', 'p', True]], [], [['/a', '/b', 'p', True], ['/a', '/b', 'q', True]], ['/a', '/a'], 1, [['/a', '/b', 'q', True]], True, False, []]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 'p', True]], '/z', '/a', 'p', False), {'request': '/requests/' + str(N) + '/4', 'decision': [[['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True]], [], [], 0, [['/a', '/b', 'p', True]], False, False, ['/a']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], '/a', '/a', 'p', True), {'request': '/requests/' + str(N) + '/5', 'decision': [[['/b', '/a', 'p', True]], [['/b', '/a', 'p', True]], [['/a', '/b', 'p', True]], [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], ['/b'], 1, [['/a', '/b', 'p', True], ['/b', '/a', 'p', True]], True, True, ['/b']]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], '/a', '/c', 'p', True), {'request': '/requests/' + str(N) + '/6', 'decision': [[['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], [['/a', '/b', 'q', True]], [['/ab', '/c', 'p', True], ['/a', '/b', 'q', True]], ['/z', '/ab'], 0, [['/z', '/c', 'p', False], ['/ab', '/c', 'p', True]], True, False, ['/z', '/ab']]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Invalidate redirect mappings by source and affected target with partition isolation: the survivor order branch emits an incorrect decision.

Invalidate redirect mappings by source and affected target with partition isolation. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[-1] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the trust gates forwarded host branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto if trusted else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the trusted proto fallback branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, list(reversed(chain)), bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, sorted(chain), bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the proxy chain order branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, trusted, '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(proto), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the empty forwarded value fallback branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), prefix, prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), prefix.lstrip('/'), prefix if trusted else '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the prefix not authority branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix, direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', '', direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the ignore untrusted prefix branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host.split(':')[0], prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', chain[0] if chain else direct_host, prefix.rstrip('/')+'/' if prefix else '/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the direct authority port preserved branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. 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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix+'/', not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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, trusted, chain, proto, direct_host, direct_scheme, prefix):
    return {'request': request, 'decision': [chain[0] if trusted and chain else direct_host, proto.lower() if trusted and proto else direct_scheme, chain, bool(chain), '/' + prefix.lstrip('/') if prefix else '', prefix if trusted else '', direct_host, prefix.rstrip('/'), not proto or proto.lower() in ('http','https'), 'forwarded' if trusted and chain else 'direct']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', True, ['client.test', 'edge.test'], 'https', 'internal:8080', 'http', '/app'), {'request': '/requests/' + str(N) + '/0', 'decision': ['client.test', 'https', ['client.test', 'edge.test'], True, '/app', '/app', 'internal:8080', '/app/', True, 'forwarded']})
check('fixture 2', solve('/requests/' + str(N) + '/1', False, ['attacker.test'], 'https', 'public.test', 'http', '/'), {'request': '/requests/' + str(N) + '/1', 'decision': ['public.test', 'http', ['attacker.test'], True, '/', '', 'public.test', '/', True, 'direct']})
check('fixture 3', solve('/requests/' + str(N) + '/2', True, [], '', 'fallback.test', 'https', ''), {'request': '/requests/' + str(N) + '/2', 'decision': ['fallback.test', 'https', [], False, '', '', 'fallback.test', '/', True, 'direct']})
check('fixture 4', solve('/requests/' + str(N) + '/3', True, ['one.test', 'two.test', 'three.test'], 'http', 'internal', 'https', '/v2/'), {'request': '/requests/' + str(N) + '/3', 'decision': ['one.test', 'http', ['one.test', 'two.test', 'three.test'], True, '/v2/', '/v2/', 'internal', '/v2/', True, 'forwarded']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, ['public.test'], 'HTTPS', 'internal', 'http', '//evil.test'), {'request': '/requests/' + str(N) + '/4', 'decision': ['public.test', 'https', ['public.test'], True, '/evil.test', '//evil.test', 'internal', '//evil.test/', True, 'forwarded']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, [], 'http', 'actual.test', 'https', '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['actual.test', 'https', [], False, '/x', '', 'actual.test', '/x/', True, 'direct']})
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:
Build public redirect origins from explicitly trusted proxy metadata: the prefix single terminal delimiter branch emits an incorrect decision.

Build public redirect origins from explicitly trusted proxy metadata. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access