FAILURE MAP
← Case archive

FA-60106 / Inventory cost layering / Open access

Standard cost material variances: variance direction label · case 01

Overspending is reported as favorable and savings as unfavorable.

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

ROOT CAUSE

The label mapping assigns F to positive variances and U to negative ones.

THE FAILURE

The label mapping assigns F to positive variances and U to negative ones.

Unsuccessful approach: Labelling by absolute size cannot distinguish direction.

Case contract

Input {std_price, std_qty (per good unit), good_units, scrap_units, purchases:[[qty,total_cost]], used}. The price variance is isolated at purchase: sum(total_cost - qty*std_price). Standard allowed quantity is std_qty*good_units (scrap earns no allowance). Usage variance = (used - allowed)*std_price. Labels: positive "U", negative "F", zero "-". Return {ppv, ppv_label, usage, usage_label, allowed}.

Why this case matters

Inventory valuation and cost-of-goods decisions depend on this rule.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    ppv = sum(tc - q * x['std_price'] for q, tc in x['purchases'])
    allowed = x['std_qty'] * x['good_units']
    usage = (x['used'] - allowed) * x['std_price']
    lab = lambda v: 'F' if v > 0 else ('U' if v < 0 else '-')
    return {'ppv': ppv, 'ppv_label': lab(ppv), 'usage': usage, 'usage_label': lab(usage), 'allowed': allowed}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8401]], 'used': 33}, {'ppv': 401, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 21, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 40}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 42}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1301]], 'used': 26}, {'ppv': 201, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 4, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 6}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2110], [5, 700]], 'used': 11}, {'ppv': -190, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8402]], 'used': 33}, {'ppv': 402, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 22, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 42}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 44}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1302]], 'used': 26}, {'ppv': 202, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 5, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 7}, {'ppv': 0, 'ppv_label': '-', 'usage': 90, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2120], [5, 700]], 'used': 11}, {'ppv': -180, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8403]], 'used': 33}, {'ppv': 403, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 23, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 44}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 46}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1303]], 'used': 26}, {'ppv': 203, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 6, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 180, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2130], [5, 700]], 'used': 11}, {'ppv': -170, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8404]], 'used': 33}, {'ppv': 404, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 24, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 46}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 48}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1304]], 'used': 26}, {'ppv': 204, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 7, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 9}, {'ppv': 0, 'ppv_label': '-', 'usage': 270, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2140], [5, 700]], 'used': 11}, {'ppv': -160, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8405]], 'used': 33}, {'ppv': 405, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 25, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 48}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 50}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1305]], 'used': 26}, {'ppv': 205, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 8, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 10}, {'ppv': 0, 'ppv_label': '-', 'usage': 360, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2150], [5, 700]], 'used': 11}, {'ppv': -150, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unfavorable price{'allowed': 30, 'ppv': 401, 'ppv_label': 'F', 'usage': 600, 'usage_label': 'F'}{'allowed': 30, 'ppv': 401, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}Failed
favorable usage{'allowed': 42, 'ppv': -500, 'ppv_label': 'U', 'usage': -300, 'usage_label': 'U'}{'allowed': 42, 'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F'}Failed
two purchases{'allowed': 20, 'ppv': 201, 'ppv_label': 'F', 'usage': 600, 'usage_label': 'F'}{'allowed': 20, 'ppv': 201, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}Failed
exact standard{'allowed': 8, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}{'allowed': 8, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}Passed
scrap heavy{'allowed': 30, 'ppv': 250, 'ppv_label': 'F', 'usage': 750, 'usage_label': 'F'}{'allowed': 30, 'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U'}Failed
no purchases{'allowed': 6, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}{'allowed': 6, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}Passed
mixed signs{'allowed': 12, 'ppv': -190, 'ppv_label': 'U', 'usage': -120, 'usage_label': 'U'}{'allowed': 12, 'ppv': -190, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F'}Failed

SHA-256 / fbf0b750d2811d93e9c20971c809ee2ae183dbe550f6b7fc045a3c6c68152df9

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    ppv = sum(tc - q * x['std_price'] for q, tc in x['purchases'])
    allowed = x['std_qty'] * x['good_units']
    usage = (x['used'] - allowed) * x['std_price']
    lab = lambda v: 'U' if abs(v) > 100 else ('F' if v != 0 else '-')
    return {'ppv': ppv, 'ppv_label': lab(ppv), 'usage': usage, 'usage_label': lab(usage), 'allowed': allowed}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8401]], 'used': 33}, {'ppv': 401, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 21, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 40}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 42}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1301]], 'used': 26}, {'ppv': 201, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 4, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 6}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2110], [5, 700]], 'used': 11}, {'ppv': -190, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8402]], 'used': 33}, {'ppv': 402, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 22, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 42}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 44}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1302]], 'used': 26}, {'ppv': 202, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 5, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 7}, {'ppv': 0, 'ppv_label': '-', 'usage': 90, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2120], [5, 700]], 'used': 11}, {'ppv': -180, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8403]], 'used': 33}, {'ppv': 403, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 23, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 44}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 46}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1303]], 'used': 26}, {'ppv': 203, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 6, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 180, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2130], [5, 700]], 'used': 11}, {'ppv': -170, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8404]], 'used': 33}, {'ppv': 404, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 24, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 46}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 48}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1304]], 'used': 26}, {'ppv': 204, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 7, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 9}, {'ppv': 0, 'ppv_label': '-', 'usage': 270, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2140], [5, 700]], 'used': 11}, {'ppv': -160, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]], [['unfavorable price', {'std_price': 200, 'std_qty': 3, 'good_units': 10, 'scrap_units': 1, 'purchases': [[40, 8405]], 'used': 33}, {'ppv': 405, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 30}], ['favorable usage', {'std_price': 150, 'std_qty': 2, 'good_units': 25, 'scrap_units': 0, 'purchases': [[50, 7000]], 'used': 48}, {'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F', 'allowed': 50}], ['two purchases', {'std_price': 100, 'std_qty': 4, 'good_units': 5, 'scrap_units': 2, 'purchases': [[10, 900], [10, 1305]], 'used': 26}, {'ppv': 205, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U', 'allowed': 20}], ['exact standard', {'std_price': 75, 'std_qty': 1, 'good_units': 8, 'scrap_units': 0, 'purchases': [[8, 600]], 'used': 8}, {'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-', 'allowed': 8}], ['scrap heavy', {'std_price': 50, 'std_qty': 5, 'good_units': 6, 'scrap_units': 8, 'purchases': [[60, 3300], [5, 200]], 'used': 45}, {'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U', 'allowed': 30}], ['no purchases', {'std_price': 90, 'std_qty': 2, 'good_units': 3, 'scrap_units': 1, 'purchases': [], 'used': 10}, {'ppv': 0, 'ppv_label': '-', 'usage': 360, 'usage_label': 'U', 'allowed': 6}], ['mixed signs', {'std_price': 120, 'std_qty': 3, 'good_units': 4, 'scrap_units': 1, 'purchases': [[20, 2150], [5, 700]], 'used': 11}, {'ppv': -150, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F', 'allowed': 12}]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
unfavorable price{'allowed': 30, 'ppv': 401, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}{'allowed': 30, 'ppv': 401, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}Passed
favorable usage{'allowed': 42, 'ppv': -500, 'ppv_label': 'U', 'usage': -300, 'usage_label': 'U'}{'allowed': 42, 'ppv': -500, 'ppv_label': 'F', 'usage': -300, 'usage_label': 'F'}Failed
two purchases{'allowed': 20, 'ppv': 201, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}{'allowed': 20, 'ppv': 201, 'ppv_label': 'U', 'usage': 600, 'usage_label': 'U'}Passed
exact standard{'allowed': 8, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}{'allowed': 8, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}Passed
scrap heavy{'allowed': 30, 'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U'}{'allowed': 30, 'ppv': 250, 'ppv_label': 'U', 'usage': 750, 'usage_label': 'U'}Passed
no purchases{'allowed': 6, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}{'allowed': 6, 'ppv': 0, 'ppv_label': '-', 'usage': 0, 'usage_label': '-'}Passed
mixed signs{'allowed': 12, 'ppv': -190, 'ppv_label': 'U', 'usage': -120, 'usage_label': 'U'}{'allowed': 12, 'ppv': -190, 'ppv_label': 'F', 'usage': -120, 'usage_label': 'F'}Failed

SHA-256 / f0fd91e2e8d2d2886d9353b7b2a312538d344f4c25fe3efcf79c1ced5aa9a88f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:46:42.632607+00:00.

Case digest / 64a0b5a876e2e319bc7da6c23bb4eaf6273e4d01c6466a6108d5bb0be6620ff1