FA-72731 / Check-digit algorithms / Open access
Container category admits only freight containers · case 01
Detachable-equipment (J) and trailer (Z) identifiers are rejected.
ROOT CAUSE
The category test accepts only U.
VERIFIED REPAIR
Accept equipment categories U, J and Z.
Unsuccessful approach: Adding J but not Z still rejects trailers and chassis.
Case contract
Shipping container identification check digit: three uppercase owner letters, category U, J or Z, six serial digits and a check digit (else "malformed"). Letter values start at A=10 and skip every multiple of 11 (so B=12, L=23, V=34, Z=38). Position i (0-based) has weight 2^i; the check digit is (sum mod 11) mod 10. Return [check, match].
Why this case matters
Terminal gate systems validate container numbers read by OCR cameras before booking moves.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
return 'malformed'
if s[3] != 'U' or not s[4:].isdigit():
return 'malformed'
vals = {}
v = 10
for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
if v % 11 == 0:
v += 1
vals[ch] = v
v += 1
total = 0
for i, ch in enumerate(s[:10]):
total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
check = total % 11 % 10
return [check, check == int(s[10])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['control ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]], [['regression ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['regression ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['control ["MJWU6668315"]', ['MJWU6668315'], [4, False]], ['control ["NPNU9965846"]', ['NPNU9965846'], [3, False]], ['control ["CCQU2344092"]', ['CCQU2344092'], [4, False]], ['control ["CSQU3054383"]', ['CSQU3054383'], [3, True]], ['control ["MSKU9070323"]', ['MSKU9070323'], [3, True]]], [['regression ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['regression ["XYZJ9999999"]', ['XYZJ9999999'], [1, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['partial-repair ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['control ["TCLU1234560"]', ['TCLU1234560'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]]]
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 ["BYYJ6917585"] | malformed | [8, False] | Failed |
| regression ["MUHJ6260452"] | malformed | [4, False] | Failed |
| partial-repair ["TSAZ4635083"] | malformed | [9, False] | Failed |
| partial-repair ["QSJZ1716340"] | malformed | [4, False] | Failed |
| control ["HRNU7843702"] | [9, False] | [9, False] | Passed |
| control ["VGQU8532227"] | [2, False] | [2, False] | Passed |
| control ["YQEU5793145"] | [6, False] | [6, False] | Passed |
| control ["CTZU8384457"] | [2, False] | [2, False] | Passed |
SHA-256 / 3b43ee85dcf6e1a10fb530fd7241a2901958e3a166528ca4180643fd47d99996
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
return 'malformed'
if s[3] not in 'UJ' or not s[4:].isdigit():
return 'malformed'
vals = {}
v = 10
for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
if v % 11 == 0:
v += 1
vals[ch] = v
v += 1
total = 0
for i, ch in enumerate(s[:10]):
total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
check = total % 11 % 10
return [check, check == int(s[10])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['control ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]], [['regression ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['regression ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['control ["MJWU6668315"]', ['MJWU6668315'], [4, False]], ['control ["NPNU9965846"]', ['NPNU9965846'], [3, False]], ['control ["CCQU2344092"]', ['CCQU2344092'], [4, False]], ['control ["CSQU3054383"]', ['CSQU3054383'], [3, True]], ['control ["MSKU9070323"]', ['MSKU9070323'], [3, True]]], [['regression ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['regression ["XYZJ9999999"]', ['XYZJ9999999'], [1, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['partial-repair ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['control ["TCLU1234560"]', ['TCLU1234560'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]]]
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 ["BYYJ6917585"] | [8, False] | [8, False] | Passed |
| regression ["MUHJ6260452"] | [4, False] | [4, False] | Passed |
| partial-repair ["TSAZ4635083"] | malformed | [9, False] | Failed |
| partial-repair ["QSJZ1716340"] | malformed | [4, False] | Failed |
| control ["HRNU7843702"] | [9, False] | [9, False] | Passed |
| control ["VGQU8532227"] | [2, False] | [2, False] | Passed |
| control ["YQEU5793145"] | [6, False] | [6, False] | Passed |
| control ["CTZU8384457"] | [2, False] | [2, False] | Passed |
SHA-256 / df0cdeab5170174995b73d2d4e1203397a76772653e28ba09dce12b81e37aacf
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s[:3].isalpha() or not s[:3].isupper():
return 'malformed'
if s[3] not in 'UJZ' or not s[4:].isdigit():
return 'malformed'
vals = {}
v = 10
for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
if v % 11 == 0:
v += 1
vals[ch] = v
v += 1
total = 0
for i, ch in enumerate(s[:10]):
total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
check = total % 11 % 10
return [check, check == int(s[10])]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['control ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]], ['control ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['control ["RGOU0215685"]', ['RGOU0215685'], [3, False]]], [['regression ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['regression ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['partial-repair ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['control ["MJWU6668315"]', ['MJWU6668315'], [4, False]], ['control ["NPNU9965846"]', ['NPNU9965846'], [3, False]], ['control ["CCQU2344092"]', ['CCQU2344092'], [4, False]], ['control ["CSQU3054383"]', ['CSQU3054383'], [3, True]], ['control ["MSKU9070323"]', ['MSKU9070323'], [3, True]]], [['regression ["ABCZ0000000"]', ['ABCZ0000000'], [5, False]], ['regression ["XYZJ9999999"]', ['XYZJ9999999'], [1, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['partial-repair ["NACZ1755331"]', ['NACZ1755331'], [0, False]], ['control ["TCLU1234560"]', ['TCLU1234560'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['control ["VGQU8532227"]', ['VGQU8532227'], [2, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CTZU8384457"]', ['CTZU8384457'], [2, False]]]]
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 ["BYYJ6917585"] | [8, False] | [8, False] | Passed |
| regression ["MUHJ6260452"] | [4, False] | [4, False] | Passed |
| partial-repair ["TSAZ4635083"] | [9, False] | [9, False] | Passed |
| partial-repair ["QSJZ1716340"] | [4, False] | [4, False] | Passed |
| control ["HRNU7843702"] | [9, False] | [9, False] | Passed |
| control ["VGQU8532227"] | [2, False] | [2, False] | Passed |
| control ["YQEU5793145"] | [6, False] | [6, False] | Passed |
| control ["CTZU8384457"] | [2, False] | [2, False] | Passed |
SHA-256 / 78d8c8108aa4ab362d6a2e940afb42b7271e52dd359578fe49636733b2ce422c
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:41.013326+00:00.
Case digest / 4ed48b6f85e2524247b9c8121e0017afb822494ea9c823625997b20e13664ba2