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.
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| equidistant substitution ambiguous | specimen1 | None | Failed |
| exact wins over near competitor | specimen1 | specimen1 | Passed |
| unique single substitution | specimen1 | specimen1 | Passed |
| too many substitutions | specimen1 | None | Failed |
| empty manifest | None | None | Passed |
| exact singleton | specimen1 | specimen1 | Passed |
| tie independent of manifest ordering | other | None | Failed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| equidistant substitution ambiguous | None | None | Passed |
| exact wins over near competitor | None | specimen1 | Failed |
| unique single substitution | specimen1 | specimen1 | Passed |
| too many substitutions | None | None | Passed |
| empty manifest | None | None | Passed |
| exact singleton | specimen1 | specimen1 | Passed |
| tie independent of manifest ordering | None | None | Passed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| equidistant substitution ambiguous | None | None | Passed |
| exact wins over near competitor | specimen1 | specimen1 | Passed |
| unique single substitution | specimen1 | specimen1 | Passed |
| too many substitutions | None | None | Passed |
| empty manifest | None | None | Passed |
| exact singleton | specimen1 | specimen1 | Passed |
| tie independent of manifest ordering | None | None | Passed |
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