FAILURE MAP
← Case archive

FA-11911 / Scientific pipeline provenance / Open access

A barcode tie assigns a specimen by manifest order · case 01

An ambiguous observed barcode is attributed to the first listed specimen.

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

ROOT CAUSE

Nearest-barcode demultiplexing accepts the first candidate even when another is equally close.

VERIFIED REPAIR

Compute Hamming distance to every barcode, then accept only a unique minimum within one substitution.

Unsuccessful approach: Rejecting every observation with more than one nearby candidate incorrectly discards an exact match when a worse candidate is also nearby.

Case contract

Manifest maps unique equal-length DNA barcode strings to specimen IDs. Observed barcode has the same length. Return the specimen at a unique minimum Hamming distance no greater than one, otherwise None. This controlled substitution-only decoder does not model sequencing error probabilities.

Why this case matters

A deterministic offline model of scientific specimen processing and provenance; explicit fixtures test the stated bookkeeping or processing acceptance rule.

1 / The failure

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

N = 1
observations = []
def solve(observed, manifest):
    return min(manifest.items(),key=lambda item:sum(a!=b for a,b in zip(observed,item[0])))[1] if manifest else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='specimen'+str(N)
check('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)
check('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)
check('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)
check('too many substitutions', solve('AATT', {'AAAA':s}), None)
check('empty manifest', solve('AAAA', {}), None)
check('exact singleton', solve('CCCC', {'CCCC':s}), s)
check('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)
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
equidistant substitution ambiguousspecimen1NoneFailed
exact wins over near competitorspecimen1specimen1Passed
unique single substitutionspecimen1specimen1Passed
too many substitutionsspecimen1NoneFailed
empty manifestNoneNonePassed
exact singletonspecimen1specimen1Passed
tie independent of manifest orderingotherNoneFailed

SHA-256 / d968210be1f8e77ddb0d137922d541ba6bd879e5af51b57f8371efe596f7aa36

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(observed, manifest):
    near=[sample for barcode,sample in manifest.items() if sum(a!=b for a,b in zip(observed,barcode))<=1]
    return near[0] if len(near)==1 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='specimen'+str(N)
check('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)
check('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)
check('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)
check('too many substitutions', solve('AATT', {'AAAA':s}), None)
check('empty manifest', solve('AAAA', {}), None)
check('exact singleton', solve('CCCC', {'CCCC':s}), s)
check('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)
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
equidistant substitution ambiguousNoneNonePassed
exact wins over near competitorNonespecimen1Failed
unique single substitutionspecimen1specimen1Passed
too many substitutionsNoneNonePassed
empty manifestNoneNonePassed
exact singletonspecimen1specimen1Passed
tie independent of manifest orderingNoneNonePassed

SHA-256 / 948222e281a81b2dce5285fbd7c5bfe7d98213d3fda4e405aa6b9463d38bd6eb

3 / The verified repair

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

N = 1
observations = []
def solve(observed, manifest):
    distances=[(sum(a!=b for a,b in zip(observed,barcode)),sample) for barcode,sample in manifest.items()]
    if not distances: return None
    best=min(d for d,s in distances)
    winners=[s for d,s in distances if d==best]
    return winners[0] if best<=1 and len(winners)==1 else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s='specimen'+str(N)
check('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)
check('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)
check('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)
check('too many substitutions', solve('AATT', {'AAAA':s}), None)
check('empty manifest', solve('AAAA', {}), None)
check('exact singleton', solve('CCCC', {'CCCC':s}), s)
check('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)
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
equidistant substitution ambiguousNoneNonePassed
exact wins over near competitorspecimen1specimen1Passed
unique single substitutionspecimen1specimen1Passed
too many substitutionsNoneNonePassed
empty manifestNoneNonePassed
exact singletonspecimen1specimen1Passed
tie independent of manifest orderingNoneNonePassed

SHA-256 / 553e64b3435849c000cb0bb0cb934f219063042a00496a39cd84f364120180c0

Verification & scope

Symbolic in-memory model only; not instrument safety guidance or a production scientific validation. 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:38:52.130279+00:00.

Case digest / bef0f0472717eaaa225f32c907fdf629a12c0b27e6893b1c62f73e009dc030f4