{"abstract":"Two tablets of a smaller strength are chosen over one and a half of a larger strength giving the same dose.","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":"Putting tablet count first lets a less accurate dose win whenever it needs fewer tablets.","family":"w2-meddose-tablet-selection-candidate-ranking","id":"FA-63971","implementations":{"attempt":{"sha256":"db36e11eb62784371b690180415d23c84e2f33b6ad0b12d8822396e19fd25dfd","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 = (math.ceil(tabs), abs(dose - target), -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":"8894ad7574679eef10bc774d185f8bd83bd9faccbeefe8eb204f4ff0d90361e1","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"},"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-candidate-ranking","generated_at":"2026-09-29T14:47:19.836475+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":"Rank by absolute error, then physical tablet count, then larger strength.","root_cause":"The final tie-break prefers the smallest strength instead of the largest.","sha256":"74565fc93bfb32988807fbad895b16648bbfce4e48ac7d7cb8e3c1fa3ca0e277","title":"Tablet strength selection with scored halves: candidate ranking · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.691,"exit_code":1,"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":20.0,"status":"OK","strength":10,"tablets":2.0},"check":"accuracy outranks tablet count","expected":{"dose_mg":21.0,"status":"OK","strength":7,"tablets":3.0},"passed":false}],"passed":false,"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\": 10, \"tablets\": 2.0, \"dose_mg\": 20.0}, \"expected\": {\"status\": \"OK\", \"strength\": 7, \"tablets\": 3.0, \"dose_mg\": 21.0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.41,"exit_code":1,"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":15,"tablets":2.0},"check":"equal error prefers larger strength","expected":{"dose_mg":30.0,"status":"OK","strength":20,"tablets":1.5},"passed":false},{"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\": \"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\": 15, \"tablets\": 2.0, \"dose_mg\": 30.0}, \"expected\": {\"status\": \"OK\", \"strength\": 20, \"tablets\": 1.5, \"dose_mg\": 30.0}, \"passed\": false}, {\"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":43.133,"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"}