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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host, None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.upper(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the host normalization branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None, method, path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), port, method, path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the nondefault port branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, 'GET' if method == 'HEAD' else method, path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, 'GET', path, query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the head isolated from get branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path.lower(), query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path.upper(), query, '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the case sensitive path key branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, '&'.join(sorted(set(query.split('&')))), '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query.split('&')[0], '=' in query, partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the query order and duplicates branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, bool(query), partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, bool(query.partition('=')[2]), partition, vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the empty value query presence branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, 'global', vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition[:3], vary, len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the partition key branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, sorted(vary), len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, list(reversed(vary)), len(vary)]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the vary value order branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, vary, len([v for v in vary if v])]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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, scheme, host, port, method, path, query, partition, vary):
    return {'request': request, 'decision': [scheme, host.lower(), None if (scheme,port) in (("https",443),("http",80)) else port, method, path, query, '=' in query, partition, vary, len(set(vary))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 'https', 'H.TEST', 443, 'GET', '/A', 'x=1', 'tab1', ['en', 'gzip']), {'request': '/requests/' + str(N) + '/0', 'decision': ['https', 'h.test', None, 'GET', '/A', 'x=1', True, 'tab1', ['en', 'gzip'], 2]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 'https', 'h.test', 8443, 'HEAD', '/a', 'x=2', 'tab2', ['fr', 'br']), {'request': '/requests/' + str(N) + '/1', 'decision': ['https', 'h.test', 8443, 'HEAD', '/a', 'x=2', True, 'tab2', ['fr', 'br'], 2]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 'http', 'h.test', 80, 'POST', '/a', 'q=', 'tab1', []), {'request': '/requests/' + str(N) + '/2', 'decision': ['http', 'h.test', None, 'POST', '/a', 'q=', True, 'tab1', [], 0]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 'http', 'Z.TEST', 8080, 'GET', '/b', 'b=2&a=1&b=2', 'tab3', ['en', 'br']), {'request': '/requests/' + str(N) + '/3', 'decision': ['http', 'z.test', 8080, 'GET', '/b', 'b=2&a=1&b=2', True, 'tab3', ['en', 'br'], 2]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 'https', 'h.test', 443, 'PUT', '/B', 'flag', 'tab2', ['']), {'request': '/requests/' + str(N) + '/4', 'decision': ['https', 'h.test', None, 'PUT', '/B', 'flag', False, 'tab2', [''], 1]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 'https', 'h.test', 443, 'GET', '/a', 'x=1', 'tab1', ['gzip', 'en', 'gzip']), {'request': '/requests/' + str(N) + '/5', 'decision': ['https', 'h.test', None, 'GET', '/a', 'x=1', True, 'tab1', ['gzip', 'en', 'gzip'], 3]})
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:
Partition redirect cache entries by their declared request dimensions: the vary empty value sentinel branch emits an incorrect decision.

Partition redirect cache entries by their declared request dimensions. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [ttl, status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [ttl+age, status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the freshness after age branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status == 301, status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,302,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the permanent class branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307), not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status == 302 and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the explicit temporary freshness branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, True, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store and not private, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the no store veto branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not private, age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not shared, age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the private shared veto branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age==ttl, location is not None, status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the expired insertion branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, bool(location), status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, status in (301,302,307,308), status in (302,303,307) and ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the location required branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, ttl>age, age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307), age, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the transient with freshness branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, 0, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, ttl, status]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the stored age metadata branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, 301 if status in (301,308) else 302]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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, status, ttl, age, no_store, private, shared, location):
    return {'request': request, 'decision': [max(0,ttl-age), status in (301,308), status in (302,303,307) and ttl>0, not no_store, not (private and shared), age>=ttl, location is not None, status in (302,303,307) and ttl>age, age, 302]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', 301, 60, 10, False, False, True, '/b'), {'request': '/requests/' + str(N) + '/0', 'decision': [50, True, False, True, True, False, True, False, 10, 301]})
check('fixture 2', solve('/requests/' + str(N) + '/1', 302, 0, 0, False, False, True, '/c'), {'request': '/requests/' + str(N) + '/1', 'decision': [0, False, False, True, True, True, True, False, 0, 302]})
check('fixture 3', solve('/requests/' + str(N) + '/2', 307, 30, 35, False, True, True, '/d'), {'request': '/requests/' + str(N) + '/2', 'decision': [0, False, True, True, False, True, True, False, 35, 307]})
check('fixture 4', solve('/requests/' + str(N) + '/3', 308, 60, 0, True, False, False, '/e'), {'request': '/requests/' + str(N) + '/3', 'decision': [60, True, False, False, True, False, True, False, 0, 308]})
check('fixture 5', solve('/requests/' + str(N) + '/4', 303, 20, 5, False, True, False, ''), {'request': '/requests/' + str(N) + '/4', 'decision': [15, False, True, True, True, False, True, True, 5, 303]})
check('fixture 6', solve('/requests/' + str(N) + '/5', 200, 0, 0, False, False, False, None), {'request': '/requests/' + str(N) + '/5', 'decision': [0, False, False, True, True, True, False, False, 0, 200]})
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:
Cache redirects only under the stipulated freshness and response policy: the status persisted branch emits an incorrect decision.

Cache redirects only under the stipulated freshness and response policy. 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, targets, fresh, network, blocked, now, inserted):
    return {'request': request, 'decision': [sorted(targets), next((i for i,f in enumerate(fresh) if not f),None), all(fresh), max(0,now-inserted), 'network' if network else 'cache', blocked and not network, targets[0] if targets else None, len(targets), not targets, targets[:next((i for i,f in enumerate(fresh) if not f),len(fresh))]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/b', '/c'], [True, False], False, False, 20, 10), {'request': '/requests/' + str(N) + '/0', 'decision': [['/b', '/c'], 1, False, 10, 'cache', False, '/b', 2, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/b'], [True], True, False, 10, 10), {'request': '/requests/' + str(N) + '/1', 'decision': [['/b'], None, True, 0, 'network', False, '/b', 1, False, ['/b']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], True, False, 0, 0), {'request': '/requests/' + str(N) + '/2', 'decision': [[], None, True, 0, 'network', False, None, 0, True, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['/z', '/a'], [True, True], False, True, 30, 5), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], None, True, 25, 'cache', True, '/z', 2, False, ['/z', '/a']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a', '/a'], [False, True], False, False, 8, 9), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/a'], 0, False, 0, 'cache', False, '/a', 2, False, []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/q'], [False], True, True, 100, 80), {'request': '/requests/' + str(N) + '/5', 'decision': [['/q'], 0, False, 20, 'network', False, '/q', 1, False, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, targets, fresh, network, blocked, now, inserted):
    return {'request': request, 'decision': [list(reversed(targets)), next((i for i,f in enumerate(fresh) if not f),None), all(fresh), max(0,now-inserted), 'network' if network else 'cache', blocked and not network, targets[0] if targets else None, len(targets), not targets, targets[:next((i for i,f in enumerate(fresh) if not f),len(fresh))]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', ['/b', '/c'], [True, False], False, False, 20, 10), {'request': '/requests/' + str(N) + '/0', 'decision': [['/b', '/c'], 1, False, 10, 'cache', False, '/b', 2, False, ['/b']]})
check('fixture 2', solve('/requests/' + str(N) + '/1', ['/b'], [True], True, False, 10, 10), {'request': '/requests/' + str(N) + '/1', 'decision': [['/b'], None, True, 0, 'network', False, '/b', 1, False, ['/b']]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [], [], True, False, 0, 0), {'request': '/requests/' + str(N) + '/2', 'decision': [[], None, True, 0, 'network', False, None, 0, True, []]})
check('fixture 4', solve('/requests/' + str(N) + '/3', ['/z', '/a'], [True, True], False, True, 30, 5), {'request': '/requests/' + str(N) + '/3', 'decision': [['/z', '/a'], None, True, 25, 'cache', True, '/z', 2, False, ['/z', '/a']]})
check('fixture 5', solve('/requests/' + str(N) + '/4', ['/a', '/a'], [False, True], False, False, 8, 9), {'request': '/requests/' + str(N) + '/4', 'decision': [['/a', '/a'], 0, False, 0, 'cache', False, '/a', 2, False, []]})
check('fixture 6', solve('/requests/' + str(N) + '/5', ['/q'], [False], True, True, 100, 80), {'request': '/requests/' + str(N) + '/5', 'decision': [['/q'], 0, False, 20, 'network', False, '/q', 1, False, []]})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Resolve stored redirect chains with per-entry freshness and provenance: the chain order branch emits an incorrect decision.

Resolve stored redirect chains with per-entry freshness and provenance. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

split: open-access