FAILURE MAP
← Case archive

FA-95351 / Shipping rate zone lookup / Open access

Zone chart: last ZIP3 of a range unmatched · case 01

Destinations on the last ZIP3 of a chart row fall to a wider row or NO_ZONE.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The chart row upper bound is treated as exclusive.

VERIFIED REPAIR

Match ZIP3 values within lo and hi inclusive.

Unsuccessful approach: Making the lower bound exclusive instead loses the first ZIP3 of every 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 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 = [[['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], ['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], ['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], ['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'], ['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], ['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 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 19', ['\t20000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 68', ['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 33', ['20000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 13', ['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 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 29', ['02134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 37', ['\t21000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2]], [['generated mix 46', ['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 57', ['15000-1234', [[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], ['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 48', ['10001', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]]]
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 fixtureActualExpectedOutcome
range upper edgeNO_ZONE5Failed
padded77Passed
zip plus four44Passed
nested narrowest66Passed
equal width higher zone first99Passed
lettersINVALIDINVALIDPassed
lost leading zero88Passed
generated mix 5INVALIDINVALIDPassed

SHA-256 / 9b84cdb66a252d67bb7fc90b19dee5f525ec1a78dba35f4721de080d1f2004ba

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 = [[['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], ['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], ['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], ['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'], ['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], ['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 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 19', ['\t20000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 68', ['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 33', ['20000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 13', ['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 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 29', ['02134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 37', ['\t21000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2]], [['generated mix 46', ['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 57', ['15000-1234', [[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], ['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 48', ['10001', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]]]
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 fixtureActualExpectedOutcome
range upper edge55Passed
paddedNO_ZONE7Failed
zip plus four54Failed
nested narrowest66Passed
equal width higher zone first99Passed
lettersINVALIDINVALIDPassed
lost leading zero88Passed
generated mix 5INVALIDINVALIDPassed

SHA-256 / cef98995add9e359e38213f6e43cc6e51f78ee4d9a2c49c05431f4eaf68d5d39

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 = [[['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], ['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], ['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], ['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'], ['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], ['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 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 19', ['\t20000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 68', ['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 33', ['20000', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 3], ['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 13', ['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 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 29', ['02134', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 8], ['generated mix 37', ['\t21000\n', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 2]], [['generated mix 46', ['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 57', ['15000-1234', [[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], ['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 48', ['10001', [[5, 99, 8], [100, 199, 5], [150, 159, 4], [200, 299, 3], [210, 219, 2], [215, 219, 6], [300, 399, 7]]], 5]]]
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 fixtureActualExpectedOutcome
range upper edge55Passed
padded77Passed
zip plus four44Passed
nested narrowest66Passed
equal width higher zone first99Passed
lettersINVALIDINVALIDPassed
lost leading zero88Passed
generated mix 5INVALIDINVALIDPassed

SHA-256 / 7f219d28c004184eecc83450b81f64d6a81eb42ff275a6f6d80d5b021843b0cb

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.954431+00:00.

Case digest / 622a4d047e4f185f47105471f5cb64eb6245ab22c64e23f82a8712c71874654f