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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], additions+pairs, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the append query values branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, pairs+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, additions if replace else pairs, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the replace all old values branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0]+'='+str(p[1]) for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if not p[1] else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the bare field serialization branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '#'+anchor if anchor else '', [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '#'+str(anchor), [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the empty fragment delimiter branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, sorted(p[0] for p in pairs), [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, list(dict.fromkeys(p[0] for p in pairs)), [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the query key order branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1]], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], pairs, len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the empty value kept branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(set(p[0] for p in additions)), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(pairs), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the addition cardinality branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), removed, '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [], '?' if pairs or additions else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the unknown removal no change branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?' if pairs else '']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, removed, additions, replace, anchor):
    return {'request': request, 'decision': [[p for p in pairs if p[0] not in removed], pairs+additions, ([p for p in pairs if p[0] not in {a[0] for a in additions}] if replace else pairs)+additions, [p[0] if p[1] is None else p[0]+'='+p[1] for p in pairs], '' if anchor is None else '#'+anchor, [p[0] for p in pairs], [p for p in pairs if p[1] is not None], len(additions), [x for x in removed if x not in {p[0] for p in pairs}], '?']}
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', '1'], ['b', '2'], ['a', '3']], ['b'], [['a', '4']], False, 'section'), {'request': '/requests/' + str(N) + '/0', 'decision': [[['a', '1'], ['a', '3']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], [['a', '1'], ['b', '2'], ['a', '3'], ['a', '4']], ['a=1', 'b=2', 'a=3'], '#section', ['a', 'b', 'a'], [['a', '1'], ['b', '2'], ['a', '3']], 1, [], '?']})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['a', '1'], ['a', '2']], [], [['a', '3']], True, ''), {'request': '/requests/' + str(N) + '/1', 'decision': [[['a', '1'], ['a', '2']], [['a', '1'], ['a', '2'], ['a', '3']], [['a', '3']], ['a=1', 'a=2'], '#', ['a', 'a'], [['a', '1'], ['a', '2']], 1, [], '?']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], [['q', '']], False, None), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [['q', '']], [['q', '']], [], '', [], [], 1, [], '?']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['x', ''], ['flag', None]], ['x'], [], True, 'z'), {'request': '/requests/' + str(N) + '/3', 'decision': [[['flag', None]], [['x', ''], ['flag', None]], [['x', ''], ['flag', None]], ['x=', 'flag'], '#z', ['x', 'flag'], [['x', '']], 0, [], '?']})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['b', '2'], ['a', '1']], ['absent'], [['c', '3'], ['c', '4']], False, '#x'), {'request': '/requests/' + str(N) + '/4', 'decision': [[['b', '2'], ['a', '1']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], [['b', '2'], ['a', '1'], ['c', '3'], ['c', '4']], ['b=2', 'a=1'], '##x', ['b', 'a'], [['b', '2'], ['a', '1']], 2, ['absent'], '?']})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['a', '1']], ['a'], [['a', '2']], True, None), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [['a', '1'], ['a', '2']], [['a', '2']], ['a=1'], '', ['a'], [['a', '1']], 1, [], '?']})
check('fixture 7', solve('/requests/' + str(N) + '/6', [], [], [], False, None), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], [], [], '', [], [], 0, [], '']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Apply a configured redirect query transformation without changing retained value order: the result query delimiter branch emits an incorrect decision.

Apply a configured redirect query transformation without changing retained value order. 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, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [chain, methods[-1] not in ('GET','HEAD'), state, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[chain[-1]], methods[-1] not in ('GET','HEAD'), state, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit a redirect chain using terminal document semantics and the original navigation intent: the intermediate hops not documents branch emits an incorrect decision.

Commit a redirect chain using terminal document semantics and the original navigation intent. 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, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[0] not in ('GET','HEAD'), state, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], any(m not in ('GET','HEAD') for m in methods), state, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit a redirect chain using terminal document semantics and the original navigation intent: the resubmit terminal method only branch emits an incorrect decision.

Commit a redirect chain using terminal document semantics and the original navigation intent. 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, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), {}, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), state if len(chain)==1 else {}, 1 if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit a redirect chain using terminal document semantics and the original navigation intent: the navigation state survives hops branch emits an incorrect decision.

Commit a redirect chain using terminal document semantics and the original navigation intent. 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, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), state, len(chain) if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), state, max(0,len(chain)-1) if activation else 0, replace, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit a redirect chain using terminal document semantics and the original navigation intent: the activation not multiplied by hops branch emits an incorrect decision.

Commit a redirect chain using terminal document semantics and the original navigation intent. 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, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), state, 1 if activation else 0, len(chain)>1, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, chain, methods, state, download, activation, replace, initiator, allows):
    return {'request': request, 'decision': [[] if download else [chain[-1]], methods[-1] not in ('GET','HEAD'), state, 1 if activation else 0, replace or len(chain)>1, initiator, [u for u,ok in zip(chain,allows) if not ok], urlsplit(chain[-1]).netloc, 'download' if download else 'document', {'requested':chain[0],'committed':None if download else chain[-1]}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['https://a/x', 'https://b/y', 'https://c/z'], ['POST', 'GET', 'GET'], {'view': 'v'}, False, True, False, 'https://start/home', [True, False, True]), {'request': '/requests/' + str(N) + '/0', 'decision': [['https://c/z'], False, {'view': 'v'}, 1, False, 'https://start/home', ['https://b/y'], 'c', 'document', {'requested': 'https://a/x', 'committed': 'https://c/z'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['https://a/x'], ['GET'], {'view': 'q'}, False, True, True, 'https://start/home', [True]), {'request': '/requests/' + str(N) + '/1', 'decision': [['https://a/x'], False, {'view': 'q'}, 1, True, 'https://start/home', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/x'}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', ['https://a/x', 'https://b/file'], ['GET', 'GET'], {}, True, False, False, 'https://start/a', [True, True]), {'request': '/requests/' + str(N) + '/2', 'decision': [[], False, {}, 0, False, 'https://start/a', [], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['https://a/x', 'https://b/y'], ['POST', 'POST'], {'form': 'a'}, False, False, True, 'https://start/b', [False, True]), {'request': '/requests/' + str(N) + '/3', 'decision': [['https://b/y'], True, {'form': 'a'}, 0, True, 'https://start/b', ['https://a/x'], 'b', 'document', {'requested': 'https://a/x', 'committed': 'https://b/y'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['https://a/x', 'https://a/y'], ['GET', 'HEAD'], {}, False, True, False, 'https://start/c', [True, True]), {'request': '/requests/' + str(N) + '/4', 'decision': [['https://a/y'], False, {}, 1, False, 'https://start/c', [], 'a', 'document', {'requested': 'https://a/x', 'committed': 'https://a/y'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['https://a/x', 'https://b/file'], ['POST', 'GET'], {'download': 'd'}, True, True, True, 'https://start/d', [True, False]), {'request': '/requests/' + str(N) + '/5', 'decision': [[], False, {'download': 'd'}, 1, True, 'https://start/d', ['https://b/file'], 'b', 'download', {'requested': 'https://a/x', 'committed': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit a redirect chain using terminal document semantics and the original navigation intent: the replace intent not implied by redirect branch emits an incorrect decision.

Commit a redirect chain using terminal document semantics and the original navigation intent. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access