{"abstract":"Yen shelf prices appear as 1234.99.","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":"Using ceil(raw/10)*10-2 without the bump prices values ending in 9 below raw.","family":"w2-currency_rounding_and_fx_conversion-charm-price-conversion-yen-ending","id":"FA-62311","implementations":{"attempt":{"sha256":"1b91f9b6137539e100c211dc0aeb4710bcb78d26897ef351b45e27f78b267283","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        return format(c, 'f')\n    c = raw.to_integral_value(rounding=ROUND_FLOOR) + Decimal('0.99')\n    if c < raw: 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 yen-ending 1', ('1239', '1', 'JPY'), '1248'),\n  ('regression yen-ending 2', ('1234.5', '1', 'JPY'), '1238'),\n  ('partial repair guard 2', ('1408.999', '1', 'JPY'), '1418'),\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  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')],\n [('regression yen-ending 1', ('1238', '1', 'JPY'), '1238'),\n  ('regression yen-ending 2', ('9.99', '151.37', 'JPY'), '1518'),\n  ('partial repair guard 1', ('128.999', '1', 'JPY'), '138'), ('partial repair guard 2', ('538.99', '1', 'JPY'), '548'),\n  ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99'),\n  ('control: just above charm', ('11.994', '1', 'USD'), '12.99')],\n [('regression yen-ending 1', ('1408.999', '1', 'JPY'), '1418'),\n  ('regression yen-ending 2', ('73.04', '172.2043', 'JPY'), '12578'),\n  ('partial repair guard 1', ('82.26', '4.0106', 'JPY'), '338'),\n  ('partial repair guard 2', ('291.37', '7.8591', 'JPY'), '2298'),\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 yen-ending 1', ('114', '1', 'JPY'), '118'),\n  ('regression yen-ending 2', ('42.57', '41.3869', 'JPY'), '1768'),\n  ('partial repair guard 1', ('63.46', '153.7785', 'JPY'), '9768'),\n  ('partial repair guard 2', ('2209.9996', '1', 'JPY'), '2218'),\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 yen-ending 1', ('225.53', '87.4879', 'JPY'), '19738'),\n  ('regression yen-ending 2', ('128.999', '1', 'JPY'), '138'),\n  ('partial repair guard 1', ('124.55', '167.3895', 'JPY'), '20858'),\n  ('partial repair guard 2', ('119', '1', 'JPY'), '128'), ('control: above charm', ('12.995', '1', 'EUR'), '13.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')]]\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":"aae081d6408f353f1134d359cd3a46ffb75dcba1201cd9a8d909b97e5802c925","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        c = raw.to_integral_value(rounding=ROUND_FLOOR) + Decimal('0.99')\n        if c < raw: c += 1\n        return format(c, 'f')\n    c = raw.to_integral_value(rounding=ROUND_FLOOR) + Decimal('0.99')\n    if c < raw: 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 yen-ending 1', ('1239', '1', 'JPY'), '1248'),\n  ('regression yen-ending 2', ('1234.5', '1', 'JPY'), '1238'),\n  ('partial repair guard 2', ('1408.999', '1', 'JPY'), '1418'),\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  ('control: yen exact ending', ('1238', '1', 'JPY'), '1238')],\n [('regression yen-ending 1', ('1238', '1', 'JPY'), '1238'),\n  ('regression yen-ending 2', ('9.99', '151.37', 'JPY'), '1518'),\n  ('partial repair guard 1', ('128.999', '1', 'JPY'), '138'), ('partial repair guard 2', ('538.99', '1', 'JPY'), '548'),\n  ('control: yen round up', ('1234.5', '1', 'JPY'), '1238'),\n  ('control: yen above ending', ('1239', '1', 'JPY'), '1248'),\n  ('control: converted euro', ('10.00', '0.92', 'EUR'), '9.99'),\n  ('control: just above charm', ('11.994', '1', 'USD'), '12.99')],\n [('regression yen-ending 1', ('1408.999', '1', 'JPY'), '1418'),\n  ('regression yen-ending 2', ('73.04', '172.2043', 'JPY'), '12578'),\n  ('partial repair guard 1', ('82.26', '4.0106', 'JPY'), '338'),\n  ('partial repair guard 2', ('291.37', '7.8591', 'JPY'), '2298'),\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 yen-ending 1', ('114', '1', 'JPY'), '118'),\n  ('regression yen-ending 2', ('42.57', '41.3869', 'JPY'), '1768'),\n  ('partial repair guard 1', ('63.46', '153.7785', 'JPY'), '9768'),\n  ('partial repair guard 2', ('2209.9996', '1', 'JPY'), '2218'),\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 yen-ending 1', ('225.53', '87.4879', 'JPY'), '19738'),\n  ('regression yen-ending 2', ('128.999', '1', 'JPY'), '138'),\n  ('partial repair guard 1', ('124.55', '167.3895', 'JPY'), '20858'),\n  ('partial repair guard 2', ('119', '1', 'JPY'), '128'), ('control: above charm', ('12.995', '1', 'EUR'), '13.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')]]\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-yen-ending","generated_at":"2026-09-29T14:47:03.405123+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 JPY branch is missing, so the decimal .99 rule is applied to a zero-decimal currency.","sha256":"b57b3f1fd3cdf40f90b37a75846dd1e6f18f42b4ffb54b5de55ca22441fdd725","title":"Yen prices receive a decimal .99 charm ending · 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":41.104,"exit_code":1,"observations":[{"actual":"1238","check":"regression yen-ending 1","expected":"1248","passed":false},{"actual":"1238","check":"regression yen-ending 2","expected":"1238","passed":true},{"actual":"1408","check":"partial repair guard 2","expected":"1418","passed":false},{"actual":"12.99","check":"control: whole number","expected":"12.99","passed":true},{"actual":"11.99","check":"control: already charm","expected":"11.99","passed":true},{"actual":"13.99","check":"control: above charm","expected":"13.99","passed":true},{"actual":"1238","check":"control: yen exact ending","expected":"1238","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression yen-ending 1\", \"actual\": \"1238\", \"expected\": \"1248\", \"passed\": false}, {\"check\": \"regression yen-ending 2\", \"actual\": \"1238\", \"expected\": \"1238\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"1408\", \"expected\": \"1418\", \"passed\": false}, {\"check\": \"control: whole number\", \"actual\": \"12.99\", \"expected\": \"12.99\", \"passed\": true}, {\"check\": \"control: already charm\", \"actual\": \"11.99\", \"expected\": \"11.99\", \"passed\": true}, {\"check\": \"control: above charm\", \"actual\": \"13.99\", \"expected\": \"13.99\", \"passed\": true}, {\"check\": \"control: yen exact ending\", \"actual\": \"1238\", \"expected\": \"1238\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.482,"exit_code":1,"observations":[{"actual":"1239.99","check":"regression yen-ending 1","expected":"1248","passed":false},{"actual":"1234.99","check":"regression yen-ending 2","expected":"1238","passed":false},{"actual":"1409.99","check":"partial repair guard 2","expected":"1418","passed":false},{"actual":"12.99","check":"control: whole number","expected":"12.99","passed":true},{"actual":"11.99","check":"control: already charm","expected":"11.99","passed":true},{"actual":"13.99","check":"control: above charm","expected":"13.99","passed":true},{"actual":"1238.99","check":"control: yen exact ending","expected":"1238","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression yen-ending 1\", \"actual\": \"1239.99\", \"expected\": \"1248\", \"passed\": false}, {\"check\": \"regression yen-ending 2\", \"actual\": \"1234.99\", \"expected\": \"1238\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"1409.99\", \"expected\": \"1418\", \"passed\": false}, {\"check\": \"control: whole number\", \"actual\": \"12.99\", \"expected\": \"12.99\", \"passed\": true}, {\"check\": \"control: already charm\", \"actual\": \"11.99\", \"expected\": \"11.99\", \"passed\": true}, {\"check\": \"control: above charm\", \"actual\": \"13.99\", \"expected\": \"13.99\", \"passed\": true}, {\"check\": \"control: yen exact ending\", \"actual\": \"1238.99\", \"expected\": \"1238\", \"passed\": false}], \"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."}}