FAILURE MAP
← Case archive

FA-96176 / Postal address normalization / Open access

Attention and care-of line extractor: a later attention line overwrites the first · case 01

"ATTN SHIPPING" replaces the named recipient and vanishes from the address lines.

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

ROOT CAUSE

The kind is filled again even when it already holds a value.

VERIFIED REPAIR

Only fill an empty kind; otherwise keep the line as an address line.

Unsuccessful approach: Keeping the first value but still consuming the later line drops "ATTN SHIPPING" entirely.

Case contract

Input a list of lines. Each line is uppercased and whitespace-collapsed. The first line whose text starts with ATTENTION or ATTN, followed by end, space or colon, fills "attention"; likewise CARE OF or C/O fills "care_of"; the value is the remainder with leading spaces and colons removed. Every other line, including later duplicates, is kept in "lines".

Why this case matters

Recipient-routing lines must be separated from the delivery address before street and last-line parsing, or the attention name is parsed as a street.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    res = {'attention': '', 'care_of': '', 'lines': []}
    KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
    for line in x:
        u = ' '.join(line.upper().split())
        for prefix, kind in KINDS:
            rest = u[len(prefix):]
            if u.startswith(prefix) and (rest == '' or rest[0] in ' :'):
                res[kind] = rest.lstrip(' :')
                break
        else:
            res['lines'].append(u)
    return res
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 fixtureActualExpectedOutcome
attention with colon{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}Passed
care-of with runs of spaces{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}Passed
spelled care-of{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}Passed
word that merely starts with CARE OF{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}Passed
colon without space{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}Passed
second attention line kept as address{'attention': 'SHIPPING', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}Failed
lowercase spelled attention{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}Passed

SHA-256 / 6a6185a82d713751325513c82b96fc5ee5acb2f1167ef8ae5b0b8b40edfb3c95

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    res = {'attention': '', 'care_of': '', 'lines': []}
    KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
    for line in x:
        u = ' '.join(line.upper().split())
        for prefix, kind in KINDS:
            rest = u[len(prefix):]
            if u.startswith(prefix) and (rest == '' or rest[0] in ' :'):
                res[kind] = res[kind] or rest.lstrip(' :')
                break
        else:
            res['lines'].append(u)
    return res
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 fixtureActualExpectedOutcome
attention with colon{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}Passed
care-of with runs of spaces{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}Passed
spelled care-of{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}Passed
word that merely starts with CARE OF{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}Passed
colon without space{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}Passed
second attention line kept as address{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}Failed
lowercase spelled attention{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}Passed

SHA-256 / 8245d6d7547c57cf6297fb4980718358fc298543d370177ac8b042ca751c55c9

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    res = {'attention': '', 'care_of': '', 'lines': []}
    KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
    for line in x:
        u = ' '.join(line.upper().split())
        for prefix, kind in KINDS:
            rest = u[len(prefix):]
            if u.startswith(prefix) and (rest == '' or rest[0] in ' :') and not res[kind]:
                res[kind] = rest.lstrip(' :')
                break
        else:
            res['lines'].append(u)
    return res
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O  FAKECO   LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 fixtureActualExpectedOutcome
attention with colon{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}Passed
care-of with runs of spaces{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}Passed
spelled care-of{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}{'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}Passed
word that merely starts with CARE OF{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}{'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}Passed
colon without space{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}Passed
second attention line kept as address{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}Passed
lowercase spelled attention{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}{'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}Passed

SHA-256 / 456fbf26b7a892996faaaa66cf602435b3e3972b240b55965ba2d4563ed7c8de

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

Case digest / ed2d7755a1e01ac5de1ed283d2720ff5599c11b43e71408f415b1863f8b094b7