{"abstract":"Small deferred prorations from earlier cycles are never billed.","category":"Subscription proration billing","checks":10,"contract":"Input {lines, threshold, carried}. Pending = carried + sum(lines). Pending >= threshold is invoiced now; pending <= -threshold is credited to the balance now; anything in between is carried to the next cycle. Return [invoiced, credited, carry].","contract_signature":"x","evaluation_group":"w2-subscription-proration-proration-minimum-threshold","failed_approach":"The attempt includes carry but ignores new credit lines.","family":"w2-subscription-proration-proration-minimum-threshold-carried-amount-inclusion","id":"FA-59641","implementations":{"attempt":{"sha256":"b6cf441e27fe9c3cc1734eb359991209eaeebbe01875bdfe8f2a32d809c409a0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pending = x['carried'] + sum(l for l in x['lines'] if l > 0)\n    if pending >= x['threshold']:\n        return [pending, 0, 0]\n    if pending <= -x['threshold']:\n        return [0, -pending, 0]\n    return [0, 0, pending]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('regression (boundary)', {'lines': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-100], 'threshold': 100, 'carried': 0}, [0, 100, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [481], 'threshold': 100, 'carried': 0}, [481, 0, 0]), ('normal control', {'lines': [207], 'threshold': 500, 'carried': 0}, [0, 0, 207]), ('normal control', {'lines': [429], 'threshold': 100, 'carried': 0}, [429, 0, 0]), ('normal control', {'lines': [97], 'threshold': 50, 'carried': 0}, [97, 0, 0])], [('regression', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('partial-repair probe', {'lines': [61, 426, -138, 400], 'threshold': 50, 'carried': 0}, [749, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [344], 'threshold': 100, 'carried': 0}, [344, 0, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [326, 112, 108, 591], 'threshold': 50, 'carried': 0}, [1137, 0, 0]), ('normal control', {'lines': [127], 'threshold': 100, 'carried': 0}, [127, 0, 0])], [('regression', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('regression (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('partial-repair probe', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('partial-repair probe', {'lines': [-381, 116], 'threshold': 500, 'carried': 0}, [0, 0, -265]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [341], 'threshold': 500, 'carried': 0}, [0, 0, 341]), ('normal control', {'lines': [], 'threshold': 500, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [], 'threshold': 100, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [225], 'threshold': 500, 'carried': 0}, [0, 0, 225])], [('regression', {'lines': [-497, -497, -32, -352], 'threshold': 50, 'carried': -49}, [0, 1427, 0]), ('regression', {'lines': [], 'threshold': 500, 'carried': 499}, [0, 0, 499]), ('partial-repair probe', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('partial-repair probe', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [120, 341, 183, 393], 'threshold': 500, 'carried': 0}, [1037, 0, 0]), ('normal control', {'lines': [376], 'threshold': 500, 'carried': 0}, [0, 0, 376]), ('normal control', {'lines': [458], 'threshold': 100, 'carried': 0}, [458, 0, 0]), ('normal control', {'lines': [239], 'threshold': 100, 'carried': 0}, [239, 0, 0])], [('regression', {'lines': [382, -579, 100], 'threshold': 500, 'carried': 299}, [0, 0, 202]), ('regression', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('partial-repair probe', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('partial-repair probe', {'lines': [145, -201, 592, 509], 'threshold': 500, 'carried': 0}, [1045, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [336], 'threshold': 100, 'carried': 0}, [336, 0, 0]), ('normal control', {'lines': [41], 'threshold': 500, 'carried': 0}, [0, 0, 41]), ('normal control', {'lines': [360], 'threshold': 500, 'carried': 0}, [0, 0, 360]), ('normal control', {'lines': [263, 589], 'threshold': 100, 'carried': 0}, [852, 0, 0])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"37656c965a5608125d46d584e34564292d68eb07df70f640c79e902df177825e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pending = sum(x['lines'])\n    if pending >= x['threshold']:\n        return [pending, 0, 0]\n    if pending <= -x['threshold']:\n        return [0, -pending, 0]\n    return [0, 0, pending]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('regression (boundary)', {'lines': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-100], 'threshold': 100, 'carried': 0}, [0, 100, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [481], 'threshold': 100, 'carried': 0}, [481, 0, 0]), ('normal control', {'lines': [207], 'threshold': 500, 'carried': 0}, [0, 0, 207]), ('normal control', {'lines': [429], 'threshold': 100, 'carried': 0}, [429, 0, 0]), ('normal control', {'lines': [97], 'threshold': 50, 'carried': 0}, [97, 0, 0])], [('regression', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('partial-repair probe', {'lines': [61, 426, -138, 400], 'threshold': 50, 'carried': 0}, [749, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [344], 'threshold': 100, 'carried': 0}, [344, 0, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [326, 112, 108, 591], 'threshold': 50, 'carried': 0}, [1137, 0, 0]), ('normal control', {'lines': [127], 'threshold': 100, 'carried': 0}, [127, 0, 0])], [('regression', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('regression (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('partial-repair probe', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('partial-repair probe', {'lines': [-381, 116], 'threshold': 500, 'carried': 0}, [0, 0, -265]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [341], 'threshold': 500, 'carried': 0}, [0, 0, 341]), ('normal control', {'lines': [], 'threshold': 500, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [], 'threshold': 100, 'carried': 0}, [0, 0, 0]), ('normal control', {'lines': [225], 'threshold': 500, 'carried': 0}, [0, 0, 225])], [('regression', {'lines': [-497, -497, -32, -352], 'threshold': 50, 'carried': -49}, [0, 1427, 0]), ('regression', {'lines': [], 'threshold': 500, 'carried': 499}, [0, 0, 499]), ('partial-repair probe', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('partial-repair probe', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [120, 341, 183, 393], 'threshold': 500, 'carried': 0}, [1037, 0, 0]), ('normal control', {'lines': [376], 'threshold': 500, 'carried': 0}, [0, 0, 376]), ('normal control', {'lines': [458], 'threshold': 100, 'carried': 0}, [458, 0, 0]), ('normal control', {'lines': [239], 'threshold': 100, 'carried': 0}, [239, 0, 0])], [('regression', {'lines': [382, -579, 100], 'threshold': 500, 'carried': 299}, [0, 0, 202]), ('regression', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('partial-repair probe', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('partial-repair probe', {'lines': [145, -201, 592, 509], 'threshold': 500, 'carried': 0}, [1045, 0, 0]), ('boundary control', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('boundary control', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('normal control', {'lines': [336], 'threshold': 100, 'carried': 0}, [336, 0, 0]), ('normal control', {'lines': [41], 'threshold': 500, 'carried': 0}, [0, 0, 41]), ('normal control', {'lines': [360], 'threshold': 500, 'carried': 0}, [0, 0, 360]), ('normal control', {'lines': [263, 589], 'threshold': 100, 'carried': 0}, [852, 0, 0])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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 teaching model of a stipulated billing rule. It makes no claim to reproduce any billing provider's exact behaviour and is not billing software. 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-subscription-proration-proration-minimum-threshold-carried-amount-inclusion","generated_at":"2026-09-29T14:46:38.174494+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tiny proration amounts are deferred to avoid micro-charges, but must not be lost.","root_cause":"The carried amount is dropped when computing pending prorations.","sha256":"b9f26d520b3a0a0b96d399f7390704c550df57ba5ed2e976809681e9b36943af","title":"Minimum threshold for invoicing prorations: carried amount inclusion · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.401,"exit_code":1,"observations":[{"actual":[0,0,10],"check":"regression (boundary) 0","expected":[0,50,0],"passed":false},{"actual":[50,0,0],"check":"regression (boundary) 1","expected":[50,0,0],"passed":true},{"actual":[150,0,0],"check":"partial-repair probe (boundary) 2","expected":[100,0,0],"passed":false},{"actual":[0,0,0],"check":"partial-repair probe (boundary) 3","expected":[0,100,0],"passed":false},{"actual":[500,0,0],"check":"boundary control 4","expected":[500,0,0],"passed":true},{"actual":[50,0,0],"check":"boundary control 5","expected":[50,0,0],"passed":true},{"actual":[481,0,0],"check":"normal control 6","expected":[481,0,0],"passed":true},{"actual":[0,0,207],"check":"normal control 7","expected":[0,0,207],"passed":true},{"actual":[429,0,0],"check":"normal control 8","expected":[429,0,0],"passed":true},{"actual":[97,0,0],"check":"normal control 9","expected":[97,0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [0, 0, 10], \"expected\": [0, 50, 0], \"passed\": false}, {\"check\": \"regression (boundary) 1\", \"actual\": [50, 0, 0], \"expected\": [50, 0, 0], \"passed\": true}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [150, 0, 0], \"expected\": [100, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe (boundary) 3\", \"actual\": [0, 0, 0], \"expected\": [0, 100, 0], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [500, 0, 0], \"expected\": [500, 0, 0], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [50, 0, 0], \"expected\": [50, 0, 0], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [481, 0, 0], \"expected\": [481, 0, 0], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, 207], \"expected\": [0, 0, 207], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [429, 0, 0], \"expected\": [429, 0, 0], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [97, 0, 0], \"expected\": [97, 0, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.719,"exit_code":1,"observations":[{"actual":[0,60,0],"check":"regression (boundary) 0","expected":[0,50,0],"passed":false},{"actual":[0,0,30],"check":"regression (boundary) 1","expected":[50,0,0],"passed":false},{"actual":[100,0,0],"check":"partial-repair probe (boundary) 2","expected":[100,0,0],"passed":true},{"actual":[0,100,0],"check":"partial-repair probe (boundary) 3","expected":[0,100,0],"passed":true},{"actual":[500,0,0],"check":"boundary control 4","expected":[500,0,0],"passed":true},{"actual":[50,0,0],"check":"boundary control 5","expected":[50,0,0],"passed":true},{"actual":[481,0,0],"check":"normal control 6","expected":[481,0,0],"passed":true},{"actual":[0,0,207],"check":"normal control 7","expected":[0,0,207],"passed":true},{"actual":[429,0,0],"check":"normal control 8","expected":[429,0,0],"passed":true},{"actual":[97,0,0],"check":"normal control 9","expected":[97,0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [0, 60, 0], \"expected\": [0, 50, 0], \"passed\": false}, {\"check\": \"regression (boundary) 1\", \"actual\": [0, 0, 30], \"expected\": [50, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [100, 0, 0], \"expected\": [100, 0, 0], \"passed\": true}, {\"check\": \"partial-repair probe (boundary) 3\", \"actual\": [0, 100, 0], \"expected\": [0, 100, 0], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [500, 0, 0], \"expected\": [500, 0, 0], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [50, 0, 0], \"expected\": [50, 0, 0], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [481, 0, 0], \"expected\": [481, 0, 0], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, 207], \"expected\": [0, 0, 207], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [429, 0, 0], \"expected\": [429, 0, 0], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [97, 0, 0], \"expected\": [97, 0, 0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}