{"abstract":"The first posting of a new day is reduced by the previous day's accumulated floor.","category":"Currency rounding and FX conversion","checks":7,"contract":"solve(items, rate): items are [day, amount] with integer source minor units (reversals negative) in posting order; rate is target minor units per source minor unit. Within a day, each posting's converted amount is floor(cumulative_exact) - floor(previous cumulative_exact), so daily converted postings sum to floor of the day's exact converted total. The carry (cumulative total and previous floor) resets whenever the day changes. Return the list of integer converted postings.","contract_signature":"items, rate","evaluation_group":"w2-currency_rounding_and_fx_conversion-micro-payment-cumulative-carry","failed_approach":"Carrying the fractional remainder into the new day contradicts the daily-reset contract.","family":"w2-currency_rounding_and_fx_conversion-micro-payment-cumulative-carry-previous-floor-reset","id":"FA-62211","implementations":{"attempt":{"sha256":"254dbf2cd96b6db1a62ee47f524ade3eb5b63fc6d35395f8c6f03969667ded49","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(items, rate):\n    out, cum, prev_floor, day = [], Decimal(0), 0, None\n    r = Decimal(rate)\n    for d, a in items:\n        if d != day:\n            day, cum, prev_floor = d, cum - prev_floor, 0\n        cum += Decimal(a) * r\n        f = int(cum.to_integral_value(rounding=ROUND_FLOOR))\n        out.append(f - prev_floor)\n        prev_floor = f\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression previous-floor-reset 1', ([['d1', 7], ['d2', 1]], '0.5'), [3, 0]),\n  ('regression previous-floor-reset 2', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('partial repair guard 2', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]), ('control: empty', ([], '1.5'), [])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', 186], ['2026-03-01', -5], ['2026-03-02', 8], ['2026-03-02', 154]], '0.3542'), [65, -1, 2, 55]),\n  ('regression previous-floor-reset 2',\n   ([['2026-03-01', 263], ['2026-03-01', 239], ['2026-03-01', 228], ['2026-03-01', -26], ['2026-03-02', 231]], '29.57'),\n   [7776, 7068, 6742, -769, 6830]),\n  ('partial repair guard 1',\n   ([['2026-03-01', -18], ['2026-03-01', 240], ['2026-03-02', -19], ['2026-03-02', 81], ['2026-03-02', 129],\n     ['2026-03-02', 231]],\n    '0.2472'),\n   [-5, 59, -5, 20, 32, 57]),\n  ('partial repair guard 2',\n   ([['2026-03-02', 92], ['2026-03-03', 36], ['2026-03-03', -15], ['2026-04-01', 46], ['2026-04-01', 50],\n     ['2026-04-01', 95]],\n    '4.346'),\n   [399, 156, -65, 199, 218, 413]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]),\n  ('control: month change', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('control: empty', ([], '1.5'), []),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', -18], ['2026-03-01', 240], ['2026-03-02', -19], ['2026-03-02', 81], ['2026-03-02', 129],\n     ['2026-03-02', 231]],\n    '0.2472'),\n   [-5, 59, -5, 20, 32, 57]),\n  ('regression previous-floor-reset 2', ([['2026-03-02', 294], ['2026-03-03', 199]], '0.0860'), [25, 17]),\n  ('partial repair guard 1',\n   ([['2026-03-02', 62], ['2026-03-02', 120], ['2026-03-03', 27], ['2026-03-03', 189]], '0.4750'), [29, 57, 12, 90]),\n  ('partial repair guard 2',\n   ([['2026-03-01', -26], ['2026-03-01', 4], ['2026-03-01', -3], ['2026-03-02', 57], ['2026-03-02', 131]], '5.53'),\n   [-144, 22, -17, 315, 724]),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: day reset', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-02', 92], ['2026-03-03', 36], ['2026-03-03', -15], ['2026-04-01', 46], ['2026-04-01', 50],\n     ['2026-04-01', 95]],\n    '4.346'),\n   [399, 156, -65, 199, 218, 413]),\n  ('regression previous-floor-reset 2',\n   ([['2026-03-02', 62], ['2026-03-02', 120], ['2026-03-03', 27], ['2026-03-03', 189]], '0.4750'), [29, 57, 12, 90]),\n  ('partial repair guard 1',\n   ([['2026-03-01', 59], ['2026-03-02', 159], ['2026-03-02', 71], ['2026-03-03', 89]], '26.15'),\n   [1542, 4157, 1857, 2327]),\n  ('partial repair guard 2', ([['2026-03-01', -26], ['2026-03-02', 215]], '27.52'), [-716, 5916]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]),\n  ('control: month change', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('control: empty', ([], '1.5'), [])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', -26], ['2026-03-01', 4], ['2026-03-01', -3], ['2026-03-02', 57], ['2026-03-02', 131]], '5.53'),\n   [-144, 22, -17, 315, 724]),\n  ('regression previous-floor-reset 2', ([['2026-03-01', 197], ['2026-03-02', 286], ['2026-03-02', 74]], '29.61'),\n   [5833, 8468, 2191]),\n  ('partial repair guard 1',\n   ([['2026-03-02', 39], ['2026-03-02', 262], ['2026-03-02', -11], ['2026-03-03', 235], ['2026-03-03', -7],\n     ['2026-03-03', 97]],\n    '4.821'),\n   [188, 1263, -53, 1132, -33, 467]),\n  ('partial repair guard 2',\n   ([['2026-03-01', 42], ['2026-03-02', 162], ['2026-03-02', 1], ['2026-03-02', 28], ['2026-03-03', 127],\n     ['2026-03-03', -4]],\n    '0.0325'),\n   [1, 5, 0, 1, 4, -1]),\n  ('control: empty', ([], '1.5'), []),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: day reset', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, 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":"cdac0b068656c9d4af30d7535889b4df845c841e03c0b15144b49f41d6859d70","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(items, rate):\n    out, cum, prev_floor, day = [], Decimal(0), 0, None\n    r = Decimal(rate)\n    for d, a in items:\n        if d != day:\n            day, cum = d, Decimal(0)\n        cum += Decimal(a) * r\n        f = int(cum.to_integral_value(rounding=ROUND_FLOOR))\n        out.append(f - prev_floor)\n        prev_floor = f\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression previous-floor-reset 1', ([['d1', 7], ['d2', 1]], '0.5'), [3, 0]),\n  ('regression previous-floor-reset 2', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('partial repair guard 2', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]), ('control: empty', ([], '1.5'), [])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', 186], ['2026-03-01', -5], ['2026-03-02', 8], ['2026-03-02', 154]], '0.3542'), [65, -1, 2, 55]),\n  ('regression previous-floor-reset 2',\n   ([['2026-03-01', 263], ['2026-03-01', 239], ['2026-03-01', 228], ['2026-03-01', -26], ['2026-03-02', 231]], '29.57'),\n   [7776, 7068, 6742, -769, 6830]),\n  ('partial repair guard 1',\n   ([['2026-03-01', -18], ['2026-03-01', 240], ['2026-03-02', -19], ['2026-03-02', 81], ['2026-03-02', 129],\n     ['2026-03-02', 231]],\n    '0.2472'),\n   [-5, 59, -5, 20, 32, 57]),\n  ('partial repair guard 2',\n   ([['2026-03-02', 92], ['2026-03-03', 36], ['2026-03-03', -15], ['2026-04-01', 46], ['2026-04-01', 50],\n     ['2026-04-01', 95]],\n    '4.346'),\n   [399, 156, -65, 199, 218, 413]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]),\n  ('control: month change', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('control: empty', ([], '1.5'), []),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', -18], ['2026-03-01', 240], ['2026-03-02', -19], ['2026-03-02', 81], ['2026-03-02', 129],\n     ['2026-03-02', 231]],\n    '0.2472'),\n   [-5, 59, -5, 20, 32, 57]),\n  ('regression previous-floor-reset 2', ([['2026-03-02', 294], ['2026-03-03', 199]], '0.0860'), [25, 17]),\n  ('partial repair guard 1',\n   ([['2026-03-02', 62], ['2026-03-02', 120], ['2026-03-03', 27], ['2026-03-03', 189]], '0.4750'), [29, 57, 12, 90]),\n  ('partial repair guard 2',\n   ([['2026-03-01', -26], ['2026-03-01', 4], ['2026-03-01', -3], ['2026-03-02', 57], ['2026-03-02', 131]], '5.53'),\n   [-144, 22, -17, 315, 724]),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: day reset', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-02', 92], ['2026-03-03', 36], ['2026-03-03', -15], ['2026-04-01', 46], ['2026-04-01', 50],\n     ['2026-04-01', 95]],\n    '4.346'),\n   [399, 156, -65, 199, 218, 413]),\n  ('regression previous-floor-reset 2',\n   ([['2026-03-02', 62], ['2026-03-02', 120], ['2026-03-03', 27], ['2026-03-03', 189]], '0.4750'), [29, 57, 12, 90]),\n  ('partial repair guard 1',\n   ([['2026-03-01', 59], ['2026-03-02', 159], ['2026-03-02', 71], ['2026-03-03', 89]], '26.15'),\n   [1542, 4157, 1857, 2327]),\n  ('partial repair guard 2', ([['2026-03-01', -26], ['2026-03-02', 215]], '27.52'), [-716, 5916]),\n  ('control: reversal', ([['d1', 5], ['d1', -3]], '0.5'), [2, -1]),\n  ('control: single large', ([['2026-03-01', 12345]], '0.9215'), [11375]),\n  ('control: month change', ([['2026-03-31', 3], ['2026-04-01', 3]], '0.35'), [1, 1]),\n  ('control: empty', ([], '1.5'), [])],\n [('regression previous-floor-reset 1',\n   ([['2026-03-01', -26], ['2026-03-01', 4], ['2026-03-01', -3], ['2026-03-02', 57], ['2026-03-02', 131]], '5.53'),\n   [-144, 22, -17, 315, 724]),\n  ('regression previous-floor-reset 2', ([['2026-03-01', 197], ['2026-03-02', 286], ['2026-03-02', 74]], '29.61'),\n   [5833, 8468, 2191]),\n  ('partial repair guard 1',\n   ([['2026-03-02', 39], ['2026-03-02', 262], ['2026-03-02', -11], ['2026-03-03', 235], ['2026-03-03', -7],\n     ['2026-03-03', 97]],\n    '4.821'),\n   [188, 1263, -53, 1132, -33, 467]),\n  ('partial repair guard 2',\n   ([['2026-03-01', 42], ['2026-03-02', 162], ['2026-03-02', 1], ['2026-03-02', 28], ['2026-03-03', 127],\n     ['2026-03-03', -4]],\n    '0.0325'),\n   [1, 5, 0, 1, 4, -1]),\n  ('control: empty', ([], '1.5'), []),\n  ('control: negative first', ([['d1', -1], ['d1', -1], ['d1', 2]], '0.3'), [-1, 0, 1]),\n  ('control: three micro postings', ([['d1', 1], ['d1', 1], ['d1', 1]], '0.4'), [0, 0, 1]),\n  ('control: day reset', ([['d1', 1], ['d2', 1], ['d2', 1]], '0.6'), [0, 0, 1])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, 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, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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-currency_rounding_and_fx_conversion-micro-payment-cumulative-carry-previous-floor-reset","generated_at":"2026-09-29T14:47:02.461880+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","root_cause":"On a day change cum is reset but prev_floor keeps the old day's value.","sha256":"fdbb7ff039041decebcceb97ae14f10e0d73ed983cb7fd8c38b53825c8f144ed","title":"The day reset clears the running total but keeps the previous floor · 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":42.61,"exit_code":1,"observations":[{"actual":[3,1],"check":"regression previous-floor-reset 1","expected":[3,0],"passed":false},{"actual":[1,1],"check":"regression previous-floor-reset 2","expected":[1,1],"passed":true},{"actual":[0,1,0],"check":"partial repair guard 2","expected":[0,0,1],"passed":false},{"actual":[0,0,1],"check":"control: three micro postings","expected":[0,0,1],"passed":true},{"actual":[2,-1],"check":"control: reversal","expected":[2,-1],"passed":true},{"actual":[11375],"check":"control: single large","expected":[11375],"passed":true},{"actual":[],"check":"control: empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression previous-floor-reset 1\", \"actual\": [3, 1], \"expected\": [3, 0], \"passed\": false}, {\"check\": \"regression previous-floor-reset 2\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": [0, 1, 0], \"expected\": [0, 0, 1], \"passed\": false}, {\"check\": \"control: three micro postings\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 1], \"passed\": true}, {\"check\": \"control: reversal\", \"actual\": [2, -1], \"expected\": [2, -1], \"passed\": true}, {\"check\": \"control: single large\", \"actual\": [11375], \"expected\": [11375], \"passed\": true}, {\"check\": \"control: empty\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.691,"exit_code":1,"observations":[{"actual":[3,-3],"check":"regression previous-floor-reset 1","expected":[3,0],"passed":false},{"actual":[1,0],"check":"regression previous-floor-reset 2","expected":[1,1],"passed":false},{"actual":[0,0,1],"check":"partial repair guard 2","expected":[0,0,1],"passed":true},{"actual":[0,0,1],"check":"control: three micro postings","expected":[0,0,1],"passed":true},{"actual":[2,-1],"check":"control: reversal","expected":[2,-1],"passed":true},{"actual":[11375],"check":"control: single large","expected":[11375],"passed":true},{"actual":[],"check":"control: empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression previous-floor-reset 1\", \"actual\": [3, -3], \"expected\": [3, 0], \"passed\": false}, {\"check\": \"regression previous-floor-reset 2\", \"actual\": [1, 0], \"expected\": [1, 1], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 1], \"passed\": true}, {\"check\": \"control: three micro postings\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 1], \"passed\": true}, {\"check\": \"control: reversal\", \"actual\": [2, -1], \"expected\": [2, -1], \"passed\": true}, {\"check\": \"control: single large\", \"actual\": [11375], \"expected\": [11375], \"passed\": true}, {\"check\": \"control: empty\", \"actual\": [], \"expected\": [], \"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."}}