FAILURE MAP
← Case archive

FA-72686 / Check-digit algorithms / Open access

Structured communication accepts mismatched delimiters · case 01

A reference opened with +++ and closed with *** is accepted.

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

ROOT CAUSE

The delimiters are stripped without requiring the opening and closing forms to match.

VERIFIED REPAIR

Strip delimiters only when the first three and last three characters are the same delimiter.

Unsuccessful approach: Requiring only that both ends are delimiter characters still mixes the forms.

Case contract

Belgian structured payment communication: optional surrounding +++...+++ or ***...*** (matching), slashes ignored, then exactly 12 ASCII digits (else "malformed"). The last two digits must equal the first ten digits mod 97, where a remainder of 0 is written 97. Return whether they match.

Why this case matters

Banks reconcile incoming transfers by validating the structured reference before matching invoices.

1 / The failure

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

N = 1
observations = []
def solve(s):
    t = s.strip()
    if len(t) > 6 and t[:3] in ('+++', '***'):
        t = t[3:-3]
    t = t.replace('/', '')
    if len(t) != 12 or not t.isascii() or not t.isdigit():
        return 'malformed'
    r = int(t[:10]) % 97
    if r == 0:
        r = 97
    return r == int(t[10:])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["621266857360"]', ['621266857360'], True], ['control ["+++865/5789/93879+++"]', ['+++865/5789/93879+++'], True], ['control ["***035/9935/50934***"]', ['***035/9935/50934***'], True], ['control ["371789633519"]', ['371789633519'], True], ['control ["+++131/9631/75508+++"]', ['+++131/9631/75508+++'], True], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True], ['control ["+++990/8748/13965+++"]', ['+++990/8748/13965+++'], True], ['control ["***930/2019/38809***"]', ['***930/2019/38809***'], True], ['control ["646994510702"]', ['646994510702'], True], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True], ['control ["000000009797"]', ['000000009797'], True], ['control ["000000009700"]', ['000000009700'], False], ['control ["000000019497"]', ['000000019497'], True], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True], ['control ["123456780200"]', ['123456780200'], False], ['control ["999999997019"]', ['999999997019'], True], ['control ["999999997000"]', ['999999997000'], False], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False], ['control ["+++123/4567/89002+++"]', ['+++123/4567/89002+++'], True], ['control ["123456789002"]', ['123456789002'], True], ['control ["12345678900"]', ['12345678900'], 'malformed'], ['control ["+++123/4567/8900A+++"]', ['+++123/4567/8900A+++'], 'malformed'], ['control ["***090/9337/55493***"]', ['***090/9337/55493***'], True]]]
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 fixtureActualExpectedOutcome
regression ["+++090/9337/55493***"]TruemalformedFailed
control ["621266857360"]TrueTruePassed
control ["+++865/5789/93879+++"]TrueTruePassed
control ["***035/9935/50934***"]TrueTruePassed
control ["371789633519"]TrueTruePassed
control ["+++131/9631/75508+++"]TrueTruePassed
control ["***078/2001/09694***"]TrueTruePassed
control ["640618349478"]TrueTruePassed

SHA-256 / 2ba339b8060e6cef45020dbb6aa03190354917b70ccc64055fa533c9cc53842e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(s):
    t = s.strip()
    if len(t) > 6 and t[:3] in ('+++', '***') and t[-3:] in ('+++', '***'):
        t = t[3:-3]
    t = t.replace('/', '')
    if len(t) != 12 or not t.isascii() or not t.isdigit():
        return 'malformed'
    r = int(t[:10]) % 97
    if r == 0:
        r = 97
    return r == int(t[10:])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["621266857360"]', ['621266857360'], True], ['control ["+++865/5789/93879+++"]', ['+++865/5789/93879+++'], True], ['control ["***035/9935/50934***"]', ['***035/9935/50934***'], True], ['control ["371789633519"]', ['371789633519'], True], ['control ["+++131/9631/75508+++"]', ['+++131/9631/75508+++'], True], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True], ['control ["+++990/8748/13965+++"]', ['+++990/8748/13965+++'], True], ['control ["***930/2019/38809***"]', ['***930/2019/38809***'], True], ['control ["646994510702"]', ['646994510702'], True], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True], ['control ["000000009797"]', ['000000009797'], True], ['control ["000000009700"]', ['000000009700'], False], ['control ["000000019497"]', ['000000019497'], True], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True], ['control ["123456780200"]', ['123456780200'], False], ['control ["999999997019"]', ['999999997019'], True], ['control ["999999997000"]', ['999999997000'], False], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False], ['control ["+++123/4567/89002+++"]', ['+++123/4567/89002+++'], True], ['control ["123456789002"]', ['123456789002'], True], ['control ["12345678900"]', ['12345678900'], 'malformed'], ['control ["+++123/4567/8900A+++"]', ['+++123/4567/8900A+++'], 'malformed'], ['control ["***090/9337/55493***"]', ['***090/9337/55493***'], True]]]
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 fixtureActualExpectedOutcome
regression ["+++090/9337/55493***"]TruemalformedFailed
control ["621266857360"]TrueTruePassed
control ["+++865/5789/93879+++"]TrueTruePassed
control ["***035/9935/50934***"]TrueTruePassed
control ["371789633519"]TrueTruePassed
control ["+++131/9631/75508+++"]TrueTruePassed
control ["***078/2001/09694***"]TrueTruePassed
control ["640618349478"]TrueTruePassed

SHA-256 / 49e0def2400d5649caf17e8b056e7205771d0721dcef54835400ac71aa291a42

3 / The verified repair

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

N = 1
observations = []
def solve(s):
    t = s.strip()
    if len(t) > 6 and t[:3] == t[-3:] and t[:3] in ('+++', '***'):
        t = t[3:-3]
    t = t.replace('/', '')
    if len(t) != 12 or not t.isascii() or not t.isdigit():
        return 'malformed'
    r = int(t[:10]) % 97
    if r == 0:
        r = 97
    return r == int(t[10:])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["621266857360"]', ['621266857360'], True], ['control ["+++865/5789/93879+++"]', ['+++865/5789/93879+++'], True], ['control ["***035/9935/50934***"]', ['***035/9935/50934***'], True], ['control ["371789633519"]', ['371789633519'], True], ['control ["+++131/9631/75508+++"]', ['+++131/9631/75508+++'], True], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["***078/2001/09694***"]', ['***078/2001/09694***'], True], ['control ["640618349478"]', ['640618349478'], True], ['control ["+++990/8748/13965+++"]', ['+++990/8748/13965+++'], True], ['control ["***930/2019/38809***"]', ['***930/2019/38809***'], True], ['control ["646994510702"]', ['646994510702'], True], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["+++001/1569/26676+++"]', ['+++001/1569/26676+++'], True], ['control ["***178/8225/23467***"]', ['***178/8225/23467***'], True], ['control ["000000009797"]', ['000000009797'], True], ['control ["000000009700"]', ['000000009700'], False], ['control ["000000019497"]', ['000000019497'], True], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000019400"]', ['000000019400'], False], ['control ["123456780211"]', ['123456780211'], True], ['control ["123456780200"]', ['123456780200'], False], ['control ["999999997019"]', ['999999997019'], True], ['control ["999999997000"]', ['999999997000'], False], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False]], [['regression ["+++090/9337/55493***"]', ['+++090/9337/55493***'], 'malformed'], ['control ["000000000097"]', ['000000000097'], True], ['control ["000000000000"]', ['000000000000'], False], ['control ["+++123/4567/89002+++"]', ['+++123/4567/89002+++'], True], ['control ["123456789002"]', ['123456789002'], True], ['control ["12345678900"]', ['12345678900'], 'malformed'], ['control ["+++123/4567/8900A+++"]', ['+++123/4567/8900A+++'], 'malformed'], ['control ["***090/9337/55493***"]', ['***090/9337/55493***'], True]]]
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 fixtureActualExpectedOutcome
regression ["+++090/9337/55493***"]malformedmalformedPassed
control ["621266857360"]TrueTruePassed
control ["+++865/5789/93879+++"]TrueTruePassed
control ["***035/9935/50934***"]TrueTruePassed
control ["371789633519"]TrueTruePassed
control ["+++131/9631/75508+++"]TrueTruePassed
control ["***078/2001/09694***"]TrueTruePassed
control ["640618349478"]TrueTruePassed

SHA-256 / cf22a06f19ea89e893e2b91dbac9d7cae0400761e2aefeab3581bcbcc578dc2f

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

Case digest / 1b2b5d676d0f1a02c080dfa7340868e61bac2827e06047d4dad0454177531533