{"abstract":"An ambiguous observed barcode is attributed to the first listed specimen.","category":"Scientific pipeline provenance","checks":7,"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.","evaluation_group":"model-7c685bb76677fd69","failed_approach":"Rejecting every observation with more than one nearby candidate incorrectly discards an exact match when a worse candidate is also nearby.","family":"z-scientific_pipelines-barcode-ambiguity","id":"FA-11911","implementations":{"attempt":{"sha256":"948222e281a81b2dce5285fbd7c5bfe7d98213d3fda4e405aa6b9463d38bd6eb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(observed, manifest):\n    near=[sample for barcode,sample in manifest.items() if sum(a!=b for a,b in zip(observed,barcode))<=1]\n    return near[0] if len(near)==1 else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ns='specimen'+str(N)\ncheck('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)\ncheck('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)\ncheck('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)\ncheck('too many substitutions', solve('AATT', {'AAAA':s}), None)\ncheck('empty manifest', solve('AAAA', {}), None)\ncheck('exact singleton', solve('CCCC', {'CCCC':s}), s)\ncheck('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"d968210be1f8e77ddb0d137922d541ba6bd879e5af51b57f8371efe596f7aa36","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(observed, manifest):\n    return min(manifest.items(),key=lambda item:sum(a!=b for a,b in zip(observed,item[0])))[1] if manifest else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ns='specimen'+str(N)\ncheck('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)\ncheck('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)\ncheck('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)\ncheck('too many substitutions', solve('AATT', {'AAAA':s}), None)\ncheck('empty manifest', solve('AAAA', {}), None)\ncheck('exact singleton', solve('CCCC', {'CCCC':s}), s)\ncheck('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"553e64b3435849c000cb0bb0cb934f219063042a00496a39cd84f364120180c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(observed, manifest):\n    distances=[(sum(a!=b for a,b in zip(observed,barcode)),sample) for barcode,sample in manifest.items()]\n    if not distances: return None\n    best=min(d for d,s in distances)\n    winners=[s for d,s in distances if d==best]\n    return winners[0] if best<=1 and len(winners)==1 else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ns='specimen'+str(N)\ncheck('equidistant substitution ambiguous', solve('AAAG', {'AAAA':s,'AAAC':'other'}), None)\ncheck('exact wins over near competitor', solve('AAAA', {'AAAC':'other','AAAA':s}), s)\ncheck('unique single substitution', solve('AAAT', {'AAAA':s,'CCCC':'other'}), s)\ncheck('too many substitutions', solve('AATT', {'AAAA':s}), None)\ncheck('empty manifest', solve('AAAA', {}), None)\ncheck('exact singleton', solve('CCCC', {'CCCC':s}), s)\ncheck('tie independent of manifest ordering', solve('AAAG', {'AAAC':'other','AAAA':s}), None)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"z-scientific_pipelines-barcode-ambiguity","generated_at":"2026-09-29T14:38:52.130279+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic offline model of scientific specimen processing and provenance; explicit fixtures test the stated bookkeeping or processing acceptance rule.","repair":"Compute Hamming distance to every barcode, then accept only a unique minimum within one substitution.","root_cause":"Nearest-barcode demultiplexing accepts the first candidate even when another is equally close.","sha256":"bef0f0472717eaaa225f32c907fdf629a12c0b27e6893b1c62f73e009dc030f4","title":"A barcode tie assigns a specimen by manifest order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.519,"exit_code":1,"observations":[{"actual":null,"check":"equidistant substitution ambiguous","expected":null,"passed":true},{"actual":null,"check":"exact wins over near competitor","expected":"specimen1","passed":false},{"actual":"specimen1","check":"unique single substitution","expected":"specimen1","passed":true},{"actual":null,"check":"too many substitutions","expected":null,"passed":true},{"actual":null,"check":"empty manifest","expected":null,"passed":true},{"actual":"specimen1","check":"exact singleton","expected":"specimen1","passed":true},{"actual":null,"check":"tie independent of manifest ordering","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equidistant substitution ambiguous\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"exact wins over near competitor\", \"actual\": null, \"expected\": \"specimen1\", \"passed\": false}, {\"check\": \"unique single substitution\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"too many substitutions\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty manifest\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"exact singleton\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"tie independent of manifest ordering\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.154,"exit_code":1,"observations":[{"actual":"specimen1","check":"equidistant substitution ambiguous","expected":null,"passed":false},{"actual":"specimen1","check":"exact wins over near competitor","expected":"specimen1","passed":true},{"actual":"specimen1","check":"unique single substitution","expected":"specimen1","passed":true},{"actual":"specimen1","check":"too many substitutions","expected":null,"passed":false},{"actual":null,"check":"empty manifest","expected":null,"passed":true},{"actual":"specimen1","check":"exact singleton","expected":"specimen1","passed":true},{"actual":"other","check":"tie independent of manifest ordering","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equidistant substitution ambiguous\", \"actual\": \"specimen1\", \"expected\": null, \"passed\": false}, {\"check\": \"exact wins over near competitor\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"unique single substitution\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"too many substitutions\", \"actual\": \"specimen1\", \"expected\": null, \"passed\": false}, {\"check\": \"empty manifest\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"exact singleton\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"tie independent of manifest ordering\", \"actual\": \"other\", \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.76,"exit_code":0,"observations":[{"actual":null,"check":"equidistant substitution ambiguous","expected":null,"passed":true},{"actual":"specimen1","check":"exact wins over near competitor","expected":"specimen1","passed":true},{"actual":"specimen1","check":"unique single substitution","expected":"specimen1","passed":true},{"actual":null,"check":"too many substitutions","expected":null,"passed":true},{"actual":null,"check":"empty manifest","expected":null,"passed":true},{"actual":"specimen1","check":"exact singleton","expected":"specimen1","passed":true},{"actual":null,"check":"tie independent of manifest ordering","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equidistant substitution ambiguous\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"exact wins over near competitor\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"unique single substitution\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"too many substitutions\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty manifest\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"exact singleton\", \"actual\": \"specimen1\", \"expected\": \"specimen1\", \"passed\": true}, {\"check\": \"tie independent of manifest ordering\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}