{"abstract":"A USD/EUR print is compared directly with the EUR/USD reference and rejected.","category":"Currency rounding and FX conversion","checks":8,"contract":"solve(new, ref, tol_bps, inverted): accept a newly published rate if |n - ref| / ref * 10000 <= tol_bps using exact decimals, where n = new, or 1/new when the new quote arrives inverted. A non-positive new or ref returns 'ERR:rate'. Return 'accept' or 'reject'.","evaluation_group":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band","failed_approach":"Inverting the reference instead of the new rate changes the denominator of the deviation.","family":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band-inverted-quote","id":"FA-62226","implementations":{"attempt":{"sha256":"1b9187c3546dec83c08be60edeb58a683b712b10a853a0d5d1ba3a1c8346ed48","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(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    if inverted: r = 1 / r\n    dev = abs(n - r) / r\n    return 'accept' if dev * 10000 <= tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression inverted-quote 1', ('0.5', '2.0', 0, True), 'accept'),\n  ('regression inverted-quote 2', ('0.52599504', '1.9023', 10, True), 'accept'),\n  ('partial repair guard 1', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.58349261', '1.7075', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('partial repair guard 2', ('0.93539594', '1.0664', 25, True), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression inverted-quote 1', ('0.91004974', '0.9784', 1000, True), 'reject'),\n  ('regression inverted-quote 2', ('0.66896926', '1.4874', 50, True), 'accept'),\n  ('partial repair guard 1', ('1.00665155', '0.9924', 10, True), 'reject'),\n  ('partial repair guard 2', ('0.51145669', '1.9601', 25, True), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression inverted-quote 1', ('0.79028053', '1.2655', 10, True), 'accept'),\n  ('regression inverted-quote 2', ('0.53202622', '1.8710', 100, True), 'accept'),\n  ('partial repair guard 1', ('1.41341757', '0.7005', 100, True), 'reject'),\n  ('partial repair guard 2', ('0.78742098', '1.2687', 10, True), 'reject'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.96761890', '0.5057', 50, True), 'accept'),\n  ('partial repair guard 1', ('0.78810637', '1.2657', 25, True), 'reject'),\n  ('partial repair guard 2', ('0.87256913', '1.1518', 50, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\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":"16201b274bc3c8c0458bbec4bb2c71cebd495d55e071403385067786b22ab2cb","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(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    pass\n    dev = abs(n - r) / r\n    return 'accept' if dev * 10000 <= tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression inverted-quote 1', ('0.5', '2.0', 0, True), 'accept'),\n  ('regression inverted-quote 2', ('0.52599504', '1.9023', 10, True), 'accept'),\n  ('partial repair guard 1', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.58349261', '1.7075', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('partial repair guard 2', ('0.93539594', '1.0664', 25, True), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression inverted-quote 1', ('0.91004974', '0.9784', 1000, True), 'reject'),\n  ('regression inverted-quote 2', ('0.66896926', '1.4874', 50, True), 'accept'),\n  ('partial repair guard 1', ('1.00665155', '0.9924', 10, True), 'reject'),\n  ('partial repair guard 2', ('0.51145669', '1.9601', 25, True), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression inverted-quote 1', ('0.79028053', '1.2655', 10, True), 'accept'),\n  ('regression inverted-quote 2', ('0.53202622', '1.8710', 100, True), 'accept'),\n  ('partial repair guard 1', ('1.41341757', '0.7005', 100, True), 'reject'),\n  ('partial repair guard 2', ('0.78742098', '1.2687', 10, True), 'reject'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.96761890', '0.5057', 50, True), 'accept'),\n  ('partial repair guard 1', ('0.78810637', '1.2657', 25, True), 'reject'),\n  ('partial repair guard 2', ('0.87256913', '1.1518', 50, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\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"},"fixed":{"sha256":"f0e96484988378b4b54d0d432967f7053d1a10599a8fc0924682fbd9bf88524e","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(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    if inverted: n = 1 / n\n    dev = abs(n - r) / r\n    return 'accept' if dev * 10000 <= tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression inverted-quote 1', ('0.5', '2.0', 0, True), 'accept'),\n  ('regression inverted-quote 2', ('0.52599504', '1.9023', 10, True), 'accept'),\n  ('partial repair guard 1', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.58349261', '1.7075', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.20407797', '0.8389', 100, True), 'accept'),\n  ('partial repair guard 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('partial repair guard 2', ('0.93539594', '1.0664', 25, True), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression inverted-quote 1', ('0.91004974', '0.9784', 1000, True), 'reject'),\n  ('regression inverted-quote 2', ('0.66896926', '1.4874', 50, True), 'accept'),\n  ('partial repair guard 1', ('1.00665155', '0.9924', 10, True), 'reject'),\n  ('partial repair guard 2', ('0.51145669', '1.9601', 25, True), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression inverted-quote 1', ('0.79028053', '1.2655', 10, True), 'accept'),\n  ('regression inverted-quote 2', ('0.53202622', '1.8710', 100, True), 'accept'),\n  ('partial repair guard 1', ('1.41341757', '0.7005', 100, True), 'reject'),\n  ('partial repair guard 2', ('0.78742098', '1.2687', 10, True), 'reject'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression inverted-quote 1', ('0.66867939', '1.5030', 50, True), 'accept'),\n  ('regression inverted-quote 2', ('1.96761890', '0.5057', 50, True), 'accept'),\n  ('partial repair guard 1', ('0.78810637', '1.2657', 25, True), 'reject'),\n  ('partial repair guard 2', ('0.87256913', '1.1518', 50, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\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-rate-tolerance-band-inverted-quote","generated_at":"2026-09-29T14:47:02.655444+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.","repair":"Invert the new rate before comparing when it arrives in the opposite orientation.","root_cause":"The inverted flag is ignored.","sha256":"00fbe61041eca932e312e554f4b82b1a713dc7779c249d0def6159ca94da38ed","title":"An inverted incoming quote is compared without inversion · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.287,"exit_code":1,"observations":[{"actual":"accept","check":"regression inverted-quote 1","expected":"accept","passed":true},{"actual":"accept","check":"regression inverted-quote 2","expected":"accept","passed":true},{"actual":"reject","check":"partial repair guard 1","expected":"accept","passed":false},{"actual":"accept","check":"partial repair guard 2","expected":"reject","passed":false},{"actual":"accept","check":"control: upper boundary","expected":"accept","passed":true},{"actual":"accept","check":"control: lower boundary","expected":"accept","passed":true},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression inverted-quote 1\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"regression inverted-quote 2\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"accept\", \"expected\": \"reject\", \"passed\": false}, {\"check\": \"control: upper boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: lower boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.704,"exit_code":1,"observations":[{"actual":"reject","check":"regression inverted-quote 1","expected":"accept","passed":false},{"actual":"reject","check":"regression inverted-quote 2","expected":"accept","passed":false},{"actual":"reject","check":"partial repair guard 1","expected":"accept","passed":false},{"actual":"reject","check":"partial repair guard 2","expected":"reject","passed":true},{"actual":"accept","check":"control: upper boundary","expected":"accept","passed":true},{"actual":"accept","check":"control: lower boundary","expected":"accept","passed":true},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression inverted-quote 1\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"regression inverted-quote 2\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: upper boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: lower boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.379,"exit_code":0,"observations":[{"actual":"accept","check":"regression inverted-quote 1","expected":"accept","passed":true},{"actual":"accept","check":"regression inverted-quote 2","expected":"accept","passed":true},{"actual":"accept","check":"partial repair guard 1","expected":"accept","passed":true},{"actual":"reject","check":"partial repair guard 2","expected":"reject","passed":true},{"actual":"accept","check":"control: upper boundary","expected":"accept","passed":true},{"actual":"accept","check":"control: lower boundary","expected":"accept","passed":true},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression inverted-quote 1\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"regression inverted-quote 2\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: upper boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: lower boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}