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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[0] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], list(reversed([e[1] for e in edges])), all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the edge target sequence branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], True, not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(e[0]==original for e in edges), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the continuity validation branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), bool(edges) and edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[-1][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the first source original branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, bool(edges) and edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[0][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the terminal target consistency branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, int(any(e[3]=='cache' for e in edges)), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, len(edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the cached edge count branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), len(edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), int(any(e[3]=='network' for e in edges)), bool(edges) and all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the network edge count branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), all(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), any(e[2] in (301,308) for e in edges), success, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the permanent entire chain branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), bool(edges), [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), terminal != original, [e[2] for e in edges]]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the success independent of hops branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, sorted(e[2] for e in edges)]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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, edges, original, terminal, success):
    return {'request': request, 'decision': [[e[0] for e in edges], [e[1] for e in edges], all(edges[i-1][1]==edges[i][0] for i in range(1,len(edges))), not edges or edges[0][0]==original, not edges or edges[-1][1]==terminal, sum(e[3]=='cache' for e in edges), sum(e[3]=='network' for e in edges), bool(edges) and all(e[2] in (301,308) for e in edges), success, list(set(e[2] for e in edges))]}
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', 301, 'cache'], ['/b', '/c', 302, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 1, 1, False, True, [301, 302]]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [], '/x', '/x', True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], [], True, True, True, 0, 0, False, True, []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/x', '/y', 307, 'network']], '/x', '/y', False), {'request': '/requests/' + str(N) + '/2', 'decision': [['/x'], ['/y'], True, True, True, 0, 1, False, False, [307]]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/z', '/a', 308, 'cache'], ['/a', '/z', 308, 'cache']], '/z', '/z', False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], ['/a', '/z'], True, True, True, 2, 0, True, False, [308, 308]]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['/a', '/b', 303, 'network'], ['/b', '/c', 307, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, False, True, [303, 307]]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', '/b', 301, 'network'], ['/x', '/c', 302, 'cache']], '/a', '/c', False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/x'], ['/b', '/c'], False, True, True, 1, 1, False, False, [301, 302]]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['/a', '/b', 308, 'network'], ['/b', '/c', 301, 'network']], '/a', '/c', True), {'request': '/requests/' + str(N) + '/6', 'decision': [['/a', '/b'], ['/b', '/c'], True, True, True, 0, 2, True, True, [308, 301]]})
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:
Retain redirect-edge provenance when materializing a chain audit record: the status sequence preserved branch emits an incorrect decision.

Retain redirect-edge provenance when materializing a chain audit record. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': ['redirect', original, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': ['policy' if rejected else 'complete', original, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the phase preserved branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, attempted, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, completed[-1] if completed else None, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the original request retained branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, completed[-1] if completed else original, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, original, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the attempted target context branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed+[attempted], code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed[:-1] if rejected else completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the rejected target not completed branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code or 'unknown', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, 'blocked' if rejected else 'none', code is not None, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the error code optional branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', rejected, completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', phase != 'policy', completed[-1] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the failure from code branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', code is not None, completed[0] if completed else None, phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', code is not None, attempted if not completed else completed[-1], phase in ('parse','policy'), completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the last completed safe empty branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. 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, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, rejected, completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, phase, code, completed, attempted, rejected, original):
    return {'request': request, 'decision': [phase, original, attempted, completed, code if code is not None else 'none', code is not None, completed[-1] if completed else None, phase == 'policy', completed, rejected or phase == 'parse']}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'parse', 'invalid-target', ['/a'], 'bad%', True, '/a'), {'request': '/requests/' + str(N) + '/0', 'decision': ['parse', '/a', 'bad%', ['/a'], 'invalid-target', True, '/a', True, ['/a'], True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'policy', 'blocked', ['/a', '/b'], '/c', True, '/a'), {'request': '/requests/' + str(N) + '/1', 'decision': ['policy', '/a', '/c', ['/a', '/b'], 'blocked', True, '/b', True, ['/a', '/b'], True]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'dispatch', 'closed', ['/a'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/2', 'decision': ['dispatch', '/a', '/b', ['/a'], 'closed', True, '/a', False, ['/a'], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'response', 'body-error', [], '/x', False, '/x'), {'request': '/requests/' + str(N) + '/3', 'decision': ['response', '/x', '/x', [], 'body-error', True, None, False, [], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'complete', None, ['/a', '/b'], '/b', False, '/a'), {'request': '/requests/' + str(N) + '/4', 'decision': ['complete', '/a', '/b', ['/a', '/b'], 'none', False, '/b', False, ['/a', '/b'], False]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'policy', 'blocked', [], '/x', True, '/x'), {'request': '/requests/' + str(N) + '/5', 'decision': ['policy', '/x', '/x', [], 'blocked', True, None, True, [], True]})
check('fixture 7', solve('/requests/' + str(N) + '/6', 'parse', 'invalid-target', ['/z', '/a'], 'bad%', False, '/z'), {'request': '/requests/' + str(N) + '/6', 'decision': ['parse', '/z', 'bad%', ['/z', '/a'], 'invalid-target', True, '/a', True, ['/z', '/a'], True]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Report redirect failures with the failing phase and completed request context: the pre dispatch failure branch emits an incorrect decision.

Report redirect failures with the failing phase and completed request context. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access