FAILURE MAP
← Case archive

FA-12391 / Laboratory measurement reporting / Open access

Already-applied dilution steps are multiplied again · case 01

Already-applied dilution steps are multiplied again.

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

ROOT CAUSE

A report uses every recorded dilution factor without respecting instrument-applied flags.

VERIFIED REPAIR

Multiply only factors not yet applied to the incoming result.

Unsuccessful approach: Skipping all factors when any one is applied loses remaining manual factors.

Case contract

Return the Fraction string for value multiplied by each positive integer factor whose applied flag is false. Empty history preserves value.

Why this case matters

A deterministic synthetic laboratory reporting model isolates a software metadata contract; it is not a clinical procedure.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(value, steps):
    return str(Fraction(value) * math.prod(f for f, applied in steps))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed instrument and manual steps', solve(N, [(2, True), (3, False)]), str(3*N))
check('only applied', solve(N, [(5, True)]), str(N))
check('only pending', solve(N, [(5, False)]), str(5*N))
check('serial pending', solve(N, [(2, False), (3, False)]), str(6*N))
check('no history', solve(N, []), str(N))
check('zero concentration', solve(0, [(2, True), (3, False)]), '0')
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
mixed instrument and manual steps63Failed
only applied51Failed
only pending55Passed
serial pending66Passed
no history11Passed
zero concentration00Passed

SHA-256 / e33777f87164765b6cdaa3db8ee4427506ae0f24b115ffd47bcadab6fa32a6c8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(value, steps):
    return str(Fraction(value) if any(applied for f, applied in steps) else Fraction(value) * math.prod(f for f, applied in steps))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed instrument and manual steps', solve(N, [(2, True), (3, False)]), str(3*N))
check('only applied', solve(N, [(5, True)]), str(N))
check('only pending', solve(N, [(5, False)]), str(5*N))
check('serial pending', solve(N, [(2, False), (3, False)]), str(6*N))
check('no history', solve(N, []), str(N))
check('zero concentration', solve(0, [(2, True), (3, False)]), '0')
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
mixed instrument and manual steps13Failed
only applied11Passed
only pending55Passed
serial pending66Passed
no history11Passed
zero concentration00Passed

SHA-256 / 2e27a62a42db535bec86a975f6643d93d8880a082dc27ea712b31132b4179255

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(value, steps):
    return str(Fraction(value) * math.prod(f for f, applied in steps if not applied))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed instrument and manual steps', solve(N, [(2, True), (3, False)]), str(3*N))
check('only applied', solve(N, [(5, True)]), str(N))
check('only pending', solve(N, [(5, False)]), str(5*N))
check('serial pending', solve(N, [(2, False), (3, False)]), str(6*N))
check('no history', solve(N, []), str(N))
check('zero concentration', solve(0, [(2, True), (3, False)]), '0')
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
mixed instrument and manual steps33Passed
only applied11Passed
only pending55Passed
serial pending66Passed
no history11Passed
zero concentration00Passed

SHA-256 / 53884f80e1ee0e2b6527bee85ba37191229ecc9df3195c0be783b80b27debc60

Verification & scope

Synthetic integer/rational fixtures only; no instrument validation or clinical interpretation. 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:56.468896+00:00.

Case digest / 4d37ad62c2a304ea8e6203c7ade1eae551dfa773973978446a485571e315e2e7