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, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), any(v!=required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Match query-aware redirect rules against repeated decoded query fields: the negation after aggregation branch emits an incorrect decision.

Match query-aware redirect rules against repeated decoded query fields. 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, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(required in v for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v.startswith(required) for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Match query-aware redirect rules against repeated decoded query fields: the exact value not substring branch emits an incorrect decision.

Match query-aware redirect rules against repeated decoded query fields. 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, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), len(set(v for k,v in pairs if k==key)), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), int(any(k==key for k,v in pairs)), any(k==key and v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Match query-aware redirect rules against repeated decoded query fields: the duplicate query occurrence count branch emits an incorrect decision.

Match query-aware redirect rules against repeated decoded query fields. 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, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key or v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(v==required for k,v in pairs), (bool(pairs) and all(v==required for k,v in pairs)) if require_all else any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Match query-aware redirect rules against repeated decoded query fields: the key value conjunction branch emits an incorrect decision.

Match query-aware redirect rules against repeated decoded query fields. 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, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), any(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, pairs, key, required, case_sensitive, negate, require_all):
    return {'request': request, 'decision': [[v for k,v in pairs if k==key], [v for k,v in pairs if (k==key if case_sensitive else k.lower()==key.lower())], any(unquote(v)==required for k,v in pairs if k==key), any(k==key for k,v in pairs), bool([v for k,v in pairs if k==key]) and all(v==required for k,v in pairs if k==key), not any(v==required for k,v in pairs if k==key) if negate else any(v==required for k,v in pairs if k==key), any(v==required for k,v in pairs if k==key), sum(k==key for k,v in pairs), any(k==key and v==required for k,v in pairs), all(v==required for k,v 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', [['q', 'a'], ['q', 'b']], 'q', 'b', True, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['a', 'b'], ['a', 'b'], True, True, False, True, True, 2, True, True]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['Q', 'A']], 'q', 'a', False, False, True), {'request': '/requests/' + str(N) + '/1', 'decision': [[], ['A'], False, False, False, False, False, 0, False, False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], 'q', '', True, True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], [], False, False, False, True, False, 0, False, False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['q', ''], ['q', 'x']], 'q', '', True, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x'], ['', 'x'], True, True, False, True, True, 2, True, False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [['q', 'a'], ['q', 'a']], 'q', 'a', True, True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['a', 'a'], ['a', 'a'], True, True, True, False, True, 2, True, True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['q', 'a%20b']], 'q', 'a b', True, False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['a%20b'], ['a%20b'], True, True, False, False, False, 1, False, False]})
check('fixture 7', solve('/requests/' + str(N) + '/6', [['Q', 'a']], 'q', 'a', True, False, False), {'request': '/requests/' + str(N) + '/6', 'decision': [[], [], False, False, False, False, False, 0, False, True]})
check('fixture 8', solve('/requests/' + str(N) + '/7', [['q', '']], 'q', '', True, False, False), {'request': '/requests/' + str(N) + '/7', 'decision': [[''], [''], True, True, True, True, True, 1, True, True]})
check('fixture 9', solve('/requests/' + str(N) + '/8', [['q', 'prefix']], 'q', 'pre', True, False, False), {'request': '/requests/' + str(N) + '/8', 'decision': [['prefix'], ['prefix'], False, True, False, False, False, 1, False, False]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Match query-aware redirect rules against repeated decoded query fields: the all versus any option branch emits an incorrect decision.

Match query-aware redirect rules against repeated decoded query fields. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now-offset), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [deadline-now, headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the remaining monotonic branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), released-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the headers latency branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-started, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, now-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the drain latency branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-headers, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, released-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the chain latency branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now==deadline, now+offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the deadline expiration equality branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now-offset, deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the wall clock log only branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline+(now-started), now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, now+deadline, now-released, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the next hop deadline unchanged branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-headers, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, released-headers, headers==started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the redirect transition overhead branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers>started, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, False, released-started]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the zero latency is observed branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. 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, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, released-started+offset]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, started, headers, released, now, deadline, offset):
    return {'request': request, 'decision': [max(0,deadline-now), headers-started, released-headers, now-started, now>=deadline, now+offset, deadline, now-released, headers==started, abs(released-started+offset)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 10, 13, 15, 18, 20, 1000), {'request': '/requests/' + str(N) + '/0', 'decision': [2, 3, 2, 8, False, 1018, 20, 3, False, 5]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 0, 0, 0, 0, 0, 500), {'request': '/requests/' + str(N) + '/1', 'decision': [0, 0, 0, 0, True, 500, 0, 0, True, 0]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 20, 25, 29, 35, 30, -100), {'request': '/requests/' + str(N) + '/2', 'decision': [0, 5, 4, 15, True, -65, 30, 6, False, 9]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 10, 11, 12, 12, 100, 0), {'request': '/requests/' + str(N) + '/3', 'decision': [88, 1, 1, 2, False, 12, 100, 0, False, 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 5, 9, 10, 14, 15, 400), {'request': '/requests/' + str(N) + '/4', 'decision': [1, 4, 1, 9, False, 414, 15, 4, False, 5]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 100, 105, 110, 120, 121, -500), {'request': '/requests/' + str(N) + '/5', 'decision': [1, 5, 5, 20, False, -380, 121, 10, False, 10]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Account for a redirect chain using a monotonic deadline and separate response timing: the response time does not use wall branch emits an incorrect decision.

Account for a redirect chain using a monotonic deadline and separate response timing. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


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

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

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

Invalidate redirect mappings by source and affected target with partition isolation. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


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

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

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

Invalidate redirect mappings by source and affected target with partition isolation. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access


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

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

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

Invalidate redirect mappings by source and affected target with partition isolation. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access