FA-95451 / Shipping rate zone lookup / Open access
Surcharges: declared value missing from total · case 01
The shipment total omits the declared value fee shown on the same quote.
ROOT CAUSE
The total sums the fuel-subject charges and fuel but not the declared value fee.
VERIFIED REPAIR
Total = base + accessorials + fuel + declared value fee.
Unsuccessful approach: Summing only base, fuel and declared value drops residential and area fees.
Case contract
Cents. Residential 550; delivery area DAS 395 or EXT 510, plus 100 when the delivery is residential. Fuel = fuel_bp basis points of (base + residential + delivery area), rounded half up to the cent. Declared value (whole dollars): first $100 free, then 105 cents per $100 or part. Return [fuel, declared_value_fee, total].
Why this case matters
Accessorials and fuel are layered on the zone rate in a fixed order.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
res = 550 if residential else 0
das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
if residential and das != 'NONE':
das_fee += 100
subject = base + res + das_fee
fuel = (subject * fuel_bp + 5000) // 10000
excess = max(0, declared - 100)
dv = -(-excess // 100) * 105
return [fuel, dv, subject + fuel]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['generated mix 5', [1234, False, 'DAS', 150, 1250], [204, 105, 1938]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 19', [1000, False, 'DAS', 50, 1500], [209, 0, 1604]]], [['generated mix 25', [2000, True, 'EXT', 1000, 1850], [585, 945, 4690]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 30', [2345, False, 'DAS', 250, 1250], [343, 210, 3293]]], [['generated mix 36', [2000, False, 'NONE', 150, 1250], [250, 105, 2355]], ['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 32', [2000, False, 'DAS', 100, 1625], [389, 0, 2784]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 45', [1234, False, 'NONE', 101, 1850], [228, 105, 1567]], ['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 43', [1000, True, 'EXT', 1000, 1625], [351, 945, 3456]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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 |
|---|---|---|---|
| declared part hundred | [200, 105, 2200] | [200, 105, 2305] | Failed |
| residential ext uplift | [216, 0, 2376] | [216, 0, 2376] | Passed |
| commercial das | [209, 0, 1604] | [209, 0, 1604] | Passed |
| fuel exact half | [127, 0, 1139] | [127, 0, 1139] | Passed |
| declared 250 | [255, 210, 2805] | [255, 210, 3015] | Failed |
| half cent up | [125, 0, 1125] | [125, 0, 1125] | Passed |
| declared exactly 100 | [200, 0, 2200] | [200, 0, 2200] | Passed |
| generated mix 8 | [204, 105, 1833] | [204, 105, 1938] | Failed |
SHA-256 / 7e4d525bbe4fe763e715d53bb72b2654c1537fe169424a770f6ea801d04d49e2
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
res = 550 if residential else 0
das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
if residential and das != 'NONE':
das_fee += 100
subject = base + res + das_fee
fuel = (subject * fuel_bp + 5000) // 10000
excess = max(0, declared - 100)
dv = -(-excess // 100) * 105
return [fuel, dv, base + fuel + dv]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['generated mix 5', [1234, False, 'DAS', 150, 1250], [204, 105, 1938]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 19', [1000, False, 'DAS', 50, 1500], [209, 0, 1604]]], [['generated mix 25', [2000, True, 'EXT', 1000, 1850], [585, 945, 4690]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 30', [2345, False, 'DAS', 250, 1250], [343, 210, 3293]]], [['generated mix 36', [2000, False, 'NONE', 150, 1250], [250, 105, 2355]], ['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 32', [2000, False, 'DAS', 100, 1625], [389, 0, 2784]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 45', [1234, False, 'NONE', 101, 1850], [228, 105, 1567]], ['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 43', [1000, True, 'EXT', 1000, 1625], [351, 945, 3456]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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 |
|---|---|---|---|
| declared part hundred | [200, 105, 2305] | [200, 105, 2305] | Passed |
| residential ext uplift | [216, 0, 1216] | [216, 0, 2376] | Failed |
| commercial das | [209, 0, 1209] | [209, 0, 1604] | Failed |
| fuel exact half | [127, 0, 1139] | [127, 0, 1139] | Passed |
| declared 250 | [255, 210, 2465] | [255, 210, 3015] | Failed |
| half cent up | [125, 0, 1125] | [125, 0, 1125] | Passed |
| declared exactly 100 | [200, 0, 2200] | [200, 0, 2200] | Passed |
| generated mix 8 | [204, 105, 1543] | [204, 105, 1938] | Failed |
SHA-256 / 0d9fed4078ef7e6f2e5d5d7442b62569bc44898db4b526eb9531dee1b654d8bb
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
res = 550 if residential else 0
das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
if residential and das != 'NONE':
das_fee += 100
subject = base + res + das_fee
fuel = (subject * fuel_bp + 5000) // 10000
excess = max(0, declared - 100)
dv = -(-excess // 100) * 105
return [fuel, dv, subject + fuel + dv]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['generated mix 5', [1234, False, 'DAS', 150, 1250], [204, 105, 1938]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 19', [1000, False, 'DAS', 50, 1500], [209, 0, 1604]]], [['generated mix 25', [2000, True, 'EXT', 1000, 1850], [585, 945, 4690]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 30', [2345, False, 'DAS', 250, 1250], [343, 210, 3293]]], [['generated mix 36', [2000, False, 'NONE', 150, 1250], [250, 105, 2355]], ['generated mix 15', [2000, False, 'DAS', 101, 1625], [389, 105, 2889]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 32', [2000, False, 'DAS', 100, 1625], [389, 0, 2784]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 45', [1234, False, 'NONE', 101, 1850], [228, 105, 1567]], ['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 43', [1000, True, 'EXT', 1000, 1625], [351, 945, 3456]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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 |
|---|---|---|---|
| declared part hundred | [200, 105, 2305] | [200, 105, 2305] | Passed |
| residential ext uplift | [216, 0, 2376] | [216, 0, 2376] | Passed |
| commercial das | [209, 0, 1604] | [209, 0, 1604] | Passed |
| fuel exact half | [127, 0, 1139] | [127, 0, 1139] | Passed |
| declared 250 | [255, 210, 3015] | [255, 210, 3015] | Passed |
| half cent up | [125, 0, 1125] | [125, 0, 1125] | Passed |
| declared exactly 100 | [200, 0, 2200] | [200, 0, 2200] | Passed |
| generated mix 8 | [204, 105, 1938] | [204, 105, 1938] | Passed |
SHA-256 / d5e6d81a657f76bfc2a5f3f8811edba777c3dafa0faa4f65175bc6759332e881
Verification & scope
Stipulated fee amounts and ordering. 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:52:13.761691+00:00.
Case digest / 4b6c0ddd451d2c860094778a164b9de1017fb69c1092d062a724fd0c1ca45b96