{"abstract":"Converting 12345 lira to lira returns 12346 lira.","category":"Currency rounding and FX conversion","checks":8,"contract":"solve(amount, frm, to): stipulated legacy-currency triangulation. Fixed rates are units per 1 EUR (DEM 1.95583, FRF 6.55957, ITL 1936.27, ESP 166.386, IEP 0.787564, NLG 2.20371, BEF 40.3399, PTE 200.482, ATS 13.7603, FIM 5.94573). Exponents: ITL, ESP, BEF, PTE 0; others and EUR 2. Legacy to legacy: divide by the source rate, round the EUR intermediate half-up to 3 decimals, multiply by the target rate, round half-up to the target exponent. Legacy to EUR: divide and round half-up to 2 decimals. EUR to legacy: multiply and round half-up to the target exponent. Same currency: round the amount half-up to its exponent. Inverse rates are never used. Unknown codes return 'ERR:currency'.","contract_signature":"amount, frm, to","evaluation_group":"w2-currency_rounding_and_fx_conversion-legacy-euro-triangulation","failed_approach":"Returning the input string unchanged skips the required rounding to the currency exponent.","family":"w2-currency_rounding_and_fx_conversion-legacy-euro-triangulation-same-currency","id":"FA-61941","implementations":{"attempt":{"sha256":"cb3d43ff5b1e9237795c3daf613456543c2708eeb4fb29a93b321d0d4e2db778","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, frm, to):\n    rates = {'DEM': '1.95583', 'FRF': '6.55957', 'ITL': '1936.27', 'ESP': '166.386', 'IEP': '0.787564', 'NLG': '2.20371', 'BEF': '40.3399', 'PTE': '200.482', 'ATS': '13.7603', 'FIM': '5.94573', 'EUR': '1'}\n    zero = ('ITL', 'ESP', 'BEF', 'PTE')\n    if frm not in rates or to not in rates: return 'ERR:currency'\n    def q(v, c):\n        return v.quantize(Decimal(1) if c in zero else Decimal('0.01'), rounding=ROUND_HALF_UP)\n    x = Decimal(amount)\n    if frm == to: return amount\n    if frm == 'EUR':\n        eur = x\n    elif to == 'EUR':\n        return format(q(x / Decimal(rates[frm]), 'EUR'), 'f')\n    else:\n        eur = (x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)\n    return format(q(eur * Decimal(rates[to]), to), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('100.5', 'ITL', 'ITL'), '101'),\n  ('partial repair guard 2', ('1.005', 'DEM', 'DEM'), '1.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'), ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('278015', 'FIM', 'FIM'), '278015.00'),\n  ('partial repair guard 2', ('162491', 'FRF', 'FRF'), '162491.00'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('3161904', 'FRF', 'FRF'), '3161904.00'),\n  ('partial repair guard 2', ('604787', 'EUR', 'EUR'), '604787.00'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1'),\n  ('control: schilling to markka', ('987.65', 'ATS', 'FIM'), '426.75'),\n  ('control: franc to franc', ('12.345', 'BEF', 'FRF'), '2.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('2390508', 'EUR', 'EUR'), '2390508.00'),\n  ('partial repair guard 2', ('4901642', 'IEP', 'IEP'), '4901642.00'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('3675688', 'EUR', 'EUR'), '3675688.00'),\n  ('partial repair guard 2', ('4983100', 'DEM', 'DEM'), '4983100.00'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '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":"64ecb0526c292905e892945e51ff33d45365967cdeab4fe7b6a9f40c99561bd4","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, frm, to):\n    rates = {'DEM': '1.95583', 'FRF': '6.55957', 'ITL': '1936.27', 'ESP': '166.386', 'IEP': '0.787564', 'NLG': '2.20371', 'BEF': '40.3399', 'PTE': '200.482', 'ATS': '13.7603', 'FIM': '5.94573', 'EUR': '1'}\n    zero = ('ITL', 'ESP', 'BEF', 'PTE')\n    if frm not in rates or to not in rates: return 'ERR:currency'\n    def q(v, c):\n        return v.quantize(Decimal(1) if c in zero else Decimal('0.01'), rounding=ROUND_HALF_UP)\n    x = Decimal(amount)\n    pass\n    if frm == 'EUR':\n        eur = x\n    elif to == 'EUR':\n        return format(q(x / Decimal(rates[frm]), 'EUR'), 'f')\n    else:\n        eur = (x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)\n    return format(q(eur * Decimal(rates[to]), to), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('100.5', 'ITL', 'ITL'), '101'),\n  ('partial repair guard 2', ('1.005', 'DEM', 'DEM'), '1.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'), ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('278015', 'FIM', 'FIM'), '278015.00'),\n  ('partial repair guard 2', ('162491', 'FRF', 'FRF'), '162491.00'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('3161904', 'FRF', 'FRF'), '3161904.00'),\n  ('partial repair guard 2', ('604787', 'EUR', 'EUR'), '604787.00'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1'),\n  ('control: schilling to markka', ('987.65', 'ATS', 'FIM'), '426.75'),\n  ('control: franc to franc', ('12.345', 'BEF', 'FRF'), '2.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('2390508', 'EUR', 'EUR'), '2390508.00'),\n  ('partial repair guard 2', ('4901642', 'IEP', 'IEP'), '4901642.00'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression same-currency 1', ('12345', 'ITL', 'ITL'), '12345'),\n  ('regression same-currency 2', ('409108', 'ITL', 'ITL'), '409108'),\n  ('partial repair guard 1', ('3675688', 'EUR', 'EUR'), '3675688.00'),\n  ('partial repair guard 2', ('4983100', 'DEM', 'DEM'), '4983100.00'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '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-legacy-euro-triangulation-same-currency","generated_at":"2026-09-29T14:47:00.023870+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 same-currency shortcut is missing, so the amount is triangulated through a rounded EUR intermediate.","sha256":"6f19c215d49186354b3600743733ef7ea18df22be49260d053e7b8d4046365f5","title":"A same-currency conversion is routed through euro triangulation · 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.589,"exit_code":1,"observations":[{"actual":"12345","check":"regression same-currency 1","expected":"12345","passed":true},{"actual":"409108","check":"regression same-currency 2","expected":"409108","passed":true},{"actual":"100.5","check":"partial repair guard 1","expected":"101","passed":false},{"actual":"1.005","check":"partial repair guard 2","expected":"1.01","passed":false},{"actual":"335.38","check":"control: mark to franc","expected":"335.38","passed":true},{"actual":"516.46","check":"control: lira to euro","expected":"516.46","passed":true},{"actual":"19363","check":"control: euro to lira","expected":"19363","passed":true},{"actual":"ERR:currency","check":"control: unknown","expected":"ERR:currency","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression same-currency 1\", \"actual\": \"12345\", \"expected\": \"12345\", \"passed\": true}, {\"check\": \"regression same-currency 2\", \"actual\": \"409108\", \"expected\": \"409108\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"100.5\", \"expected\": \"101\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"1.005\", \"expected\": \"1.01\", \"passed\": false}, {\"check\": \"control: mark to franc\", \"actual\": \"335.38\", \"expected\": \"335.38\", \"passed\": true}, {\"check\": \"control: lira to euro\", \"actual\": \"516.46\", \"expected\": \"516.46\", \"passed\": true}, {\"check\": \"control: euro to lira\", \"actual\": \"19363\", \"expected\": \"19363\", \"passed\": true}, {\"check\": \"control: unknown\", \"actual\": \"ERR:currency\", \"expected\": \"ERR:currency\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.361,"exit_code":1,"observations":[{"actual":"12346","check":"regression same-currency 1","expected":"12345","passed":false},{"actual":"409109","check":"regression same-currency 2","expected":"409108","passed":false},{"actual":"101","check":"partial repair guard 1","expected":"101","passed":true},{"actual":"1.01","check":"partial repair guard 2","expected":"1.01","passed":true},{"actual":"335.38","check":"control: mark to franc","expected":"335.38","passed":true},{"actual":"516.46","check":"control: lira to euro","expected":"516.46","passed":true},{"actual":"19363","check":"control: euro to lira","expected":"19363","passed":true},{"actual":"ERR:currency","check":"control: unknown","expected":"ERR:currency","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression same-currency 1\", \"actual\": \"12346\", \"expected\": \"12345\", \"passed\": false}, {\"check\": \"regression same-currency 2\", \"actual\": \"409109\", \"expected\": \"409108\", \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": \"101\", \"expected\": \"101\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"1.01\", \"expected\": \"1.01\", \"passed\": true}, {\"check\": \"control: mark to franc\", \"actual\": \"335.38\", \"expected\": \"335.38\", \"passed\": true}, {\"check\": \"control: lira to euro\", \"actual\": \"516.46\", \"expected\": \"516.46\", \"passed\": true}, {\"check\": \"control: euro to lira\", \"actual\": \"19363\", \"expected\": \"19363\", \"passed\": true}, {\"check\": \"control: unknown\", \"actual\": \"ERR:currency\", \"expected\": \"ERR:currency\", \"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."}}