FA-66801 / Airline fare rule evaluation / Open access
Bag of exactly 23 kg charged as overweight · case 01
A bag weighing exactly the free weight limit incurs the 100 surcharge.
ROOT CAUSE
The overweight test includes the 23 kg limit.
VERIFIED REPAIR
Surcharge only bags heavier than 23 kg.
Unsuccessful approach: Rounding to whole kilograms lets 23.4 kg bags escape the surcharge.
Case contract
Input {'bags':[kg in check-in order],'allowance','elite'}. Any bag over 32 kg -> 'ERR_OVERWEIGHT_<i>' (first, zero-based). Free bags = allowance + 1 if elite, applied to the first bags. Base fee by overall bag position: 1st 30, 2nd 40, 3rd and later 150 (only for bags beyond the free count). Each bag over 23 kg adds 100, free or not. Return total.
Why this case matters
Baggage rules in fare families combine piece allowances, status benefits, position-based piece charges and weight surcharges.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
for i, kg in enumerate(x['bags']):
if kg > 32: return 'ERR_OVERWEIGHT_%d' % i
free = x['allowance'] + (1 if x['elite'] else 0)
sched = [30, 40]
total = 0
for pos, kg in enumerate(x['bags'], 1):
if pos > free:
total += sched[pos - 1] if pos <= len(sched) else 150
if kg >= 23:
total += 100
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basic fare three bags', {'bags': [20.0, 18.5, 22.1], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [28.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.2], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [23.3, 23.3], 'allowance': 0, 'elite': False}, 270], ['sampled case 2', {'bags': [23.0], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [23.3, 11.4, 20.9, 8.6], 'allowance': 2, 'elite': False}, 400]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.2], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [29.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.300000000000004], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [], 'allowance': 0, 'elite': True}, 0], ['sampled case 2', {'bags': [18.6, 32.0, 22.6], 'allowance': 2, 'elite': False}, 250], ['sampled case 3', {'bags': [18.1, 23.0, 32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 720]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.3], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [30.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.4], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 0], ['sampled case 1', {'bags': [32.0], 'allowance': 2, 'elite': True}, 100], ['sampled case 2', {'bags': [32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 420], ['sampled case 3', {'bags': [], 'allowance': 1, 'elite': False}, 0]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.4], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [31.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.5], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [32.0, 32.0, 32.0, 23.3, 23.3], 'allowance': 0, 'elite': False}, 1020], ['sampled case 2', {'bags': [], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [20.4, 23.3], 'allowance': 1, 'elite': True}, 100]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.5], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [32.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.6], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [31.9, 23.3, 22.9, 32.0], 'allowance': 0, 'elite': False}, 670], ['sampled case 2', {'bags': [23.3, 32.0, 32.0, 23.0], 'allowance': 1, 'elite': True}, 600], ['sampled case 3', {'bags': [7.7, 32.0], 'allowance': 2, 'elite': True}, 100]]]
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 |
|---|---|---|---|
| basic fare three bags | 220 | 220 | Passed |
| one free bag two paid | 290 | 190 | Failed |
| elite extra bag | 300 | 300 | Passed |
| heavy free bag | 140 | 140 | Passed |
| exactly hard limit | 270 | 270 | Passed |
| over hard limit | ERR_OVERWEIGHT_1 | ERR_OVERWEIGHT_1 | Passed |
| elite with two allowance | 550 | 150 | Failed |
| sampled case 1 | 270 | 270 | Passed |
| sampled case 2 | 100 | 0 | Failed |
| sampled case 3 | 400 | 400 | Passed |
SHA-256 / a27d4940fa59124cdc9cdb737a6ab834fdcd950ee667b960dedc36ace4ada988
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
for i, kg in enumerate(x['bags']):
if kg > 32: return 'ERR_OVERWEIGHT_%d' % i
free = x['allowance'] + (1 if x['elite'] else 0)
sched = [30, 40]
total = 0
for pos, kg in enumerate(x['bags'], 1):
if pos > free:
total += sched[pos - 1] if pos <= len(sched) else 150
if round(kg) > 23:
total += 100
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basic fare three bags', {'bags': [20.0, 18.5, 22.1], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [28.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.2], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [23.3, 23.3], 'allowance': 0, 'elite': False}, 270], ['sampled case 2', {'bags': [23.0], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [23.3, 11.4, 20.9, 8.6], 'allowance': 2, 'elite': False}, 400]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.2], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [29.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.300000000000004], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [], 'allowance': 0, 'elite': True}, 0], ['sampled case 2', {'bags': [18.6, 32.0, 22.6], 'allowance': 2, 'elite': False}, 250], ['sampled case 3', {'bags': [18.1, 23.0, 32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 720]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.3], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [30.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.4], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 0], ['sampled case 1', {'bags': [32.0], 'allowance': 2, 'elite': True}, 100], ['sampled case 2', {'bags': [32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 420], ['sampled case 3', {'bags': [], 'allowance': 1, 'elite': False}, 0]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.4], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [31.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.5], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [32.0, 32.0, 32.0, 23.3, 23.3], 'allowance': 0, 'elite': False}, 1020], ['sampled case 2', {'bags': [], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [20.4, 23.3], 'allowance': 1, 'elite': True}, 100]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.5], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [32.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.6], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [31.9, 23.3, 22.9, 32.0], 'allowance': 0, 'elite': False}, 670], ['sampled case 2', {'bags': [23.3, 32.0, 32.0, 23.0], 'allowance': 1, 'elite': True}, 600], ['sampled case 3', {'bags': [7.7, 32.0], 'allowance': 2, 'elite': True}, 100]]]
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 |
|---|---|---|---|
| basic fare three bags | 220 | 220 | Passed |
| one free bag two paid | 190 | 190 | Passed |
| elite extra bag | 300 | 300 | Passed |
| heavy free bag | 140 | 140 | Passed |
| exactly hard limit | 170 | 270 | Failed |
| over hard limit | ERR_OVERWEIGHT_1 | ERR_OVERWEIGHT_1 | Passed |
| elite with two allowance | 150 | 150 | Passed |
| sampled case 1 | 70 | 270 | Failed |
| sampled case 2 | 0 | 0 | Passed |
| sampled case 3 | 300 | 400 | Failed |
SHA-256 / c1d6fce3a1eca044f95a622ba549e08992d773edcca2ad0446b2b7d791e09d36
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
for i, kg in enumerate(x['bags']):
if kg > 32: return 'ERR_OVERWEIGHT_%d' % i
free = x['allowance'] + (1 if x['elite'] else 0)
sched = [30, 40]
total = 0
for pos, kg in enumerate(x['bags'], 1):
if pos > free:
total += sched[pos - 1] if pos <= len(sched) else 150
if kg > 23:
total += 100
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basic fare three bags', {'bags': [20.0, 18.5, 22.1], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [28.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.2], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [23.3, 23.3], 'allowance': 0, 'elite': False}, 270], ['sampled case 2', {'bags': [23.0], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [23.3, 11.4, 20.9, 8.6], 'allowance': 2, 'elite': False}, 400]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.2], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [29.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.300000000000004], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [], 'allowance': 0, 'elite': True}, 0], ['sampled case 2', {'bags': [18.6, 32.0, 22.6], 'allowance': 2, 'elite': False}, 250], ['sampled case 3', {'bags': [18.1, 23.0, 32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 720]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.3], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [30.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.4], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 0], ['sampled case 1', {'bags': [32.0], 'allowance': 2, 'elite': True}, 100], ['sampled case 2', {'bags': [32.0, 23.3, 23.0], 'allowance': 0, 'elite': False}, 420], ['sampled case 3', {'bags': [], 'allowance': 1, 'elite': False}, 0]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.4], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [31.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.5], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 150], ['sampled case 1', {'bags': [32.0, 32.0, 32.0, 23.3, 23.3], 'allowance': 0, 'elite': False}, 1020], ['sampled case 2', {'bags': [], 'allowance': 1, 'elite': False}, 0], ['sampled case 3', {'bags': [20.4, 23.3], 'allowance': 1, 'elite': True}, 100]], [['basic fare three bags', {'bags': [20.0, 18.5, 22.5], 'allowance': 0, 'elite': False}, 220], ['one free bag two paid', {'bags': [23.0, 21.0, 15.0], 'allowance': 1, 'elite': False}, 190], ['elite extra bag', {'bags': [19.0, 22.0, 20.0, 12.0], 'allowance': 1, 'elite': True}, 300], ['heavy free bag', {'bags': [32.0, 10.0], 'allowance': 1, 'elite': False}, 140], ['exactly hard limit', {'bags': [32.0, 23.4], 'allowance': 0, 'elite': False}, 270], ['over hard limit', {'bags': [20.0, 32.6], 'allowance': 2, 'elite': True}, 'ERR_OVERWEIGHT_1'], ['elite with two allowance', {'bags': [23.0, 23.0, 23.0, 23.0, 23.0], 'allowance': 2, 'elite': True}, 300], ['sampled case 1', {'bags': [31.9, 23.3, 22.9, 32.0], 'allowance': 0, 'elite': False}, 670], ['sampled case 2', {'bags': [23.3, 32.0, 32.0, 23.0], 'allowance': 1, 'elite': True}, 600], ['sampled case 3', {'bags': [7.7, 32.0], 'allowance': 2, 'elite': True}, 100]]]
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 |
|---|---|---|---|
| basic fare three bags | 220 | 220 | Passed |
| one free bag two paid | 190 | 190 | Passed |
| elite extra bag | 300 | 300 | Passed |
| heavy free bag | 140 | 140 | Passed |
| exactly hard limit | 270 | 270 | Passed |
| over hard limit | ERR_OVERWEIGHT_1 | ERR_OVERWEIGHT_1 | Passed |
| elite with two allowance | 150 | 150 | Passed |
| sampled case 1 | 270 | 270 | Passed |
| sampled case 2 | 0 | 0 | Passed |
| sampled case 3 | 400 | 400 | Passed |
SHA-256 / 7b029ecc83ee8ed6d85bdbd34c5a87dd8bb519b8bd5c19a826ccde10937c9fbf
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:46.929931+00:00.
Case digest / a7f4bbb591ca78a529e8abc8338ecb0e20db16983ea0ed41c49f516f54517e56