broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    hour_ok = 0 <= r['hour'] <= 24
    minute_ok = 0 <= r['minute'] < 60
    second_ok = 0 <= r['second'] < 60
    fraction_ok = 0 <= r['fraction'] < 1000
    end_label = r['hour'] == 24
    end_valid = not end_label or (r['minute'] == 0 and r['second'] == 0 and r['fraction'] == 0)
    valid = hour_ok and minute_ok and second_ok and fraction_ok and end_valid
    day = r['day'] + int(end_label)
    hour = r['hour']
    coordinate = ((day*24+hour)*3600+r['minute']*60+r['second'])*1000+r['fraction']
    return [valid,[day,hour,r['minute'],r['second'],r['fraction']] if valid else None,r['day'] if valid and end_label else None,coordinate if valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [11, 0, 0, 0, 0], 10, 950400000])
check('fixture 2', solve({'day': 10, 'hour': 0, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [10, 0, 0, 0, 0], None, 864000000])
check('fixture 3', solve({'day': 10, 'hour': 23, 'minute': 59, 'second': 59, 'fraction': 999}), [True, [10, 23, 59, 59, 999], None, 950399999])
check('fixture 4', solve({'day': -1, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [0, 0, 0, 0, 0], -1, 0])
check('fixture 5', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 1, 'fraction': 0}), [False, None, None, None])
check('fixture 6', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 1}), [False, None, None, None])
check('fixture 7', solve({'day': 10, 'hour': 24, 'minute': 1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 8', solve({'day': 10, 'hour': 25, 'minute': 0, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 9', solve({'day': 10, 'hour': 12, 'minute': 60, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 10', solve({'day': 10, 'hour': 12, 'minute': -1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 11', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 60, 'fraction': 0}), [False, None, None, None])
check('fixture 12', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': -1, 'fraction': 0}), [False, None, None, None])
check('fixture 13', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': 1000}), [False, None, None, None])
check('fixture 14', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': -1}), [False, None, None, None])
check('fixture 15', solve({'day': 0, 'hour': 12, 'minute': 30, 'second': 1, 'fraction': 2}), [True, [0, 12, 30, 1, 2], None, 45001002])
variant = [({'day': 11, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [12, 0, 0, 0, 0], 11, 1036800000]), ({'day': 12, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [13, 0, 0, 0, 0], 12, 1123200000]), ({'day': 13, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [14, 0, 0, 0, 0], 13, 1209600000]), ({'day': 14, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [15, 0, 0, 0, 0], 14, 1296000000]), ({'day': 15, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [16, 0, 0, 0, 0], 15, 1382400000])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    hour_ok = 0 <= r['hour'] <= 24
    minute_ok = 0 <= r['minute'] < 60
    second_ok = 0 <= r['second'] < 60
    fraction_ok = 0 <= r['fraction'] < 1000
    end_label = r['hour'] == 24
    end_valid = not end_label or (r['minute'] == 0 and r['second'] == 0 and r['fraction'] == 0)
    valid = hour_ok and minute_ok and second_ok and fraction_ok and end_valid
    day = r['day'] + int(end_label)
    hour = r['hour'] % 12
    coordinate = ((day*24+hour)*3600+r['minute']*60+r['second'])*1000+r['fraction']
    return [valid,[day,hour,r['minute'],r['second'],r['fraction']] if valid else None,r['day'] if valid and end_label else None,coordinate if valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [11, 0, 0, 0, 0], 10, 950400000])
check('fixture 2', solve({'day': 10, 'hour': 0, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [10, 0, 0, 0, 0], None, 864000000])
check('fixture 3', solve({'day': 10, 'hour': 23, 'minute': 59, 'second': 59, 'fraction': 999}), [True, [10, 23, 59, 59, 999], None, 950399999])
check('fixture 4', solve({'day': -1, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [0, 0, 0, 0, 0], -1, 0])
check('fixture 5', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 1, 'fraction': 0}), [False, None, None, None])
check('fixture 6', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 1}), [False, None, None, None])
check('fixture 7', solve({'day': 10, 'hour': 24, 'minute': 1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 8', solve({'day': 10, 'hour': 25, 'minute': 0, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 9', solve({'day': 10, 'hour': 12, 'minute': 60, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 10', solve({'day': 10, 'hour': 12, 'minute': -1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 11', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 60, 'fraction': 0}), [False, None, None, None])
check('fixture 12', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': -1, 'fraction': 0}), [False, None, None, None])
check('fixture 13', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': 1000}), [False, None, None, None])
check('fixture 14', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': -1}), [False, None, None, None])
check('fixture 15', solve({'day': 0, 'hour': 12, 'minute': 30, 'second': 1, 'fraction': 2}), [True, [0, 12, 30, 1, 2], None, 45001002])
variant = [({'day': 11, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [12, 0, 0, 0, 0], 11, 1036800000]), ({'day': 12, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [13, 0, 0, 0, 0], 12, 1123200000]), ({'day': 13, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [14, 0, 0, 0, 0], 13, 1209600000]), ({'day': 14, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [15, 0, 0, 0, 0], 14, 1296000000]), ({'day': 15, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [16, 0, 0, 0, 0], 15, 1382400000])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for hour.

Controlled local date index plus clock label permits ordinary 00:00:00 through 23:59:59, or exact 24:00:00 with zero fractional milliseconds only. Normalize 24:00 to following day 00:00, retaining end-of-day provenance for roundtrip. Date index is an abstract signed day, not Gregorian arithmetic. Return admission, normalized tuple, original-day provenance and total millisecond coordinate.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    hour_ok = 0 <= r['hour'] <= 24
    minute_ok = 0 <= r['minute'] < 60
    second_ok = 0 <= r['second'] < 60
    fraction_ok = 0 <= r['fraction'] < 1000
    end_label = r['hour'] == 24
    end_valid = not end_label or (r['minute'] == 0 and r['second'] == 0 and r['fraction'] == 0)
    valid = hour_ok and minute_ok and second_ok and fraction_ok and end_valid
    day = r['day'] + int(end_label)
    hour = 0 if end_label else r['hour']
    coordinate = ((r['day']*24+hour)*3600+r['minute']*60+r['second'])*1000+r['fraction']
    return [valid,[day,hour,r['minute'],r['second'],r['fraction']] if valid else None,r['day'] if valid and end_label else None,coordinate if valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [11, 0, 0, 0, 0], 10, 950400000])
check('fixture 2', solve({'day': 10, 'hour': 0, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [10, 0, 0, 0, 0], None, 864000000])
check('fixture 3', solve({'day': 10, 'hour': 23, 'minute': 59, 'second': 59, 'fraction': 999}), [True, [10, 23, 59, 59, 999], None, 950399999])
check('fixture 4', solve({'day': -1, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [0, 0, 0, 0, 0], -1, 0])
check('fixture 5', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 1, 'fraction': 0}), [False, None, None, None])
check('fixture 6', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 1}), [False, None, None, None])
check('fixture 7', solve({'day': 10, 'hour': 24, 'minute': 1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 8', solve({'day': 10, 'hour': 25, 'minute': 0, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 9', solve({'day': 10, 'hour': 12, 'minute': 60, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 10', solve({'day': 10, 'hour': 12, 'minute': -1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 11', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 60, 'fraction': 0}), [False, None, None, None])
check('fixture 12', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': -1, 'fraction': 0}), [False, None, None, None])
check('fixture 13', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': 1000}), [False, None, None, None])
check('fixture 14', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': -1}), [False, None, None, None])
check('fixture 15', solve({'day': 0, 'hour': 12, 'minute': 30, 'second': 1, 'fraction': 2}), [True, [0, 12, 30, 1, 2], None, 45001002])
variant = [({'day': 11, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [12, 0, 0, 0, 0], 11, 1036800000]), ({'day': 12, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [13, 0, 0, 0, 0], 12, 1123200000]), ({'day': 13, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [14, 0, 0, 0, 0], 13, 1209600000]), ({'day': 14, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [15, 0, 0, 0, 0], 14, 1296000000]), ({'day': 15, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [16, 0, 0, 0, 0], 15, 1382400000])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    hour_ok = 0 <= r['hour'] <= 24
    minute_ok = 0 <= r['minute'] < 60
    second_ok = 0 <= r['second'] < 60
    fraction_ok = 0 <= r['fraction'] < 1000
    end_label = r['hour'] == 24
    end_valid = not end_label or (r['minute'] == 0 and r['second'] == 0 and r['fraction'] == 0)
    valid = hour_ok and minute_ok and second_ok and fraction_ok and end_valid
    day = r['day'] + int(end_label)
    hour = 0 if end_label else r['hour']
    coordinate = ((day*24+hour)*3600+r['minute']*60+r['second']+r['fraction'])*1000
    return [valid,[day,hour,r['minute'],r['second'],r['fraction']] if valid else None,r['day'] if valid and end_label else None,coordinate if valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [11, 0, 0, 0, 0], 10, 950400000])
check('fixture 2', solve({'day': 10, 'hour': 0, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [10, 0, 0, 0, 0], None, 864000000])
check('fixture 3', solve({'day': 10, 'hour': 23, 'minute': 59, 'second': 59, 'fraction': 999}), [True, [10, 23, 59, 59, 999], None, 950399999])
check('fixture 4', solve({'day': -1, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}), [True, [0, 0, 0, 0, 0], -1, 0])
check('fixture 5', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 1, 'fraction': 0}), [False, None, None, None])
check('fixture 6', solve({'day': 10, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 1}), [False, None, None, None])
check('fixture 7', solve({'day': 10, 'hour': 24, 'minute': 1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 8', solve({'day': 10, 'hour': 25, 'minute': 0, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 9', solve({'day': 10, 'hour': 12, 'minute': 60, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 10', solve({'day': 10, 'hour': 12, 'minute': -1, 'second': 0, 'fraction': 0}), [False, None, None, None])
check('fixture 11', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 60, 'fraction': 0}), [False, None, None, None])
check('fixture 12', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': -1, 'fraction': 0}), [False, None, None, None])
check('fixture 13', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': 1000}), [False, None, None, None])
check('fixture 14', solve({'day': 10, 'hour': 12, 'minute': 0, 'second': 0, 'fraction': -1}), [False, None, None, None])
check('fixture 15', solve({'day': 0, 'hour': 12, 'minute': 30, 'second': 1, 'fraction': 2}), [True, [0, 12, 30, 1, 2], None, 45001002])
variant = [({'day': 11, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [12, 0, 0, 0, 0], 11, 1036800000]), ({'day': 12, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [13, 0, 0, 0, 0], 12, 1123200000]), ({'day': 13, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [14, 0, 0, 0, 0], 13, 1209600000]), ({'day': 14, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [15, 0, 0, 0, 0], 14, 1296000000]), ({'day': 15, 'hour': 24, 'minute': 0, 'second': 0, 'fraction': 0}, [True, [16, 0, 0, 0, 0], 15, 1382400000])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for coordinate.

Controlled local date index plus clock label permits ordinary 00:00:00 through 23:59:59, or exact 24:00:00 with zero fractional milliseconds only. Normalize 24:00 to following day 00:00, retaining end-of-day provenance for roundtrip. Date index is an abstract signed day, not Gregorian arithmetic. Return admission, normalized tuple, original-day provenance and total millisecond coordinate.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = True
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'].startswith(r['trusted_source'])
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for identity.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] == r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] > 0
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for version.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['query'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] > r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for published.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['query'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] <= r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for live.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] <= r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] < r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for covered.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'ok' if covered else 'uncovered'
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('expired' if not live else ('uncovered' if not covered else 'ok'))
    shifted = r['query'] + r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for status.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] + r['offset']
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    identity = r['source'] == r['trusted_source']
    version = r['version'] >= r['minimum_version']
    published = r['now'] >= r['published']
    live = r['now'] < r['expires']
    covered = r['start'] <= r['query'] < r['end']
    status = 'identity' if not identity else ('version' if not version else ('future' if not published else ('expired' if not live else ('uncovered' if not covered else 'ok'))))
    shifted = r['query'] - r['offset'] if status == 'ok' else None
    remaining = max(0,r['expires'] - r['now'])
    left_margin = r['query'] - r['start']
    right_margin = r['end'] - r['query']
    return [status,shifted,remaining,[left_margin,right_margin] if covered else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 10, [0, 100]])
check('fixture 2', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 3, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['ok', 157, 5, [50, 50]])
check('fixture 3', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 1, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['version', None, 5, [50, 50]])
check('fixture 4', solve({'source': 'clock2', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 5', solve({'source': 'other', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['identity', None, 5, [50, 50]])
check('fixture 6', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 9, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['future', None, 11, [50, 50]])
check('fixture 7', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 20, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 8', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 21, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 150, 'offset': 7}), ['expired', None, 0, [50, 50]])
check('fixture 9', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 200, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 10', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 99, 'offset': 7}), ['uncovered', None, 5, None])
check('fixture 11', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 199, 'offset': 7}), ['ok', 206, 5, [99, 1]])
check('fixture 12', solve({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 15, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 100, 'offset': 7}), ['ok', 107, 5, [0, 100]])
variant = [({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 101, 'offset': 7}, ['ok', 108, 10, [1, 99]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 102, 'offset': 7}, ['ok', 109, 10, [2, 98]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 103, 'offset': 7}, ['ok', 110, 10, [3, 97]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 104, 'offset': 7}, ['ok', 111, 10, [4, 96]]), ({'source': 'clock', 'trusted_source': 'clock', 'version': 2, 'minimum_version': 2, 'now': 10, 'published': 10, 'expires': 20, 'start': 100, 'end': 200, 'query': 105, 'offset': 7}, ['ok', 112, 10, [5, 95]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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:
The decoded time state disagrees with the explicit regression oracle for shifted.

A timescale offset certificate declares coverage [start,end), publication instant, expiry instant, version and source identity. A query may use offset only inside coverage with a currently valid certificate and minimum accepted version. Query time and validation wall time are independent. Return status precedence identity/version/publication/expiry/coverage, admitted shifted coordinate, remaining validity and coverage margin.

split: open-access