{"abstract":"A converted price of exactly 12.00 is listed at 11.99, below the converted value.","category":"Currency rounding and FX conversion","checks":7,"contract":"solve(price, rate, ccy): a price list converted at rate is re-priced to the smallest charm price not below the exact converted value raw = price*rate. For JPY, charm prices end in 8 (…8 yen, i.e. 10k-2). For other currencies, charm prices end in .99. Return the charm price as a plain string.","contract_signature":"price, rate, ccy","evaluation_group":"w2-currency_rounding_and_fx_conversion-charm-price-conversion","failed_approach":"Bumping only when raw is a whole number still under-prices values between n.99 and n+1.","family":"w2-currency_rounding_and_fx_conversion-charm-price-conversion-whole-unit-boundary","id":"FA-62301","implementations":{"attempt":{"sha256":"b0821b57473928a09266907560baf60f650b9dbf52926d1e62b1d21730c7494a","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(price, rate, ccy):\n    raw = Decimal(price) * Decimal(rate)\n    if ccy == 'JPY':\n        c = (raw / 10).to_integral_value(rounding=ROUND_CEILING) * 10 - 2\n        if c < raw: c += 10\n        return format(c, 'f')\n    c = raw.to_integral_value(rounding=ROUND_CEILING) - Decimal('0.01')\n    if raw == raw.to_integral_value(): c += 1\n    return format(c, 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression whole-unit-boundary 1', ('12.00', '1', 'EUR'), '12.99'),\n  ('regression whole-unit-boundary 2', ('12.995', '1', 'EUR'), '13.99'),\n  ('partial repair guard 2', ('11.994', '1', 'USD'), '12.99'),\n  ('control: already charm', ('11.99', '1', 'EUR'), '11.99'), ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')],\n [('regression whole-unit-boundary 1', ('11.994', '1', 'USD'), '12.99'),\n  ('regression whole-unit-boundary 2', ('11.99004', '1', 'GBP'), '12.99'),\n  ('partial repair guard 2', ('1671.9996', '1', 'USD'), '1672.99'),\n  ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99')],\n [('regression whole-unit-boundary 1', ('1671.9996', '1', 'USD'), '1672.99'),\n  ('regression whole-unit-boundary 2', ('2820.995', '1', 'USD'), '2821.99'),\n  ('partial repair guard 2', ('2931.999', '1', 'EUR'), '2932.99'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99'),\n  ('control: just above charm', ('11.994', '1', 'USD'), '12.99'),\n  ('control: sub-cent above', ('11.99004', '1', 'GBP'), '12.99'),\n  ('control: yen converted', ('9.99', '151.37', 'JPY'), '1518')],\n [('regression whole-unit-boundary 1', ('2931.999', '1', 'EUR'), '2932.99'),\n  ('regression whole-unit-boundary 2', ('1682.999', '1', 'GBP'), '1683.99'),\n  ('partial repair guard 2', ('2543.999', '1', 'USD'), '2544.99'),\n  ('control: yen converted', ('9.99', '151.37', 'JPY'), '1518'),\n  ('control: whole number', ('12.00', '1', 'EUR'), '12.99'), ('control: already charm', ('11.99', '1', 'EUR'), '11.99'),\n  ('control: above charm', ('12.995', '1', 'EUR'), '13.99')],\n [('regression whole-unit-boundary 1', ('2543.999', '1', 'USD'), '2544.99'),\n  ('regression whole-unit-boundary 2', ('2655.9996', '1', 'GBP'), '2656.99'),\n  ('partial repair guard 2', ('1127.995', '1', 'USD'), '1128.99'),\n  ('control: above charm', ('12.995', '1', 'EUR'), '13.99'), ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')]]\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":"77e876cfe14af37ee60f48ba0a4bbcf8fc5917c3ad421dddddfce88c6b4e250c","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(price, rate, ccy):\n    raw = Decimal(price) * Decimal(rate)\n    if ccy == 'JPY':\n        c = (raw / 10).to_integral_value(rounding=ROUND_CEILING) * 10 - 2\n        if c < raw: c += 10\n        return format(c, 'f')\n    c = raw.to_integral_value(rounding=ROUND_CEILING) - Decimal('0.01')\n    return format(c, 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression whole-unit-boundary 1', ('12.00', '1', 'EUR'), '12.99'),\n  ('regression whole-unit-boundary 2', ('12.995', '1', 'EUR'), '13.99'),\n  ('partial repair guard 2', ('11.994', '1', 'USD'), '12.99'),\n  ('control: already charm', ('11.99', '1', 'EUR'), '11.99'), ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')],\n [('regression whole-unit-boundary 1', ('11.994', '1', 'USD'), '12.99'),\n  ('regression whole-unit-boundary 2', ('11.99004', '1', 'GBP'), '12.99'),\n  ('partial repair guard 2', ('1671.9996', '1', 'USD'), '1672.99'),\n  ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99')],\n [('regression whole-unit-boundary 1', ('1671.9996', '1', 'USD'), '1672.99'),\n  ('regression whole-unit-boundary 2', ('2820.995', '1', 'USD'), '2821.99'),\n  ('partial repair guard 2', ('2931.999', '1', 'EUR'), '2932.99'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99'),\n  ('control: just above charm', ('11.994', '1', 'USD'), '12.99'),\n  ('control: sub-cent above', ('11.99004', '1', 'GBP'), '12.99'),\n  ('control: yen converted', ('9.99', '151.37', 'JPY'), '1518')],\n [('regression whole-unit-boundary 1', ('2931.999', '1', 'EUR'), '2932.99'),\n  ('regression whole-unit-boundary 2', ('1682.999', '1', 'GBP'), '1683.99'),\n  ('partial repair guard 2', ('2543.999', '1', 'USD'), '2544.99'),\n  ('control: yen converted', ('9.99', '151.37', 'JPY'), '1518'),\n  ('control: whole number', ('12.00', '1', 'EUR'), '12.99'), ('control: already charm', ('11.99', '1', 'EUR'), '11.99'),\n  ('control: above charm', ('12.995', '1', 'EUR'), '13.99')],\n [('regression whole-unit-boundary 1', ('2543.999', '1', 'USD'), '2544.99'),\n  ('regression whole-unit-boundary 2', ('2655.9996', '1', 'GBP'), '2656.99'),\n  ('partial repair guard 2', ('1127.995', '1', 'USD'), '1128.99'),\n  ('control: above charm', ('12.995', '1', 'EUR'), '13.99'), ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')]]\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-charm-price-conversion-whole-unit-boundary","generated_at":"2026-09-29T14:47:03.364447+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 charm price is computed as ceil(raw) - 0.01 without checking that it is not below raw.","sha256":"03497ca8ad917e6de0c061c5a44b49b5efdb59d67abfa42ea6c386601dceb901","title":"Charm pricing subtracts a cent from the ceiling · 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.295,"exit_code":1,"observations":[{"actual":"12.99","check":"regression whole-unit-boundary 1","expected":"12.99","passed":true},{"actual":"12.99","check":"regression whole-unit-boundary 2","expected":"13.99","passed":false},{"actual":"11.99","check":"partial repair guard 2","expected":"12.99","passed":false},{"actual":"11.99","check":"control: already charm","expected":"11.99","passed":true},{"actual":"1238","check":"control: yen round up","expected":"1238","passed":true},{"actual":"1248","check":"control: yen above ending","expected":"1248","passed":true},{"actual":"1238","check":"control: yen exact ending","expected":"1238","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression whole-unit-boundary 1\", \"actual\": \"12.99\", \"expected\": \"12.99\", \"passed\": true}, {\"check\": \"regression whole-unit-boundary 2\", \"actual\": \"12.99\", \"expected\": \"13.99\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"11.99\", \"expected\": \"12.99\", \"passed\": false}, {\"check\": \"control: already charm\", \"actual\": \"11.99\", \"expected\": \"11.99\", \"passed\": true}, {\"check\": \"control: yen round up\", \"actual\": \"1238\", \"expected\": \"1238\", \"passed\": true}, {\"check\": \"control: yen above ending\", \"actual\": \"1248\", \"expected\": \"1248\", \"passed\": true}, {\"check\": \"control: yen exact ending\", \"actual\": \"1238\", \"expected\": \"1238\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.818,"exit_code":1,"observations":[{"actual":"11.99","check":"regression whole-unit-boundary 1","expected":"12.99","passed":false},{"actual":"12.99","check":"regression whole-unit-boundary 2","expected":"13.99","passed":false},{"actual":"11.99","check":"partial repair guard 2","expected":"12.99","passed":false},{"actual":"11.99","check":"control: already charm","expected":"11.99","passed":true},{"actual":"1238","check":"control: yen round up","expected":"1238","passed":true},{"actual":"1248","check":"control: yen above ending","expected":"1248","passed":true},{"actual":"1238","check":"control: yen exact ending","expected":"1238","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression whole-unit-boundary 1\", \"actual\": \"11.99\", \"expected\": \"12.99\", \"passed\": false}, {\"check\": \"regression whole-unit-boundary 2\", \"actual\": \"12.99\", \"expected\": \"13.99\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"11.99\", \"expected\": \"12.99\", \"passed\": false}, {\"check\": \"control: already charm\", \"actual\": \"11.99\", \"expected\": \"11.99\", \"passed\": true}, {\"check\": \"control: yen round up\", \"actual\": \"1238\", \"expected\": \"1238\", \"passed\": true}, {\"check\": \"control: yen above ending\", \"actual\": \"1248\", \"expected\": \"1248\", \"passed\": true}, {\"check\": \"control: yen exact ending\", \"actual\": \"1238\", \"expected\": \"1238\", \"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."}}