{"abstract":"Scrap sale proceeds are credited only for abnormal scrap, overstating good-unit cost.","category":"Inventory cost layering","checks":6,"contract":"Input {material:[[qty,unit]], hours, rate, oh_bp (of labor cost), input_units, good_units, recovery (per scrapped unit), normal_bp}. Total = material + labor + overhead. Scrap = input - good; normal loss = floor(input*normal_bp/10000); abnormal = max(0, scrap - normal) valued at floor(total/input) per unit and expensed. Scrap recovery credits every scrapped unit. Good-unit cost = round-half-up((total - recovery credit - abnormal value)/good); good_units == 0 returns {\"error\"}. Return {total, abnormal_units, abnormal_value, unit_cost}.","evaluation_group":"w2-inventory-cost-layering-production-lot-rollup","failed_approach":"Crediting only normal-loss units ignores proceeds from abnormal scrap.","family":"w2-inventory-cost-layering-production-lot-rollup-scrap-recovery-scope","id":"FA-60276","implementations":{"attempt":{"sha256":"321021a2f45b1442acc8ef209ad02f0554bed5dbeb75c6314c45d2bd6911a668","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    mat = sum(q * u for q, u in x['material'])\n    labor = x['hours'] * x['rate']\n    oh = labor * x['oh_bp'] // 10000\n    total = mat + labor + oh\n    if x['good_units'] == 0:\n        return {'error': 'no good output'}\n    scrap = x['input_units'] - x['good_units']\n    normal = x['input_units'] * x['normal_bp'] // 10000\n    abnormal = max(0, scrap - normal)\n    ab_value = abnormal * (total // x['input_units'])\n    credit = min(scrap, normal) * x['recovery']\n    net = total - credit - ab_value\n    unit = (2 * net + x['good_units']) // (2 * x['good_units'])\n    return {'total': total, 'abnormal_units': abnormal, 'abnormal_value': ab_value, 'unit_cost': unit}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 501}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 39, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 9, 'abnormal_value': 1980, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2010, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6020, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 4, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 26037, 'abnormal_units': 3, 'abnormal_value': 2601, 'unit_cost': 866}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 151, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 502}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 38, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 10, 'abnormal_value': 2200, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2020, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6040, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 5, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 31797, 'abnormal_units': 3, 'abnormal_value': 3177, 'unit_cost': 1058}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 152, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 503}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 37, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 11, 'abnormal_value': 2420, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2030, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6060, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 6, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 37557, 'abnormal_units': 3, 'abnormal_value': 3753, 'unit_cost': 1250}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 153, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 504}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 36, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 12, 'abnormal_value': 2640, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2040, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6080, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 7, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 43317, 'abnormal_units': 3, 'abnormal_value': 4329, 'unit_cost': 1442}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 154, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 505}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 35, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 13, 'abnormal_value': 2860, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2050, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6100, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 153}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 8, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 49077, 'abnormal_units': 3, 'abnormal_value': 4905, 'unit_cost': 1634}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 155, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]]]\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":"9823939e96d11d6faa03b8ae071d0d337de59b18ad059bbfddc5cecc7ead9fee","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    mat = sum(q * u for q, u in x['material'])\n    labor = x['hours'] * x['rate']\n    oh = labor * x['oh_bp'] // 10000\n    total = mat + labor + oh\n    if x['good_units'] == 0:\n        return {'error': 'no good output'}\n    scrap = x['input_units'] - x['good_units']\n    normal = x['input_units'] * x['normal_bp'] // 10000\n    abnormal = max(0, scrap - normal)\n    ab_value = abnormal * (total // x['input_units'])\n    credit = abnormal * x['recovery']\n    net = total - credit - ab_value\n    unit = (2 * net + x['good_units']) // (2 * x['good_units'])\n    return {'total': total, 'abnormal_units': abnormal, 'abnormal_value': ab_value, 'unit_cost': unit}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 501}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 39, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 9, 'abnormal_value': 1980, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2010, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6020, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 4, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 26037, 'abnormal_units': 3, 'abnormal_value': 2601, 'unit_cost': 866}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 151, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 502}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 38, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 10, 'abnormal_value': 2200, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2020, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6040, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 5, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 31797, 'abnormal_units': 3, 'abnormal_value': 3177, 'unit_cost': 1058}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 152, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 503}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 37, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 11, 'abnormal_value': 2420, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2030, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6060, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 6, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 37557, 'abnormal_units': 3, 'abnormal_value': 3753, 'unit_cost': 1250}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 153, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 504}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 36, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 12, 'abnormal_value': 2640, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2040, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6080, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 7, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 43317, 'abnormal_units': 3, 'abnormal_value': 4329, 'unit_cost': 1442}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 154, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 505}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 35, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 13, 'abnormal_value': 2860, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2050, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6100, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 153}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 8, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 49077, 'abnormal_units': 3, 'abnormal_value': 4905, 'unit_cost': 1634}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 155, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]]]\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":"b37fa334cbdc369b425e57129b69dd5f376bc747ff07b662935950fbc6958d92","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    mat = sum(q * u for q, u in x['material'])\n    labor = x['hours'] * x['rate']\n    oh = labor * x['oh_bp'] // 10000\n    total = mat + labor + oh\n    if x['good_units'] == 0:\n        return {'error': 'no good output'}\n    scrap = x['input_units'] - x['good_units']\n    normal = x['input_units'] * x['normal_bp'] // 10000\n    abnormal = max(0, scrap - normal)\n    ab_value = abnormal * (total // x['input_units'])\n    credit = scrap * x['recovery']\n    net = total - credit - ab_value\n    unit = (2 * net + x['good_units']) // (2 * x['good_units'])\n    return {'total': total, 'abnormal_units': abnormal, 'abnormal_value': ab_value, 'unit_cost': unit}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 501}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 39, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 9, 'abnormal_value': 1980, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2010, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6020, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 4, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 26037, 'abnormal_units': 3, 'abnormal_value': 2601, 'unit_cost': 866}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 151, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 502}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 38, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 10, 'abnormal_value': 2200, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2020, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6040, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 151}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 5, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 31797, 'abnormal_units': 3, 'abnormal_value': 3177, 'unit_cost': 1058}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 152, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 503}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 37, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 11, 'abnormal_value': 2420, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2030, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6060, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 6, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 37557, 'abnormal_units': 3, 'abnormal_value': 3753, 'unit_cost': 1250}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 153, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 504}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 36, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 12, 'abnormal_value': 2640, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2040, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6080, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 152}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 7, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 43317, 'abnormal_units': 3, 'abnormal_value': 4329, 'unit_cost': 1442}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 154, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]], [['normal run', {'material': [[10, 300], [5, 120]], 'hours': 4, 'rate': 2500, 'oh_bp': 15000, 'input_units': 100, 'good_units': 96, 'recovery': 5, 'normal_bp': 505}, {'total': 28600, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 298}], ['abnormal loss', {'material': [[20, 100]], 'hours': 2, 'rate': 3000, 'oh_bp': 5000, 'input_units': 50, 'good_units': 35, 'recovery': 10, 'normal_bp': 400}, {'total': 11000, 'abnormal_units': 13, 'abnormal_value': 2860, 'unit_cost': 228}], ['better than normal', {'material': [[8, 250]], 'hours': 1, 'rate': 2050, 'oh_bp': 10000, 'input_units': 40, 'good_units': 40, 'recovery': 0, 'normal_bp': 1000}, {'total': 6100, 'abnormal_units': 0, 'abnormal_value': 0, 'unit_cost': 153}], ['no good units', {'material': [[1, 100]], 'hours': 1, 'rate': 100, 'oh_bp': 0, 'input_units': 5, 'good_units': 0, 'recovery': 1, 'normal_bp': 0}, {'error': 'no good output'}], ['high overhead', {'material': [[3, 999]], 'hours': 8, 'rate': 1800, 'oh_bp': 22000, 'input_units': 30, 'good_units': 27, 'recovery': 20, 'normal_bp': 300}, {'total': 49077, 'abnormal_units': 3, 'abnormal_value': 4905, 'unit_cost': 1634}], ['recovery heavy', {'material': [[12, 450]], 'hours': 5, 'rate': 1500, 'oh_bp': 8000, 'input_units': 60, 'good_units': 51, 'recovery': 155, 'normal_bp': 1000}, {'total': 18900, 'abnormal_units': 3, 'abnormal_value': 945, 'unit_cost': 325}]]]\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":"Stipulated bounded teaching model with explicit toy rules; not an accounting-standard implementation. 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-inventory-cost-layering-production-lot-rollup-scrap-recovery-scope","generated_at":"2026-09-29T14:46:44.104013+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Inventory valuation and cost-of-goods decisions depend on this rule.","repair":"Credit recovery value for every scrapped unit.","root_cause":"The recovery credit multiplies by abnormal units instead of all scrapped units.","sha256":"8639f730f6c773be41bb50dd8d575db8894db3abb37e68cb4ad74bbb076ebe69","title":"Production lot cost roll-up with yield: scrap recovery scope · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.442,"exit_code":1,"observations":[{"actual":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"check":"normal run","expected":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"passed":true},{"actual":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":231},"check":"abnormal loss","expected":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":228},"passed":false},{"actual":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"check":"better than normal","expected":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"passed":true},{"actual":{"error":"no good output"},"check":"no good units","expected":{"error":"no good output"},"passed":true},{"actual":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":868},"check":"high overhead","expected":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":866},"passed":false},{"actual":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":334},"check":"recovery heavy","expected":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":325},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal run\", \"actual\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"expected\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"passed\": true}, {\"check\": \"abnormal loss\", \"actual\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 231}, \"expected\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 228}, \"passed\": false}, {\"check\": \"better than normal\", \"actual\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"expected\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"passed\": true}, {\"check\": \"no good units\", \"actual\": {\"error\": \"no good output\"}, \"expected\": {\"error\": \"no good output\"}, \"passed\": true}, {\"check\": \"high overhead\", \"actual\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 868}, \"expected\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 866}, \"passed\": false}, {\"check\": \"recovery heavy\", \"actual\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 334}, \"expected\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 325}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.361,"exit_code":1,"observations":[{"actual":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"check":"normal run","expected":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"passed":true},{"actual":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":229},"check":"abnormal loss","expected":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":228},"passed":false},{"actual":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"check":"better than normal","expected":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"passed":true},{"actual":{"error":"no good output"},"check":"no good units","expected":{"error":"no good output"},"passed":true},{"actual":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":866},"check":"high overhead","expected":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":866},"passed":true},{"actual":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":343},"check":"recovery heavy","expected":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":325},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal run\", \"actual\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"expected\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"passed\": true}, {\"check\": \"abnormal loss\", \"actual\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 229}, \"expected\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 228}, \"passed\": false}, {\"check\": \"better than normal\", \"actual\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"expected\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"passed\": true}, {\"check\": \"no good units\", \"actual\": {\"error\": \"no good output\"}, \"expected\": {\"error\": \"no good output\"}, \"passed\": true}, {\"check\": \"high overhead\", \"actual\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 866}, \"expected\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 866}, \"passed\": true}, {\"check\": \"recovery heavy\", \"actual\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 343}, \"expected\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 325}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.579,"exit_code":0,"observations":[{"actual":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"check":"normal run","expected":{"abnormal_units":0,"abnormal_value":0,"total":28600,"unit_cost":298},"passed":true},{"actual":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":228},"check":"abnormal loss","expected":{"abnormal_units":9,"abnormal_value":1980,"total":11000,"unit_cost":228},"passed":true},{"actual":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"check":"better than normal","expected":{"abnormal_units":0,"abnormal_value":0,"total":6020,"unit_cost":151},"passed":true},{"actual":{"error":"no good output"},"check":"no good units","expected":{"error":"no good output"},"passed":true},{"actual":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":866},"check":"high overhead","expected":{"abnormal_units":3,"abnormal_value":2601,"total":26037,"unit_cost":866},"passed":true},{"actual":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":325},"check":"recovery heavy","expected":{"abnormal_units":3,"abnormal_value":945,"total":18900,"unit_cost":325},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal run\", \"actual\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"expected\": {\"total\": 28600, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 298}, \"passed\": true}, {\"check\": \"abnormal loss\", \"actual\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 228}, \"expected\": {\"total\": 11000, \"abnormal_units\": 9, \"abnormal_value\": 1980, \"unit_cost\": 228}, \"passed\": true}, {\"check\": \"better than normal\", \"actual\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"expected\": {\"total\": 6020, \"abnormal_units\": 0, \"abnormal_value\": 0, \"unit_cost\": 151}, \"passed\": true}, {\"check\": \"no good units\", \"actual\": {\"error\": \"no good output\"}, \"expected\": {\"error\": \"no good output\"}, \"passed\": true}, {\"check\": \"high overhead\", \"actual\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 866}, \"expected\": {\"total\": 26037, \"abnormal_units\": 3, \"abnormal_value\": 2601, \"unit_cost\": 866}, \"passed\": true}, {\"check\": \"recovery heavy\", \"actual\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 325}, \"expected\": {\"total\": 18900, \"abnormal_units\": 3, \"abnormal_value\": 945, \"unit_cost\": 325}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}