{"abstract":"Rounding 2.02 down to 2.00 reports an adjustment of +0.02.","category":"Currency rounding and FX conversion","checks":7,"contract":"solve(lines, tender): lines are CHF decimal strings with up to three decimals (weight- or volume-priced items; refund lines negative). The exact total is their sum. For tender 'cash' (compared after trimming and lower-casing) the total is rounded to the nearest 0.05 with ties away from zero; every other tender ('card', 'twint', 'voucher', ...) pays the total rounded half-up to 0.01. Return [payable as a 2-decimal string, adjustment as a 3-decimal string] where adjustment = payable - exact; zeros are unsigned.","contract_signature":"lines, tender","evaluation_group":"w2-currency_rounding_and_fx_conversion-swiss-cash-rounding","failed_approach":"Reporting the absolute adjustment loses the direction of downward roundings.","family":"w2-currency_rounding_and_fx_conversion-swiss-cash-rounding-adjustment-sign","id":"FA-62026","implementations":{"attempt":{"sha256":"be080fa25754510c87820543d86ef5bf323da2a5d7b0e365cda6494f54b81d2d","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(lines, tender):\n    def cash(v):\n        return (v / Decimal('0.05')).quantize(Decimal(1), rounding=ROUND_HALF_UP) * Decimal('0.05')\n    def z(d, e):\n        d = d.quantize(Decimal(1).scaleb(-e), rounding=ROUND_HALF_UP)\n        return format(abs(d) if d == 0 else d, 'f')\n    exact = sum((Decimal(l) for l in lines), Decimal('0.000'))\n    if tender.strip().lower() == 'cash':\n        r = cash(exact)\n    else:\n        r = exact.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)\n    return [z(r, 2), z(abs(r - exact), 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression adjustment-sign 1', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020']),\n  ('regression adjustment-sign 2', (['2.025'], 'cash'), ['2.05', '0.025']),\n  ('partial repair guard 2', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000'])],\n [('regression adjustment-sign 1', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('regression adjustment-sign 2', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('partial repair guard 1', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('partial repair guard 2', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000']),\n  ('control: positive tie', (['3.00', '0.025'], 'cash'), ['3.05', '0.025'])],\n [('regression adjustment-sign 1', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('regression adjustment-sign 2', (['3.00', '0.025'], 'cash'), ['3.05', '0.025']),\n  ('partial repair guard 1', (['19.47', '26.34'], 'CASH'), ['45.80', '-0.010']),\n  ('partial repair guard 2', (['17.98', '8.07', '0.335', '23.38'], 'Cash'), ['49.75', '-0.015']),\n  ('control: negative tie', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('control: voucher exact', (['7.07'], 'voucher'), ['7.07', '0.000']),\n  ('control: mixed basket', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('control: round down', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020'])],\n [('regression adjustment-sign 1', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('regression adjustment-sign 2', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('partial repair guard 1', (['-1.435'], 'Cash'), ['-1.45', '-0.015']),\n  ('partial repair guard 2', (['2.955'], ' cash '), ['2.95', '-0.005']),\n  ('control: round down', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020']),\n  ('control: round to franc', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020'])],\n [('regression adjustment-sign 1', (['12.71', '-2.68'], 'Cash'), ['10.05', '0.020']),\n  ('regression adjustment-sign 2', (['22.99', '2.02', '4.93', '0.185'], 'twint'), ['30.13', '0.005']),\n  ('partial repair guard 1', (['1.91', '-3.315'], 'card'), ['-1.41', '-0.005']),\n  ('partial repair guard 2', (['4.92'], ' cash '), ['4.90', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000'])]]\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":"5c1cd1dd10a1a7cdea18fea4ea7bb0e884e60cad0a0d47b3b29e913aca327c45","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(lines, tender):\n    def cash(v):\n        return (v / Decimal('0.05')).quantize(Decimal(1), rounding=ROUND_HALF_UP) * Decimal('0.05')\n    def z(d, e):\n        d = d.quantize(Decimal(1).scaleb(-e), rounding=ROUND_HALF_UP)\n        return format(abs(d) if d == 0 else d, 'f')\n    exact = sum((Decimal(l) for l in lines), Decimal('0.000'))\n    if tender.strip().lower() == 'cash':\n        r = cash(exact)\n    else:\n        r = exact.quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)\n    return [z(r, 2), z(exact - r, 3)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression adjustment-sign 1', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020']),\n  ('regression adjustment-sign 2', (['2.025'], 'cash'), ['2.05', '0.025']),\n  ('partial repair guard 2', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000'])],\n [('regression adjustment-sign 1', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('regression adjustment-sign 2', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('partial repair guard 1', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('partial repair guard 2', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000']),\n  ('control: positive tie', (['3.00', '0.025'], 'cash'), ['3.05', '0.025'])],\n [('regression adjustment-sign 1', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('regression adjustment-sign 2', (['3.00', '0.025'], 'cash'), ['3.05', '0.025']),\n  ('partial repair guard 1', (['19.47', '26.34'], 'CASH'), ['45.80', '-0.010']),\n  ('partial repair guard 2', (['17.98', '8.07', '0.335', '23.38'], 'Cash'), ['49.75', '-0.015']),\n  ('control: negative tie', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('control: voucher exact', (['7.07'], 'voucher'), ['7.07', '0.000']),\n  ('control: mixed basket', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('control: round down', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020'])],\n [('regression adjustment-sign 1', (['-2.075'], 'cash'), ['-2.10', '-0.025']),\n  ('regression adjustment-sign 2', (['12.40', '-3.12', '0.99'], ' CASH'), ['10.25', '-0.020']),\n  ('partial repair guard 1', (['-1.435'], 'Cash'), ['-1.45', '-0.015']),\n  ('partial repair guard 2', (['2.955'], ' cash '), ['2.95', '-0.005']),\n  ('control: round down', (['1.02', '1.00'], 'cash'), ['2.00', '-0.020']),\n  ('control: round to franc', (['0.99', '0.03'], 'cash'), ['1.00', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020'])],\n [('regression adjustment-sign 1', (['12.71', '-2.68'], 'Cash'), ['10.05', '0.020']),\n  ('regression adjustment-sign 2', (['22.99', '2.02', '4.93', '0.185'], 'twint'), ['30.13', '0.005']),\n  ('partial repair guard 1', (['1.91', '-3.315'], 'card'), ['-1.41', '-0.005']),\n  ('partial repair guard 2', (['4.92'], ' cash '), ['4.90', '-0.020']),\n  ('control: refund', (['-1.03', '-0.99'], 'cash'), ['-2.00', '0.020']),\n  ('control: refund to zero', (['-0.02'], 'Cash '), ['0.00', '0.020']),\n  ('control: card exact', (['1.02'], 'card'), ['1.02', '0.000']),\n  ('control: twint exact', (['3.33', '4.44'], 'twint'), ['7.77', '0.000'])]]\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-swiss-cash-rounding-adjustment-sign","generated_at":"2026-09-29T14:47:00.713255+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":"The adjustment is computed as exact - payable.","sha256":"f24883f9b5c0340fa07e4684151805253a806a7b53af7b29466eed90797cc794","title":"The cash rounding adjustment is reported with the wrong sign · 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":43.134,"exit_code":1,"observations":[{"actual":["2.00","0.020"],"check":"regression adjustment-sign 1","expected":["2.00","-0.020"],"passed":false},{"actual":["2.05","0.025"],"check":"regression adjustment-sign 2","expected":["2.05","0.025"],"passed":true},{"actual":["1.00","0.020"],"check":"partial repair guard 2","expected":["1.00","-0.020"],"passed":false},{"actual":["-2.00","0.020"],"check":"control: refund","expected":["-2.00","0.020"],"passed":true},{"actual":["0.00","0.020"],"check":"control: refund to zero","expected":["0.00","0.020"],"passed":true},{"actual":["1.02","0.000"],"check":"control: card exact","expected":["1.02","0.000"],"passed":true},{"actual":["7.77","0.000"],"check":"control: twint exact","expected":["7.77","0.000"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression adjustment-sign 1\", \"actual\": [\"2.00\", \"0.020\"], \"expected\": [\"2.00\", \"-0.020\"], \"passed\": false}, {\"check\": \"regression adjustment-sign 2\", \"actual\": [\"2.05\", \"0.025\"], \"expected\": [\"2.05\", \"0.025\"], \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": [\"1.00\", \"0.020\"], \"expected\": [\"1.00\", \"-0.020\"], \"passed\": false}, {\"check\": \"control: refund\", \"actual\": [\"-2.00\", \"0.020\"], \"expected\": [\"-2.00\", \"0.020\"], \"passed\": true}, {\"check\": \"control: refund to zero\", \"actual\": [\"0.00\", \"0.020\"], \"expected\": [\"0.00\", \"0.020\"], \"passed\": true}, {\"check\": \"control: card exact\", \"actual\": [\"1.02\", \"0.000\"], \"expected\": [\"1.02\", \"0.000\"], \"passed\": true}, {\"check\": \"control: twint exact\", \"actual\": [\"7.77\", \"0.000\"], \"expected\": [\"7.77\", \"0.000\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.58,"exit_code":1,"observations":[{"actual":["2.00","0.020"],"check":"regression adjustment-sign 1","expected":["2.00","-0.020"],"passed":false},{"actual":["2.05","-0.025"],"check":"regression adjustment-sign 2","expected":["2.05","0.025"],"passed":false},{"actual":["1.00","0.020"],"check":"partial repair guard 2","expected":["1.00","-0.020"],"passed":false},{"actual":["-2.00","-0.020"],"check":"control: refund","expected":["-2.00","0.020"],"passed":false},{"actual":["0.00","-0.020"],"check":"control: refund to zero","expected":["0.00","0.020"],"passed":false},{"actual":["1.02","0.000"],"check":"control: card exact","expected":["1.02","0.000"],"passed":true},{"actual":["7.77","0.000"],"check":"control: twint exact","expected":["7.77","0.000"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression adjustment-sign 1\", \"actual\": [\"2.00\", \"0.020\"], \"expected\": [\"2.00\", \"-0.020\"], \"passed\": false}, {\"check\": \"regression adjustment-sign 2\", \"actual\": [\"2.05\", \"-0.025\"], \"expected\": [\"2.05\", \"0.025\"], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [\"1.00\", \"0.020\"], \"expected\": [\"1.00\", \"-0.020\"], \"passed\": false}, {\"check\": \"control: refund\", \"actual\": [\"-2.00\", \"-0.020\"], \"expected\": [\"-2.00\", \"0.020\"], \"passed\": false}, {\"check\": \"control: refund to zero\", \"actual\": [\"0.00\", \"-0.020\"], \"expected\": [\"0.00\", \"0.020\"], \"passed\": false}, {\"check\": \"control: card exact\", \"actual\": [\"1.02\", \"0.000\"], \"expected\": [\"1.02\", \"0.000\"], \"passed\": true}, {\"check\": \"control: twint exact\", \"actual\": [\"7.77\", \"0.000\"], \"expected\": [\"7.77\", \"0.000\"], \"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."}}