FA-95356 / Shipping rate zone lookup / Open access
Zone chart: broad row shadows exception row · case 01
A ZIP3 carved out as an exception row is rated with the broad surrounding row.
ROOT CAUSE
The first matching row wins instead of the narrowest.
VERIFIED REPAIR
Prefer the narrowest matching range; keep the earliest on equal width.
Unsuccessful approach: Preferring the widest range always picks the broad row.
Case contract
dest is a ZIP string with optional surrounding whitespace, optionally ZIP+4 ("12345-6789"), or a 4-digit ZIP whose leading zero was lost (left-pad one zero). chart [[lo3, hi3, zone]] inclusive ZIP3 ranges; the narrowest matching range wins, earliest listed on equal width. Malformed -> "INVALID"; no match -> "NO_ZONE".
Why this case matters
Carrier zone charts map origin to destination ZIP3 ranges, the first step of rating.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dest, chart):
z = dest.strip()
if len(z) == 10 and z[5] == '-' and z[6:].isdecimal():
z = z[:5]
if len(z) == 4 and z.isdecimal():
z = '0' + z
if len(z) != 5 or not z.isdecimal():
return 'INVALID'
p = int(z[:3])
best = None
for lo, hi, zone in chart:
if lo <= p <= hi:
if best is None:
best = (lo, hi, zone)
return best[2] if best else 'NO_ZONE'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 5', ['40000-12a4', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 20', ['21500-1234', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 18', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['letters', ['123AB', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID'], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['generated mix 6', ['22000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['generated mix 14', ['14999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 42', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 32', ['15999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 17', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 25', ['15999-123', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['generated mix 28', [' 09999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 36', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 77', ['21999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['generated mix 39', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4]]]
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 |
|---|---|---|---|
| zip plus four | 5 | 4 | Failed |
| nested narrowest | 3 | 6 | Failed |
| lost leading zero | 8 | 8 | Passed |
| equal width first listed | 2 | 2 | Passed |
| equal width plus four | 1 | 7 | Failed |
| outside chart | NO_ZONE | NO_ZONE | Passed |
| range upper edge | 5 | 5 | Passed |
| generated mix 5 | INVALID | INVALID | Passed |
SHA-256 / 1d50df3898e2894060c771e0b0d01a2f35dd8668d4d74db162a55a82e4481f6c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dest, chart):
z = dest.strip()
if len(z) == 10 and z[5] == '-' and z[6:].isdecimal():
z = z[:5]
if len(z) == 4 and z.isdecimal():
z = '0' + z
if len(z) != 5 or not z.isdecimal():
return 'INVALID'
p = int(z[:3])
best = None
for lo, hi, zone in chart:
if lo <= p <= hi:
if best is None or (hi - lo) > (best[1] - best[0]):
best = (lo, hi, zone)
return best[2] if best else 'NO_ZONE'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 5', ['40000-12a4', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 20', ['21500-1234', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 18', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['letters', ['123AB', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID'], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['generated mix 6', ['22000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['generated mix 14', ['14999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 42', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 32', ['15999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 17', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 25', ['15999-123', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['generated mix 28', [' 09999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 36', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 77', ['21999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['generated mix 39', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4]]]
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 |
|---|---|---|---|
| zip plus four | 5 | 4 | Failed |
| nested narrowest | 3 | 6 | Failed |
| lost leading zero | 8 | 8 | Passed |
| equal width first listed | 2 | 2 | Passed |
| equal width plus four | 1 | 7 | Failed |
| outside chart | NO_ZONE | NO_ZONE | Passed |
| range upper edge | 5 | 5 | Passed |
| generated mix 5 | INVALID | INVALID | Passed |
SHA-256 / f82575f3cb21cf2045dcaeadba782e6576d8a8aa13fa7a789118b09cd7031e81
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dest, chart):
z = dest.strip()
if len(z) == 10 and z[5] == '-' and z[6:].isdecimal():
z = z[:5]
if len(z) == 4 and z.isdecimal():
z = '0' + z
if len(z) != 5 or not z.isdecimal():
return 'INVALID'
p = int(z[:3])
best = None
for lo, hi, zone in chart:
if lo <= p <= hi:
if best is None or (hi - lo) < (best[1] - best[0]):
best = (lo, hi, zone)
return best[2] if best else 'NO_ZONE'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 5', ['40000-12a4', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 20', ['21500-1234', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 18', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['letters', ['123AB', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID'], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['generated mix 6', ['22000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['generated mix 14', ['14999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 42', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 32', ['15999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['zip plus four', ['15012-3456', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 17', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 25', ['15999-123', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'INVALID']], [['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4], ['padded', [' 30001\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 7], ['lost leading zero', ['2134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['nested narrowest', ['21700', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['equal width higher zone first', ['21600', [[210, 219, 9], [215, 224, 2]]], 9], ['generated mix 28', [' 09999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 36', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]], [['generated mix 77', ['21999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 6], ['generated mix 56', ['21499', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2], ['range upper edge', ['19999', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['equal width first listed', ['21500', [[210, 219, 2], [215, 224, 9]]], 2], ['equal width plus four', ['21999-0001', [[200, 299, 1], [210, 219, 7], [215, 224, 3]]], 7], ['outside chart', ['40000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 'NO_ZONE'], ['generated mix 39', ['16000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5], ['generated mix 47', ['15000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 4]]]
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 |
|---|---|---|---|
| zip plus four | 4 | 4 | Passed |
| nested narrowest | 6 | 6 | Passed |
| lost leading zero | 8 | 8 | Passed |
| equal width first listed | 2 | 2 | Passed |
| equal width plus four | 7 | 7 | Passed |
| outside chart | NO_ZONE | NO_ZONE | Passed |
| range upper edge | 5 | 5 | Passed |
| generated mix 5 | INVALID | INVALID | Passed |
SHA-256 / 4f1a21204228599c5d5da87aa6649ed964b63c7a8f1605d45263bd32a6a4609e
Verification & scope
Stipulated chart rows and input normalization; not a carrier-published chart. 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:12.989273+00:00.
Case digest / ef5c1401b34ec59895d22c216f0a9cd54af343839e4cb282a7062dee88986f4c