FA-72611 / Check-digit algorithms / Open access
MRZ filler character is scored like a letter · case 01
Document numbers padded with "<" fail their check digit.
ROOT CAUSE
The explicit "<" branch is missing, so the filler falls into the letter branch and scores ord("<") - 55.
VERIFIED REPAIR
Give the filler "<" the value 0.
Unsuccessful approach: Scoring the filler as 36 (after Z) is still nonzero.
Case contract
Machine-readable passport (TD3) second line, 44 characters of 0-9, A-Z and the filler "<" (else "malformed"). Check digits use weights 7,3,1 restarting per field, "<" = 0, A-Z = 10-35: document number [0:9] check [9]; birth date [13:19] check [19]; expiry [21:27] check [27]; optional data [28:42] check [42] (a "<" check is allowed only when the optional field is entirely filler); composite check [43] over [0:10]+[13:20]+[21:43]. Return five booleans.
Why this case matters
Border-control kiosks verify MRZ check digits to catch OCR misreads before a database query.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(line):
def cd(field):
total = 0
for i, ch in enumerate(field):
if ch.isdigit():
v = int(ch)
else:
v = ord(ch) - 55
total += v * (7, 3, 1)[i % 3]
return str(total % 10)
if len(line) != 44 or not line.isascii():
return 'malformed'
if any(not (c.isdigit() or 'A' <= c <= 'Z' or c == '<') for c in line):
return 'malformed'
opt_ok = line[42] == cd(line[28:42]) or (line[42] == '<' and set(line[28:42]) == {'<'})
comp = line[0:10] + line[13:20] + line[21:43]
return [line[9] == cd(line[0:9]), line[19] == cd(line[13:19]), line[27] == cd(line[21:27]), opt_ok, line[43] == cd(comp)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [True, True, True, True, True]], ['partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [False, True, True, True, False]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46"]', ['ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46'], [True, False, True, True, False]], ['partial-repair ["WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00"]', ['WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00'], [True, True, True, True, True]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]]], [['regression ["X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56"]', ['X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56'], [True, True, True, True, True]], ['regression ["C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8"]', ['C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8'], [True, True, True, False, True]], ['partial-repair ["6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40'], [True, True, True, True, True]], ['partial-repair ["6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40'], [True, False, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]]], [['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04"]', ['ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04'], [True, True, True, True, True]], ['partial-repair ["IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40"]', ['IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40'], [True, True, True, True, True]], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36"]', ['7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36'], [True, True, True, True, True]], ['partial-repair ["T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02"]', ['T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02'], [True, True, True, True, True]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [True, True, True, True, False] | [True, True, True, True, True] | Failed |
| regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [True, True, True, True, False] | [True, True, True, True, True] | Failed |
| partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"] | malformed | malformed | Passed |
| control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"] | malformed | malformed | Passed |
SHA-256 / bf2289598531576d3ea9027e08d7f5f999fcb2597310c4a5bf48b93386dee132
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(line):
def cd(field):
total = 0
for i, ch in enumerate(field):
if ch == '<':
v = 36
elif ch.isdigit():
v = int(ch)
else:
v = ord(ch) - 55
total += v * (7, 3, 1)[i % 3]
return str(total % 10)
if len(line) != 44 or not line.isascii():
return 'malformed'
if any(not (c.isdigit() or 'A' <= c <= 'Z' or c == '<') for c in line):
return 'malformed'
opt_ok = line[42] == cd(line[28:42]) or (line[42] == '<' and set(line[28:42]) == {'<'})
comp = line[0:10] + line[13:20] + line[21:43]
return [line[9] == cd(line[0:9]), line[19] == cd(line[13:19]), line[27] == cd(line[21:27]), opt_ok, line[43] == cd(comp)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [True, True, True, True, True]], ['partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [False, True, True, True, False]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46"]', ['ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46'], [True, False, True, True, False]], ['partial-repair ["WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00"]', ['WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00'], [True, True, True, True, True]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]]], [['regression ["X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56"]', ['X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56'], [True, True, True, True, True]], ['regression ["C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8"]', ['C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8'], [True, True, True, False, True]], ['partial-repair ["6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40'], [True, True, True, True, True]], ['partial-repair ["6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40'], [True, False, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]]], [['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04"]', ['ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04'], [True, True, True, True, True]], ['partial-repair ["IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40"]', ['IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40'], [True, True, True, True, True]], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36"]', ['7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36'], [True, True, True, True, True]], ['partial-repair ["T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02"]', ['T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02'], [True, True, True, True, True]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [False, True, True, False, False] | [True, True, True, True, True] | Failed |
| partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [False, True, True, False, False] | [False, True, True, True, False] | Failed |
| control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"] | malformed | malformed | Passed |
| control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"] | malformed | malformed | Passed |
SHA-256 / 2fb166f268b169977bf6b2b3146cc341e16653aae18ea486e416e09f2492b23b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(line):
def cd(field):
total = 0
for i, ch in enumerate(field):
if ch == '<':
v = 0
elif ch.isdigit():
v = int(ch)
else:
v = ord(ch) - 55
total += v * (7, 3, 1)[i % 3]
return str(total % 10)
if len(line) != 44 or not line.isascii():
return 'malformed'
if any(not (c.isdigit() or 'A' <= c <= 'Z' or c == '<') for c in line):
return 'malformed'
opt_ok = line[42] == cd(line[28:42]) or (line[42] == '<' and set(line[28:42]) == {'<'})
comp = line[0:10] + line[13:20] + line[21:43]
return [line[9] == cd(line[0:9]), line[19] == cd(line[13:19]), line[27] == cd(line[21:27]), opt_ok, line[43] == cd(comp)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [True, True, True, True, True]], ['partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"]', ['S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14'], [False, True, True, True, False]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46"]', ['ZX2H4LT816UTO1712239F2305086AOX6HQ<<<<<<<<46'], [True, False, True, True, False]], ['partial-repair ["WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00"]', ['WEXHJ2U<<7UTO6804200F3006184<<<<<<<<<<<<<<00'], [True, True, True, True, True]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]]], [['regression ["X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56"]', ['X<<<<<<<<1UTO0002299F2912316ABC<<<<<<<<<<<56'], [True, True, True, True, True]], ['regression ["C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8"]', ['C0000001<7UTO9111303F3106305PX77<<<<<<<<<<<8'], [True, True, True, False, True]], ['partial-repair ["6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO4305208F2401025ORMBRF<<<<<<<<40'], [True, True, True, True, True]], ['partial-repair ["6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40"]', ['6OGHJGP443UTO7305208F2401025ORMBRF<<<<<<<<40'], [True, False, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]]], [['regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [True, True, True, True, True]], ['regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [True, True, True, True, True]], ['partial-repair ["ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04"]', ['ORO5E0T416UTO4006240F2711221<<<<<<<<<<<<<<04'], [True, True, True, True, True]], ['partial-repair ["IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40"]', ['IW9C4XZ762UTO4007096F2906025PS0IN0<<<<<<<<40'], [True, True, True, True, True]], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed'], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed']], [['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<10'], [True, True, True, True, True]], ['regression ["L898902C36UTO7408122F1204159ZE184226B<<<<<11"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<<11'], [True, True, True, True, False]], ['partial-repair ["7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36"]', ['7MZSP32754UTO7512054F33062086HKCM0<<<<<<<<36'], [True, True, True, True, True]], ['partial-repair ["T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02"]', ['T8AHLV5223UTO4905147F2401173<<<<<<<<<<<<<<02'], [True, True, True, True, True]], ['control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"]', ['HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0'], [False, True, True, True, False]], ['control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"]', ['Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2'], [False, True, True, True, False]], ['control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"]', ['L898902C36UTO7408122F1204159ZE184226B<<<<10'], 'malformed'], ['control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"]', ['l898902C36UTO7408122F1204159ZE184226B<<<<<10'], 'malformed']]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["HM87YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| regression ["ZI4II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| partial-repair ["SK5TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [True, True, True, True, True] | [True, True, True, True, True] | Passed |
| partial-repair ["S75TG49<<9UTO2004046F2210193O66P4C<<<<<<<<14"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["HM77YWD225UTO1907195F3112216<<<<<<<<<<<<<<<0"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["Z74II1W798UTO2103259F3311282<<<<<<<<<<<<<<<2"] | [False, True, True, True, False] | [False, True, True, True, False] | Passed |
| control ["L898902C36UTO7408122F1204159ZE184226B<<<<10"] | malformed | malformed | Passed |
| control ["l898902C36UTO7408122F1204159ZE184226B<<<<<10"] | malformed | malformed | Passed |
SHA-256 / 7c2cc112a10279f404c931ed2be430e02217e5f9184806a7c7f37e99a9bea7fa
Verification & scope
A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. 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:48:40.026964+00:00.
Case digest / ff7ca024ff4c8b57fb8669bd1400bb99d2b6ad58b3a32fc76878fd435a9367d4