FA-11891 / Scientific pipeline provenance / Open access
Sorting measurements separately reassigns sample values · case 01
Sorting measurements separately reassigns sample values.
ROOT CAUSE
Independent ordering is mistaken for a shared sample axis.
VERIFIED REPAIR
Index measurements by unique specimen ID and emit requested order.
Unsuccessful approach: Sorting both lists still emits sorted order instead of the requested axis.
Case contract
For unique measurement IDs, return values in requested ID order, with None for missing IDs.
Why this case matters
A deterministic offline model of scientific workflow bookkeeping; the fixtures test provenance contracts without modeling instruments or biological inference.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(axis, rows):
return [r[1] for r in rows][:len(axis)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reversed specimen axis', solve(['b','a'], [('a',N),('b',N+4)]), [N+4,N])
check('missing specimen', solve(['x','a'], [('a',N)]), [None,N])
check('empty axis', solve([], [('a',N)]), [])
check('empty measurements', solve(['a'], []), [None])
check('repeated requested specimen', solve(['a','a'], [('a',N)]), [N,N])
check('irrelevant measurement', solve(['a'], [('z',0),('a',N)]), [N])
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 |
|---|---|---|---|
| reversed specimen axis | [1, 5] | [5, 1] | Failed |
| missing specimen | [1] | [None, 1] | Failed |
| empty axis | [] | [] | Passed |
| empty measurements | [] | [None] | Failed |
| repeated requested specimen | [1] | [1, 1] | Failed |
| irrelevant measurement | [0] | [1] | Failed |
SHA-256 / 4ddae0ec4c508a0b28138912c046857bcce6b35d1f87ab0240f02215eca769f3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(axis, rows):
d = dict(rows)
return [d.get(k) for k in sorted(axis)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reversed specimen axis', solve(['b','a'], [('a',N),('b',N+4)]), [N+4,N])
check('missing specimen', solve(['x','a'], [('a',N)]), [None,N])
check('empty axis', solve([], [('a',N)]), [])
check('empty measurements', solve(['a'], []), [None])
check('repeated requested specimen', solve(['a','a'], [('a',N)]), [N,N])
check('irrelevant measurement', solve(['a'], [('z',0),('a',N)]), [N])
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 |
|---|---|---|---|
| reversed specimen axis | [1, 5] | [5, 1] | Failed |
| missing specimen | [1, None] | [None, 1] | Failed |
| empty axis | [] | [] | Passed |
| empty measurements | [None] | [None] | Passed |
| repeated requested specimen | [1, 1] | [1, 1] | Passed |
| irrelevant measurement | [1] | [1] | Passed |
SHA-256 / 5878f63837d2e4ea3bcf3fa8d35c260a62254192d1406fe0f4280af5963c479f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(axis, rows):
d = dict(rows)
return [d.get(k) for k in axis]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reversed specimen axis', solve(['b','a'], [('a',N),('b',N+4)]), [N+4,N])
check('missing specimen', solve(['x','a'], [('a',N)]), [None,N])
check('empty axis', solve([], [('a',N)]), [])
check('empty measurements', solve(['a'], []), [None])
check('repeated requested specimen', solve(['a','a'], [('a',N)]), [N,N])
check('irrelevant measurement', solve(['a'], [('z',0),('a',N)]), [N])
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 |
|---|---|---|---|
| reversed specimen axis | [5, 1] | [5, 1] | Passed |
| missing specimen | [None, 1] | [None, 1] | Passed |
| empty axis | [] | [] | Passed |
| empty measurements | [None] | [None] | Passed |
| repeated requested specimen | [1, 1] | [1, 1] | Passed |
| irrelevant measurement | [1] | [1] | Passed |
SHA-256 / 8fdab310b7a20881f5d12eddddcb53a0a2a567d49d1b91ac40b8edbe01408381
Verification & scope
In-memory symbolic records only; no instrument, assay, or production workflow 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:51.847188+00:00.
Case digest / 6c3ac24bc67d2230c7bdd2a3ec6fa3ab469a5d5e05e2bdade37c4b4125660b70