{"abstract":"\"12029 4101\" returns None although a space separator is allowed.","category":"Postal address normalization","checks":12,"contract":"Input a string or an integer. Integers are zero-padded to 5 digits when <= 99999, else to 9. Strings are stripped; a 10-character string with \"-\" or a space at index 5 loses that separator. Valid results are exactly 5 or 9 ASCII digits; 9 digits render \"DDDDD-DDDD\" unless the last four are \"0000\", which renders the 5-digit form. Anything else returns None.","evaluation_group":"w2-postal-address-normalization-five-nine-code","failed_approach":"Accepting any non-digit at index 5 also turns \"12029/4101\" into a valid code.","family":"w2-postal-address-normalization-five-nine-code-separator-set","id":"FA-95901","implementations":{"attempt":{"sha256":"318ca8a249bfee42d04b836d452b9f50930c9342392ea794e96b1f96fbd978b8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if isinstance(x, int):\n        s = str(x).zfill(5) if x <= 99999 else str(x).zfill(9)\n    else:\n        s = x.strip()\n        if len(s) == 10 and not s[5].isdigit():\n            s = s[:5] + s[6:]\n    if len(s) not in (5, 9) or not s.isdigit():\n        return None\n    if len(s) == 9 and s[5:] != '0000':\n        return s[:5] + '-' + s[5:]\n    return s[:5]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain five-digit code', '12039', '12039'], ['hyphenated plus-four', '12039-4101', '12039-4101'], ['space-separated plus-four', '12039 4101', '12039-4101'], ['spreadsheet integer lost its leading zero', 1231, '01231'], ['eight-digit integer is a nine-digit code with a leading zero', 12345671, '01234-5671'], ['zero plus-four is dropped', '12039-0000', '12039'], ['plus-four ending in three zeros is kept', '12039-2000', '12039-2000'], ['seven digits rejected', '1203912', None], ['ten digits without separator rejected', '1203941017', None], ['slash separator rejected', '12039/4101', None], ['letter O is not zero', '1203O', None], ['surrounding whitespace trimmed', ' 12039\\n', '12039']], [['plain five-digit code', '23049', '23049'], ['hyphenated plus-four', '23049-5102', '23049-5102'], ['space-separated plus-four', '23049 5102', '23049-5102'], ['spreadsheet integer lost its leading zero', 1232, '01232'], ['eight-digit integer is a nine-digit code with a leading zero', 12345672, '01234-5672'], ['zero plus-four is dropped', '23049-0000', '23049'], ['plus-four ending in three zeros is kept', '23049-3000', '23049-3000'], ['seven digits rejected', '2304912', None], ['ten digits without separator rejected', '2304951027', None], ['slash separator rejected', '23049/5102', None], ['letter O is not zero', '2304O', None], ['surrounding whitespace trimmed', ' 23049\\n', '23049']], [['plain five-digit code', '34059', '34059'], ['hyphenated plus-four', '34059-6103', '34059-6103'], ['space-separated plus-four', '34059 6103', '34059-6103'], ['spreadsheet integer lost its leading zero', 1233, '01233'], ['eight-digit integer is a nine-digit code with a leading zero', 12345673, '01234-5673'], ['zero plus-four is dropped', '34059-0000', '34059'], ['plus-four ending in three zeros is kept', '34059-4000', '34059-4000'], ['seven digits rejected', '3405912', None], ['ten digits without separator rejected', '3405961037', None], ['slash separator rejected', '34059/6103', None], ['letter O is not zero', '3405O', None], ['surrounding whitespace trimmed', ' 34059\\n', '34059']], [['plain five-digit code', '45069', '45069'], ['hyphenated plus-four', '45069-7104', '45069-7104'], ['space-separated plus-four', '45069 7104', '45069-7104'], ['spreadsheet integer lost its leading zero', 1234, '01234'], ['eight-digit integer is a nine-digit code with a leading zero', 12345674, '01234-5674'], ['zero plus-four is dropped', '45069-0000', '45069'], ['plus-four ending in three zeros is kept', '45069-5000', '45069-5000'], ['seven digits rejected', '4506912', None], ['ten digits without separator rejected', '4506971047', None], ['slash separator rejected', '45069/7104', None], ['letter O is not zero', '4506O', None], ['surrounding whitespace trimmed', ' 45069\\n', '45069']], [['plain five-digit code', '56079', '56079'], ['hyphenated plus-four', '56079-8105', '56079-8105'], ['space-separated plus-four', '56079 8105', '56079-8105'], ['spreadsheet integer lost its leading zero', 1235, '01235'], ['eight-digit integer is a nine-digit code with a leading zero', 12345675, '01234-5675'], ['zero plus-four is dropped', '56079-0000', '56079'], ['plus-four ending in three zeros is kept', '56079-6000', '56079-6000'], ['seven digits rejected', '5607912', None], ['ten digits without separator rejected', '5607981057', None], ['slash separator rejected', '56079/8105', None], ['letter O is not zero', '5607O', None], ['surrounding whitespace trimmed', ' 56079\\n', '56079']]]\nfor label, arg, expected in fixtures[N - 1]:\n    check(label, solve(arg), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"58ec59e6a09987062b5ca5d8ea6a754f0117f768a1ebf8f4f3f4b291c383ad94","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if isinstance(x, int):\n        s = str(x).zfill(5) if x <= 99999 else str(x).zfill(9)\n    else:\n        s = x.strip()\n        if len(s) == 10 and s[5] == '-':\n            s = s[:5] + s[6:]\n    if len(s) not in (5, 9) or not s.isdigit():\n        return None\n    if len(s) == 9 and s[5:] != '0000':\n        return s[:5] + '-' + s[5:]\n    return s[:5]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain five-digit code', '12039', '12039'], ['hyphenated plus-four', '12039-4101', '12039-4101'], ['space-separated plus-four', '12039 4101', '12039-4101'], ['spreadsheet integer lost its leading zero', 1231, '01231'], ['eight-digit integer is a nine-digit code with a leading zero', 12345671, '01234-5671'], ['zero plus-four is dropped', '12039-0000', '12039'], ['plus-four ending in three zeros is kept', '12039-2000', '12039-2000'], ['seven digits rejected', '1203912', None], ['ten digits without separator rejected', '1203941017', None], ['slash separator rejected', '12039/4101', None], ['letter O is not zero', '1203O', None], ['surrounding whitespace trimmed', ' 12039\\n', '12039']], [['plain five-digit code', '23049', '23049'], ['hyphenated plus-four', '23049-5102', '23049-5102'], ['space-separated plus-four', '23049 5102', '23049-5102'], ['spreadsheet integer lost its leading zero', 1232, '01232'], ['eight-digit integer is a nine-digit code with a leading zero', 12345672, '01234-5672'], ['zero plus-four is dropped', '23049-0000', '23049'], ['plus-four ending in three zeros is kept', '23049-3000', '23049-3000'], ['seven digits rejected', '2304912', None], ['ten digits without separator rejected', '2304951027', None], ['slash separator rejected', '23049/5102', None], ['letter O is not zero', '2304O', None], ['surrounding whitespace trimmed', ' 23049\\n', '23049']], [['plain five-digit code', '34059', '34059'], ['hyphenated plus-four', '34059-6103', '34059-6103'], ['space-separated plus-four', '34059 6103', '34059-6103'], ['spreadsheet integer lost its leading zero', 1233, '01233'], ['eight-digit integer is a nine-digit code with a leading zero', 12345673, '01234-5673'], ['zero plus-four is dropped', '34059-0000', '34059'], ['plus-four ending in three zeros is kept', '34059-4000', '34059-4000'], ['seven digits rejected', '3405912', None], ['ten digits without separator rejected', '3405961037', None], ['slash separator rejected', '34059/6103', None], ['letter O is not zero', '3405O', None], ['surrounding whitespace trimmed', ' 34059\\n', '34059']], [['plain five-digit code', '45069', '45069'], ['hyphenated plus-four', '45069-7104', '45069-7104'], ['space-separated plus-four', '45069 7104', '45069-7104'], ['spreadsheet integer lost its leading zero', 1234, '01234'], ['eight-digit integer is a nine-digit code with a leading zero', 12345674, '01234-5674'], ['zero plus-four is dropped', '45069-0000', '45069'], ['plus-four ending in three zeros is kept', '45069-5000', '45069-5000'], ['seven digits rejected', '4506912', None], ['ten digits without separator rejected', '4506971047', None], ['slash separator rejected', '45069/7104', None], ['letter O is not zero', '4506O', None], ['surrounding whitespace trimmed', ' 45069\\n', '45069']], [['plain five-digit code', '56079', '56079'], ['hyphenated plus-four', '56079-8105', '56079-8105'], ['space-separated plus-four', '56079 8105', '56079-8105'], ['spreadsheet integer lost its leading zero', 1235, '01235'], ['eight-digit integer is a nine-digit code with a leading zero', 12345675, '01234-5675'], ['zero plus-four is dropped', '56079-0000', '56079'], ['plus-four ending in three zeros is kept', '56079-6000', '56079-6000'], ['seven digits rejected', '5607912', None], ['ten digits without separator rejected', '5607981057', None], ['slash separator rejected', '56079/8105', None], ['letter O is not zero', '5607O', None], ['surrounding whitespace trimmed', ' 56079\\n', '56079']]]\nfor label, arg, expected in fixtures[N - 1]:\n    check(label, solve(arg), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"c32795b8a0f49bfd0ad869ca6928cdd31471271c1cfa784b88444a76fd3d1495","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if isinstance(x, int):\n        s = str(x).zfill(5) if x <= 99999 else str(x).zfill(9)\n    else:\n        s = x.strip()\n        if len(s) == 10 and s[5] in '- ':\n            s = s[:5] + s[6:]\n    if len(s) not in (5, 9) or not s.isdigit():\n        return None\n    if len(s) == 9 and s[5:] != '0000':\n        return s[:5] + '-' + s[5:]\n    return s[:5]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain five-digit code', '12039', '12039'], ['hyphenated plus-four', '12039-4101', '12039-4101'], ['space-separated plus-four', '12039 4101', '12039-4101'], ['spreadsheet integer lost its leading zero', 1231, '01231'], ['eight-digit integer is a nine-digit code with a leading zero', 12345671, '01234-5671'], ['zero plus-four is dropped', '12039-0000', '12039'], ['plus-four ending in three zeros is kept', '12039-2000', '12039-2000'], ['seven digits rejected', '1203912', None], ['ten digits without separator rejected', '1203941017', None], ['slash separator rejected', '12039/4101', None], ['letter O is not zero', '1203O', None], ['surrounding whitespace trimmed', ' 12039\\n', '12039']], [['plain five-digit code', '23049', '23049'], ['hyphenated plus-four', '23049-5102', '23049-5102'], ['space-separated plus-four', '23049 5102', '23049-5102'], ['spreadsheet integer lost its leading zero', 1232, '01232'], ['eight-digit integer is a nine-digit code with a leading zero', 12345672, '01234-5672'], ['zero plus-four is dropped', '23049-0000', '23049'], ['plus-four ending in three zeros is kept', '23049-3000', '23049-3000'], ['seven digits rejected', '2304912', None], ['ten digits without separator rejected', '2304951027', None], ['slash separator rejected', '23049/5102', None], ['letter O is not zero', '2304O', None], ['surrounding whitespace trimmed', ' 23049\\n', '23049']], [['plain five-digit code', '34059', '34059'], ['hyphenated plus-four', '34059-6103', '34059-6103'], ['space-separated plus-four', '34059 6103', '34059-6103'], ['spreadsheet integer lost its leading zero', 1233, '01233'], ['eight-digit integer is a nine-digit code with a leading zero', 12345673, '01234-5673'], ['zero plus-four is dropped', '34059-0000', '34059'], ['plus-four ending in three zeros is kept', '34059-4000', '34059-4000'], ['seven digits rejected', '3405912', None], ['ten digits without separator rejected', '3405961037', None], ['slash separator rejected', '34059/6103', None], ['letter O is not zero', '3405O', None], ['surrounding whitespace trimmed', ' 34059\\n', '34059']], [['plain five-digit code', '45069', '45069'], ['hyphenated plus-four', '45069-7104', '45069-7104'], ['space-separated plus-four', '45069 7104', '45069-7104'], ['spreadsheet integer lost its leading zero', 1234, '01234'], ['eight-digit integer is a nine-digit code with a leading zero', 12345674, '01234-5674'], ['zero plus-four is dropped', '45069-0000', '45069'], ['plus-four ending in three zeros is kept', '45069-5000', '45069-5000'], ['seven digits rejected', '4506912', None], ['ten digits without separator rejected', '4506971047', None], ['slash separator rejected', '45069/7104', None], ['letter O is not zero', '4506O', None], ['surrounding whitespace trimmed', ' 45069\\n', '45069']], [['plain five-digit code', '56079', '56079'], ['hyphenated plus-four', '56079-8105', '56079-8105'], ['space-separated plus-four', '56079 8105', '56079-8105'], ['spreadsheet integer lost its leading zero', 1235, '01235'], ['eight-digit integer is a nine-digit code with a leading zero', 12345675, '01234-5675'], ['zero plus-four is dropped', '56079-0000', '56079'], ['plus-four ending in three zeros is kept', '56079-6000', '56079-6000'], ['seven digits rejected', '5607912', None], ['ten digits without separator rejected', '5607981057', None], ['slash separator rejected', '56079/8105', None], ['letter O is not zero', '5607O', None], ['surrounding whitespace trimmed', ' 56079\\n', '56079']]]\nfor label, arg, expected in fixtures[N - 1]:\n    check(label, solve(arg), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-postal-address-normalization-five-nine-code-separator-set","generated_at":"2026-09-29T14:52:17.959212+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Postal codes arrive from spreadsheets, forms and legacy files; losing leading zeros or accepting malformed codes misroutes mail and breaks deduplication.","repair":"Accept exactly a hyphen or a space at index 5.","root_cause":"Only a hyphen is accepted at index 5.","sha256":"3bdaea690772b7cadb104bbbded3519b74516a94565530b3ede5abd4fea45243","title":"Five-or-nine digit postal code: space-separated plus-four is rejected · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.502,"exit_code":1,"observations":[{"actual":"12039","check":"plain five-digit code","expected":"12039","passed":true},{"actual":"12039-4101","check":"hyphenated plus-four","expected":"12039-4101","passed":true},{"actual":"12039-4101","check":"space-separated plus-four","expected":"12039-4101","passed":true},{"actual":"01231","check":"spreadsheet integer lost its leading zero","expected":"01231","passed":true},{"actual":"01234-5671","check":"eight-digit integer is a nine-digit code with a leading zero","expected":"01234-5671","passed":true},{"actual":"12039","check":"zero plus-four is dropped","expected":"12039","passed":true},{"actual":"12039-2000","check":"plus-four ending in three zeros is kept","expected":"12039-2000","passed":true},{"actual":null,"check":"seven digits rejected","expected":null,"passed":true},{"actual":null,"check":"ten digits without separator rejected","expected":null,"passed":true},{"actual":"12039-4101","check":"slash separator rejected","expected":null,"passed":false},{"actual":null,"check":"letter O is not zero","expected":null,"passed":true},{"actual":"12039","check":"surrounding whitespace trimmed","expected":"12039","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain five-digit code\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"hyphenated plus-four\", \"actual\": \"12039-4101\", \"expected\": \"12039-4101\", \"passed\": true}, {\"check\": \"space-separated plus-four\", \"actual\": \"12039-4101\", \"expected\": \"12039-4101\", \"passed\": true}, {\"check\": \"spreadsheet integer lost its leading zero\", \"actual\": \"01231\", \"expected\": \"01231\", \"passed\": true}, {\"check\": \"eight-digit integer is a nine-digit code with a leading zero\", \"actual\": \"01234-5671\", \"expected\": \"01234-5671\", \"passed\": true}, {\"check\": \"zero plus-four is dropped\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"plus-four ending in three zeros is kept\", \"actual\": \"12039-2000\", \"expected\": \"12039-2000\", \"passed\": true}, {\"check\": \"seven digits rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ten digits without separator rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"slash separator rejected\", \"actual\": \"12039-4101\", \"expected\": null, \"passed\": false}, {\"check\": \"letter O is not zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"surrounding whitespace trimmed\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.126,"exit_code":1,"observations":[{"actual":"12039","check":"plain five-digit code","expected":"12039","passed":true},{"actual":"12039-4101","check":"hyphenated plus-four","expected":"12039-4101","passed":true},{"actual":null,"check":"space-separated plus-four","expected":"12039-4101","passed":false},{"actual":"01231","check":"spreadsheet integer lost its leading zero","expected":"01231","passed":true},{"actual":"01234-5671","check":"eight-digit integer is a nine-digit code with a leading zero","expected":"01234-5671","passed":true},{"actual":"12039","check":"zero plus-four is dropped","expected":"12039","passed":true},{"actual":"12039-2000","check":"plus-four ending in three zeros is kept","expected":"12039-2000","passed":true},{"actual":null,"check":"seven digits rejected","expected":null,"passed":true},{"actual":null,"check":"ten digits without separator rejected","expected":null,"passed":true},{"actual":null,"check":"slash separator rejected","expected":null,"passed":true},{"actual":null,"check":"letter O is not zero","expected":null,"passed":true},{"actual":"12039","check":"surrounding whitespace trimmed","expected":"12039","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain five-digit code\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"hyphenated plus-four\", \"actual\": \"12039-4101\", \"expected\": \"12039-4101\", \"passed\": true}, {\"check\": \"space-separated plus-four\", \"actual\": null, \"expected\": \"12039-4101\", \"passed\": false}, {\"check\": \"spreadsheet integer lost its leading zero\", \"actual\": \"01231\", \"expected\": \"01231\", \"passed\": true}, {\"check\": \"eight-digit integer is a nine-digit code with a leading zero\", \"actual\": \"01234-5671\", \"expected\": \"01234-5671\", \"passed\": true}, {\"check\": \"zero plus-four is dropped\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"plus-four ending in three zeros is kept\", \"actual\": \"12039-2000\", \"expected\": \"12039-2000\", \"passed\": true}, {\"check\": \"seven digits rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ten digits without separator rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"slash separator rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"letter O is not zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"surrounding whitespace trimmed\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.607,"exit_code":0,"observations":[{"actual":"12039","check":"plain five-digit code","expected":"12039","passed":true},{"actual":"12039-4101","check":"hyphenated plus-four","expected":"12039-4101","passed":true},{"actual":"12039-4101","check":"space-separated plus-four","expected":"12039-4101","passed":true},{"actual":"01231","check":"spreadsheet integer lost its leading zero","expected":"01231","passed":true},{"actual":"01234-5671","check":"eight-digit integer is a nine-digit code with a leading zero","expected":"01234-5671","passed":true},{"actual":"12039","check":"zero plus-four is dropped","expected":"12039","passed":true},{"actual":"12039-2000","check":"plus-four ending in three zeros is kept","expected":"12039-2000","passed":true},{"actual":null,"check":"seven digits rejected","expected":null,"passed":true},{"actual":null,"check":"ten digits without separator rejected","expected":null,"passed":true},{"actual":null,"check":"slash separator rejected","expected":null,"passed":true},{"actual":null,"check":"letter O is not zero","expected":null,"passed":true},{"actual":"12039","check":"surrounding whitespace trimmed","expected":"12039","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain five-digit code\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"hyphenated plus-four\", \"actual\": \"12039-4101\", \"expected\": \"12039-4101\", \"passed\": true}, {\"check\": \"space-separated plus-four\", \"actual\": \"12039-4101\", \"expected\": \"12039-4101\", \"passed\": true}, {\"check\": \"spreadsheet integer lost its leading zero\", \"actual\": \"01231\", \"expected\": \"01231\", \"passed\": true}, {\"check\": \"eight-digit integer is a nine-digit code with a leading zero\", \"actual\": \"01234-5671\", \"expected\": \"01234-5671\", \"passed\": true}, {\"check\": \"zero plus-four is dropped\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}, {\"check\": \"plus-four ending in three zeros is kept\", \"actual\": \"12039-2000\", \"expected\": \"12039-2000\", \"passed\": true}, {\"check\": \"seven digits rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ten digits without separator rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"slash separator rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"letter O is not zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"surrounding whitespace trimmed\", \"actual\": \"12039\", \"expected\": \"12039\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}