FA-96156 / Postal address normalization / Open access
Delivery point check digit: digits after a hyphen join the house number · case 01
"12-4" gives delivery point 24 instead of 12.
ROOT CAUSE
The scan skips non-digits instead of stopping at the first one.
THE FAILURE
The scan skips non-digits instead of stopping at the first one.
Unsuccessful approach: Stopping only at letters still merges digits across a hyphen.
Case contract
Input [zip5, plus4, primary]. The delivery point is the last two of the leading digits of the primary number, zero-padded to two, or "99" when there are none. With a plus-four the digit string is zip5 + plus4 + delivery point, otherwise zip5 alone. Append the check digit (10 - digit sum mod 10) mod 10.
Why this case matters
A wrong delivery point or check digit sends machine-sorted mail to the wrong door or rejects it.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
zip5, plus4, primary = x
lead = ''
for c in primary:
if not c.isdigit():
continue
lead += c
dp = lead[-2:].zfill(2) if lead else '99'
digits = zip5 + plus4 + dp if plus4 else zip5
check = (10 - sum(int(c) for c in digits) % 10) % 10
return digits + str(check)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['three-digit house number', ['12341', '6789', '123'], '123416789234'], ['four-digit house number', ['12341', '6789', '4567'], '123416789676'], ['one-digit house number is padded', ['12341', '6789', '7'], '123416789072'], ['no house digits uses the default', ['12341', '6789', 'RR'], '123416789991'], ['hyphenated house number stops at the hyphen', ['12341', '6789', '12-4'], '123416789126'], ['five-digit code has no delivery point', ['12341', '', '123'], '123419'], ['digit sum already a multiple of ten', ['19000', '0000', '300'], '190000000000']], [['three-digit house number', ['23442', '6789', '123'], '234426789230'], ['four-digit house number', ['23442', '6789', '4567'], '234426789672'], ['one-digit house number is padded', ['23442', '6789', '7'], '234426789078'], ['no house digits uses the default', ['23442', '6789', 'RR'], '234426789997'], ['hyphenated house number stops at the hyphen', ['23442', '6789', '12-4'], '234426789122'], ['five-digit code has no delivery point', ['23442', '', '123'], '234425'], ['digit sum already a multiple of ten', ['28000', '0000', '300'], '280000000000']], [['three-digit house number', ['34543', '6789', '123'], '345436789236'], ['four-digit house number', ['34543', '6789', '4567'], '345436789678'], ['one-digit house number is padded', ['34543', '6789', '7'], '345436789074'], ['no house digits uses the default', ['34543', '6789', 'RR'], '345436789993'], ['hyphenated house number stops at the hyphen', ['34543', '6789', '12-4'], '345436789128'], ['five-digit code has no delivery point', ['34543', '', '123'], '345431'], ['digit sum already a multiple of ten', ['37000', '0000', '300'], '370000000000']], [['three-digit house number', ['45644', '6789', '123'], '456446789232'], ['four-digit house number', ['45644', '6789', '4567'], '456446789674'], ['one-digit house number is padded', ['45644', '6789', '7'], '456446789070'], ['no house digits uses the default', ['45644', '6789', 'RR'], '456446789999'], ['hyphenated house number stops at the hyphen', ['45644', '6789', '12-4'], '456446789124'], ['five-digit code has no delivery point', ['45644', '', '123'], '456447'], ['digit sum already a multiple of ten', ['46000', '0000', '300'], '460000000000']], [['three-digit house number', ['56745', '6789', '123'], '567456789238'], ['four-digit house number', ['56745', '6789', '4567'], '567456789670'], ['one-digit house number is padded', ['56745', '6789', '7'], '567456789076'], ['no house digits uses the default', ['56745', '6789', 'RR'], '567456789995'], ['hyphenated house number stops at the hyphen', ['56745', '6789', '12-4'], '567456789120'], ['five-digit code has no delivery point', ['56745', '', '123'], '567453'], ['digit sum already a multiple of ten', ['55000', '0000', '300'], '550000000000']]]
for label, arg, expected in fixtures[N - 1]:
check(label, solve(arg), 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 |
|---|---|---|---|
| three-digit house number | 123416789234 | 123416789234 | Passed |
| four-digit house number | 123416789676 | 123416789676 | Passed |
| one-digit house number is padded | 123416789072 | 123416789072 | Passed |
| no house digits uses the default | 123416789991 | 123416789991 | Passed |
| hyphenated house number stops at the hyphen | 123416789243 | 123416789126 | Failed |
| five-digit code has no delivery point | 123419 | 123419 | Passed |
| digit sum already a multiple of ten | 190000000000 | 190000000000 | Passed |
SHA-256 / 42beec7916d58ca6bb83dab4e8dd9d9f1a7c72aa8af6a9aac6ad53728f48e198
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
zip5, plus4, primary = x
lead = ''
for c in primary:
if c.isalpha():
break
lead += c if c.isdigit() else ''
dp = lead[-2:].zfill(2) if lead else '99'
digits = zip5 + plus4 + dp if plus4 else zip5
check = (10 - sum(int(c) for c in digits) % 10) % 10
return digits + str(check)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['three-digit house number', ['12341', '6789', '123'], '123416789234'], ['four-digit house number', ['12341', '6789', '4567'], '123416789676'], ['one-digit house number is padded', ['12341', '6789', '7'], '123416789072'], ['no house digits uses the default', ['12341', '6789', 'RR'], '123416789991'], ['hyphenated house number stops at the hyphen', ['12341', '6789', '12-4'], '123416789126'], ['five-digit code has no delivery point', ['12341', '', '123'], '123419'], ['digit sum already a multiple of ten', ['19000', '0000', '300'], '190000000000']], [['three-digit house number', ['23442', '6789', '123'], '234426789230'], ['four-digit house number', ['23442', '6789', '4567'], '234426789672'], ['one-digit house number is padded', ['23442', '6789', '7'], '234426789078'], ['no house digits uses the default', ['23442', '6789', 'RR'], '234426789997'], ['hyphenated house number stops at the hyphen', ['23442', '6789', '12-4'], '234426789122'], ['five-digit code has no delivery point', ['23442', '', '123'], '234425'], ['digit sum already a multiple of ten', ['28000', '0000', '300'], '280000000000']], [['three-digit house number', ['34543', '6789', '123'], '345436789236'], ['four-digit house number', ['34543', '6789', '4567'], '345436789678'], ['one-digit house number is padded', ['34543', '6789', '7'], '345436789074'], ['no house digits uses the default', ['34543', '6789', 'RR'], '345436789993'], ['hyphenated house number stops at the hyphen', ['34543', '6789', '12-4'], '345436789128'], ['five-digit code has no delivery point', ['34543', '', '123'], '345431'], ['digit sum already a multiple of ten', ['37000', '0000', '300'], '370000000000']], [['three-digit house number', ['45644', '6789', '123'], '456446789232'], ['four-digit house number', ['45644', '6789', '4567'], '456446789674'], ['one-digit house number is padded', ['45644', '6789', '7'], '456446789070'], ['no house digits uses the default', ['45644', '6789', 'RR'], '456446789999'], ['hyphenated house number stops at the hyphen', ['45644', '6789', '12-4'], '456446789124'], ['five-digit code has no delivery point', ['45644', '', '123'], '456447'], ['digit sum already a multiple of ten', ['46000', '0000', '300'], '460000000000']], [['three-digit house number', ['56745', '6789', '123'], '567456789238'], ['four-digit house number', ['56745', '6789', '4567'], '567456789670'], ['one-digit house number is padded', ['56745', '6789', '7'], '567456789076'], ['no house digits uses the default', ['56745', '6789', 'RR'], '567456789995'], ['hyphenated house number stops at the hyphen', ['56745', '6789', '12-4'], '567456789120'], ['five-digit code has no delivery point', ['56745', '', '123'], '567453'], ['digit sum already a multiple of ten', ['55000', '0000', '300'], '550000000000']]]
for label, arg, expected in fixtures[N - 1]:
check(label, solve(arg), 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 |
|---|---|---|---|
| three-digit house number | 123416789234 | 123416789234 | Passed |
| four-digit house number | 123416789676 | 123416789676 | Passed |
| one-digit house number is padded | 123416789072 | 123416789072 | Passed |
| no house digits uses the default | 123416789991 | 123416789991 | Passed |
| hyphenated house number stops at the hyphen | 123416789243 | 123416789126 | Failed |
| five-digit code has no delivery point | 123419 | 123419 | Passed |
| digit sum already a multiple of ten | 190000000000 | 190000000000 | Passed |
SHA-256 / 01bc2f11004d023bbaad59e55b4274238427014390d34a734d126f5f1009df03
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic toy contract over synthetic, obviously fictitious addresses. The rules are stipulated for this model only and make no claim of conformance with any postal authority standard. 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:20.307048+00:00.
Case digest / 48090b42db917eaa714d206376b67b57d024a57336b4ac1dab83c3114aa2e600