FA-66621 / Airline fare rule evaluation / Open access
A connection of exactly 24 hours counted as a stopover · case 01
An international connection of exactly 24 hours consumes the stopover allowance.
ROOT CAUSE
The stopover test is inclusive of the time limit.
THE FAILURE
The stopover test is inclusive of the time limit.
Unsuccessful approach: Rounding the gap to whole hours hides connections up to 30 minutes over the limit.
Case contract
Input {'segments':[[departure, arrival ISO local, domestic flag]],'max_stopovers','max_transfers'}. At each connection the gap from the inbound arrival to the next departure is a stopover when it exceeds 4 h if both segments are domestic, otherwise 24 h (a gap equal to the limit is not a stopover). Every connection point is a transfer. Return [stopovers, transfers, failures in order STOPOVERS, TRANSFERS].
Why this case matters
Fare rules cap stopovers and transfers separately; whether a connection is a stopover depends on the connection time and the domestic/international context.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
segs = x['segments']
stops = 0
for (d0, a0, dom0), (d1, a1, dom1) in zip(segs, segs[1:]):
gap = (datetime.datetime.fromisoformat(d1) - datetime.datetime.fromisoformat(a0)).total_seconds() / 3600
limit = 4 if (dom0 and dom1) else 24
if gap >= limit: stops += 1
transfers = len(segs) - 1
fails = []
if stops > x['max_stopovers']: fails.append('STOPOVERS')
if transfers > x['max_transfers']: fails.append('TRANSFERS')
return [stops, transfers, fails]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:01', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-07T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:01', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2029-07-06T05:00', '2029-07-06T16:00', False], ['2029-07-06T19:00', '2029-07-06T20:30', False], ['2029-07-07T00:30', '2029-07-07T14:30', False]], 'max_stopovers': 2, 'max_transfers': 2}, [0, 2, []]], ['sampled case 2', {'segments': [['2029-04-03T21:30', '2029-04-04T07:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 0, []]], ['sampled case 3', {'segments': [['2028-08-09T11:30', '2028-08-09T19:00', False], ['2028-08-09T20:30', '2028-08-10T07:00', False], ['2028-08-10T12:00', '2028-08-10T18:30', True], ['2028-08-10T20:00', '2028-08-11T07:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 3, []]], ['regression: stopover threshold boundary', {'segments': [['2027-03-20T11:00', '2027-03-20T13:00', False], ['2027-03-20T17:00', '2027-03-20T23:00', True], ['2027-03-21T23:30', '2027-03-22T08:30', False], ['2027-03-22T13:30', '2027-03-22T16:00', True], ['2027-03-22T19:00', '2027-03-23T06:30', False]], 'max_stopovers': 0, 'max_transfers': 2}, [1, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:02', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 1}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-08T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:02', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2028-08-14T16:45', '2028-08-15T03:45', False], ['2028-08-17T03:45', '2028-08-17T17:45', False], ['2028-08-17T22:45', '2028-08-18T09:15', True], ['2028-08-18T13:15', '2028-08-18T22:45', False], ['2028-08-19T18:45', '2028-08-20T06:45', False]], 'max_stopovers': 2, 'max_transfers': 1}, [1, 4, ['TRANSFERS']]], ['sampled case 2', {'segments': [['2027-06-01T12:45', '2027-06-01T20:15', True], ['2027-06-01T22:15', '2027-06-02T11:45', True], ['2027-06-03T11:45', '2027-06-03T21:45', True]], 'max_stopovers': 1, 'max_transfers': 2}, [1, 2, []]], ['sampled case 3', {'segments': [['2027-07-21T03:00', '2027-07-21T07:00', False], ['2027-07-22T03:00', '2027-07-22T08:30', False], ['2027-07-22T09:30', '2027-07-22T16:30', False], ['2027-07-22T17:30', '2027-07-22T23:00', False], ['2027-07-23T19:00', '2027-07-24T00:00', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 4, ['TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2028-11-08T02:30', '2028-11-08T15:00', True], ['2028-11-10T15:30', '2028-11-10T21:00', True], ['2028-11-11T21:30', '2028-11-12T03:00', True], ['2028-11-12T08:00', '2028-11-12T10:30', False], ['2028-11-13T11:00', '2028-11-13T12:00', True]], 'max_stopovers': 1, 'max_transfers': 0}, [3, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:03', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-06T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [2, 3, []]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:03', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-02-15T21:15', '2027-02-15T23:15', True], ['2027-02-16T07:45', '2027-02-16T18:45', True], ['2027-02-17T02:45', '2027-02-17T13:45', False], ['2027-02-17T22:15', '2027-02-18T00:45', False], ['2027-02-18T20:45', '2027-02-19T02:15', False]], 'max_stopovers': 1, 'max_transfers': 3}, [1, 4, ['TRANSFERS']]], ['sampled case 2', {'segments': [['2029-05-25T20:00', '2029-05-26T01:00', True], ['2029-05-27T02:00', '2029-05-27T07:00', False], ['2029-05-28T08:30', '2029-05-28T17:00', False], ['2029-05-28T19:00', '2029-05-29T07:30', False], ['2029-05-29T09:30', '2029-05-29T13:00', False]], 'max_stopovers': 1, 'max_transfers': 3}, [2, 4, ['STOPOVERS', 'TRANSFERS']]], ['sampled case 3', {'segments': [['2028-09-07T21:45', '2028-09-08T03:15', True], ['2028-09-08T23:15', '2028-09-09T11:15', True], ['2028-09-10T11:15', '2028-09-10T14:45', False], ['2028-09-12T14:45', '2028-09-13T04:45', True], ['2028-09-13T05:45', '2028-09-13T20:15', True]], 'max_stopovers': 0, 'max_transfers': 2}, [2, 4, ['STOPOVERS', 'TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2027-04-06T14:30', '2027-04-06T17:00', True], ['2027-04-06T20:30', '2027-04-07T04:30', False], ['2027-04-07T12:30', '2027-04-07T19:30', True], ['2027-04-08T20:00', '2027-04-09T00:30', False], ['2027-04-09T02:30', '2027-04-09T03:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [1, 4, ['TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:04', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 1}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-07T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:04', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-11-27T17:15', '2027-11-27T23:45', False], ['2027-11-28T01:45', '2027-11-28T11:45', False]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 1, []]], ['sampled case 2', {'segments': [['2029-03-09T18:00', '2029-03-10T02:00', True], ['2029-03-10T03:00', '2029-03-10T12:00', True]], 'max_stopovers': 1, 'max_transfers': 2}, [0, 1, []]], ['sampled case 3', {'segments': [['2029-03-20T20:00', '2029-03-20T23:30', True], ['2029-03-21T02:30', '2029-03-21T12:00', False], ['2029-03-23T12:00', '2029-03-23T16:00', False], ['2029-03-23T21:00', '2029-03-24T01:30', False], ['2029-03-24T02:30', '2029-03-24T12:00', False]], 'max_stopovers': 1, 'max_transfers': 0}, [1, 4, ['TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2028-06-19T07:45', '2028-06-19T16:45', False], ['2028-06-20T12:45', '2028-06-20T17:15', False], ['2028-06-21T17:45', '2028-06-22T01:45', False], ['2028-06-22T03:45', '2028-06-22T15:15', False], ['2028-06-23T16:15', '2028-06-24T01:15', False]], 'max_stopovers': 1, 'max_transfers': 1}, [2, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:05', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-08T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:05', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-02-17T17:30', '2027-02-17T20:00', False]], 'max_stopovers': 1, 'max_transfers': 0}, [0, 0, []]], ['sampled case 2', {'segments': [['2029-07-05T21:30', '2029-07-06T01:30', False], ['2029-07-06T02:30', '2029-07-06T07:30', True], ['2029-07-06T09:00', '2029-07-06T23:00', True], ['2029-07-08T00:30', '2029-07-08T15:00', True], ['2029-07-08T18:30', '2029-07-09T04:30', False]], 'max_stopovers': 2, 'max_transfers': 2}, [1, 4, ['TRANSFERS']]], ['sampled case 3', {'segments': [['2027-06-10T18:15', '2027-06-10T19:15', False], ['2027-06-10T22:45', '2027-06-11T12:15', True]], 'max_stopovers': 0, 'max_transfers': 3}, [0, 1, []]], ['regression: stopover threshold boundary', {'segments': [['2027-02-12T09:30', '2027-02-12T16:00', True], ['2027-02-13T00:00', '2027-02-13T02:00', False], ['2027-02-14T02:00', '2027-02-14T11:00', False], ['2027-02-14T16:00', '2027-02-15T00:00', True], ['2027-02-15T04:30', '2027-02-15T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 4, ['STOPOVERS', 'TRANSFERS']]]]]
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 |
|---|---|---|---|
| international 24h exactly | [1, 1, ['STOPOVERS']] | [0, 1, []] | Failed |
| domestic five hour connection | [1, 1, ['STOPOVERS']] | [1, 1, ['STOPOVERS']] | Passed |
| mixed connection 6h | [0, 1, []] | [0, 1, []] | Passed |
| long flight short connection | [1, 2, ['TRANSFERS']] | [1, 2, ['TRANSFERS']] | Passed |
| three stopovers | [3, 3, ['STOPOVERS']] | [3, 3, ['STOPOVERS']] | Passed |
| nonstop | [0, 0, []] | [0, 0, []] | Passed |
| sampled case 1 | [0, 2, []] | [0, 2, []] | Passed |
| sampled case 2 | [0, 0, []] | [0, 0, []] | Passed |
| sampled case 3 | [0, 3, []] | [0, 3, []] | Passed |
| regression: stopover threshold boundary | [1, 4, ['STOPOVERS', 'TRANSFERS']] | [1, 4, ['STOPOVERS', 'TRANSFERS']] | Passed |
SHA-256 / 0edc85652b53149082dadad24370b9ce4de66db8f76e569897c5eb8e7538a162
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
segs = x['segments']
stops = 0
for (d0, a0, dom0), (d1, a1, dom1) in zip(segs, segs[1:]):
gap = (datetime.datetime.fromisoformat(d1) - datetime.datetime.fromisoformat(a0)).total_seconds() / 3600
limit = 4 if (dom0 and dom1) else 24
if round(gap) > limit: stops += 1
transfers = len(segs) - 1
fails = []
if stops > x['max_stopovers']: fails.append('STOPOVERS')
if transfers > x['max_transfers']: fails.append('TRANSFERS')
return [stops, transfers, fails]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:01', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-07T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:01', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2029-07-06T05:00', '2029-07-06T16:00', False], ['2029-07-06T19:00', '2029-07-06T20:30', False], ['2029-07-07T00:30', '2029-07-07T14:30', False]], 'max_stopovers': 2, 'max_transfers': 2}, [0, 2, []]], ['sampled case 2', {'segments': [['2029-04-03T21:30', '2029-04-04T07:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 0, []]], ['sampled case 3', {'segments': [['2028-08-09T11:30', '2028-08-09T19:00', False], ['2028-08-09T20:30', '2028-08-10T07:00', False], ['2028-08-10T12:00', '2028-08-10T18:30', True], ['2028-08-10T20:00', '2028-08-11T07:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 3, []]], ['regression: stopover threshold boundary', {'segments': [['2027-03-20T11:00', '2027-03-20T13:00', False], ['2027-03-20T17:00', '2027-03-20T23:00', True], ['2027-03-21T23:30', '2027-03-22T08:30', False], ['2027-03-22T13:30', '2027-03-22T16:00', True], ['2027-03-22T19:00', '2027-03-23T06:30', False]], 'max_stopovers': 0, 'max_transfers': 2}, [1, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:02', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 1}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-08T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:02', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2028-08-14T16:45', '2028-08-15T03:45', False], ['2028-08-17T03:45', '2028-08-17T17:45', False], ['2028-08-17T22:45', '2028-08-18T09:15', True], ['2028-08-18T13:15', '2028-08-18T22:45', False], ['2028-08-19T18:45', '2028-08-20T06:45', False]], 'max_stopovers': 2, 'max_transfers': 1}, [1, 4, ['TRANSFERS']]], ['sampled case 2', {'segments': [['2027-06-01T12:45', '2027-06-01T20:15', True], ['2027-06-01T22:15', '2027-06-02T11:45', True], ['2027-06-03T11:45', '2027-06-03T21:45', True]], 'max_stopovers': 1, 'max_transfers': 2}, [1, 2, []]], ['sampled case 3', {'segments': [['2027-07-21T03:00', '2027-07-21T07:00', False], ['2027-07-22T03:00', '2027-07-22T08:30', False], ['2027-07-22T09:30', '2027-07-22T16:30', False], ['2027-07-22T17:30', '2027-07-22T23:00', False], ['2027-07-23T19:00', '2027-07-24T00:00', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 4, ['TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2028-11-08T02:30', '2028-11-08T15:00', True], ['2028-11-10T15:30', '2028-11-10T21:00', True], ['2028-11-11T21:30', '2028-11-12T03:00', True], ['2028-11-12T08:00', '2028-11-12T10:30', False], ['2028-11-13T11:00', '2028-11-13T12:00', True]], 'max_stopovers': 1, 'max_transfers': 0}, [3, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:03', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-06T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [2, 3, []]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:03', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-02-15T21:15', '2027-02-15T23:15', True], ['2027-02-16T07:45', '2027-02-16T18:45', True], ['2027-02-17T02:45', '2027-02-17T13:45', False], ['2027-02-17T22:15', '2027-02-18T00:45', False], ['2027-02-18T20:45', '2027-02-19T02:15', False]], 'max_stopovers': 1, 'max_transfers': 3}, [1, 4, ['TRANSFERS']]], ['sampled case 2', {'segments': [['2029-05-25T20:00', '2029-05-26T01:00', True], ['2029-05-27T02:00', '2029-05-27T07:00', False], ['2029-05-28T08:30', '2029-05-28T17:00', False], ['2029-05-28T19:00', '2029-05-29T07:30', False], ['2029-05-29T09:30', '2029-05-29T13:00', False]], 'max_stopovers': 1, 'max_transfers': 3}, [2, 4, ['STOPOVERS', 'TRANSFERS']]], ['sampled case 3', {'segments': [['2028-09-07T21:45', '2028-09-08T03:15', True], ['2028-09-08T23:15', '2028-09-09T11:15', True], ['2028-09-10T11:15', '2028-09-10T14:45', False], ['2028-09-12T14:45', '2028-09-13T04:45', True], ['2028-09-13T05:45', '2028-09-13T20:15', True]], 'max_stopovers': 0, 'max_transfers': 2}, [2, 4, ['STOPOVERS', 'TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2027-04-06T14:30', '2027-04-06T17:00', True], ['2027-04-06T20:30', '2027-04-07T04:30', False], ['2027-04-07T12:30', '2027-04-07T19:30', True], ['2027-04-08T20:00', '2027-04-09T00:30', False], ['2027-04-09T02:30', '2027-04-09T03:30', True]], 'max_stopovers': 2, 'max_transfers': 3}, [1, 4, ['TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:04', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 1}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-07T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:04', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-11-27T17:15', '2027-11-27T23:45', False], ['2027-11-28T01:45', '2027-11-28T11:45', False]], 'max_stopovers': 2, 'max_transfers': 3}, [0, 1, []]], ['sampled case 2', {'segments': [['2029-03-09T18:00', '2029-03-10T02:00', True], ['2029-03-10T03:00', '2029-03-10T12:00', True]], 'max_stopovers': 1, 'max_transfers': 2}, [0, 1, []]], ['sampled case 3', {'segments': [['2029-03-20T20:00', '2029-03-20T23:30', True], ['2029-03-21T02:30', '2029-03-21T12:00', False], ['2029-03-23T12:00', '2029-03-23T16:00', False], ['2029-03-23T21:00', '2029-03-24T01:30', False], ['2029-03-24T02:30', '2029-03-24T12:00', False]], 'max_stopovers': 1, 'max_transfers': 0}, [1, 4, ['TRANSFERS']]], ['regression: stopover threshold boundary', {'segments': [['2028-06-19T07:45', '2028-06-19T16:45', False], ['2028-06-20T12:45', '2028-06-20T17:15', False], ['2028-06-21T17:45', '2028-06-22T01:45', False], ['2028-06-22T03:45', '2028-06-22T15:15', False], ['2028-06-23T16:15', '2028-06-24T01:15', False]], 'max_stopovers': 1, 'max_transfers': 1}, [2, 4, ['STOPOVERS', 'TRANSFERS']]]], [['international 24h exactly', {'segments': [['2027-05-01T10:00', '2027-05-01T18:00', False], ['2027-05-02T18:00', '2027-05-02T23:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['domestic five hour connection', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T14:05', '2027-05-01T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 1, ['STOPOVERS']]], ['mixed connection 6h', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', True], ['2027-05-01T15:00', '2027-05-02T07:00', False]], 'max_stopovers': 0, 'max_transfers': 2}, [0, 1, []]], ['long flight short connection', {'segments': [['2027-05-01T07:00', '2027-05-02T01:00', False], ['2027-05-02T03:00', '2027-05-02T09:00', False], ['2027-05-03T10:00', '2027-05-03T12:00', False]], 'max_stopovers': 1, 'max_transfers': 1}, [1, 2, ['TRANSFERS']]], ['three stopovers', {'segments': [['2027-05-01T07:00', '2027-05-01T09:00', False], ['2027-05-03T07:00', '2027-05-03T09:00', False], ['2027-05-05T07:00', '2027-05-05T09:00', False], ['2027-05-08T07:00', '2027-05-09T09:00', False]], 'max_stopovers': 2, 'max_transfers': 3}, [3, 3, ['STOPOVERS']]], ['nonstop', {'segments': [['2027-05-01T07:00', '2027-05-01T09:05', False]], 'max_stopovers': 0, 'max_transfers': 0}, [0, 0, []]], ['sampled case 1', {'segments': [['2027-02-17T17:30', '2027-02-17T20:00', False]], 'max_stopovers': 1, 'max_transfers': 0}, [0, 0, []]], ['sampled case 2', {'segments': [['2029-07-05T21:30', '2029-07-06T01:30', False], ['2029-07-06T02:30', '2029-07-06T07:30', True], ['2029-07-06T09:00', '2029-07-06T23:00', True], ['2029-07-08T00:30', '2029-07-08T15:00', True], ['2029-07-08T18:30', '2029-07-09T04:30', False]], 'max_stopovers': 2, 'max_transfers': 2}, [1, 4, ['TRANSFERS']]], ['sampled case 3', {'segments': [['2027-06-10T18:15', '2027-06-10T19:15', False], ['2027-06-10T22:45', '2027-06-11T12:15', True]], 'max_stopovers': 0, 'max_transfers': 3}, [0, 1, []]], ['regression: stopover threshold boundary', {'segments': [['2027-02-12T09:30', '2027-02-12T16:00', True], ['2027-02-13T00:00', '2027-02-13T02:00', False], ['2027-02-14T02:00', '2027-02-14T11:00', False], ['2027-02-14T16:00', '2027-02-15T00:00', True], ['2027-02-15T04:30', '2027-02-15T16:00', True]], 'max_stopovers': 0, 'max_transfers': 1}, [1, 4, ['STOPOVERS', 'TRANSFERS']]]]]
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 |
|---|---|---|---|
| international 24h exactly | [0, 1, []] | [0, 1, []] | Passed |
| domestic five hour connection | [1, 1, ['STOPOVERS']] | [1, 1, ['STOPOVERS']] | Passed |
| mixed connection 6h | [0, 1, []] | [0, 1, []] | Passed |
| long flight short connection | [1, 2, ['TRANSFERS']] | [1, 2, ['TRANSFERS']] | Passed |
| three stopovers | [3, 3, ['STOPOVERS']] | [3, 3, ['STOPOVERS']] | Passed |
| nonstop | [0, 0, []] | [0, 0, []] | Passed |
| sampled case 1 | [0, 2, []] | [0, 2, []] | Passed |
| sampled case 2 | [0, 0, []] | [0, 0, []] | Passed |
| sampled case 3 | [0, 3, []] | [0, 3, []] | Passed |
| regression: stopover threshold boundary | [0, 4, ['TRANSFERS']] | [1, 4, ['STOPOVERS', 'TRANSFERS']] | Failed |
SHA-256 / 188d672121acf0b636229c2f1881d7de8676038363350b2a2fe82d1b31d8d991
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 10 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:45.512614+00:00.
Case digest / 44d05d4fbe6605a9a20f3a2c48cd7157ecdf9d2d05c6bf7efe3c5e1e59b7aca2