{"abstract":"Moving from zero seats produces an empty zero-cent credit line.","category":"Subscription proration billing","checks":10,"contract":"Input unix-second {start, end, change} and {old, qold, new, qnew}. If change < start or change >= end return []. Otherwise left = end - change, span = end - start. An \"unused\" credit line of -(old*qold*left/span) and a \"remaining\" line of new*qnew*left/span are emitted, each magnitude rounded half-up (half away from zero), omitting a line whose price*quantity is 0. Return [[kind, amount]].","evaluation_group":"w2-subscription-proration-second-granular-lines","failed_approach":"The attempt tests quantity alone, emitting zero lines for free plans.","family":"w2-subscription-proration-second-granular-lines-zero-value-line-suppression","id":"FA-59376","implementations":{"attempt":{"sha256":"201325967ffd8703df9a810707c8d9f1e4bc247e97178cf9ef44054afcceb301","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['change'] >= x['end'] or x['change'] < x['start']:\n        return []\n    span = x['end'] - x['start']\n    left = x['end'] - x['change']\n    def hu(n):\n        return (n * 2 + span) // (2 * span)\n    lines = []\n    if x['qold']:\n        lines.append(['unused', -hu(x['old'] * x['qold'] * left)])\n    if x['new'] * x['qnew']:\n        lines.append(['remaining', hu(x['new'] * x['qnew'] * left)])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 1718898066, 'end': 1722579184, 'change': 1721183532, 'old': 87270, 'qold': 0, 'new': 4900, 'qnew': 1}, [['remaining', 1858]]), ('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('partial-repair probe', {'start': 1759898518, 'end': 1762576918, 'change': 1760952409, 'old': 0, 'qold': 3, 'new': 37669, 'qnew': 0}, []), ('partial-repair probe', {'start': 1733742690, 'end': 1736421090, 'change': 1733742690, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 14}, [['remaining', 68600]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1704011568, 'end': 1706689968, 'change': 1706689968, 'old': 1000, 'qold': 3, 'new': 1500, 'qnew': 3}, []), ('normal control', {'start': 1737228310, 'end': 1739499785, 'change': 1739499795, 'old': 178, 'qold': 1, 'new': 1500, 'qnew': 1}, []), ('normal control', {'start': 1732894162, 'end': 1735486162, 'change': 1732894162, 'old': 1000, 'qold': 2, 'new': 91004, 'qnew': 0}, [['unused', -2000]]), ('normal control', {'start': 1749969117, 'end': 1752647517, 'change': 1751393656, 'old': 63152, 'qold': 13, 'new': 0, 'qnew': 0}, [['unused', -384330]])], [('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('partial-repair probe', {'start': 1703542570, 'end': 1706134570, 'change': 1705592728, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 7}, [['remaining', 7170]]), ('partial-repair probe', {'start': 1720582304, 'end': 1723174304, 'change': 1723103614, 'old': 0, 'qold': 1, 'new': 27595, 'qnew': 5}, [['remaining', 3763]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1728579559, 'end': 1760115559, 'change': 1760115559, 'old': 0, 'qold': 0, 'new': 51264, 'qnew': 1}, []), ('normal control', {'start': 1721814513, 'end': 1722419313, 'change': 1722419313, 'old': 0, 'qold': 3, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1720297909, 'end': 1720623118, 'change': 1720623118, 'old': 1000, 'qold': 17, 'new': 0, 'qnew': 0}, []), ('normal control', {'start': 1734629848, 'end': 1766165848, 'change': 1766165848, 'old': 1000, 'qold': 1, 'new': 4900, 'qnew': 1}, [])], [('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1708667964, 'end': 1709272764, 'change': 1708667964, 'old': 0, 'qold': 14, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1757422189, 'end': 1758026989, 'change': 1757422189, 'old': 0, 'qold': 1, 'new': 0, 'qnew': 5}, []), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 11, 'qold': 1, 'new': 13, 'qnew': 1}, [['unused', -6], ['remaining', 7]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 13, 'qold': 1, 'new': 15, 'qnew': 1}, [['unused', -7], ['remaining', 8]]), ('normal control', {'start': 1759524018, 'end': 1763871464, 'change': 1759976835, 'old': 0, 'qold': 0, 'new': 1500, 'qnew': 5}, [['remaining', 6719]]), ('normal control', {'start': 1724743049, 'end': 1756279049, 'change': 1724743049, 'old': 2500, 'qold': 1, 'new': 1500, 'qnew': 1}, [['unused', -2500], ['remaining', 1500]]), ('normal control', {'start': 1742436208, 'end': 1773972208, 'change': 1773972218, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 1}, []), ('normal control', {'start': 1757847857, 'end': 1760439857, 'change': 1757847852, 'old': 92286, 'qold': 0, 'new': 0, 'qnew': 4}, [])], [('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('partial-repair probe', {'start': 1741666940, 'end': 1742271740, 'change': 1742262231, 'old': 0, 'qold': 3, 'new': 51773, 'qnew': 5}, [['remaining', 4070]]), ('partial-repair probe', {'start': 1726326778, 'end': 1757862778, 'change': 1743535077, 'old': 0, 'qold': 3, 'new': 67019, 'qnew': 5}, [['remaining', 152243]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1726496239, 'end': 1729174639, 'change': 1726496239, 'old': 73990, 'qold': 3, 'new': 47429, 'qnew': 5}, [['unused', -221970], ['remaining', 237145]]), ('normal control', {'start': 1739738740, 'end': 1771274740, 'change': 1771274740, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 5}, []), ('normal control', {'start': 1725551908, 'end': 1757087908, 'change': 1757087918, 'old': 67119, 'qold': 3, 'new': 4900, 'qnew': 13}, []), ('normal control', {'start': 1739142581, 'end': 1739747381, 'change': 1739142581, 'old': 26706, 'qold': 3, 'new': 1500, 'qnew': 5}, [['unused', -80118], ['remaining', 7500]])], [('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('regression', {'start': 1702270224, 'end': 1702644112, 'change': 1702432315, 'old': 1000, 'qold': 0, 'new': 97578, 'qnew': 1}, [['remaining', 55275]]), ('partial-repair probe', {'start': 1759684109, 'end': 1761679609, 'change': 1759972940, 'old': 0, 'qold': 19, 'new': 23288, 'qnew': 1}, [['remaining', 19917]]), ('partial-repair probe', {'start': 1726548056, 'end': 1729226456, 'change': 1726548056, 'old': 0, 'qold': 1, 'new': 4900, 'qnew': 10}, [['remaining', 49000]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1742150000, 'end': 1745617539, 'change': 1744739339, 'old': 2500, 'qold': 3, 'new': 0, 'qnew': 1}, [['unused', -1899]]), ('normal control', {'start': 1734436882, 'end': 1765972882, 'change': 1756322121, 'old': 10374, 'qold': 1, 'new': 4900, 'qnew': 1}, [['unused', -3175], ['remaining', 1500]]), ('normal control', {'start': 1716957129, 'end': 1717561929, 'change': 1716957124, 'old': 1000, 'qold': 7, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1724685898, 'end': 1728923706, 'change': 1728923716, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 1}, [])]]\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":"0ecf8470f650cdfcbb8390020a53c6cc43678e770b22522c2b223195aa764948","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['change'] >= x['end'] or x['change'] < x['start']:\n        return []\n    span = x['end'] - x['start']\n    left = x['end'] - x['change']\n    def hu(n):\n        return (n * 2 + span) // (2 * span)\n    lines = []\n    if x['old']:\n        lines.append(['unused', -hu(x['old'] * x['qold'] * left)])\n    if x['new'] * x['qnew']:\n        lines.append(['remaining', hu(x['new'] * x['qnew'] * left)])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 1718898066, 'end': 1722579184, 'change': 1721183532, 'old': 87270, 'qold': 0, 'new': 4900, 'qnew': 1}, [['remaining', 1858]]), ('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('partial-repair probe', {'start': 1759898518, 'end': 1762576918, 'change': 1760952409, 'old': 0, 'qold': 3, 'new': 37669, 'qnew': 0}, []), ('partial-repair probe', {'start': 1733742690, 'end': 1736421090, 'change': 1733742690, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 14}, [['remaining', 68600]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1704011568, 'end': 1706689968, 'change': 1706689968, 'old': 1000, 'qold': 3, 'new': 1500, 'qnew': 3}, []), ('normal control', {'start': 1737228310, 'end': 1739499785, 'change': 1739499795, 'old': 178, 'qold': 1, 'new': 1500, 'qnew': 1}, []), ('normal control', {'start': 1732894162, 'end': 1735486162, 'change': 1732894162, 'old': 1000, 'qold': 2, 'new': 91004, 'qnew': 0}, [['unused', -2000]]), ('normal control', {'start': 1749969117, 'end': 1752647517, 'change': 1751393656, 'old': 63152, 'qold': 13, 'new': 0, 'qnew': 0}, [['unused', -384330]])], [('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('partial-repair probe', {'start': 1703542570, 'end': 1706134570, 'change': 1705592728, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 7}, [['remaining', 7170]]), ('partial-repair probe', {'start': 1720582304, 'end': 1723174304, 'change': 1723103614, 'old': 0, 'qold': 1, 'new': 27595, 'qnew': 5}, [['remaining', 3763]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1728579559, 'end': 1760115559, 'change': 1760115559, 'old': 0, 'qold': 0, 'new': 51264, 'qnew': 1}, []), ('normal control', {'start': 1721814513, 'end': 1722419313, 'change': 1722419313, 'old': 0, 'qold': 3, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1720297909, 'end': 1720623118, 'change': 1720623118, 'old': 1000, 'qold': 17, 'new': 0, 'qnew': 0}, []), ('normal control', {'start': 1734629848, 'end': 1766165848, 'change': 1766165848, 'old': 1000, 'qold': 1, 'new': 4900, 'qnew': 1}, [])], [('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1708667964, 'end': 1709272764, 'change': 1708667964, 'old': 0, 'qold': 14, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1757422189, 'end': 1758026989, 'change': 1757422189, 'old': 0, 'qold': 1, 'new': 0, 'qnew': 5}, []), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 11, 'qold': 1, 'new': 13, 'qnew': 1}, [['unused', -6], ['remaining', 7]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 13, 'qold': 1, 'new': 15, 'qnew': 1}, [['unused', -7], ['remaining', 8]]), ('normal control', {'start': 1759524018, 'end': 1763871464, 'change': 1759976835, 'old': 0, 'qold': 0, 'new': 1500, 'qnew': 5}, [['remaining', 6719]]), ('normal control', {'start': 1724743049, 'end': 1756279049, 'change': 1724743049, 'old': 2500, 'qold': 1, 'new': 1500, 'qnew': 1}, [['unused', -2500], ['remaining', 1500]]), ('normal control', {'start': 1742436208, 'end': 1773972208, 'change': 1773972218, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 1}, []), ('normal control', {'start': 1757847857, 'end': 1760439857, 'change': 1757847852, 'old': 92286, 'qold': 0, 'new': 0, 'qnew': 4}, [])], [('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('partial-repair probe', {'start': 1741666940, 'end': 1742271740, 'change': 1742262231, 'old': 0, 'qold': 3, 'new': 51773, 'qnew': 5}, [['remaining', 4070]]), ('partial-repair probe', {'start': 1726326778, 'end': 1757862778, 'change': 1743535077, 'old': 0, 'qold': 3, 'new': 67019, 'qnew': 5}, [['remaining', 152243]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1726496239, 'end': 1729174639, 'change': 1726496239, 'old': 73990, 'qold': 3, 'new': 47429, 'qnew': 5}, [['unused', -221970], ['remaining', 237145]]), ('normal control', {'start': 1739738740, 'end': 1771274740, 'change': 1771274740, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 5}, []), ('normal control', {'start': 1725551908, 'end': 1757087908, 'change': 1757087918, 'old': 67119, 'qold': 3, 'new': 4900, 'qnew': 13}, []), ('normal control', {'start': 1739142581, 'end': 1739747381, 'change': 1739142581, 'old': 26706, 'qold': 3, 'new': 1500, 'qnew': 5}, [['unused', -80118], ['remaining', 7500]])], [('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('regression', {'start': 1702270224, 'end': 1702644112, 'change': 1702432315, 'old': 1000, 'qold': 0, 'new': 97578, 'qnew': 1}, [['remaining', 55275]]), ('partial-repair probe', {'start': 1759684109, 'end': 1761679609, 'change': 1759972940, 'old': 0, 'qold': 19, 'new': 23288, 'qnew': 1}, [['remaining', 19917]]), ('partial-repair probe', {'start': 1726548056, 'end': 1729226456, 'change': 1726548056, 'old': 0, 'qold': 1, 'new': 4900, 'qnew': 10}, [['remaining', 49000]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1742150000, 'end': 1745617539, 'change': 1744739339, 'old': 2500, 'qold': 3, 'new': 0, 'qnew': 1}, [['unused', -1899]]), ('normal control', {'start': 1734436882, 'end': 1765972882, 'change': 1756322121, 'old': 10374, 'qold': 1, 'new': 4900, 'qnew': 1}, [['unused', -3175], ['remaining', 1500]]), ('normal control', {'start': 1716957129, 'end': 1717561929, 'change': 1716957124, 'old': 1000, 'qold': 7, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1724685898, 'end': 1728923706, 'change': 1728923716, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 1}, [])]]\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":"ee7f1c3281b46e987ef7cf2c83fcf483522a93f68c5070f11b0eb4a25efc43eb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if x['change'] >= x['end'] or x['change'] < x['start']:\n        return []\n    span = x['end'] - x['start']\n    left = x['end'] - x['change']\n    def hu(n):\n        return (n * 2 + span) // (2 * span)\n    lines = []\n    if x['old'] * x['qold']:\n        lines.append(['unused', -hu(x['old'] * x['qold'] * left)])\n    if x['new'] * x['qnew']:\n        lines.append(['remaining', hu(x['new'] * x['qnew'] * left)])\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'start': 1718898066, 'end': 1722579184, 'change': 1721183532, 'old': 87270, 'qold': 0, 'new': 4900, 'qnew': 1}, [['remaining', 1858]]), ('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('partial-repair probe', {'start': 1759898518, 'end': 1762576918, 'change': 1760952409, 'old': 0, 'qold': 3, 'new': 37669, 'qnew': 0}, []), ('partial-repair probe', {'start': 1733742690, 'end': 1736421090, 'change': 1733742690, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 14}, [['remaining', 68600]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1704011568, 'end': 1706689968, 'change': 1706689968, 'old': 1000, 'qold': 3, 'new': 1500, 'qnew': 3}, []), ('normal control', {'start': 1737228310, 'end': 1739499785, 'change': 1739499795, 'old': 178, 'qold': 1, 'new': 1500, 'qnew': 1}, []), ('normal control', {'start': 1732894162, 'end': 1735486162, 'change': 1732894162, 'old': 1000, 'qold': 2, 'new': 91004, 'qnew': 0}, [['unused', -2000]]), ('normal control', {'start': 1749969117, 'end': 1752647517, 'change': 1751393656, 'old': 63152, 'qold': 13, 'new': 0, 'qnew': 0}, [['unused', -384330]])], [('regression', {'start': 1726549577, 'end': 1727154377, 'change': 1726962866, 'old': 2500, 'qold': 0, 'new': 0, 'qnew': 0}, []), ('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('partial-repair probe', {'start': 1703542570, 'end': 1706134570, 'change': 1705592728, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 7}, [['remaining', 7170]]), ('partial-repair probe', {'start': 1720582304, 'end': 1723174304, 'change': 1723103614, 'old': 0, 'qold': 1, 'new': 27595, 'qnew': 5}, [['remaining', 3763]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1728579559, 'end': 1760115559, 'change': 1760115559, 'old': 0, 'qold': 0, 'new': 51264, 'qnew': 1}, []), ('normal control', {'start': 1721814513, 'end': 1722419313, 'change': 1722419313, 'old': 0, 'qold': 3, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1720297909, 'end': 1720623118, 'change': 1720623118, 'old': 1000, 'qold': 17, 'new': 0, 'qnew': 0}, []), ('normal control', {'start': 1734629848, 'end': 1766165848, 'change': 1766165848, 'old': 1000, 'qold': 1, 'new': 4900, 'qnew': 1}, [])], [('regression', {'start': 1700089359, 'end': 1702545450, 'change': 1702420392, 'old': 79079, 'qold': 0, 'new': 0, 'qnew': 5}, []), ('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1708667964, 'end': 1709272764, 'change': 1708667964, 'old': 0, 'qold': 14, 'new': 0, 'qnew': 1}, []), ('partial-repair probe', {'start': 1757422189, 'end': 1758026989, 'change': 1757422189, 'old': 0, 'qold': 1, 'new': 0, 'qnew': 5}, []), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 11, 'qold': 1, 'new': 13, 'qnew': 1}, [['unused', -6], ['remaining', 7]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 13, 'qold': 1, 'new': 15, 'qnew': 1}, [['unused', -7], ['remaining', 8]]), ('normal control', {'start': 1759524018, 'end': 1763871464, 'change': 1759976835, 'old': 0, 'qold': 0, 'new': 1500, 'qnew': 5}, [['remaining', 6719]]), ('normal control', {'start': 1724743049, 'end': 1756279049, 'change': 1724743049, 'old': 2500, 'qold': 1, 'new': 1500, 'qnew': 1}, [['unused', -2500], ['remaining', 1500]]), ('normal control', {'start': 1742436208, 'end': 1773972208, 'change': 1773972218, 'old': 0, 'qold': 3, 'new': 4900, 'qnew': 1}, []), ('normal control', {'start': 1757847857, 'end': 1760439857, 'change': 1757847852, 'old': 92286, 'qold': 0, 'new': 0, 'qnew': 4}, [])], [('regression', {'start': 1753105090, 'end': 1753709890, 'change': 1753105090, 'old': 1000, 'qold': 0, 'new': 0, 'qnew': 1}, []), ('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('partial-repair probe', {'start': 1741666940, 'end': 1742271740, 'change': 1742262231, 'old': 0, 'qold': 3, 'new': 51773, 'qnew': 5}, [['remaining', 4070]]), ('partial-repair probe', {'start': 1726326778, 'end': 1757862778, 'change': 1743535077, 'old': 0, 'qold': 3, 'new': 67019, 'qnew': 5}, [['remaining', 152243]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 3, 'qold': 1, 'new': 5, 'qnew': 1}, [['unused', -2], ['remaining', 3]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 5, 'qold': 1, 'new': 7, 'qnew': 1}, [['unused', -3], ['remaining', 4]]), ('normal control', {'start': 1726496239, 'end': 1729174639, 'change': 1726496239, 'old': 73990, 'qold': 3, 'new': 47429, 'qnew': 5}, [['unused', -221970], ['remaining', 237145]]), ('normal control', {'start': 1739738740, 'end': 1771274740, 'change': 1771274740, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 5}, []), ('normal control', {'start': 1725551908, 'end': 1757087908, 'change': 1757087918, 'old': 67119, 'qold': 3, 'new': 4900, 'qnew': 13}, []), ('normal control', {'start': 1739142581, 'end': 1739747381, 'change': 1739142581, 'old': 26706, 'qold': 3, 'new': 1500, 'qnew': 5}, [['unused', -80118], ['remaining', 7500]])], [('regression', {'start': 1726598960, 'end': 1727203760, 'change': 1726783107, 'old': 2500, 'qold': 0, 'new': 4900, 'qnew': 0}, []), ('regression', {'start': 1702270224, 'end': 1702644112, 'change': 1702432315, 'old': 1000, 'qold': 0, 'new': 97578, 'qnew': 1}, [['remaining', 55275]]), ('partial-repair probe', {'start': 1759684109, 'end': 1761679609, 'change': 1759972940, 'old': 0, 'qold': 19, 'new': 23288, 'qnew': 1}, [['remaining', 19917]]), ('partial-repair probe', {'start': 1726548056, 'end': 1729226456, 'change': 1726548056, 'old': 0, 'qold': 1, 'new': 4900, 'qnew': 10}, [['remaining', 49000]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 7, 'qold': 1, 'new': 9, 'qnew': 1}, [['unused', -4], ['remaining', 5]]), ('boundary control', {'start': 1000, 'end': 2000, 'change': 1500, 'old': 9, 'qold': 1, 'new': 11, 'qnew': 1}, [['unused', -5], ['remaining', 6]]), ('normal control', {'start': 1742150000, 'end': 1745617539, 'change': 1744739339, 'old': 2500, 'qold': 3, 'new': 0, 'qnew': 1}, [['unused', -1899]]), ('normal control', {'start': 1734436882, 'end': 1765972882, 'change': 1756322121, 'old': 10374, 'qold': 1, 'new': 4900, 'qnew': 1}, [['unused', -3175], ['remaining', 1500]]), ('normal control', {'start': 1716957129, 'end': 1717561929, 'change': 1716957124, 'old': 1000, 'qold': 7, 'new': 0, 'qnew': 5}, []), ('normal control', {'start': 1724685898, 'end': 1728923706, 'change': 1728923716, 'old': 2500, 'qold': 3, 'new': 1500, 'qnew': 1}, [])]]\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-second-granular-lines-zero-value-line-suppression","generated_at":"2026-09-29T14:46:35.706224+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Timestamp-based proration produces separate credit and debit lines whose rounding and emission rules show on the invoice.","repair":"Restore the contract rule at the zero-value line suppression step: use `if x['old'] * x['qold']:`.","root_cause":"The credit line is emitted whenever the old price is nonzero, even with zero quantity.","sha256":"e09f22f08b836a9d82ddd42dadccbfd7a517a3923bc7230999cbcf30213f7fed","title":"Second-granular proration line items: zero-value line suppression · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.5,"exit_code":1,"observations":[{"actual":[["remaining",1858]],"check":"regression 0","expected":[["remaining",1858]],"passed":true},{"actual":[],"check":"regression 1","expected":[],"passed":true},{"actual":[["unused",0]],"check":"partial-repair probe 2","expected":[],"passed":false},{"actual":[["unused",0],["remaining",68600]],"check":"partial-repair probe 3","expected":[["remaining",68600]],"passed":false},{"actual":[["unused",-2],["remaining",3]],"check":"boundary control 4","expected":[["unused",-2],["remaining",3]],"passed":true},{"actual":[["unused",-3],["remaining",4]],"check":"boundary control 5","expected":[["unused",-3],["remaining",4]],"passed":true},{"actual":[],"check":"normal control 6","expected":[],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true},{"actual":[["unused",-2000]],"check":"normal control 8","expected":[["unused",-2000]],"passed":true},{"actual":[["unused",-384330]],"check":"normal control 9","expected":[["unused",-384330]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [[\"remaining\", 1858]], \"expected\": [[\"remaining\", 1858]], \"passed\": true}, {\"check\": \"regression 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": [[\"unused\", 0]], \"expected\": [], \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": [[\"unused\", 0], [\"remaining\", 68600]], \"expected\": [[\"remaining\", 68600]], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [[\"unused\", -2], [\"remaining\", 3]], \"expected\": [[\"unused\", -2], [\"remaining\", 3]], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [[\"unused\", -3], [\"remaining\", 4]], \"expected\": [[\"unused\", -3], [\"remaining\", 4]], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [[\"unused\", -2000]], \"expected\": [[\"unused\", -2000]], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [[\"unused\", -384330]], \"expected\": [[\"unused\", -384330]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.248,"exit_code":1,"observations":[{"actual":[["unused",0],["remaining",1858]],"check":"regression 0","expected":[["remaining",1858]],"passed":false},{"actual":[["unused",0]],"check":"regression 1","expected":[],"passed":false},{"actual":[],"check":"partial-repair probe 2","expected":[],"passed":true},{"actual":[["remaining",68600]],"check":"partial-repair probe 3","expected":[["remaining",68600]],"passed":true},{"actual":[["unused",-2],["remaining",3]],"check":"boundary control 4","expected":[["unused",-2],["remaining",3]],"passed":true},{"actual":[["unused",-3],["remaining",4]],"check":"boundary control 5","expected":[["unused",-3],["remaining",4]],"passed":true},{"actual":[],"check":"normal control 6","expected":[],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true},{"actual":[["unused",-2000]],"check":"normal control 8","expected":[["unused",-2000]],"passed":true},{"actual":[["unused",-384330]],"check":"normal control 9","expected":[["unused",-384330]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [[\"unused\", 0], [\"remaining\", 1858]], \"expected\": [[\"remaining\", 1858]], \"passed\": false}, {\"check\": \"regression 1\", \"actual\": [[\"unused\", 0]], \"expected\": [], \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [[\"remaining\", 68600]], \"expected\": [[\"remaining\", 68600]], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [[\"unused\", -2], [\"remaining\", 3]], \"expected\": [[\"unused\", -2], [\"remaining\", 3]], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [[\"unused\", -3], [\"remaining\", 4]], \"expected\": [[\"unused\", -3], [\"remaining\", 4]], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [[\"unused\", -2000]], \"expected\": [[\"unused\", -2000]], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [[\"unused\", -384330]], \"expected\": [[\"unused\", -384330]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.337,"exit_code":0,"observations":[{"actual":[["remaining",1858]],"check":"regression 0","expected":[["remaining",1858]],"passed":true},{"actual":[],"check":"regression 1","expected":[],"passed":true},{"actual":[],"check":"partial-repair probe 2","expected":[],"passed":true},{"actual":[["remaining",68600]],"check":"partial-repair probe 3","expected":[["remaining",68600]],"passed":true},{"actual":[["unused",-2],["remaining",3]],"check":"boundary control 4","expected":[["unused",-2],["remaining",3]],"passed":true},{"actual":[["unused",-3],["remaining",4]],"check":"boundary control 5","expected":[["unused",-3],["remaining",4]],"passed":true},{"actual":[],"check":"normal control 6","expected":[],"passed":true},{"actual":[],"check":"normal control 7","expected":[],"passed":true},{"actual":[["unused",-2000]],"check":"normal control 8","expected":[["unused",-2000]],"passed":true},{"actual":[["unused",-384330]],"check":"normal control 9","expected":[["unused",-384330]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [[\"remaining\", 1858]], \"expected\": [[\"remaining\", 1858]], \"passed\": true}, {\"check\": \"regression 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [[\"remaining\", 68600]], \"expected\": [[\"remaining\", 68600]], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [[\"unused\", -2], [\"remaining\", 3]], \"expected\": [[\"unused\", -2], [\"remaining\", 3]], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [[\"unused\", -3], [\"remaining\", 4]], \"expected\": [[\"unused\", -3], [\"remaining\", 4]], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [[\"unused\", -2000]], \"expected\": [[\"unused\", -2000]], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [[\"unused\", -384330]], \"expected\": [[\"unused\", -384330]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}