{"abstract":"A ticket bought at 22:30 for a 06:00 departure exactly 14 calendar days later fails a 14-day advance purchase.","category":"Airline fare rule evaluation","checks":10,"contract":"Input {'res','ticket','depart' ISO local datetimes,'ap_days','ticket_within_h'}. Ticket before reservation -> 'ERR_ORDER'. AP counts calendar days between the ticketing date and the departure date (>= ap_days passes) and is checked before the ticketing time limit; ticketing must be at or before reservation + ticket_within_h hours. Return 'PASS', 'FAIL_AP' or 'FAIL_TKT_TL'.","contract_signature":"x","evaluation_group":"w2-airline-fare-rules-advance-purchase","failed_approach":"Rounding the elapsed days still depends on the time of day and fails some calendar-exact purchases.","family":"w2-airline-fare-rules-advance-purchase-ap-elapsed-periods","id":"FA-66341","implementations":{"attempt":{"sha256":"6f0c6bd7ea6376179a7692e30088d75d09f1a6a6fde30c72b2769ffc2adaee48","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(x):\n    T = datetime.datetime.fromisoformat(x['ticket'])\n    D = datetime.datetime.fromisoformat(x['depart'])\n    R = datetime.datetime.fromisoformat(x['res'])\n    if T < R: return 'ERR_ORDER'\n    if round((D - T).total_seconds() / 86400) < x['ap_days']: return 'FAIL_AP'\n    if T > R + datetime.timedelta(hours=x['ticket_within_h']): return 'FAIL_TKT_TL'\n    return 'PASS'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-15T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 25}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:05', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:51', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-04-23T19:45', 'ticket': '2029-04-25T19:45', 'depart': '2029-05-10T07:45', 'ap_days': 21, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 2', {'res': '2028-12-29T20:45', 'ticket': '2028-12-30T21:15', 'depart': '2029-01-24T15:15', 'ap_days': 3, 'ticket_within_h': 72}, 'PASS'], ['sampled case 3', {'res': '2029-11-28T18:15', 'ticket': '2029-11-29T14:45', 'depart': '2029-12-08T20:45', 'ap_days': 21, 'ticket_within_h': 72}, 'FAIL_AP']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-16T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 26}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:10', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:52', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-03-02T18:30', 'ticket': '2029-03-05T19:00', 'depart': '2029-03-14T02:00', 'ap_days': 14, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 2', {'res': '2028-11-19T00:15', 'ticket': '2028-11-20T00:15', 'depart': '2028-12-13T04:15', 'ap_days': 7, 'ticket_within_h': 24}, 'PASS'], ['sampled case 3', {'res': '2028-08-13T05:15', 'ticket': '2028-08-13T20:45', 'depart': '2028-08-18T10:45', 'ap_days': 3, 'ticket_within_h': 72}, 'PASS'], ['regression: advance purchase day counting', {'res': '2028-09-13T18:15', 'ticket': '2028-09-16T18:15', 'depart': '2028-09-19T01:15', 'ap_days': 3, 'ticket_within_h': 48}, 'FAIL_TKT_TL']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-17T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 27}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:15', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:53', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 1', {'res': '2028-01-07T10:45', 'ticket': '2028-01-10T11:15', 'depart': '2028-01-27T06:15', 'ap_days': 14, 'ticket_within_h': 72}, 'FAIL_TKT_TL'], ['sampled case 2', {'res': '2027-11-20T22:00', 'ticket': '2027-11-23T02:00', 'depart': '2027-12-12T09:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_AP'], ['sampled case 3', {'res': '2029-01-16T10:15', 'ticket': '2029-01-17T10:45', 'depart': '2029-02-13T03:45', 'ap_days': 14, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2027-04-21T10:15', 'ticket': '2027-04-22T04:15', 'depart': '2027-05-05T17:15', 'ap_days': 14, 'ticket_within_h': 48}, 'FAIL_AP']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-18T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 28}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:20', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:54', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 96}, 'FAIL_AP'], ['sampled case 1', {'res': '2028-04-10T05:15', 'ticket': '2028-04-13T05:15', 'depart': '2028-04-21T10:15', 'ap_days': 14, 'ticket_within_h': 48}, 'FAIL_AP'], ['sampled case 2', {'res': '2029-06-06T12:45', 'ticket': '2029-06-09T12:45', 'depart': '2029-07-06T08:45', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['sampled case 3', {'res': '2029-10-21T12:00', 'ticket': '2029-10-24T12:00', 'depart': '2029-11-15T19:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2029-10-17T03:30', 'ticket': '2029-10-18T22:30', 'depart': '2029-11-08T01:30', 'ap_days': 21, 'ticket_within_h': 48}, 'PASS']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-19T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 29}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:25', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:55', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 120}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-04-07T13:45', 'ticket': '2029-04-08T19:15', 'depart': '2029-04-19T08:15', 'ap_days': 3, 'ticket_within_h': 48}, 'PASS'], ['sampled case 2', {'res': '2027-04-03T07:45', 'ticket': '2027-04-05T08:15', 'depart': '2027-05-01T01:15', 'ap_days': 3, 'ticket_within_h': 48}, 'FAIL_TKT_TL'], ['sampled case 3', {'res': '2029-01-24T00:30', 'ticket': '2029-01-25T01:00', 'depart': '2029-02-11T22:00', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2029-02-06T01:45', 'ticket': '2029-02-07T01:45', 'depart': '2029-02-13T20:45', 'ap_days': 7, 'ticket_within_h': 72}, 'FAIL_AP']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"d7c1d4ace943e0bf9aeebd400504ea0ea7cc018b00e356648f97c5803b1a023d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(x):\n    T = datetime.datetime.fromisoformat(x['ticket'])\n    D = datetime.datetime.fromisoformat(x['depart'])\n    R = datetime.datetime.fromisoformat(x['res'])\n    if T < R: return 'ERR_ORDER'\n    if (D - T).days < x['ap_days']: return 'FAIL_AP'\n    if T > R + datetime.timedelta(hours=x['ticket_within_h']): return 'FAIL_TKT_TL'\n    return 'PASS'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-15T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 25}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:05', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:51', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-04-23T19:45', 'ticket': '2029-04-25T19:45', 'depart': '2029-05-10T07:45', 'ap_days': 21, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 2', {'res': '2028-12-29T20:45', 'ticket': '2028-12-30T21:15', 'depart': '2029-01-24T15:15', 'ap_days': 3, 'ticket_within_h': 72}, 'PASS'], ['sampled case 3', {'res': '2029-11-28T18:15', 'ticket': '2029-11-29T14:45', 'depart': '2029-12-08T20:45', 'ap_days': 21, 'ticket_within_h': 72}, 'FAIL_AP']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-16T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 26}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:10', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:52', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-03-02T18:30', 'ticket': '2029-03-05T19:00', 'depart': '2029-03-14T02:00', 'ap_days': 14, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 2', {'res': '2028-11-19T00:15', 'ticket': '2028-11-20T00:15', 'depart': '2028-12-13T04:15', 'ap_days': 7, 'ticket_within_h': 24}, 'PASS'], ['sampled case 3', {'res': '2028-08-13T05:15', 'ticket': '2028-08-13T20:45', 'depart': '2028-08-18T10:45', 'ap_days': 3, 'ticket_within_h': 72}, 'PASS'], ['regression: advance purchase day counting', {'res': '2028-09-13T18:15', 'ticket': '2028-09-16T18:15', 'depart': '2028-09-19T01:15', 'ap_days': 3, 'ticket_within_h': 48}, 'FAIL_TKT_TL']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-17T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 27}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:15', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:53', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 72}, 'FAIL_AP'], ['sampled case 1', {'res': '2028-01-07T10:45', 'ticket': '2028-01-10T11:15', 'depart': '2028-01-27T06:15', 'ap_days': 14, 'ticket_within_h': 72}, 'FAIL_TKT_TL'], ['sampled case 2', {'res': '2027-11-20T22:00', 'ticket': '2027-11-23T02:00', 'depart': '2027-12-12T09:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_AP'], ['sampled case 3', {'res': '2029-01-16T10:15', 'ticket': '2029-01-17T10:45', 'depart': '2029-02-13T03:45', 'ap_days': 14, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2027-04-21T10:15', 'ticket': '2027-04-22T04:15', 'depart': '2027-05-05T17:15', 'ap_days': 14, 'ticket_within_h': 48}, 'FAIL_AP']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-18T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 28}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:20', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:54', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 96}, 'FAIL_AP'], ['sampled case 1', {'res': '2028-04-10T05:15', 'ticket': '2028-04-13T05:15', 'depart': '2028-04-21T10:15', 'ap_days': 14, 'ticket_within_h': 48}, 'FAIL_AP'], ['sampled case 2', {'res': '2029-06-06T12:45', 'ticket': '2029-06-09T12:45', 'depart': '2029-07-06T08:45', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['sampled case 3', {'res': '2029-10-21T12:00', 'ticket': '2029-10-24T12:00', 'depart': '2029-11-15T19:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2029-10-17T03:30', 'ticket': '2029-10-18T22:30', 'depart': '2029-11-08T01:30', 'ap_days': 21, 'ticket_within_h': 48}, 'PASS']], [['late evening ticket, early departure', {'res': '2027-03-01T09:00', 'ticket': '2027-03-01T22:30', 'depart': '2027-03-19T06:00', 'ap_days': 14, 'ticket_within_h': 24}, 'PASS'], ['exactly AP days', {'res': '2027-05-10T10:00', 'ticket': '2027-05-10T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 29}, 'PASS'], ['one day short', {'res': '2027-05-10T10:00', 'ticket': '2027-05-11T11:00', 'depart': '2027-05-17T08:00', 'ap_days': 7, 'ticket_within_h': 48}, 'FAIL_AP'], ['ticketed at exact time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-02T08:00', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'PASS'], ['ticketed after time limit', {'res': '2027-06-01T08:00', 'ticket': '2027-06-03T09:25', 'depart': '2027-07-01T08:00', 'ap_days': 21, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['ticket before reservation', {'res': '2027-06-01T08:00', 'ticket': '2027-06-01T07:55', 'depart': '2027-07-01T08:00', 'ap_days': 3, 'ticket_within_h': 24}, 'ERR_ORDER'], ['AP and time limit both fail', {'res': '2027-08-01T08:00', 'ticket': '2027-08-05T08:00', 'depart': '2027-08-08T08:00', 'ap_days': 7, 'ticket_within_h': 120}, 'FAIL_AP'], ['sampled case 1', {'res': '2029-04-07T13:45', 'ticket': '2029-04-08T19:15', 'depart': '2029-04-19T08:15', 'ap_days': 3, 'ticket_within_h': 48}, 'PASS'], ['sampled case 2', {'res': '2027-04-03T07:45', 'ticket': '2027-04-05T08:15', 'depart': '2027-05-01T01:15', 'ap_days': 3, 'ticket_within_h': 48}, 'FAIL_TKT_TL'], ['sampled case 3', {'res': '2029-01-24T00:30', 'ticket': '2029-01-25T01:00', 'depart': '2029-02-11T22:00', 'ap_days': 7, 'ticket_within_h': 24}, 'FAIL_TKT_TL'], ['regression: advance purchase day counting', {'res': '2029-02-06T01:45', 'ticket': '2029-02-07T01:45', 'depart': '2029-02-13T20:45', 'ap_days': 7, 'ticket_within_h': 72}, 'FAIL_AP']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-airline-fare-rules-advance-purchase-ap-elapsed-periods","generated_at":"2026-09-29T14:47:42.651864+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Advance purchase rules count calendar days, not elapsed 24-hour periods, and interact with a separate ticketing time limit after booking.","root_cause":"The day count uses the full datetime difference, so time-of-day eats into the final calendar day.","sha256":"f9f61ff7cd4efee3e67e8cb23f4a1714f9b48cf461ede8017a2ebe91aa0368ff","title":"Advance purchase measured in elapsed 24-hour periods · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":49.879,"exit_code":1,"observations":[{"actual":"FAIL_AP","check":"late evening ticket, early departure","expected":"PASS","passed":false},{"actual":"PASS","check":"exactly AP days","expected":"PASS","passed":true},{"actual":"FAIL_AP","check":"one day short","expected":"FAIL_AP","passed":true},{"actual":"PASS","check":"ticketed at exact time limit","expected":"PASS","passed":true},{"actual":"FAIL_TKT_TL","check":"ticketed after time limit","expected":"FAIL_TKT_TL","passed":true},{"actual":"ERR_ORDER","check":"ticket before reservation","expected":"ERR_ORDER","passed":true},{"actual":"FAIL_AP","check":"AP and time limit both fail","expected":"FAIL_AP","passed":true},{"actual":"FAIL_AP","check":"sampled case 1","expected":"FAIL_AP","passed":true},{"actual":"PASS","check":"sampled case 2","expected":"PASS","passed":true},{"actual":"FAIL_AP","check":"sampled case 3","expected":"FAIL_AP","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"late evening ticket, early departure\", \"actual\": \"FAIL_AP\", \"expected\": \"PASS\", \"passed\": false}, {\"check\": \"exactly AP days\", \"actual\": \"PASS\", \"expected\": \"PASS\", \"passed\": true}, {\"check\": \"one day short\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"ticketed at exact time limit\", \"actual\": \"PASS\", \"expected\": \"PASS\", \"passed\": true}, {\"check\": \"ticketed after time limit\", \"actual\": \"FAIL_TKT_TL\", \"expected\": \"FAIL_TKT_TL\", \"passed\": true}, {\"check\": \"ticket before reservation\", \"actual\": \"ERR_ORDER\", \"expected\": \"ERR_ORDER\", \"passed\": true}, {\"check\": \"AP and time limit both fail\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"sampled case 1\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"sampled case 2\", \"actual\": \"PASS\", \"expected\": \"PASS\", \"passed\": true}, {\"check\": \"sampled case 3\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.46,"exit_code":1,"observations":[{"actual":"FAIL_AP","check":"late evening ticket, early departure","expected":"PASS","passed":false},{"actual":"FAIL_AP","check":"exactly AP days","expected":"PASS","passed":false},{"actual":"FAIL_AP","check":"one day short","expected":"FAIL_AP","passed":true},{"actual":"PASS","check":"ticketed at exact time limit","expected":"PASS","passed":true},{"actual":"FAIL_TKT_TL","check":"ticketed after time limit","expected":"FAIL_TKT_TL","passed":true},{"actual":"ERR_ORDER","check":"ticket before reservation","expected":"ERR_ORDER","passed":true},{"actual":"FAIL_AP","check":"AP and time limit both fail","expected":"FAIL_AP","passed":true},{"actual":"FAIL_AP","check":"sampled case 1","expected":"FAIL_AP","passed":true},{"actual":"PASS","check":"sampled case 2","expected":"PASS","passed":true},{"actual":"FAIL_AP","check":"sampled case 3","expected":"FAIL_AP","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"late evening ticket, early departure\", \"actual\": \"FAIL_AP\", \"expected\": \"PASS\", \"passed\": false}, {\"check\": \"exactly AP days\", \"actual\": \"FAIL_AP\", \"expected\": \"PASS\", \"passed\": false}, {\"check\": \"one day short\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"ticketed at exact time limit\", \"actual\": \"PASS\", \"expected\": \"PASS\", \"passed\": true}, {\"check\": \"ticketed after time limit\", \"actual\": \"FAIL_TKT_TL\", \"expected\": \"FAIL_TKT_TL\", \"passed\": true}, {\"check\": \"ticket before reservation\", \"actual\": \"ERR_ORDER\", \"expected\": \"ERR_ORDER\", \"passed\": true}, {\"check\": \"AP and time limit both fail\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"sampled case 1\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}, {\"check\": \"sampled case 2\", \"actual\": \"PASS\", \"expected\": \"PASS\", \"passed\": true}, {\"check\": \"sampled case 3\", \"actual\": \"FAIL_AP\", \"expected\": \"FAIL_AP\", \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}