{"abstract":"Half of an unscored tablet is dispensed.","category":"Medication dosing calculations","checks":9,"contract":"Input {target_mg, strengths, scored (strengths that may be halved), tol_pct}. For each strength s: step = s/2 if s is scored else s; units = target/step rounded half-up (skip if 0); dose = units*step; tablets = dose/s (skip if more than 4 tablets); keep only |dose-target|*100 <= tol_pct*target. Prefer smallest absolute error, then fewest physical tablets (ceil of tablets), then the largest strength. Return {status OK, strength, tablets, dose_mg} or {status NO_MATCH}.","evaluation_group":"w2-meddose-tablet-selection","failed_approach":"Checking only that the scored list is non-empty makes every strength splittable once any product is scored.","family":"w2-meddose-tablet-selection-half-tablet-eligibility","id":"FA-63951","implementations":{"attempt":{"sha256":"3d0d0f36b102c2165959abb99a64c472c0923c99139625bdf4530ca250181362","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    target = Fraction(str(x['target_mg']))\n    best = None\n    for s in sorted(x['strengths']):\n        step = Fraction(s, 2) if x['scored'] else Fraction(s)\n        units = math.floor(target / step + Fraction(1, 2))\n        if units == 0:\n            continue\n        dose = units * step\n        tabs = dose / s\n        if tabs > 4:\n            continue\n        if abs(dose - target) * 100 > x['tol_pct'] * target:\n            continue\n        key = (abs(dose - target), math.ceil(tabs), -s)\n        if best is None or key < best[0]:\n            best = (key, s, tabs, dose)\n    if best is None:\n        return {'status': 'NO_MATCH'}\n    return {'status': 'OK', 'strength': best[1], 'tablets': float(best[2]), 'dose_mg': float(best[3])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('unscored tablet may not be halved',\n   {'target_mg': 5, 'strengths': [10, 25], 'scored': [25], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 27},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 15, 'strengths': [30, 75], 'scored': [75], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 28},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 25, 'strengths': [50, 125], 'scored': [125], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 29},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 35, 'strengths': [70, 175], 'scored': [175], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 30},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 45, 'strengths': [90, 225], 'scored': [225], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 31},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"e70175c03581811583b2c5296809c702508e366878ce12e9c479e1d98434ca77","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    target = Fraction(str(x['target_mg']))\n    best = None\n    for s in sorted(x['strengths']):\n        step = Fraction(s, 2)\n        units = math.floor(target / step + Fraction(1, 2))\n        if units == 0:\n            continue\n        dose = units * step\n        tabs = dose / s\n        if tabs > 4:\n            continue\n        if abs(dose - target) * 100 > x['tol_pct'] * target:\n            continue\n        key = (abs(dose - target), math.ceil(tabs), -s)\n        if best is None or key < best[0]:\n            best = (key, s, tabs, dose)\n    if best is None:\n        return {'status': 'NO_MATCH'}\n    return {'status': 'OK', 'strength': best[1], 'tablets': float(best[2]), 'dose_mg': float(best[3])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('unscored tablet may not be halved',\n   {'target_mg': 5, 'strengths': [10, 25], 'scored': [25], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 27},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 15, 'strengths': [30, 75], 'scored': [75], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 28},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 25, 'strengths': [50, 125], 'scored': [125], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 29},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 35, 'strengths': [70, 175], 'scored': [175], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 30},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 45, 'strengths': [90, 225], 'scored': [225], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 31},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"4a35ff02faa3cbdbb3323f7349bfcd6bcd62d917328ee74ebee268a6e3408893","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    target = Fraction(str(x['target_mg']))\n    best = None\n    for s in sorted(x['strengths']):\n        step = Fraction(s, 2) if s in x['scored'] else Fraction(s)\n        units = math.floor(target / step + Fraction(1, 2))\n        if units == 0:\n            continue\n        dose = units * step\n        tabs = dose / s\n        if tabs > 4:\n            continue\n        if abs(dose - target) * 100 > x['tol_pct'] * target:\n            continue\n        key = (abs(dose - target), math.ceil(tabs), -s)\n        if best is None or key < best[0]:\n            best = (key, s, tabs, dose)\n    if best is None:\n        return {'status': 'NO_MATCH'}\n    return {'status': 'OK', 'strength': best[1], 'tablets': float(best[2]), 'dose_mg': float(best[3])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('unscored tablet may not be halved',\n   {'target_mg': 5, 'strengths': [10, 25], 'scored': [25], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 11},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 27},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 1},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 6},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 15, 'strengths': [30, 75], 'scored': [75], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 12},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 28},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 2},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 7},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 25, 'strengths': [50, 125], 'scored': [125], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 13},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 29},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 3},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 8},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 35, 'strengths': [70, 175], 'scored': [175], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 14},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 30},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 4},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 9},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})],\n [('unscored tablet may not be halved',\n   {'target_mg': 45, 'strengths': [90, 225], 'scored': [225], 'tol_pct': 10},\n   {'status': 'NO_MATCH'}),\n  ('scored tablet half used',\n   {'target_mg': '7.5', 'strengths': [5, 10], 'scored': [5], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 5, 'tablets': 1.5, 'dose_mg': 7.5}),\n  ('near dose rounds up to whole tablet',\n   {'target_mg': 14, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 3.0, 'dose_mg': 15.0}),\n  ('near dose rounds down to whole tablet',\n   {'target_mg': 11, 'strengths': [5], 'scored': [], 'tol_pct': 15},\n   {'status': 'OK', 'strength': 5, 'tablets': 2.0, 'dose_mg': 10.0}),\n  ('three and a half tablets allowed',\n   {'target_mg': 35, 'strengths': [10], 'scored': [10], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 3.5, 'dose_mg': 35.0}),\n  ('exactly four tablets allowed',\n   {'target_mg': 40, 'strengths': [10], 'scored': [], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 10, 'tablets': 4.0, 'dose_mg': 40.0}),\n  ('tolerance measured against target',\n   {'target_mg': 200, 'strengths': [150], 'scored': [], 'tol_pct': 31},\n   {'status': 'OK', 'strength': 150, 'tablets': 1.0, 'dose_mg': 150.0}),\n  ('equal error prefers larger strength',\n   {'target_mg': 30, 'strengths': [15, 20], 'scored': [20], 'tol_pct': 5},\n   {'status': 'OK', 'strength': 20, 'tablets': 1.5, 'dose_mg': 30.0}),\n  ('accuracy outranks tablet count',\n   {'target_mg': 21, 'strengths': [10, 7], 'scored': [], 'tol_pct': 10},\n   {'status': 'OK', 'strength': 7, 'tablets': 3.0, 'dose_mg': 21.0})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\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":"A deterministic toy software model with explicitly stipulated thresholds and formulas; it is not clinical guidance, not a validated medical calculator, and makes no claim of conformance to any published protocol. Numbered variants vary patient and order inputs. 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":"w2-meddose-tablet-selection-half-tablet-eligibility","generated_at":"2026-09-29T14:47:19.792814+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Dispensing systems translate an ordered dose into real tablets; halving rules, tolerance, and ranking are separate decisions.","repair":"Allow half steps only for strengths listed as scored.","root_cause":"Every strength is treated as splittable regardless of the scored list.","sha256":"84406d69b0b51a87a4ebd0b367c9e8ff3bf869a34cec81cd50d3fff59425c4dc","title":"Tablet strength selection with scored halves: half-tablet eligibility · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.845,"exit_code":1,"observations":[{"actual":{"dose_mg":5.0,"status":"OK","strength":10,"tablets":0.5},"check":"unscored tablet may not be halved","expected":{"status":"NO_MATCH"},"passed":false},{"actual":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"check":"scored tablet half used","expected":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"passed":true},{"actual":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"check":"near dose rounds up to whole tablet","expected":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"passed":true},{"actual":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"check":"near dose rounds down to whole tablet","expected":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"passed":true},{"actual":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"check":"three and a half tablets allowed","expected":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"passed":true},{"actual":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"check":"exactly four tablets allowed","expected":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"passed":true},{"actual":{"dose_mg":150.0,"status":"OK","strength":150,"tablets":1.0},"check":"tolerance measured against target","expected":{"dose_mg":150.0,"status":"OK","strength":150,"tablets":1.0},"passed":true},{"actual":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"check":"equal error prefers larger strength","expected":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"passed":true},{"actual":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"check":"accuracy outranks tablet count","expected":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unscored tablet may not be halved\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 0.5, \"dose_mg\": 5.0}, \"expected\": {\"status\": \"NO_MATCH\"}, \"passed\": false}, {\"check\": \"scored tablet half used\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"passed\": true}, {\"check\": \"near dose rounds up to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"passed\": true}, {\"check\": \"near dose rounds down to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"passed\": true}, {\"check\": \"three and a half tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"passed\": true}, {\"check\": \"exactly four tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"passed\": true}, {\"check\": \"tolerance measured against target\", \"actual\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.0, \"dose_mg\": 150.0}, \"expected\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.0, \"dose_mg\": 150.0}, \"passed\": true}, {\"check\": \"equal error prefers larger strength\", \"actual\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"expected\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"passed\": true}, {\"check\": \"accuracy outranks tablet count\", \"actual\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"expected\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.978,"exit_code":1,"observations":[{"actual":{"dose_mg":5.0,"status":"OK","strength":10,"tablets":0.5},"check":"unscored tablet may not be halved","expected":{"status":"NO_MATCH"},"passed":false},{"actual":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"check":"scored tablet half used","expected":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"passed":true},{"actual":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"check":"near dose rounds up to whole tablet","expected":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"passed":true},{"actual":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"check":"near dose rounds down to whole tablet","expected":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"passed":true},{"actual":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"check":"three and a half tablets allowed","expected":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"passed":true},{"actual":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"check":"exactly four tablets allowed","expected":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"passed":true},{"actual":{"dose_mg":225.0,"status":"OK","strength":150,"tablets":1.5},"check":"tolerance measured against target","expected":{"dose_mg":150.0,"status":"OK","strength":150,"tablets":1.0},"passed":false},{"actual":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"check":"equal error prefers larger strength","expected":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"passed":true},{"actual":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"check":"accuracy outranks tablet count","expected":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unscored tablet may not be halved\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 0.5, \"dose_mg\": 5.0}, \"expected\": {\"status\": \"NO_MATCH\"}, \"passed\": false}, {\"check\": \"scored tablet half used\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"passed\": true}, {\"check\": \"near dose rounds up to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"passed\": true}, {\"check\": \"near dose rounds down to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"passed\": true}, {\"check\": \"three and a half tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"passed\": true}, {\"check\": \"exactly four tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"passed\": true}, {\"check\": \"tolerance measured against target\", \"actual\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.5, \"dose_mg\": 225.0}, \"expected\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.0, \"dose_mg\": 150.0}, \"passed\": false}, {\"check\": \"equal error prefers larger strength\", \"actual\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"expected\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"passed\": true}, {\"check\": \"accuracy outranks tablet count\", \"actual\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"expected\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":46.254,"exit_code":0,"observations":[{"actual":{"status":"NO_MATCH"},"check":"unscored tablet may not be halved","expected":{"status":"NO_MATCH"},"passed":true},{"actual":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"check":"scored tablet half used","expected":{"dose_mg":7.5,"status":"OK","strength":5,"tablets":1.5},"passed":true},{"actual":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"check":"near dose rounds up to whole tablet","expected":{"dose_mg":15.0,"status":"OK","strength":5,"tablets":3.0},"passed":true},{"actual":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"check":"near dose rounds down to whole tablet","expected":{"dose_mg":10.0,"status":"OK","strength":5,"tablets":2.0},"passed":true},{"actual":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"check":"three and a half tablets allowed","expected":{"dose_mg":35.0,"status":"OK","strength":10,"tablets":3.5},"passed":true},{"actual":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"check":"exactly four tablets allowed","expected":{"dose_mg":40.0,"status":"OK","strength":10,"tablets":4.0},"passed":true},{"actual":{"dose_mg":150.0,"status":"OK","strength":150,"tablets":1.0},"check":"tolerance measured against target","expected":{"dose_mg":150.0,"status":"OK","strength":150,"tablets":1.0},"passed":true},{"actual":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"check":"equal error prefers larger strength","expected":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"passed":true},{"actual":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"check":"accuracy outranks tablet count","expected":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unscored tablet may not be halved\", \"actual\": {\"status\": \"NO_MATCH\"}, \"expected\": {\"status\": \"NO_MATCH\"}, \"passed\": true}, {\"check\": \"scored tablet half used\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 1.5, \"dose_mg\": 7.5}, \"passed\": true}, {\"check\": \"near dose rounds up to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 3.0, \"dose_mg\": 15.0}, \"passed\": true}, {\"check\": \"near dose rounds down to whole tablet\", \"actual\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"expected\": {\"status\": \"OK\", \"strength\": 5, \"tablets\": 2.0, \"dose_mg\": 10.0}, \"passed\": true}, {\"check\": \"three and a half tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 3.5, \"dose_mg\": 35.0}, \"passed\": true}, {\"check\": \"exactly four tablets allowed\", \"actual\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"expected\": {\"status\": \"OK\", \"strength\": 10, \"tablets\": 4.0, \"dose_mg\": 40.0}, \"passed\": true}, {\"check\": \"tolerance measured against target\", \"actual\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.0, \"dose_mg\": 150.0}, \"expected\": {\"status\": \"OK\", \"strength\": 150, \"tablets\": 1.0, \"dose_mg\": 150.0}, \"passed\": true}, {\"check\": \"equal error prefers larger strength\", \"actual\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"expected\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"passed\": true}, {\"check\": \"accuracy outranks tablet count\", \"actual\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"expected\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}