FA-66406 / Airline fare rule evaluation / Open access
Last day of a season excluded · case 01
Travel on 31 August falls out of the summer season.
ROOT CAUSE
The non-wrapping range test excludes the end date.
THE FAILURE
The non-wrapping range test excludes the end date.
Unsuccessful approach: Moving the exclusion to the start date drops the first day of each season instead.
Case contract
Input {'date','seasons':[[start 'M-D', end 'M-D' (unpadded allowed), weekdays string of ISO digits 1=Mon..7=Sun, code]]}. A season with start after end wraps the year end. Both ends inclusive. Return the code of the first season (list order) containing the date on an allowed weekday, else 'NONE'.
Why this case matters
Fare seasonality tables use month-day ranges that can wrap the year boundary and are further restricted by day of week.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
d = datetime.date.fromisoformat(x['date'])
md = (d.month, d.day)
for start, end, dow, code in x['seasons']:
s = tuple(int(p) for p in start.split('-'))
e = tuple(int(p) for p in end.split('-'))
inside = s <= md < e if s <= e else (md >= s or md <= e)
if inside and str(d.isoweekday()) in dow:
return code
return 'NONE'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['New Year inside wrap season', {'date': '2028-01-03', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-05', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-13', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-02-24', 'seasons': [['10-27', '3-18', '257', 'S0'], ['10-8', '11-12', '2346', 'S1'], ['3-2', '4-14', '23467', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2029-09-07', 'seasons': [['12-12', '5-9', '123456', 'S0'], ['12-8', '2-16', '1234567', 'S1'], ['6-10', '10-12', '12347', 'S2']]}, 'NONE'], ['sampled case 3', {'date': '2029-03-20', 'seasons': [['7-27', '9-9', '123567', 'S0'], ['10-31', '12-13', '1357', 'S1']]}, 'NONE'], ['regression: season end inclusion', {'date': '2027-05-18', 'seasons': [['5-18', '8-21', '2346', 'S0'], ['4-13', '6-8', '123457', 'S1'], ['6-14', '9-30', '12457', 'S2']]}, 'S0']], [['New Year inside wrap season', {'date': '2028-01-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-11', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-06', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-14', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-05-03', 'seasons': [['5-4', '7-25', '13457', 'S0'], ['6-18', '9-12', '1234567', 'S1'], ['2-7', '6-1', '3', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2027-05-20', 'seasons': [['8-18', '2-4', '17', 'S0'], ['12-23', '12-28', '1267', 'S1']]}, 'NONE'], ['sampled case 3', {'date': '2028-01-27', 'seasons': [['2-5', '2-6', '136', 'S0'], ['11-22', '3-11', '23', 'S1'], ['10-29', '11-15', '67', 'S2'], ['4-23', '6-13', '1367', 'S3']]}, 'NONE'], ['regression: season end inclusion', {'date': '2028-01-10', 'seasons': [['4-4', '9-8', '27', 'S0'], ['9-11', '1-19', '5', 'S1'], ['10-26', '5-6', '23457', 'S2'], ['1-10', '2-24', '1234567', 'S3']]}, 'S3']], [['New Year inside wrap season', {'date': '2028-01-05', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-18', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-07', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-15', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2028-09-07', 'seasons': [['12-12', '3-3', '15', 'S0'], ['4-5', '4-30', '6', 'S1'], ['12-10', '1-5', '136', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2027-08-20', 'seasons': [['10-3', '2-23', '137', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2029-01-15', 'seasons': [['1-2', '5-8', '16', 'S0'], ['1-19', '6-11', '1234567', 'S1'], ['10-17', '1-6', '2456', 'S2'], ['11-19', '1-26', '34567', 'S3']]}, 'S0'], ['regression: season end inclusion', {'date': '2029-06-28', 'seasons': [['6-28', '8-7', '1234567', 'S0'], ['11-13', '3-26', '12567', 'S1'], ['3-23', '6-28', '134567', 'S2'], ['6-13', '10-6', '1234567', 'S3']]}, 'S0']], [['New Year inside wrap season', {'date': '2028-01-06', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-25', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-08', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'NONE'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-16', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2028-03-30', 'seasons': [['1-26', '6-22', '4', 'S0'], ['5-16', '8-21', '123467', 'S1'], ['8-21', '11-24', '123467', 'S2'], ['2-13', '7-22', '1246', 'S3']]}, 'S0'], ['sampled case 2', {'date': '2029-03-23', 'seasons': [['9-11', '3-12', '1234', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2029-03-01', 'seasons': [['4-26', '5-25', '1234567', 'S0'], ['10-24', '12-15', '7', 'S1'], ['10-4', '3-14', '1246', 'S2']]}, 'S2'], ['regression: season end inclusion', {'date': '2027-04-16', 'seasons': [['11-13', '5-8', '7', 'S0'], ['1-6', '7-23', '2346', 'S1'], ['4-23', '9-25', '123567', 'S2'], ['4-16', '7-18', '123567', 'S3']]}, 'S3']], [['New Year inside wrap season', {'date': '2028-01-07', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-09', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'NONE'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-17', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-04-07', 'seasons': [['12-9', '5-18', '123456', 'S0'], ['11-27', '12-4', '12457', 'S1']]}, 'S0'], ['sampled case 2', {'date': '2027-10-12', 'seasons': [['7-20', '1-2', '4', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2027-06-11', 'seasons': [['9-12', '2-18', '46', 'S0'], ['1-5', '7-14', '4', 'S1'], ['3-28', '6-4', '1234567', 'S2'], ['8-26', '9-24', '123567', 'S3']]}, 'NONE'], ['regression: season end inclusion', {'date': '2027-08-05', 'seasons': [['11-12', '3-23', '1234567', 'S0'], ['8-5', '8-20', '1234567', 'S1']]}, 'S1']]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| New Year inside wrap season | PEAK | PEAK | Passed |
| season end day | NONE | HIGH_WK | Failed |
| Sunday in summer | HIGH_WE | HIGH_WE | Passed |
| autumn weekday | SHOULDER | SHOULDER | Passed |
| wrap end date | PEAK | PEAK | Passed |
| overlapping seasons first wins | DEC | DEC | Passed |
| two-digit month compare | FALL | FALL | Passed |
| sampled case 1 | NONE | NONE | Passed |
| sampled case 2 | NONE | NONE | Passed |
| sampled case 3 | NONE | NONE | Passed |
| regression: season end inclusion | S0 | S0 | Passed |
SHA-256 / f4f2e0d3c73df802ba4bab9484417f267936496c3b88a7652b034065163a42a8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
d = datetime.date.fromisoformat(x['date'])
md = (d.month, d.day)
for start, end, dow, code in x['seasons']:
s = tuple(int(p) for p in start.split('-'))
e = tuple(int(p) for p in end.split('-'))
inside = s < md <= e if s <= e else (md >= s or md <= e)
if inside and str(d.isoweekday()) in dow:
return code
return 'NONE'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['New Year inside wrap season', {'date': '2028-01-03', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-05', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-13', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-02-24', 'seasons': [['10-27', '3-18', '257', 'S0'], ['10-8', '11-12', '2346', 'S1'], ['3-2', '4-14', '23467', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2029-09-07', 'seasons': [['12-12', '5-9', '123456', 'S0'], ['12-8', '2-16', '1234567', 'S1'], ['6-10', '10-12', '12347', 'S2']]}, 'NONE'], ['sampled case 3', {'date': '2029-03-20', 'seasons': [['7-27', '9-9', '123567', 'S0'], ['10-31', '12-13', '1357', 'S1']]}, 'NONE'], ['regression: season end inclusion', {'date': '2027-05-18', 'seasons': [['5-18', '8-21', '2346', 'S0'], ['4-13', '6-8', '123457', 'S1'], ['6-14', '9-30', '12457', 'S2']]}, 'S0']], [['New Year inside wrap season', {'date': '2028-01-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-11', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-06', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-14', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-05-03', 'seasons': [['5-4', '7-25', '13457', 'S0'], ['6-18', '9-12', '1234567', 'S1'], ['2-7', '6-1', '3', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2027-05-20', 'seasons': [['8-18', '2-4', '17', 'S0'], ['12-23', '12-28', '1267', 'S1']]}, 'NONE'], ['sampled case 3', {'date': '2028-01-27', 'seasons': [['2-5', '2-6', '136', 'S0'], ['11-22', '3-11', '23', 'S1'], ['10-29', '11-15', '67', 'S2'], ['4-23', '6-13', '1367', 'S3']]}, 'NONE'], ['regression: season end inclusion', {'date': '2028-01-10', 'seasons': [['4-4', '9-8', '27', 'S0'], ['9-11', '1-19', '5', 'S1'], ['10-26', '5-6', '23457', 'S2'], ['1-10', '2-24', '1234567', 'S3']]}, 'S3']], [['New Year inside wrap season', {'date': '2028-01-05', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-18', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-07', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'SHOULDER'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-15', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2028-09-07', 'seasons': [['12-12', '3-3', '15', 'S0'], ['4-5', '4-30', '6', 'S1'], ['12-10', '1-5', '136', 'S2']]}, 'NONE'], ['sampled case 2', {'date': '2027-08-20', 'seasons': [['10-3', '2-23', '137', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2029-01-15', 'seasons': [['1-2', '5-8', '16', 'S0'], ['1-19', '6-11', '1234567', 'S1'], ['10-17', '1-6', '2456', 'S2'], ['11-19', '1-26', '34567', 'S3']]}, 'S0'], ['regression: season end inclusion', {'date': '2029-06-28', 'seasons': [['6-28', '8-7', '1234567', 'S0'], ['11-13', '3-26', '12567', 'S1'], ['3-23', '6-28', '134567', 'S2'], ['6-13', '10-6', '1234567', 'S3']]}, 'S0']], [['New Year inside wrap season', {'date': '2028-01-06', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-25', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-08', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'NONE'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-16', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2028-03-30', 'seasons': [['1-26', '6-22', '4', 'S0'], ['5-16', '8-21', '123467', 'S1'], ['8-21', '11-24', '123467', 'S2'], ['2-13', '7-22', '1246', 'S3']]}, 'S0'], ['sampled case 2', {'date': '2029-03-23', 'seasons': [['9-11', '3-12', '1234', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2029-03-01', 'seasons': [['4-26', '5-25', '1234567', 'S0'], ['10-24', '12-15', '7', 'S1'], ['10-4', '3-14', '1246', 'S2']]}, 'S2'], ['regression: season end inclusion', {'date': '2027-04-16', 'seasons': [['11-13', '5-8', '7', 'S0'], ['1-6', '7-23', '2346', 'S1'], ['4-23', '9-25', '123567', 'S2'], ['4-16', '7-18', '123567', 'S3']]}, 'S3']], [['New Year inside wrap season', {'date': '2028-01-07', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['season end day', {'date': '2027-08-31', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WK'], ['Sunday in summer', {'date': '2027-07-04', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'HIGH_WE'], ['autumn weekday', {'date': '2027-10-09', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'NONE'], ['wrap end date', {'date': '2029-01-10', 'seasons': [['12-15', '1-10', '1234567', 'PEAK'], ['6-1', '8-31', '12345', 'HIGH_WK'], ['6-1', '8-31', '67', 'HIGH_WE'], ['1-11', '5-31', '1234567', 'LOW'], ['9-1', '12-14', '1234', 'SHOULDER']]}, 'PEAK'], ['overlapping seasons first wins', {'date': '2027-12-20', 'seasons': [['12-1', '12-31', '1234567', 'DEC'], ['12-15', '1-10', '1234567', 'PEAK']]}, 'DEC'], ['two-digit month compare', {'date': '2027-10-17', 'seasons': [['9-1', '11-30', '1234567', 'FALL'], ['3-1', '5-31', '1234567', 'SPRING']]}, 'FALL'], ['sampled case 1', {'date': '2029-04-07', 'seasons': [['12-9', '5-18', '123456', 'S0'], ['11-27', '12-4', '12457', 'S1']]}, 'S0'], ['sampled case 2', {'date': '2027-10-12', 'seasons': [['7-20', '1-2', '4', 'S0']]}, 'NONE'], ['sampled case 3', {'date': '2027-06-11', 'seasons': [['9-12', '2-18', '46', 'S0'], ['1-5', '7-14', '4', 'S1'], ['3-28', '6-4', '1234567', 'S2'], ['8-26', '9-24', '123567', 'S3']]}, 'NONE'], ['regression: season end inclusion', {'date': '2027-08-05', 'seasons': [['11-12', '3-23', '1234567', 'S0'], ['8-5', '8-20', '1234567', 'S1']]}, 'S1']]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| New Year inside wrap season | PEAK | PEAK | Passed |
| season end day | HIGH_WK | HIGH_WK | Passed |
| Sunday in summer | HIGH_WE | HIGH_WE | Passed |
| autumn weekday | SHOULDER | SHOULDER | Passed |
| wrap end date | PEAK | PEAK | Passed |
| overlapping seasons first wins | DEC | DEC | Passed |
| two-digit month compare | FALL | FALL | Passed |
| sampled case 1 | NONE | NONE | Passed |
| sampled case 2 | NONE | NONE | Passed |
| sampled case 3 | NONE | NONE | Passed |
| regression: season end inclusion | S1 | S0 | Failed |
SHA-256 / b6f45e24926d2f44755b87ca73d988f1f2429599d9fb040e5c008da471a01a19
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 11 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A stipulated toy fare-rule contract with invented constants; it is not an ATPCO or carrier tariff implementation and makes no claim of industry-standard conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:47:43.425573+00:00.
Case digest / 3eaaa1ee11dcd55df86dba40e169d1e565c9a4236553557a75a59ff8576e08ec