{"abstract":"A 3% markup is disclosed as 2.92%.","category":"Currency rounding and FX conversion","checks":6,"contract":"solve(amount, ref_rate, markup_bps, card_exp): amount in merchant currency, ref_rate cardholder units per merchant unit, markup_bps an integer (negative for a promotional discount). The offered rate is ref*(1+bps/10000) rounded half-up to 6 decimals, and the card amount is amount*offered rounded half-up at card_exp. The disclosed markup percentage is (offered/ref - 1)*100 computed from the rounded offered rate and rounded toward positive infinity to 2 decimals so it never understates. Return [offered, card_amount, markup_pct] as strings.","contract_signature":"amount, ref_rate, markup_bps, card_exp","evaluation_group":"w2-currency_rounding_and_fx_conversion-dynamic-currency-conversion-receipt","failed_approach":"Disclosing bps/100 ignores the effect of rounding the offered rate.","family":"w2-currency_rounding_and_fx_conversion-dynamic-currency-conversion-receipt-markup-disclosure-base","id":"FA-62186","implementations":{"attempt":{"sha256":"02597a936818070cdab10313ac8617d0be26bceb34120b3026595d4a4b31837b","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(amount, ref_rate, markup_bps, card_exp):\n    ref = Decimal(ref_rate)\n    raw = ref * (1 + Decimal(markup_bps) / 10000)\n    dcc = raw.quantize(Decimal('0.000001'), rounding=ROUND_HALF_UP)\n    card = (Decimal(amount) * dcc).quantize(Decimal(1).scaleb(-card_exp), rounding=ROUND_HALF_UP)\n    pct = (Decimal(markup_bps) / 100).quantize(Decimal('0.01'), rounding=ROUND_CEILING)\n    return [format(dcc, 'f'), format(card, 'f'), format(pct, 'f')]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression markup-disclosure-base 1', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('regression markup-disclosure-base 2', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('partial repair guard 2', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00'])],\n [('regression markup-disclosure-base 1', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('regression markup-disclosure-base 2', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('partial repair guard 1', ('3353.43', '37.36650', 275, 0), ['38.394079', '128752', '2.76']),\n  ('partial repair guard 2', ('1171.26', '0.4683115', -50, 3), ['0.465970', '545.772', '-0.49']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51'])],\n [('regression markup-disclosure-base 1', ('3353.43', '37.36650', 275, 0), ['38.394079', '128752', '2.76']),\n  ('regression markup-disclosure-base 2', ('1171.26', '0.4683115', -50, 3), ['0.465970', '545.772', '-0.49']),\n  ('partial repair guard 1', ('157.22', '31.44890', 150, 3), ['31.920634', '5018.562', '1.51']),\n  ('partial repair guard 2', ('3157.31', '0.0891399', 150, 3), ['0.090477', '285.664', '1.51']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('control: to yen card', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00'])],\n [('regression markup-disclosure-base 1', ('3884.23', '183.00464', 350, 0), ['189.409802', '735711', '3.50']),\n  ('regression markup-disclosure-base 2', ('157.22', '31.44890', 150, 3), ['31.920634', '5018.562', '1.51']),\n  ('partial repair guard 1', ('508.07', '12.046349', 275, 0), ['12.377624', '6289', '2.76']),\n  ('partial repair guard 2', ('3826.89', '1.5416740', -50, 2), ['1.533966', '5870.32', '-0.49']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00'])],\n [('regression markup-disclosure-base 1', ('3157.31', '0.0891399', 150, 3), ['0.090477', '285.664', '1.51']),\n  ('regression markup-disclosure-base 2', ('3408.26', '18.286201', 150, 2), ['18.560494', '63258.99', '1.50']),\n  ('partial repair guard 1', ('419.33', '78.12165', 350, 2), ['80.855908', '33905.31', '3.51']),\n  ('partial repair guard 2', ('2378.17', '122.42736', 300, 2), ['126.100181', '299887.67', '3.01']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('control: to yen card', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00'])]]\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":"1a60cb4e8bddc04dc932513915314dd84d8b0300629845554c41287522d4ddb5","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(amount, ref_rate, markup_bps, card_exp):\n    ref = Decimal(ref_rate)\n    raw = ref * (1 + Decimal(markup_bps) / 10000)\n    dcc = raw.quantize(Decimal('0.000001'), rounding=ROUND_HALF_UP)\n    card = (Decimal(amount) * dcc).quantize(Decimal(1).scaleb(-card_exp), rounding=ROUND_HALF_UP)\n    pct = ((dcc - ref) / dcc * 100).quantize(Decimal('0.01'), rounding=ROUND_CEILING)\n    return [format(dcc, 'f'), format(card, 'f'), format(pct, 'f')]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression markup-disclosure-base 1', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('regression markup-disclosure-base 2', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('partial repair guard 2', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00'])],\n [('regression markup-disclosure-base 1', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('regression markup-disclosure-base 2', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('partial repair guard 1', ('3353.43', '37.36650', 275, 0), ['38.394079', '128752', '2.76']),\n  ('partial repair guard 2', ('1171.26', '0.4683115', -50, 3), ['0.465970', '545.772', '-0.49']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51'])],\n [('regression markup-disclosure-base 1', ('3353.43', '37.36650', 275, 0), ['38.394079', '128752', '2.76']),\n  ('regression markup-disclosure-base 2', ('1171.26', '0.4683115', -50, 3), ['0.465970', '545.772', '-0.49']),\n  ('partial repair guard 1', ('157.22', '31.44890', 150, 3), ['31.920634', '5018.562', '1.51']),\n  ('partial repair guard 2', ('3157.31', '0.0891399', 150, 3), ['0.090477', '285.664', '1.51']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('control: to yen card', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00'])],\n [('regression markup-disclosure-base 1', ('3884.23', '183.00464', 350, 0), ['189.409802', '735711', '3.50']),\n  ('regression markup-disclosure-base 2', ('157.22', '31.44890', 150, 3), ['31.920634', '5018.562', '1.51']),\n  ('partial repair guard 1', ('508.07', '12.046349', 275, 0), ['12.377624', '6289', '2.76']),\n  ('partial repair guard 2', ('3826.89', '1.5416740', -50, 2), ['1.533966', '5870.32', '-0.49']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00']),\n  ('control: promotional discount', ('80.00', '0.913377', -50, 2), ['0.908810', '72.70', '-0.50']),\n  ('control: zero markup', ('12.34', '1.2', 0, 2), ['1.200000', '14.81', '0.00']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00'])],\n [('regression markup-disclosure-base 1', ('3157.31', '0.0891399', 150, 3), ['0.090477', '285.664', '1.51']),\n  ('regression markup-disclosure-base 2', ('3408.26', '18.286201', 150, 2), ['18.560494', '63258.99', '1.50']),\n  ('partial repair guard 1', ('419.33', '78.12165', 350, 2), ['80.855908', '33905.31', '3.51']),\n  ('partial repair guard 2', ('2378.17', '122.42736', 300, 2), ['126.100181', '299887.67', '3.01']),\n  ('control: euro to dollar', ('100.00', '1.083471', 300, 2), ['1.115975', '111.60', '3.00']),\n  ('control: yen to dollar', ('5000', '0.00662', 350, 2), ['0.006852', '34.26', '3.51']),\n  ('control: to yen card', ('49.99', '151.3742', 275, 0), ['155.536991', '7775', '2.76']),\n  ('control: dinar card', ('250.00', '0.307133', 400, 3), ['0.319418', '79.855', '4.00'])]]\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-dynamic-currency-conversion-receipt-markup-disclosure-base","generated_at":"2026-09-29T14:47:02.317626+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 disclosure divides the rate difference by the offered rate instead of the reference rate.","sha256":"9e5c11e9ae780d2e17ba72d5e7f07038c2a30aedd2d146ba9baa1acc90e44362","title":"The disclosed markup is measured against the offered rate · 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.072,"exit_code":1,"observations":[{"actual":["1.115975","111.60","3.00"],"check":"regression markup-disclosure-base 1","expected":["1.115975","111.60","3.00"],"passed":true},{"actual":["0.006852","34.26","3.50"],"check":"regression markup-disclosure-base 2","expected":["0.006852","34.26","3.51"],"passed":false},{"actual":["155.536991","7775","2.75"],"check":"partial repair guard 2","expected":["155.536991","7775","2.76"],"passed":false},{"actual":["0.319418","79.855","4.00"],"check":"control: dinar card","expected":["0.319418","79.855","4.00"],"passed":true},{"actual":["0.908810","72.70","-0.50"],"check":"control: promotional discount","expected":["0.908810","72.70","-0.50"],"passed":true},{"actual":["1.200000","14.81","0.00"],"check":"control: zero markup","expected":["1.200000","14.81","0.00"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression markup-disclosure-base 1\", \"actual\": [\"1.115975\", \"111.60\", \"3.00\"], \"expected\": [\"1.115975\", \"111.60\", \"3.00\"], \"passed\": true}, {\"check\": \"regression markup-disclosure-base 2\", \"actual\": [\"0.006852\", \"34.26\", \"3.50\"], \"expected\": [\"0.006852\", \"34.26\", \"3.51\"], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [\"155.536991\", \"7775\", \"2.75\"], \"expected\": [\"155.536991\", \"7775\", \"2.76\"], \"passed\": false}, {\"check\": \"control: dinar card\", \"actual\": [\"0.319418\", \"79.855\", \"4.00\"], \"expected\": [\"0.319418\", \"79.855\", \"4.00\"], \"passed\": true}, {\"check\": \"control: promotional discount\", \"actual\": [\"0.908810\", \"72.70\", \"-0.50\"], \"expected\": [\"0.908810\", \"72.70\", \"-0.50\"], \"passed\": true}, {\"check\": \"control: zero markup\", \"actual\": [\"1.200000\", \"14.81\", \"0.00\"], \"expected\": [\"1.200000\", \"14.81\", \"0.00\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.004,"exit_code":1,"observations":[{"actual":["1.115975","111.60","2.92"],"check":"regression markup-disclosure-base 1","expected":["1.115975","111.60","3.00"],"passed":false},{"actual":["0.006852","34.26","3.39"],"check":"regression markup-disclosure-base 2","expected":["0.006852","34.26","3.51"],"passed":false},{"actual":["155.536991","7775","2.68"],"check":"partial repair guard 2","expected":["155.536991","7775","2.76"],"passed":false},{"actual":["0.319418","79.855","3.85"],"check":"control: dinar card","expected":["0.319418","79.855","4.00"],"passed":false},{"actual":["0.908810","72.70","-0.50"],"check":"control: promotional discount","expected":["0.908810","72.70","-0.50"],"passed":true},{"actual":["1.200000","14.81","0.00"],"check":"control: zero markup","expected":["1.200000","14.81","0.00"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression markup-disclosure-base 1\", \"actual\": [\"1.115975\", \"111.60\", \"2.92\"], \"expected\": [\"1.115975\", \"111.60\", \"3.00\"], \"passed\": false}, {\"check\": \"regression markup-disclosure-base 2\", \"actual\": [\"0.006852\", \"34.26\", \"3.39\"], \"expected\": [\"0.006852\", \"34.26\", \"3.51\"], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [\"155.536991\", \"7775\", \"2.68\"], \"expected\": [\"155.536991\", \"7775\", \"2.76\"], \"passed\": false}, {\"check\": \"control: dinar card\", \"actual\": [\"0.319418\", \"79.855\", \"3.85\"], \"expected\": [\"0.319418\", \"79.855\", \"4.00\"], \"passed\": false}, {\"check\": \"control: promotional discount\", \"actual\": [\"0.908810\", \"72.70\", \"-0.50\"], \"expected\": [\"0.908810\", \"72.70\", \"-0.50\"], \"passed\": true}, {\"check\": \"control: zero markup\", \"actual\": [\"1.200000\", \"14.81\", \"0.00\"], \"expected\": [\"1.200000\", \"14.81\", \"0.00\"], \"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."}}