{"abstract":"Pending amounts exactly at the threshold are carried instead of invoiced.","category":"Subscription proration billing","checks":8,"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 uses the magnitude, invoicing large credits as negative charges.","family":"w2-subscription-proration-proration-minimum-threshold-invoice-threshold","id":"FA-59646","implementations":{"attempt":{"sha256":"193801e1a0ea89e14a13d73007f718f3f83b3a59444202846ebd09a08b902b77","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pending = x['carried'] + sum(x['lines'])\n    if abs(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': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-100], 'threshold': 100, 'carried': 0}, [0, 100, 0]), ('partial-repair probe (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('normal control', {'lines': [61, 426, -138, 400], 'threshold': 50, 'carried': 0}, [749, 0, 0]), ('normal control', {'lines': [], 'threshold': 500, 'carried': 499}, [0, 0, 499]), ('normal control', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('normal control', {'lines': [-381, 116], 'threshold': 500, 'carried': 0}, [0, 0, -265])], [('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('regression (boundary)', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('partial-repair probe', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('partial-repair probe', {'lines': [-497, -497, -32, -352], 'threshold': 50, 'carried': -49}, [0, 1427, 0]), ('normal control', {'lines': [], 'threshold': 500, 'carried': -499}, [0, 0, -499]), ('normal control', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('normal control', {'lines': [145, -201, 592, 509], 'threshold': 500, 'carried': 0}, [1045, 0, 0]), ('normal control', {'lines': [382, -579, 100], 'threshold': 500, 'carried': 299}, [0, 0, 202])], [('regression (boundary)', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('regression (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('partial-repair probe', {'lines': [2, -134, -347, 119], 'threshold': 50, 'carried': 0}, [0, 360, 0]), ('partial-repair probe', {'lines': [-325], 'threshold': 500, 'carried': -499}, [0, 824, 0]), ('normal control', {'lines': [3], 'threshold': 100, 'carried': 49}, [0, 0, 52]), ('normal control', {'lines': [481], 'threshold': 100, 'carried': 0}, [481, 0, 0]), ('normal control', {'lines': [184, -104], 'threshold': 50, 'carried': 0}, [80, 0, 0]), ('normal control', {'lines': [131], 'threshold': 100, 'carried': 99}, [230, 0, 0])], [('regression (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('regression (boundary)', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('partial-repair probe', {'lines': [218, -553], 'threshold': 100, 'carried': -99}, [0, 434, 0]), ('partial-repair probe', {'lines': [-336, -428, -165, 586], 'threshold': 50, 'carried': 49}, [0, 294, 0]), ('normal control', {'lines': [140, 140], 'threshold': 100, 'carried': -99}, [181, 0, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': 49}, [0, 0, 49]), ('normal control', {'lines': [], 'threshold': 100, 'carried': -99}, [0, 0, -99]), ('normal control', {'lines': [489], 'threshold': 50, 'carried': -49}, [440, 0, 0])], [('regression (boundary)', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('regression (boundary)', {'lines': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('partial-repair probe', {'lines': [111, -322], 'threshold': 500, 'carried': -499}, [0, 710, 0]), ('partial-repair probe', {'lines': [-510, 83, 385, -249], 'threshold': 100, 'carried': -99}, [0, 390, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': -41}, [0, 0, -41]), ('normal control', {'lines': [462, -187], 'threshold': 50, 'carried': 49}, [324, 0, 0]), ('normal control', {'lines': [425, 134, -443, 185], 'threshold': 100, 'carried': -99}, [202, 0, 0]), ('normal control', {'lines': [-98, 187, -568, 507], 'threshold': 100, 'carried': 99}, [127, 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":"bbc6b1471aea601dc45856ccf592da4798f360a96442b92ae28b4845f7195929","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pending = x['carried'] + 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': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('partial-repair probe (boundary)', {'lines': [-100], 'threshold': 100, 'carried': 0}, [0, 100, 0]), ('partial-repair probe (boundary)', {'lines': [-60], 'threshold': 50, 'carried': 10}, [0, 50, 0]), ('normal control', {'lines': [61, 426, -138, 400], 'threshold': 50, 'carried': 0}, [749, 0, 0]), ('normal control', {'lines': [], 'threshold': 500, 'carried': 499}, [0, 0, 499]), ('normal control', {'lines': [518, -386], 'threshold': 500, 'carried': 499}, [631, 0, 0]), ('normal control', {'lines': [-381, 116], 'threshold': 500, 'carried': 0}, [0, 0, -265])], [('regression (boundary)', {'lines': [], 'threshold': 100, 'carried': 100}, [100, 0, 0]), ('regression (boundary)', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('partial-repair probe', {'lines': [340, -379, -241], 'threshold': 50, 'carried': -6}, [0, 286, 0]), ('partial-repair probe', {'lines': [-497, -497, -32, -352], 'threshold': 50, 'carried': -49}, [0, 1427, 0]), ('normal control', {'lines': [], 'threshold': 500, 'carried': -499}, [0, 0, -499]), ('normal control', {'lines': [-95, 305], 'threshold': 100, 'carried': 0}, [210, 0, 0]), ('normal control', {'lines': [145, -201, 592, 509], 'threshold': 500, 'carried': 0}, [1045, 0, 0]), ('normal control', {'lines': [382, -579, 100], 'threshold': 500, 'carried': 299}, [0, 0, 202])], [('regression (boundary)', {'lines': [250, 250], 'threshold': 500, 'carried': 0}, [500, 0, 0]), ('regression (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('partial-repair probe', {'lines': [2, -134, -347, 119], 'threshold': 50, 'carried': 0}, [0, 360, 0]), ('partial-repair probe', {'lines': [-325], 'threshold': 500, 'carried': -499}, [0, 824, 0]), ('normal control', {'lines': [3], 'threshold': 100, 'carried': 49}, [0, 0, 52]), ('normal control', {'lines': [481], 'threshold': 100, 'carried': 0}, [481, 0, 0]), ('normal control', {'lines': [184, -104], 'threshold': 50, 'carried': 0}, [80, 0, 0]), ('normal control', {'lines': [131], 'threshold': 100, 'carried': 99}, [230, 0, 0])], [('regression (boundary)', {'lines': [-50, 150], 'threshold': 100, 'carried': 0}, [100, 0, 0]), ('regression (boundary)', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('partial-repair probe', {'lines': [218, -553], 'threshold': 100, 'carried': -99}, [0, 434, 0]), ('partial-repair probe', {'lines': [-336, -428, -165, 586], 'threshold': 50, 'carried': 49}, [0, 294, 0]), ('normal control', {'lines': [140, 140], 'threshold': 100, 'carried': -99}, [181, 0, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': 49}, [0, 0, 49]), ('normal control', {'lines': [], 'threshold': 100, 'carried': -99}, [0, 0, -99]), ('normal control', {'lines': [489], 'threshold': 50, 'carried': -49}, [440, 0, 0])], [('regression (boundary)', {'lines': [40, 10], 'threshold': 50, 'carried': 0}, [50, 0, 0]), ('regression (boundary)', {'lines': [30], 'threshold': 50, 'carried': 20}, [50, 0, 0]), ('partial-repair probe', {'lines': [111, -322], 'threshold': 500, 'carried': -499}, [0, 710, 0]), ('partial-repair probe', {'lines': [-510, 83, 385, -249], 'threshold': 100, 'carried': -99}, [0, 390, 0]), ('normal control', {'lines': [], 'threshold': 50, 'carried': -41}, [0, 0, -41]), ('normal control', {'lines': [462, -187], 'threshold': 50, 'carried': 49}, [324, 0, 0]), ('normal control', {'lines': [425, 134, -443, 185], 'threshold': 100, 'carried': -99}, [202, 0, 0]), ('normal control', {'lines': [-98, 187, -568, 507], 'threshold': 100, 'carried': 99}, [127, 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-invoice-threshold","generated_at":"2026-09-29T14:46:38.223666+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 invoice test is exclusive at the threshold.","sha256":"c83989b257481ea7260870a0eeb1eb8a8609c4aa3af316e5cc2b5da01bfbfba1","title":"Minimum threshold for invoicing prorations: invoice threshold · 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":38.489,"exit_code":1,"observations":[{"actual":[50,0,0],"check":"regression (boundary) 0","expected":[50,0,0],"passed":true},{"actual":[100,0,0],"check":"regression (boundary) 1","expected":[100,0,0],"passed":true},{"actual":[-100,0,0],"check":"partial-repair probe (boundary) 2","expected":[0,100,0],"passed":false},{"actual":[-50,0,0],"check":"partial-repair probe (boundary) 3","expected":[0,50,0],"passed":false},{"actual":[749,0,0],"check":"normal control 4","expected":[749,0,0],"passed":true},{"actual":[0,0,499],"check":"normal control 5","expected":[0,0,499],"passed":true},{"actual":[631,0,0],"check":"normal control 6","expected":[631,0,0],"passed":true},{"actual":[0,0,-265],"check":"normal control 7","expected":[0,0,-265],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [50, 0, 0], \"expected\": [50, 0, 0], \"passed\": true}, {\"check\": \"regression (boundary) 1\", \"actual\": [100, 0, 0], \"expected\": [100, 0, 0], \"passed\": true}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [-100, 0, 0], \"expected\": [0, 100, 0], \"passed\": false}, {\"check\": \"partial-repair probe (boundary) 3\", \"actual\": [-50, 0, 0], \"expected\": [0, 50, 0], \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": [749, 0, 0], \"expected\": [749, 0, 0], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [0, 0, 499], \"expected\": [0, 0, 499], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [631, 0, 0], \"expected\": [631, 0, 0], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, -265], \"expected\": [0, 0, -265], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.175,"exit_code":1,"observations":[{"actual":[0,0,50],"check":"regression (boundary) 0","expected":[50,0,0],"passed":false},{"actual":[0,0,100],"check":"regression (boundary) 1","expected":[100,0,0],"passed":false},{"actual":[0,100,0],"check":"partial-repair probe (boundary) 2","expected":[0,100,0],"passed":true},{"actual":[0,50,0],"check":"partial-repair probe (boundary) 3","expected":[0,50,0],"passed":true},{"actual":[749,0,0],"check":"normal control 4","expected":[749,0,0],"passed":true},{"actual":[0,0,499],"check":"normal control 5","expected":[0,0,499],"passed":true},{"actual":[631,0,0],"check":"normal control 6","expected":[631,0,0],"passed":true},{"actual":[0,0,-265],"check":"normal control 7","expected":[0,0,-265],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [0, 0, 50], \"expected\": [50, 0, 0], \"passed\": false}, {\"check\": \"regression (boundary) 1\", \"actual\": [0, 0, 100], \"expected\": [100, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [0, 100, 0], \"expected\": [0, 100, 0], \"passed\": true}, {\"check\": \"partial-repair probe (boundary) 3\", \"actual\": [0, 50, 0], \"expected\": [0, 50, 0], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [749, 0, 0], \"expected\": [749, 0, 0], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [0, 0, 499], \"expected\": [0, 0, 499], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [631, 0, 0], \"expected\": [631, 0, 0], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, -265], \"expected\": [0, 0, -265], \"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."}}