FA-96161 / Postal address normalization / Open access
Delivery point check digit: missing house number defaults to 00 · case 01
A line without house digits gets delivery point 00.
ROOT CAUSE
The default delivery point is "00" instead of "99".
VERIFIED REPAIR
Use "99" when no leading digits exist.
Unsuccessful approach: Using an empty default shortens the code by two digits.
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():
break
lead += c
dp = lead[-2:].zfill(2) if lead else '00'
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 | 123416789009 | 123416789991 | Failed |
| hyphenated house number stops at the hyphen | 123416789126 | 123416789126 | Passed |
| five-digit code has no delivery point | 123419 | 123419 | Passed |
| digit sum already a multiple of ten | 190000000000 | 190000000000 | Passed |
SHA-256 / cd30b3129ea9df8c5a02c6582efb578d80d2636616f51e0d847049f725cfe8ff
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 not c.isdigit():
break
lead += c
dp = lead[-2:].zfill(2) if lead else ''
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 | 1234167899 | 123416789991 | Failed |
| hyphenated house number stops at the hyphen | 123416789126 | 123416789126 | Passed |
| five-digit code has no delivery point | 123419 | 123419 | Passed |
| digit sum already a multiple of ten | 190000000000 | 190000000000 | Passed |
SHA-256 / a64cee3b18dbed158b9ffd175f46ae851505ba1557a07514755411e6b55a55d4
3 / The verified repair
Exit 0"""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():
break
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 | 123416789126 | 123416789126 | Passed |
| five-digit code has no delivery point | 123419 | 123419 | Passed |
| digit sum already a multiple of ten | 190000000000 | 190000000000 | Passed |
SHA-256 / a1af4429ffda66938003d4e30131d093702831f4e549075692d328dc8d7ab5f6
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.264110+00:00.
Case digest / debdf9a91dcf4fd60c84438ca0b865107f6a9fd28244e25ab91f003fce1d5b9c