broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, target):
    return 'absolute' if '://' in target else 'origin'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('CONNECT', 'host:443'), 'authority')", "check('fixture 2', solve('OPTIONS', '*'), 'asterisk')", "check('fixture 3', solve('GET', 'https://h/a'), 'absolute')", "check('fixture 4', solve('GET', '/a'), 'origin')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-request-target-form

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, target):
    return 'authority' if method == 'CONNECT' else ('asterisk' if target == '*' else 'origin')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('CONNECT', 'host:443'), 'authority')", "check('fixture 2', solve('OPTIONS', '*'), 'asterisk')", "check('fixture 3', solve('GET', 'https://h/a'), 'absolute')", "check('fixture 4', solve('GET', '/a'), 'origin')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
CONNECT uses authority form and server-wide OPTIONS uses asterisk form.

CONNECT uses authority form and server-wide OPTIONS uses asterisk form: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(status, method):
    return 'GET' if status in (301,302,303,307,308) else method
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(307, 'POST'), 'POST')", "check('fixture 2', solve(302, 'POST'), 'GET')", "check('fixture 3', solve(303, 'HEAD'), 'HEAD')", "check('fixture 4', solve(308, 'PUT'), 'PUT')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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

evaluation_group: xh-redirect-rewrite

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(status, method):
    return 'GET' if status == 303 else method
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(307, 'POST'), 'POST')", "check('fixture 2', solve(302, 'POST'), 'GET')", "check('fixture 3', solve(303, 'HEAD'), 'HEAD')", "check('fixture 4', solve(308, 'PUT'), 'PUT')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Redirect rewriting preserves methods for 307 and 308.

Redirect rewriting preserves methods for 307 and 308: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(base, location):
    return location
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https://h/a/b', '../c'), 'https://h/c')", "check('fixture 2', solve('https://h/a/b', '/c'), 'https://h/c')", "check('fixture 3', solve('https://h/a', 'https://z/x'), 'https://z/x')", "check('fixture 4', solve('https://h/a', '?q=1'), 'https://h/a?q=1')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-relative-location

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(base, location):
    return base.rstrip('/') + '/' + location.lstrip('/')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https://h/a/b', '../c'), 'https://h/c')", "check('fixture 2', solve('https://h/a/b', '/c'), 'https://h/c')", "check('fixture 3', solve('https://h/a', 'https://z/x'), 'https://z/x')", "check('fixture 4', solve('https://h/a', '?q=1'), 'https://h/a?q=1')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A relative Location resolves against the current request URL.

A relative Location resolves against the current request URL: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(old, location):
    return location
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#x', '/b'), '/b#x')", "check('fixture 2', solve('/a#x', '/b#y'), '/b#y')", "check('fixture 3', solve('/a', '/b'), '/b')", "check('fixture 4', solve('/a#x', '/b#'), '/b#')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-redirect-fragment

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(old, location):
    return location + ('#' + old.split('#',1)[1] if '#' in old else '')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#x', '/b'), '/b#x')", "check('fixture 2', solve('/a#x', '/b#y'), '/b#y')", "check('fixture 3', solve('/a', '/b'), '/b')", "check('fixture 4', solve('/a#x', '/b#'), '/b#')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A redirect without a fragment inherits the original fragment.

A redirect without a fragment inherits the original fragment: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url, visited):
    return url in visited
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#new', ['/a#old']), True)", "check('fixture 2', solve('/a?q=2', ['/a?q=1']), False)", "check('fixture 3', solve('/b', ['/a']), False)", "check('fixture 4', solve('/a', []), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-redirect-loop

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url, visited):
    return url.split('?',1)[0].split('#',1)[0] in {v.split('?',1)[0].split('#',1)[0] for v in visited}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#new', ['/a#old']), True)", "check('fixture 2', solve('/a?q=2', ['/a?q=1']), False)", "check('fixture 3', solve('/b', ['/a']), False)", "check('fixture 4', solve('/a', []), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Loop detection ignores URL fragments but retains query identity.

Loop detection ignores URL fragments but retains query identity: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(redirects, limit):
    return redirects <= limit
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), False)", "check('fixture 2', solve(1, 2), True)", "check('fixture 3', solve(0, 0), False)", "check('fixture 4', solve(0, 3), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-redirect-budget

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(redirects, limit):
    return redirects + 1 < limit
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), False)", "check('fixture 2', solve(1, 2), True)", "check('fixture 3', solve(0, 0), False)", "check('fixture 4', solve(0, 3), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A redirect budget charges redirects rather than the initial request.

A redirect budget charges redirects rather than the initial request: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(delay, cap):
    return min(cap, delay)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(-1, 10), 0)", "check('fixture 2', solve(3, 10), 3)", "check('fixture 3', solve(20, 10), 10)", "check('fixture 4', solve(0, 0), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-retry-after-delay

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(delay, cap):
    return max(cap, max(0, delay))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(-1, 10), 0)", "check('fixture 2', solve(3, 10), 3)", "check('fixture 3', solve(20, 10), 10)", "check('fixture 4', solve(0, 0), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Negative Retry-After delays are clamped before imposing a cap.

Negative Retry-After delays are clamped before imposing a cap: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(status, replayable, allowed):
    return status in allowed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(503, False, [503]), False)", "check('fixture 2', solve(429, True, [429]), True)", "check('fixture 3', solve(500, True, [503]), False)", "check('fixture 4', solve(503, True, [503]), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-retry-response

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(status, replayable, allowed):
    return status >= 500 and replayable
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(503, False, [503]), False)", "check('fixture 2', solve(429, True, [429]), True)", "check('fixture 3', solve(500, True, [503]), False)", "check('fixture 4', solve(503, True, [503]), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Status retries require both a configured status and a replayable body.

Status retries require both a configured status and a replayable body: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(safe, sent, known_unprocessed):
    return safe or sent < 10
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(False, 1, False), False)", "check('fixture 2', solve(False, 100, True), True)", "check('fixture 3', solve(True, 100, False), True)", "check('fixture 4', solve(False, 0, False), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-retry-partial-write

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(safe, sent, known_unprocessed):
    return safe or sent == 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(False, 1, False), False)", "check('fixture 2', solve(False, 100, True), True)", "check('fixture 3', solve(True, 100, False), True)", "check('fixture 4', solve(False, 0, False), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
An unsafe request cannot replay after any bytes may have reached the peer.

An unsafe request cannot replay after any bytes may have reached the peer: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(remaining, backoff, service):
    return backoff < remaining
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 8, 3), False)", "check('fixture 2', solve(10, 8, 2), True)", "check('fixture 3', solve(0, 0, 0), True)", "check('fixture 4', solve(2, 3, 0), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-retry-deadline

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(remaining, backoff, service):
    return backoff + service < remaining
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 8, 3), False)", "check('fixture 2', solve(10, 8, 2), True)", "check('fixture 3', solve(0, 0, 0), True)", "check('fixture 4', solve(2, 3, 0), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A retry starts only when both backoff and minimum service time fit.

A retry starts only when both backoff and minimum service time fit: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(base, cap, fraction):
    return min(base * fraction, cap)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(20, 10, 0.5), 5.0)", "check('fixture 2', solve(8, 10, 0), 0)", "check('fixture 3', solve(8, 10, 1), 8)", "check('fixture 4', solve(20, 10, 1), 10)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-retry-jitter

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(base, cap, fraction):
    return min(base, cap) * (0.5 + fraction / 2)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(20, 10, 0.5), 5.0)", "check('fixture 2', solve(8, 10, 0), 0)", "check('fixture 3', solve(8, 10, 1), 8)", "check('fixture 4', solve(20, 10, 1), 10)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Deterministic full jitter spans the entire capped delay interval.

Deterministic full jitter spans the entire capped delay interval: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(start, end):
    return max(0, end-start)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), 1)", "check('fixture 2', solve(5, 2), 0)", "check('fixture 3', solve(0, 3), 4)", "check('fixture 4', solve(0, -1), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-range-inclusive

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(start, end):
    return end-start+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), 1)", "check('fixture 2', solve(5, 2), 0)", "check('fixture 3', solve(0, 3), 4)", "check('fixture 4', solve(0, -1), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
An inclusive byte endpoint yields one more byte than endpoint subtraction.

An inclusive byte endpoint yields one more byte than endpoint subtraction: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(start, length):
    return (start, length)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 5), (2, 4))", "check('fixture 2', solve(5, 5), None)", "check('fixture 3', solve(0, 1), (0, 0))", "check('fixture 4', solve(0, 0), None)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-range-open

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(start, length):
    return (min(start,length-1),length-1) if length else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 5), (2, 4))", "check('fixture 2', solve(5, 5), None)", "check('fixture 3', solve(0, 1), (0, 0))", "check('fixture 4', solve(0, 0), None)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
An open byte range clips at representation length and rejects starts beyond it.

An open byte range clips at representation length and rejects starts beyond it: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(suffix, length):
    return (length-suffix,length-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(8, 5), (0, 4))", "check('fixture 2', solve(0, 5), None)", "check('fixture 3', solve(2, 5), (3, 4))", "check('fixture 4', solve(2, 0), None)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-range-suffix

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(suffix, length):
    return (max(0,length-suffix),length-1) if length else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(8, 5), (0, 4))", "check('fixture 2', solve(0, 5), None)", "check('fixture 3', solve(2, 5), (3, 4))", "check('fixture 4', solve(2, 0), None)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A suffix range is bounded by representation length and excludes zero suffixes.

A suffix range is bounded by representation length and excludes zero suffixes: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(starts, length):
    return any(s >= length for s in starts)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([0, 9], 5), False)", "check('fixture 2', solve([5], 5), True)", "check('fixture 3', solve([], 5), False)", "check('fixture 4', solve([7, 9], 5), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-range-unsatisfiable

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(starts, length):
    return all(s > length for s in starts)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([0, 9], 5), False)", "check('fixture 2', solve([5], 5), True)", "check('fixture 3', solve([], 5), False)", "check('fixture 4', solve([7, 9], 5), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
A range set is unsatisfiable only when every requested start is beyond the representation.

A range set is unsatisfiable only when every requested start is beyond the representation: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(request, current):
    return request == current
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'W/"a"\'), False)', 'check(\'fixture 2\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 3\', solve(\'W/"a"\', \'"a"\'), False)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-if-range-weak

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(request, current):
    return request.removeprefix('W/') == current.removeprefix('W/')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'W/"a"\'), False)', 'check(\'fixture 2\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 3\', solve(\'W/"a"\', \'"a"\'), False)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
If-Range requires exact strong entity tags.

If-Range requires exact strong entity tags: return the result specified by the explicit input/output boundary fixtures.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(private, shared):
    return not private
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), True)", "check('fixture 2', solve(False, True), True)", "check('fixture 3', solve(True, True), False)", "check('fixture 4', solve(False, False), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(private, shared):
    return not shared
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), True)", "check('fixture 2', solve(False, True), True)", "check('fixture 3', solve(True, True), False)", "check('fixture 4', solve(False, False), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Shared cache rejects private responses.

Bounded offline decision model: shared cache rejects private responses. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(no_store, fresh):
    return fresh
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True), False)", "check('fixture 2', solve(False, False), True)", "check('fixture 3', solve(False, True), True)", "check('fixture 4', solve(True, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(no_store, fresh):
    return not no_store and fresh
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True), False)", "check('fixture 2', solve(False, False), True)", "check('fixture 3', solve(False, True), True)", "check('fixture 4', solve(True, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
No store prevents insertion even when fresh.

Bounded offline decision model: no store prevents insertion even when fresh. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(no_cache, validated):
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), False)", "check('fixture 2', solve(True, True), True)", "check('fixture 3', solve(False, False), True)", "check('fixture 4', solve(False, True), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(no_cache, validated):
    return not no_cache
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), False)", "check('fixture 2', solve(True, True), True)", "check('fixture 3', solve(False, False), True)", "check('fixture 4', solve(False, True), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
No cache requires validation without preventing storage.

Bounded offline decision model: no cache requires validation without preventing storage. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(shared, smax, maxage):
    return smax if smax is not None else maxage
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, 0, 30), 0)", "check('fixture 2', solve(False, 10, 30), 30)", "check('fixture 3', solve(True, None, 30), 30)", "check('fixture 4', solve(True, 10, 30), 10)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(shared, smax, maxage):
    return smax if shared and smax else maxage
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, 0, 30), 0)", "check('fixture 2', solve(False, 10, 30), 30)", "check('fixture 3', solve(True, None, 30), 30)", "check('fixture 4', solve(True, 10, 30), 10)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
S maxage overrides max age only in shared cache.

Bounded offline decision model: s maxage overrides max age only in shared cache. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(apparent, age, delay):
    return max(apparent,age)+delay
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 2, 3), 10)", "check('fixture 2', solve(2, 10, 3), 13)", "check('fixture 3', solve(0, 0, 0), 0)", "check('fixture 4', solve(5, 5, 2), 7)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(apparent, age, delay):
    return apparent+age+delay
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 2, 3), 10)", "check('fixture 2', solve(2, 10, 3), 13)", "check('fixture 3', solve(0, 0, 0), 0)", "check('fixture 4', solve(5, 5, 2), 7)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Age includes response delay after corrected received age.

Bounded offline decision model: age includes response delay after corrected received age. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(initial, now, received):
    return initial
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(5, 20, 10), 15)", "check('fixture 2', solve(5, 8, 10), 5)", "check('fixture 3', solve(0, 10, 10), 0)", "check('fixture 4', solve(2, 12, 10), 4)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-resident-time-advances-cache-age

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(initial, now, received):
    return max(initial,now-received)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(5, 20, 10), 15)", "check('fixture 2', solve(5, 8, 10), 5)", "check('fixture 3', solve(0, 10, 10), 0)", "check('fixture 4', solve(2, 12, 10), 4)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Resident time advances cache age.

Bounded offline decision model: resident time advances cache age. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, lifetime, request_maxage):
    return age <= lifetime and (request_maxage is None or age <= request_maxage)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 10, None), False)", "check('fixture 2', solve(5, 10, 3), False)", "check('fixture 3', solve(3, 10, 3), True)", "check('fixture 4', solve(0, 0, None), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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)

evaluation_group: xh-freshness-deadline-is-exclusive

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, lifetime, request_maxage):
    return age < lifetime
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(10, 10, None), False)", "check('fixture 2', solve(5, 10, 3), False)", "check('fixture 3', solve(3, 10, 3), True)", "check('fixture 4', solve(0, 0, None), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Freshness deadline is exclusive.

Given age, lifetime, request_maxage, freshness deadline is exclusive. Return the protocol decision or transformed value; fields are validated and fixtures state boundary outcomes.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, life, reserve):
    return age < life
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(8, 10, 2), False)", "check('fixture 2', solve(8, 10, 3), False)", "check('fixture 3', solve(8, 10, 1), True)", "check('fixture 4', solve(0, 10, 0), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, life, reserve):
    return age+reserve <= life
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(8, 10, 2), False)", "check('fixture 2', solve(8, 10, 3), False)", "check('fixture 3', solve(8, 10, 1), True)", "check('fixture 4', solve(0, 10, 0), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Request min fresh reserves future freshness.

Bounded offline decision model: request min fresh reserves future freshness. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, life, allowance):
    return age <= allowance
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(15, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(5, 10, 0), True)", "check('fixture 4', solve(10, 10, 0), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, life, allowance):
    return age < life+allowance
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(15, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(5, 10, 0), True)", "check('fixture 4', solve(10, 10, 0), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Max stale allows only bounded staleness.

Bounded offline decision model: max stale allows only bounded staleness. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(stale, must, permitted):
    return not stale or permitted
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, True), False)", "check('fixture 2', solve(False, True, False), True)", "check('fixture 3', solve(True, False, True), True)", "check('fixture 4', solve(True, False, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(stale, must, permitted):
    return permitted and not must
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, True), False)", "check('fixture 2', solve(False, True, False), True)", "check('fixture 3', solve(True, False, True), True)", "check('fixture 4', solve(True, False, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Must revalidate blocks stale use despite request allowance.

Bounded offline decision model: must revalidate blocks stale use despite request allowance. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, lifetime, window):
    return age <= window
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(14, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(15, 10, 5), True)", "check('fixture 4', solve(5, 10, 5), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(age, lifetime, window):
    return age < lifetime+window
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(14, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(15, 10, 5), True)", "check('fixture 4', solve(5, 10, 5), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Stale if error window measures time after expiration.

Bounded offline decision model: stale if error window measures time after expiration. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(stored, updates):
    return updates
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'etag': 'a', 'type': 'text'}, {'etag': 'b'}), {'etag': 'b', 'type': 'text'})", "check('fixture 2', solve({'x': 1}, {}), {'x': 1})", "check('fixture 3', solve({}, {'x': 2}), {'x': 2})", "check('fixture 4', solve({}, {}), {})"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(stored, updates):
    return dict(updates, **stored)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'etag': 'a', 'type': 'text'}, {'etag': 'b'}), {'etag': 'b', 'type': 'text'})", "check('fixture 2', solve({'x': 1}, {}), {'x': 1})", "check('fixture 3', solve({}, {'x': 2}), {'x': 2})", "check('fixture 4', solve({}, {}), {})"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Revalidation 304 merges present fields and retains absent fields.

Bounded offline decision model: revalidation 304 merges present fields and retains absent fields. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(vary, old, new):
    return all(old.get(k)==new.get(k) for k in vary)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['*'], {}, {}), False)", "check('fixture 2', solve(['accept'], {'accept': 'a', 'other': 1}, {'accept': 'a', 'other': 2}), True)", "check('fixture 3', solve(['accept'], {'accept': 'a'}, {'accept': 'b'}), False)", "check('fixture 4', solve([], {}, {}), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(vary, old, new):
    return old == new
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['*'], {}, {}), False)", "check('fixture 2', solve(['accept'], {'accept': 'a', 'other': 1}, {'accept': 'a', 'other': 2}), True)", "check('fixture 3', solve(['accept'], {'accept': 'a'}, {'accept': 'b'}), False)", "check('fixture 4', solve([], {}, {}), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Vary star never selects a stored response.

Bounded offline decision model: vary star never selects a stored response. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url):
    return url
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a?q=1#x'), '/a?q=1')", "check('fixture 2', solve('/a?q=2'), '/a?q=2')", "check('fixture 3', solve('/a#x'), '/a')", "check('fixture 4', solve('/a'), '/a')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url):
    return url.split('?',1)[0].split('#',1)[0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a?q=1#x'), '/a?q=1')", "check('fixture 2', solve('/a?q=2'), '/a?q=2')", "check('fixture 3', solve('/a#x'), '/a')", "check('fixture 4', solve('/a'), '/a')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 key retains query but discards fragment.

Bounded offline decision model: cache key retains query but discards fragment. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, status):
    return method != 'GET'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 201), True)", "check('fixture 2', solve('HEAD', 200), False)", "check('fixture 3', solve('DELETE', 204), True)", "check('fixture 4', solve('POST', 500), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, status):
    return method == 'POST' and status == 200
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 201), True)", "check('fixture 2', solve('HEAD', 200), False)", "check('fixture 3', solve('DELETE', 204), True)", "check('fixture 4', solve('POST', 500), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Unsafe success invalidates only successful statuses.

Bounded offline decision model: unsafe success invalidates only successful statuses. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(only, hit):
    return 'serve' if hit else 'fetch'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), '504')", "check('fixture 2', solve(True, True), 'serve')", "check('fixture 3', solve(False, False), 'fetch')", "check('fixture 4', solve(False, True), 'serve')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(only, hit):
    return '504' if only else 'fetch'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), '504')", "check('fixture 2', solve(True, True), 'serve')", "check('fixture 3', solve(False, False), 'fetch')", "check('fixture 4', solve(False, True), 'serve')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Only if cached miss returns gateway timeout.

Bounded offline decision model: only if cached miss returns gateway timeout. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(date, modified, cap):
    return (date-modified)*0.1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(100, 0, 5), 5)", "check('fixture 2', solve(10, 20, 5), 0)", "check('fixture 3', solve(10, 0, 5), 1)", "check('fixture 4', solve(0, 0, 5), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(date, modified, cap):
    return max(cap,max(0,date-modified)*0.1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(100, 0, 5), 5)", "check('fixture 2', solve(10, 20, 5), 0)", "check('fixture 3', solve(10, 0, 5), 1)", "check('fixture 4', solve(0, 0, 5), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Heuristic freshness never exceeds configured cap.

Bounded offline decision model: heuristic freshness never exceeds configured cap. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(left, right):
    return left == right
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'"a"\'), True)', 'check(\'fixture 2\', solve(\'"A"\', \'"a"\'), False)', 'check(\'fixture 3\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(left, right):
    return left.lower().removeprefix('w/') == right.lower().removeprefix('w/')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'"a"\'), True)', 'check(\'fixture 2\', solve(\'"A"\', \'"a"\'), False)', 'check(\'fixture 3\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Weak etag comparison ignores weakness markers.

Bounded offline decision model: weak etag comparison ignores weakness markers. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(star, exists, matches):
    return matches
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, False), True)", "check('fixture 2', solve(True, False, True), False)", "check('fixture 3', solve(False, True, True), True)", "check('fixture 4', solve(False, True, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(star, exists, matches):
    return star or matches
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, False), True)", "check('fixture 2', solve(True, False, True), False)", "check('fixture 3', solve(False, True, True), True)", "check('fixture 4', solve(False, True, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
If match star tests existence not tag presence.

Bounded offline decision model: if match star tests existence not tag presence. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, matches):
    return 304 if matches else 200
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('GET', True), 304)", "check('fixture 2', solve('PUT', True), 412)", "check('fixture 3', solve('HEAD', True), 304)", "check('fixture 4', solve('POST', False), 200)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, matches):
    return 412 if matches else 200
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('GET', True), 304)", "check('fixture 2', solve('PUT', True), 412)", "check('fixture 3', solve('HEAD', True), 304)", "check('fixture 4', solve('POST', False), 200)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
If none match selects 304 only for safe retrieval.

Bounded offline decision model: if none match selects 304 only for safe retrieval. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(has_etag, etag_match, date_match):
    return etag_match or date_match
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False, True), False)", "check('fixture 2', solve(True, True, False), True)", "check('fixture 3', solve(False, False, True), True)", "check('fixture 4', solve(False, False, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(has_etag, etag_match, date_match):
    return etag_match and date_match
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False, True), False)", "check('fixture 2', solve(True, True, False), True)", "check('fixture 3', solve(False, False, True), True)", "check('fixture 4', solve(False, False, False), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
If none match takes precedence over modified since.

Bounded offline decision model: if none match takes precedence over modified since. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(has_match, tag_ok, modified, since):
    return tag_ok and (since is None or modified <= since)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, 20, 10), True)", "check('fixture 2', solve(True, False, 0, 10), False)", "check('fixture 3', solve(False, False, 10, 10), True)", "check('fixture 4', solve(False, False, 20, None), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(has_match, tag_ok, modified, since):
    return tag_ok if has_match else since is None or modified < since
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, True, 20, 10), True)", "check('fixture 2', solve(True, False, 0, 10), False)", "check('fixture 3', solve(False, False, 10, 10), True)", "check('fixture 4', solve(False, False, 20, None), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
If unmodified since is ignored when if match present.

Given has_match, tag_ok, modified, since, if unmodified since is ignored when if match present. Return the protocol decision or transformed value; fields are validated and fixtures state boundary outcomes.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, old_body, new_body):
    return new_body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('HEAD', 'abc', ''), 'abc')", "check('fixture 2', solve('GET', 'abc', 'xyz'), 'xyz')", "check('fixture 3', solve('HEAD', '', ''), '')", "check('fixture 4', solve('GET', '', 'x'), 'x')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(method, old_body, new_body):
    return old_body
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('HEAD', 'abc', ''), 'abc')", "check('fixture 2', solve('GET', 'abc', 'xyz'), 'xyz')", "check('fixture 3', solve('HEAD', '', ''), '')", "check('fixture 4', solve('GET', '', 'x'), 'x')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Cached head updates do not replace get payload.

Bounded offline decision model: cached head updates do not replace get payload. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(headers, name):
    return headers.get(name, "")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({}, 'accept'), (False, None))", "check('fixture 2', solve({'accept': ''}, 'accept'), (True, ''))", "check('fixture 3', solve({'accept': 'x'}, 'accept'), (True, 'x'))", "check('fixture 4', solve({'other': 'x'}, 'accept'), (False, None))"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(headers, name):
    return bool(headers.get(name))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({}, 'accept'), (False, None))", "check('fixture 2', solve({'accept': ''}, 'accept'), (True, ''))", "check('fixture 3', solve({'accept': 'x'}, 'accept'), (True, 'x'))", "check('fixture 4', solve({'other': 'x'}, 'accept'), (False, None))"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 variants distinguish missing header from empty header.

Bounded offline decision model: cache variants distinguish missing header from empty header. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(warnings):
    return warnings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([110, 214]), [214])", "check('fixture 2', solve([199, 200]), [200])", "check('fixture 3', solve([]), [])", "check('fixture 4', solve([214, 299]), [214, 299])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(warnings):
    return []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([110, 214]), [214])", "check('fixture 2', solve([199, 200]), [200])", "check('fixture 3', solve([]), [])", "check('fixture 4', solve([214, 299]), [214, 299])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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 warning removal preserves persistent warnings.

Bounded offline decision model: cache warning removal preserves persistent warnings. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(exact, wildcard):
    return max(exact or 0,wildcard)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(0, 1), 0)", "check('fixture 2', solve(0.2, 0.9), 0.2)", "check('fixture 3', solve(None, 0.7), 0.7)", "check('fixture 4', solve(1, 0), 1)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(exact, wildcard):
    return exact or wildcard
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(0, 1), 0)", "check('fixture 2', solve(0.2, 0.9), 0.2)", "check('fixture 3', solve(None, 0.7), 0.7)", "check('fixture 4', solve(1, 0), 1)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Media specificity outranks wildcard before quality.

Bounded offline decision model: media specificity outranks wildcard before quality. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(candidates):
    return [name for name,q in candidates]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 0), ('b', 1)]), ['b'])", "check('fixture 2', solve([]), [])", "check('fixture 3', solve([('a', 0.1)]), ['a'])", "check('fixture 4', solve([('a', 0)]), [])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(candidates):
    return [name for name,q in candidates if q >= 0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 0), ('b', 1)]), ['b'])", "check('fixture 2', solve([]), [])", "check('fixture 3', solve([('a', 0.1)]), ['a'])", "check('fixture 4', solve([('a', 0)]), [])"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Zero quality excludes media candidates.

Bounded offline decision model: zero quality excludes media candidates. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(candidates):
    return max(candidates)[0] if candidates else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 1), ('z', 1)]), 'a')", "check('fixture 2', solve([('z', 0.2), ('a', 0.8)]), 'a')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('x', 0)]), 'x')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(candidates):
    return sorted(candidates,key=lambda p:p[1])[-1][0] if candidates else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 1), ('z', 1)]), 'a')", "check('fixture 2', solve([('z', 0.2), ('a', 0.8)]), 'a')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('x', 0)]), 'x')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Equal quality retains server preference order.

Bounded offline decision model: equal quality retains server preference order. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(range_, media):
    return range_.endswith('/*') or range_ == media
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('text/*', 'image/png'), False)", "check('fixture 2', solve('text/*', 'text/html'), True)", "check('fixture 3', solve('*/*', 'image/png'), True)", "check('fixture 4', solve('text/plain', 'text/html'), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(range_, media):
    return range_ == media
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('text/*', 'image/png'), False)", "check('fixture 2', solve('text/*', 'text/html'), True)", "check('fixture 3', solve('*/*', 'image/png'), True)", "check('fixture 4', solve('text/plain', 'text/html'), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Media subtype wildcard does not cross top level types.

Bounded offline decision model: media subtype wildcard does not cross top level types. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(required, actual):
    return any(actual.get(k)==v for k,v in required.items())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'level': '1'}, {'level': '1', 'charset': 'utf8'}), True)", "check('fixture 2', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3}), False)", "check('fixture 3', solve({}, {}), True)", "check('fixture 4', solve({'x': 1}, {}), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(required, actual):
    return required == actual
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'level': '1'}, {'level': '1', 'charset': 'utf8'}), True)", "check('fixture 2', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3}), False)", "check('fixture 3', solve({}, {}), True)", "check('fixture 4', solve({'x': 1}, {}), False)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Media parameters must all match selected representation.

Bounded offline decision model: media parameters must all match selected representation. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(name, qualities):
    return max(qualities.get(name,0),qualities.get("*",0))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('gzip', {'gzip': 0, '*': 1}), 0)", "check('fixture 2', solve('br', {'*': 0.5}), 0.5)", "check('fixture 3', solve('gzip', {'gzip': 0.2, '*': 0.8}), 0.2)", "check('fixture 4', solve('br', {}), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(name, qualities):
    return qualities.get(name) or qualities.get("*",0)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('gzip', {'gzip': 0, '*': 1}), 0)", "check('fixture 2', solve('br', {'*': 0.5}), 0.5)", "check('fixture 3', solve('gzip', {'gzip': 0.2, '*': 0.8}), 0.2)", "check('fixture 4', solve('br', {}), 0)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
    exec(_line)
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:
Accept encoding explicit entry overrides star.

Bounded offline decision model: accept encoding explicit entry overrides star. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

split: open-access