{"abstract":"Two changes submitted in the same second produce two sets of proration lines.","category":"Subscription proration billing","checks":8,"contract":"Input {start, end, initial price, changes: [[t, price]]}. Changes are ordered by time; at equal times only the last applies. A change outside [start, end) or to the current price is ignored. Each effective change emits a credit line -(current*(end-t)/span) and a debit line new*(end-t)/span, magnitudes half-up, and the new price becomes current. Return the list of line amounts.","evaluation_group":"w2-subscription-proration-sequential-plan-changes","failed_approach":"The attempt keeps the first simultaneous change instead of the last.","family":"w2-subscription-proration-sequential-plan-changes-same-time-collapse","id":"FA-59606","implementations":{"attempt":{"sha256":"058373d8f34a567fe89954b5f8bc9b8af89f94287345c862614df696e729212f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    span = x['end'] - x['start']\n    ch = sorted(x['changes'], key=lambda c: c[0])\n    dedup = []\n    for t, p in ch:\n        if dedup and dedup[-1][0] == t:\n            pass\n        else:\n            dedup.append([t, p])\n    cur = x['initial']\n    lines = []\n    for t, p in dedup:\n        if t < x['start'] or t >= x['end'] or p == cur:\n            continue\n        left = x['end'] - t\n        lines.append(-((cur * left * 2 + span) // (2 * span)))\n        lines.append((p * left * 2 + span) // (2 * span))\n        cur = p\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 983, 'end': 1348, 'initial': 2000, 'changes': [[1164, 5000], [1164, 7000]]}, [-1008, 3529]), ('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('partial-repair probe', {'start': 3, 'end': 34, 'initial': 5000, 'changes': [[34, 2000], [14, 5000], [14, 2000], [16, 5000]]}, [-3226, 1290, -1161, 2903]), ('partial-repair probe', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('normal control', {'start': 925, 'end': 955, 'initial': 1000, 'changes': [[940, 1000], [922, 5000]]}, []), ('normal control', {'start': 984, 'end': 1015, 'initial': 2000, 'changes': [[1001, 5000], [1014, 3956], [981, 1000]]}, [-903, 2258, -161, 128]), ('normal control', {'start': 605, 'end': 636, 'initial': 1000, 'changes': [[610, 1000], [625, 5000], [602, 1000], [602, 2000]]}, [-355, 1774]), ('normal control', {'start': 446, 'end': 811, 'initial': 2000, 'changes': [[443, 5000]]}, [])], [('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('partial-repair probe', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('normal control', {'start': 526, 'end': 557, 'initial': 5000, 'changes': []}, []), ('normal control', {'start': 534, 'end': 565, 'initial': 5000, 'changes': [[565, 1007], [565, 1000], [539, 1000], [537, 2000]]}, [-4516, 1806, -1677, 839]), ('normal control', {'start': 670, 'end': 700, 'initial': 2000, 'changes': [[678, 520], [700, 1000], [691, 5000]]}, [-1467, 381, -156, 1500]), ('normal control', {'start': 968, 'end': 1333, 'initial': 1000, 'changes': [[1333, 1000], [965, 5000], [1171, 2000]]}, [-444, 888])], [('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('normal control', {'start': 796, 'end': 827, 'initial': 2000, 'changes': [[819, 2000], [827, 2383], [799, 1000], [827, 1000]]}, [-1806, 903, -258, 516]), ('normal control', {'start': 918, 'end': 948, 'initial': 1000, 'changes': [[920, 4137], [928, 1000], [948, 1000], [948, 7000]]}, [-933, 3861, -2758, 667]), ('normal control', {'start': 198, 'end': 563, 'initial': 1000, 'changes': [[263, 5000], [461, 2011], [195, 5000], [493, 1242]]}, [-822, 4110, -1397, 562, -386, 238]), ('normal control', {'start': 597, 'end': 627, 'initial': 2000, 'changes': [[594, 4502], [594, 7000]]}, [])], [('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 268, 'end': 299, 'initial': 2000, 'changes': [[265, 1000], [277, 7070], [277, 1000]]}, [-1419, 710]), ('normal control', {'start': 903, 'end': 1268, 'initial': 1000, 'changes': [[900, 3996]]}, []), ('normal control', {'start': 925, 'end': 956, 'initial': 2000, 'changes': [[935, 95], [925, 5000], [956, 1000], [956, 1000]]}, [-2000, 5000, -3387, 64]), ('normal control', {'start': 382, 'end': 747, 'initial': 2000, 'changes': [[508, 5000]]}, [-1310, 3274]), ('normal control', {'start': 414, 'end': 445, 'initial': 2000, 'changes': [[445, 1000], [434, 1000], [431, 8555]]}, [-903, 3864, -3036, 355])], [('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('regression', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 140, 'end': 170, 'initial': 2000, 'changes': [[137, 5000], [158, 1000], [157, 2000], [157, 1000]]}, [-867, 433]), ('partial-repair probe', {'start': 479, 'end': 509, 'initial': 2000, 'changes': [[476, 5319], [484, 5000], [505, 5000], [507, 5000], [507, 1000]]}, [-1667, 4167, -333, 67]), ('normal control', {'start': 398, 'end': 429, 'initial': 5000, 'changes': [[429, 4572], [429, 1000]]}, []), ('normal control', {'start': 677, 'end': 1042, 'initial': 5000, 'changes': [[1042, 5000], [1042, 5000]]}, []), ('normal control', {'start': 849, 'end': 879, 'initial': 5000, 'changes': [[879, 7238], [846, 4596], [846, 5000], [863, 2000]]}, [-2667, 1067]), ('normal control', {'start': 358, 'end': 388, 'initial': 5000, 'changes': [[355, 4064], [386, 5000], [373, 2000]]}, [-2500, 1000, -133, 333])]]\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":"f9e2ad8d58e055ef08cfa9d619d4212155e46a39de48eca11bd2ca1cbe96d0ff","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    span = x['end'] - x['start']\n    ch = sorted(x['changes'], key=lambda c: c[0])\n    dedup = []\n    for t, p in ch:\n        if dedup and dedup[-1][0] == t:\n            dedup.append([t, p])\n        else:\n            dedup.append([t, p])\n    cur = x['initial']\n    lines = []\n    for t, p in dedup:\n        if t < x['start'] or t >= x['end'] or p == cur:\n            continue\n        left = x['end'] - t\n        lines.append(-((cur * left * 2 + span) // (2 * span)))\n        lines.append((p * left * 2 + span) // (2 * span))\n        cur = p\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 983, 'end': 1348, 'initial': 2000, 'changes': [[1164, 5000], [1164, 7000]]}, [-1008, 3529]), ('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('partial-repair probe', {'start': 3, 'end': 34, 'initial': 5000, 'changes': [[34, 2000], [14, 5000], [14, 2000], [16, 5000]]}, [-3226, 1290, -1161, 2903]), ('partial-repair probe', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('normal control', {'start': 925, 'end': 955, 'initial': 1000, 'changes': [[940, 1000], [922, 5000]]}, []), ('normal control', {'start': 984, 'end': 1015, 'initial': 2000, 'changes': [[1001, 5000], [1014, 3956], [981, 1000]]}, [-903, 2258, -161, 128]), ('normal control', {'start': 605, 'end': 636, 'initial': 1000, 'changes': [[610, 1000], [625, 5000], [602, 1000], [602, 2000]]}, [-355, 1774]), ('normal control', {'start': 446, 'end': 811, 'initial': 2000, 'changes': [[443, 5000]]}, [])], [('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('partial-repair probe', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('normal control', {'start': 526, 'end': 557, 'initial': 5000, 'changes': []}, []), ('normal control', {'start': 534, 'end': 565, 'initial': 5000, 'changes': [[565, 1007], [565, 1000], [539, 1000], [537, 2000]]}, [-4516, 1806, -1677, 839]), ('normal control', {'start': 670, 'end': 700, 'initial': 2000, 'changes': [[678, 520], [700, 1000], [691, 5000]]}, [-1467, 381, -156, 1500]), ('normal control', {'start': 968, 'end': 1333, 'initial': 1000, 'changes': [[1333, 1000], [965, 5000], [1171, 2000]]}, [-444, 888])], [('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('normal control', {'start': 796, 'end': 827, 'initial': 2000, 'changes': [[819, 2000], [827, 2383], [799, 1000], [827, 1000]]}, [-1806, 903, -258, 516]), ('normal control', {'start': 918, 'end': 948, 'initial': 1000, 'changes': [[920, 4137], [928, 1000], [948, 1000], [948, 7000]]}, [-933, 3861, -2758, 667]), ('normal control', {'start': 198, 'end': 563, 'initial': 1000, 'changes': [[263, 5000], [461, 2011], [195, 5000], [493, 1242]]}, [-822, 4110, -1397, 562, -386, 238]), ('normal control', {'start': 597, 'end': 627, 'initial': 2000, 'changes': [[594, 4502], [594, 7000]]}, [])], [('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 268, 'end': 299, 'initial': 2000, 'changes': [[265, 1000], [277, 7070], [277, 1000]]}, [-1419, 710]), ('normal control', {'start': 903, 'end': 1268, 'initial': 1000, 'changes': [[900, 3996]]}, []), ('normal control', {'start': 925, 'end': 956, 'initial': 2000, 'changes': [[935, 95], [925, 5000], [956, 1000], [956, 1000]]}, [-2000, 5000, -3387, 64]), ('normal control', {'start': 382, 'end': 747, 'initial': 2000, 'changes': [[508, 5000]]}, [-1310, 3274]), ('normal control', {'start': 414, 'end': 445, 'initial': 2000, 'changes': [[445, 1000], [434, 1000], [431, 8555]]}, [-903, 3864, -3036, 355])], [('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('regression', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 140, 'end': 170, 'initial': 2000, 'changes': [[137, 5000], [158, 1000], [157, 2000], [157, 1000]]}, [-867, 433]), ('partial-repair probe', {'start': 479, 'end': 509, 'initial': 2000, 'changes': [[476, 5319], [484, 5000], [505, 5000], [507, 5000], [507, 1000]]}, [-1667, 4167, -333, 67]), ('normal control', {'start': 398, 'end': 429, 'initial': 5000, 'changes': [[429, 4572], [429, 1000]]}, []), ('normal control', {'start': 677, 'end': 1042, 'initial': 5000, 'changes': [[1042, 5000], [1042, 5000]]}, []), ('normal control', {'start': 849, 'end': 879, 'initial': 5000, 'changes': [[879, 7238], [846, 4596], [846, 5000], [863, 2000]]}, [-2667, 1067]), ('normal control', {'start': 358, 'end': 388, 'initial': 5000, 'changes': [[355, 4064], [386, 5000], [373, 2000]]}, [-2500, 1000, -133, 333])]]\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"},"fixed":{"sha256":"c8fd27085877bfb2dbd22f85b6d3ca5f98df73a9720f125251f64a27a2b5d152","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    span = x['end'] - x['start']\n    ch = sorted(x['changes'], key=lambda c: c[0])\n    dedup = []\n    for t, p in ch:\n        if dedup and dedup[-1][0] == t:\n            dedup[-1] = [t, p]\n        else:\n            dedup.append([t, p])\n    cur = x['initial']\n    lines = []\n    for t, p in dedup:\n        if t < x['start'] or t >= x['end'] or p == cur:\n            continue\n        left = x['end'] - t\n        lines.append(-((cur * left * 2 + span) // (2 * span)))\n        lines.append((p * left * 2 + span) // (2 * span))\n        cur = p\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 983, 'end': 1348, 'initial': 2000, 'changes': [[1164, 5000], [1164, 7000]]}, [-1008, 3529]), ('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('partial-repair probe', {'start': 3, 'end': 34, 'initial': 5000, 'changes': [[34, 2000], [14, 5000], [14, 2000], [16, 5000]]}, [-3226, 1290, -1161, 2903]), ('partial-repair probe', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('normal control', {'start': 925, 'end': 955, 'initial': 1000, 'changes': [[940, 1000], [922, 5000]]}, []), ('normal control', {'start': 984, 'end': 1015, 'initial': 2000, 'changes': [[1001, 5000], [1014, 3956], [981, 1000]]}, [-903, 2258, -161, 128]), ('normal control', {'start': 605, 'end': 636, 'initial': 1000, 'changes': [[610, 1000], [625, 5000], [602, 1000], [602, 2000]]}, [-355, 1774]), ('normal control', {'start': 446, 'end': 811, 'initial': 2000, 'changes': [[443, 5000]]}, [])], [('regression', {'start': 791, 'end': 822, 'initial': 5000, 'changes': [[791, 1000], [806, 3745], [806, 2000]]}, [-5000, 1000, -516, 1032]), ('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('partial-repair probe', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('normal control', {'start': 526, 'end': 557, 'initial': 5000, 'changes': []}, []), ('normal control', {'start': 534, 'end': 565, 'initial': 5000, 'changes': [[565, 1007], [565, 1000], [539, 1000], [537, 2000]]}, [-4516, 1806, -1677, 839]), ('normal control', {'start': 670, 'end': 700, 'initial': 2000, 'changes': [[678, 520], [700, 1000], [691, 5000]]}, [-1467, 381, -156, 1500]), ('normal control', {'start': 968, 'end': 1333, 'initial': 1000, 'changes': [[1333, 1000], [965, 5000], [1171, 2000]]}, [-444, 888])], [('regression', {'start': 818, 'end': 848, 'initial': 2000, 'changes': [[822, 4662], [848, 5000], [815, 5000], [832, 2000], [832, 7000]]}, [-1733, 4040, -2486, 3733]), ('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('partial-repair probe', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('normal control', {'start': 796, 'end': 827, 'initial': 2000, 'changes': [[819, 2000], [827, 2383], [799, 1000], [827, 1000]]}, [-1806, 903, -258, 516]), ('normal control', {'start': 918, 'end': 948, 'initial': 1000, 'changes': [[920, 4137], [928, 1000], [948, 1000], [948, 7000]]}, [-933, 3861, -2758, 667]), ('normal control', {'start': 198, 'end': 563, 'initial': 1000, 'changes': [[263, 5000], [461, 2011], [195, 5000], [493, 1242]]}, [-822, 4110, -1397, 562, -386, 238]), ('normal control', {'start': 597, 'end': 627, 'initial': 2000, 'changes': [[594, 4502], [594, 7000]]}, [])], [('regression', {'start': 314, 'end': 345, 'initial': 5000, 'changes': [[345, 5000], [311, 2000], [337, 1000], [340, 768], [340, 7000]]}, [-1290, 258, -161, 1129]), ('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('partial-repair probe', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 268, 'end': 299, 'initial': 2000, 'changes': [[265, 1000], [277, 7070], [277, 1000]]}, [-1419, 710]), ('normal control', {'start': 903, 'end': 1268, 'initial': 1000, 'changes': [[900, 3996]]}, []), ('normal control', {'start': 925, 'end': 956, 'initial': 2000, 'changes': [[935, 95], [925, 5000], [956, 1000], [956, 1000]]}, [-2000, 5000, -3387, 64]), ('normal control', {'start': 382, 'end': 747, 'initial': 2000, 'changes': [[508, 5000]]}, [-1310, 3274]), ('normal control', {'start': 414, 'end': 445, 'initial': 2000, 'changes': [[445, 1000], [434, 1000], [431, 8555]]}, [-903, 3864, -3036, 355])], [('regression', {'start': 707, 'end': 737, 'initial': 1000, 'changes': [[704, 1000], [716, 3529], [710, 2000], [735, 1000], [735, 2000]]}, [-900, 1800, -1400, 2470, -235, 133]), ('regression', {'start': 263, 'end': 293, 'initial': 2000, 'changes': [[283, 3865], [283, 1000]]}, [-667, 333]), ('partial-repair probe', {'start': 140, 'end': 170, 'initial': 2000, 'changes': [[137, 5000], [158, 1000], [157, 2000], [157, 1000]]}, [-867, 433]), ('partial-repair probe', {'start': 479, 'end': 509, 'initial': 2000, 'changes': [[476, 5319], [484, 5000], [505, 5000], [507, 5000], [507, 1000]]}, [-1667, 4167, -333, 67]), ('normal control', {'start': 398, 'end': 429, 'initial': 5000, 'changes': [[429, 4572], [429, 1000]]}, []), ('normal control', {'start': 677, 'end': 1042, 'initial': 5000, 'changes': [[1042, 5000], [1042, 5000]]}, []), ('normal control', {'start': 849, 'end': 879, 'initial': 5000, 'changes': [[879, 7238], [846, 4596], [846, 5000], [863, 2000]]}, [-2667, 1067]), ('normal control', {'start': 358, 'end': 388, 'initial': 5000, 'changes': [[355, 4064], [386, 5000], [373, 2000]]}, [-2500, 1000, -133, 333])]]\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-sequential-plan-changes-same-time-collapse","generated_at":"2026-09-29T14:46:37.851529+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Customers who change plans several times in a cycle must be credited for the plan they actually had at each change.","repair":"Restore the contract rule at the same-time collapse step: use `dedup[-1] = [t, p]`.","root_cause":"Simultaneous changes are all applied instead of only the last.","sha256":"4c30db2d0e97646154c0d5fe73222b38c34fc250b3b111c82a55489d1daf69c2","title":"Sequential plan changes within one cycle: same-time collapse · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.154,"exit_code":1,"observations":[{"actual":[-1008,2521],"check":"regression 0","expected":[-1008,3529],"passed":false},{"actual":[-5000,1000,-516,1933],"check":"regression 1","expected":[-5000,1000,-516,1032],"passed":false},{"actual":[],"check":"partial-repair probe 2","expected":[-3226,1290,-1161,2903],"passed":false},{"actual":[-1733,4040,-2486,1067],"check":"partial-repair probe 3","expected":[-1733,4040,-2486,3733],"passed":false},{"actual":[],"check":"normal control 4","expected":[],"passed":true},{"actual":[-903,2258,-161,128],"check":"normal control 5","expected":[-903,2258,-161,128],"passed":true},{"actual":[-355,1774],"check":"normal control 6","expected":[-355,1774],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [-1008, 2521], \"expected\": [-1008, 3529], \"passed\": false}, {\"check\": \"regression 1\", \"actual\": [-5000, 1000, -516, 1933], \"expected\": [-5000, 1000, -516, 1032], \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": [], \"expected\": [-3226, 1290, -1161, 2903], \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": [-1733, 4040, -2486, 1067], \"expected\": [-1733, 4040, -2486, 3733], \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [-903, 2258, -161, 128], \"expected\": [-903, 2258, -161, 128], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [-355, 1774], \"expected\": [-355, 1774], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.156,"exit_code":1,"observations":[{"actual":[-1008,2521,-2521,3529],"check":"regression 0","expected":[-1008,3529],"passed":false},{"actual":[-5000,1000,-516,1933,-1933,1032],"check":"regression 1","expected":[-5000,1000,-516,1032],"passed":false},{"actual":[-3226,1290,-1161,2903],"check":"partial-repair probe 2","expected":[-3226,1290,-1161,2903],"passed":true},{"actual":[-1733,4040,-2486,1067,-1067,3733],"check":"partial-repair probe 3","expected":[-1733,4040,-2486,3733],"passed":false},{"actual":[],"check":"normal control 4","expected":[],"passed":true},{"actual":[-903,2258,-161,128],"check":"normal control 5","expected":[-903,2258,-161,128],"passed":true},{"actual":[-355,1774],"check":"normal control 6","expected":[-355,1774],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [-1008, 2521, -2521, 3529], \"expected\": [-1008, 3529], \"passed\": false}, {\"check\": \"regression 1\", \"actual\": [-5000, 1000, -516, 1933, -1933, 1032], \"expected\": [-5000, 1000, -516, 1032], \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": [-3226, 1290, -1161, 2903], \"expected\": [-3226, 1290, -1161, 2903], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [-1733, 4040, -2486, 1067, -1067, 3733], \"expected\": [-1733, 4040, -2486, 3733], \"passed\": false}, {\"check\": \"normal control 4\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [-903, 2258, -161, 128], \"expected\": [-903, 2258, -161, 128], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [-355, 1774], \"expected\": [-355, 1774], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.529,"exit_code":0,"observations":[{"actual":[-1008,3529],"check":"regression 0","expected":[-1008,3529],"passed":true},{"actual":[-5000,1000,-516,1032],"check":"regression 1","expected":[-5000,1000,-516,1032],"passed":true},{"actual":[-3226,1290,-1161,2903],"check":"partial-repair probe 2","expected":[-3226,1290,-1161,2903],"passed":true},{"actual":[-1733,4040,-2486,3733],"check":"partial-repair probe 3","expected":[-1733,4040,-2486,3733],"passed":true},{"actual":[],"check":"normal control 4","expected":[],"passed":true},{"actual":[-903,2258,-161,128],"check":"normal control 5","expected":[-903,2258,-161,128],"passed":true},{"actual":[-355,1774],"check":"normal control 6","expected":[-355,1774],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [-1008, 3529], \"expected\": [-1008, 3529], \"passed\": true}, {\"check\": \"regression 1\", \"actual\": [-5000, 1000, -516, 1032], \"expected\": [-5000, 1000, -516, 1032], \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": [-3226, 1290, -1161, 2903], \"expected\": [-3226, 1290, -1161, 2903], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [-1733, 4040, -2486, 3733], \"expected\": [-1733, 4040, -2486, 3733], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [-903, 2258, -161, 128], \"expected\": [-903, 2258, -161, 128], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [-355, 1774], \"expected\": [-355, 1774], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}