broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path, path.replace('%20',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.split('?')[-1], path.replace('%20',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Keep encoded path structure distinct from redirect routing structure: the query not path branch emits an incorrect decision.

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('+',' ').replace('%20',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('+',' '), unquote(path), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Keep encoded path structure distinct from redirect routing structure: the literal plus preservation branch emits an incorrect decision.

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('%20',' '), unquote(unquote(path)), [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('%20',' '), path, [p for p in path.split('/') if p in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Keep encoded path structure distinct from redirect routing structure: the one percent decode branch emits an incorrect decision.

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('%20',' '), unquote(path), [p for p in path.split('/') if '.' in p]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, path):
    return {'request': request, 'decision': [path.split('/'), path.partition('?')[0], path.replace('%20',' '), unquote(path), [p for p in path.split('/') if unquote(p) in ('.','..')]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', '/a%2Fb/%252F'), {'request': '/requests/' + str(N) + '/0', 'decision': [['', 'a%2Fb', '%252F'], '/a%2Fb/%252F', '/a%2Fb/%252F', '/a/b/%2F', []]})
check('fixture 2', solve('/requests/' + str(N) + '/1', '/a+b/c%20d'), {'request': '/requests/' + str(N) + '/1', 'decision': [['', 'a+b', 'c%20d'], '/a+b/c%20d', '/a+b/c d', '/a+b/c d', []]})
check('fixture 3', solve('/requests/' + str(N) + '/2', '/a?x=1'), {'request': '/requests/' + str(N) + '/2', 'decision': [['', 'a?x=1'], '/a', '/a?x=1', '/a?x=1', []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', '/x/../y/./z'), {'request': '/requests/' + str(N) + '/3', 'decision': [['', 'x', '..', 'y', '.', 'z'], '/x/../y/./z', '/x/../y/./z', '/x/../y/./z', ['..', '.']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', '/v1.2/%2e%2e/a'), {'request': '/requests/' + str(N) + '/4', 'decision': [['', 'v1.2', '%2e%2e', 'a'], '/v1.2/%2e%2e/a', '/v1.2/%2e%2e/a', '/v1.2/../a', []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', '/'), {'request': '/requests/' + str(N) + '/5', 'decision': [['', ''], '/', '/', '/', []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Keep encoded path structure distinct from redirect routing structure: the dot segment recognition branch emits an incorrect decision.

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

split: open-access


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, query):
    return {'request': request, 'decision': [list(dict.fromkeys(query.split('&'))) if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, query):
    return {'request': request, 'decision': [sorted(set(query.split('&'))) if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preserve query-field structure while preparing a redirect target: the duplicate key preservation branch emits an incorrect decision.

Preserve query-field structure while preparing a redirect target. 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, query):
    return {'request': request, 'decision': [query.split('&') if query else [], ['value' for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('value' if p.partition('=')[2] else 'bare') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preserve query-field structure while preparing a redirect target: the bare vs empty value branch emits an incorrect decision.

Preserve query-field structure while preparing a redirect target. 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, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.split('=')[-1] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.split('=')[1] if '=' in p else '' for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preserve query-field structure while preparing a redirect target: the first equals boundary branch emits an incorrect decision.

Preserve query-field structure while preparing a redirect target. 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, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], len(re.split('[&;]',query)) if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count(';')+1 if query else 0, query.split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preserve query-field structure while preparing a redirect target: the semicolon is data branch emits an incorrect decision.

Preserve query-field structure while preparing a redirect target. 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, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, unquote(query).split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, query):
    return {'request': request, 'decision': [query.split('&') if query else [], [('bare' if '=' not in p else 'value') for p in query.split('&')] if query else [], [p.partition('=')[2] for p in query.split('&')] if query else [], query.count('&')+1 if query else 0, query.replace('%26','&').split('&') if query else []]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'a=1&a=1&b'), {'request': '/requests/' + str(N) + '/0', 'decision': [['a=1', 'a=1', 'b'], ['value', 'value', 'bare'], ['1', '1', ''], 3, ['a=1', 'a=1', 'b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'a=&b=x=y=z'), {'request': '/requests/' + str(N) + '/1', 'decision': [['a=', 'b=x=y=z'], ['value', 'value'], ['', 'x=y=z'], 2, ['a=', 'b=x=y=z']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'a=x;y=z'), {'request': '/requests/' + str(N) + '/2', 'decision': [['a=x;y=z'], ['value'], ['x;y=z'], 1, ['a=x;y=z']]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'a=x%26b=y'), {'request': '/requests/' + str(N) + '/3', 'decision': [['a=x%26b=y'], ['value'], ['x%26b=y'], 1, ['a=x%26b=y']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'flag'), {'request': '/requests/' + str(N) + '/4', 'decision': [['flag'], ['bare'], [''], 1, ['flag']]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ''), {'request': '/requests/' + str(N) + '/5', 'decision': [[], [], [], 0, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Preserve query-field structure while preparing a redirect target: the encoded delimiter preservation branch emits an incorrect decision.

Preserve query-field structure while preparing a redirect target. 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, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + [pending], history, pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if completed else []), history, pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit redirect history only after target admission: the pending entry commit branch emits an incorrect decision.

Commit redirect history only after target admission. 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, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), list(reversed(history)), pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), sorted(history), pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit redirect history only after target admission: the chronological order branch emits an incorrect decision.

Commit redirect history only after target admission. 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, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, pending, completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, history[0] if history else None, completed and terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit redirect history only after target admission: the terminal url choice branch emits an incorrect decision.

Commit redirect history only after target admission. 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, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, pending if admitted else (history[-1] if history else None), completed, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, pending if admitted else (history[-1] if history else None), terminal, {'completed':history,'rejected':None if admitted else pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit redirect history only after target admission: the completion flag branch emits an incorrect decision.

Commit redirect history only after target admission. 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, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history+([pending] if not admitted else []),'rejected':None}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, history, pending, admitted, completed, terminal):
    return {'request': request, 'decision': [history + ([pending] if admitted else []), history, pending if admitted else (history[-1] if history else None), completed and terminal, {'completed':history,'rejected':pending}]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/z', '/a'], '/b', False, True, False), {'request': '/requests/' + str(N) + '/0', 'decision': [['/z', '/a'], ['/z', '/a'], '/a', False, {'completed': ['/z', '/a'], 'rejected': '/b'}]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/z', '/a'], '/b', True, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/z', '/a', '/b'], ['/z', '/a'], '/b', False, {'completed': ['/z', '/a'], 'rejected': None}]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], '/a', True, True, True), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], [], '/a', True, {'completed': [], 'rejected': None}]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], '/a', False, False, True), {'request': '/requests/' + str(N) + '/3', 'decision': [[], [], None, False, {'completed': [], 'rejected': '/a'}]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a'], '/b', False, False, False), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a'], ['/a'], '/a', False, {'completed': ['/a'], 'rejected': '/b'}]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/b', '/a'], '/c', True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/b', '/a', '/c'], ['/b', '/a'], '/c', False, {'completed': ['/b', '/a'], 'rejected': None}]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Commit redirect history only after target admission: the failed hop retention branch emits an incorrect decision.

Commit redirect history only after target admission. 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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events+[target], done and not canceled, len(events), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [([target]+events) if accepted else events, done and not canceled, len(events), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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:
Expose redirect events in request order without false completion: the event appending branch emits an incorrect decision.

Expose redirect events in request order without false completion. 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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done, len(events), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), not canceled, len(events), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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:
Expose redirect events in request order without false completion: the completion after cancel branch emits an incorrect decision.

Expose redirect events in request order without false completion. 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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, len(set(events)), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, max(0,len(events)-1), events[-1] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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:
Expose redirect events in request order without false completion: the redirect count from events branch emits an incorrect decision.

Expose redirect events in request order without false completion. 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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, len(events), events[0] if events else None, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, len(events), target, 'canceled' if canceled else ('redirect' if accepted else 'blocked')]}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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:
Expose redirect events in request order without false completion: the last observed target branch emits an incorrect decision.

Expose redirect events in request order without false completion. 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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, len(events), events[-1] if events else None, 'redirect' if accepted else 'blocked']}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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, events, accepted, target, done, canceled):
    return {'request': request, 'decision': [events + ([target] if accepted else []), done and not canceled, len(events), events[-1] if events else None, 'canceled' if canceled else 'redirect']}
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', '/a'], False, '/c', True, True), {'request': '/requests/' + str(N) + '/0', 'decision': [['/a', '/b', '/a'], False, 3, '/a', 'canceled']})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/a', '/b'], True, '/c', False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [['/a', '/b', '/c'], False, 2, '/b', 'redirect']})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], False, '/a', True, False), {'request': '/requests/' + str(N) + '/2', 'decision': [[], True, 0, None, 'blocked']})
check('fixture 4', solve('/requests/' + str(N) + '/3', [], True, '/a', False, False), {'request': '/requests/' + str(N) + '/3', 'decision': [['/a'], False, 0, None, 'redirect']})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/b'], True, '/c', True, True), {'request': '/requests/' + str(N) + '/4', 'decision': [['/b', '/c'], False, 1, '/b', 'canceled']})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/a', '/b'], False, '/c', False, False), {'request': '/requests/' + str(N) + '/5', 'decision': [['/a', '/b'], False, 2, '/b', 'blocked']})
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:
Expose redirect events in request order without false completion: the rejection event kind branch emits an incorrect decision.

Expose redirect events in request order without false completion. 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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [not drained, reusable and drained and not closed, not http2 and remaining > 0 and not reusable, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [remaining >= 0, reusable and drained and not closed, not http2 and remaining > 0 and not reusable, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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:
Release an intermediate response before following its target: the drain required branch emits an incorrect decision.

Release an intermediate response before following its target. 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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [not drained and remaining > 0, reusable, not http2 and remaining > 0 and not reusable, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [not drained and remaining > 0, drained, not http2 and remaining > 0 and not reusable, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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:
Release an intermediate response before following its target: the pool return branch emits an incorrect decision.

Release an intermediate response before following its target. 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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [not drained and remaining > 0, reusable and drained and not closed, remaining > 0, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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, drained, remaining, reusable, closed, canceled, http2):
    return {'request': request, 'decision': [not drained and remaining > 0, reusable and drained and not closed, not reusable, http2 and remaining > 0, not canceled and not closed, 'eof' if remaining == 0 else 'pending', not closed, remaining if not drained else 0, 'stream' if http2 else 'connection', 'released' if closed else ('canceling' if canceled else 'owned')]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', False, 8, True, False, False, False), {'request': '/requests/' + str(N) + '/0', 'decision': [True, False, False, False, True, 'pending', True, 8, 'connection', 'owned']})
check('fixture 2', solve('/requests/' + str(N) + '/1', True, 0, True, False, False, False), {'request': '/requests/' + str(N) + '/1', 'decision': [False, True, False, False, True, 'eof', True, 0, 'connection', 'owned']})
check('fixture 3', solve('/requests/' + str(N) + '/2', False, 3, False, False, False, False), {'request': '/requests/' + str(N) + '/2', 'decision': [True, False, True, False, True, 'pending', True, 3, 'connection', 'owned']})
check('fixture 4', solve('/requests/' + str(N) + '/3', False, 5, True, False, True, True), {'request': '/requests/' + str(N) + '/3', 'decision': [True, False, False, True, False, 'pending', True, 5, 'stream', 'canceling']})
check('fixture 5', solve('/requests/' + str(N) + '/4', True, 0, True, True, False, True), {'request': '/requests/' + str(N) + '/4', 'decision': [False, False, False, False, False, 'eof', False, 0, 'stream', 'released']})
check('fixture 6', solve('/requests/' + str(N) + '/5', False, 0, False, True, True, False), {'request': '/requests/' + str(N) + '/5', 'decision': [False, False, False, False, False, 'eof', False, 0, 'connection', 'released']})
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:
Release an intermediate response before following its target: the unread body close branch emits an incorrect decision.

Release an intermediate response before following its target. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access