{"abstract":"A collapsed rate far below the reference is accepted.","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":"Checking only (r - n)/r catches drops but now accepts every rise.","family":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band-two-sided-band","id":"FA-62231","implementations":{"attempt":{"sha256":"c336a4395978a60f9d6b3e1f37403850914b7a962af437446d63a74476d36a4d","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 = (r - n) / 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 two-sided-band 1', ('0.8', '1.0', 1000, False), 'reject'),\n  ('regression two-sided-band 2', ('0.91604868', '1.0968', 25, True), 'reject'),\n  ('partial repair guard 1', ('1.2', '1.0', 1000, False), 'reject'),\n  ('partial repair guard 2', ('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  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression two-sided-band 1', ('0.74336731', '1.4947', 1000, True), 'reject'),\n  ('regression two-sided-band 2', ('0.87740214', '1.3928', 1000, True), 'reject'),\n  ('partial repair guard 1', ('0.59568663', '0.5929', 25, False), 'reject'),\n  ('partial repair guard 2', ('0.95162298', '0.8547', 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  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression two-sided-band 1', ('0.85059956', '0.8572', 50, False), 'reject'),\n  ('regression two-sided-band 2', ('1.03353628', '1.0354', 10, False), 'reject'),\n  ('partial repair guard 1', ('0.57265770', '0.5718', 10, False), 'reject'),\n  ('partial repair guard 2', ('0.96278577', '1.0229', 100, True), 'reject'),\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 two-sided-band 1', ('1.6275668', '1.6574', 100, False), 'reject'),\n  ('regression two-sided-band 2', ('1.60129822', '1.6066', 25, False), 'reject'),\n  ('partial repair guard 1', ('0.96185726', '0.9529', 50, False), 'reject'),\n  ('partial repair guard 2', ('1.35897716', '1.3564', 10, False), '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 two-sided-band 1', ('1.66306861', '1.6649', 10, False), 'reject'),\n  ('regression two-sided-band 2', ('0.55485514', '0.5558', 10, False), 'reject'),\n  ('partial repair guard 1', ('1.41436370', '0.6093', 1000, True), 'reject'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\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":"af27464419061f9b8f70f016e1f458a36557b9d895d4d16f7451b99c15b15ee2","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 = (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 two-sided-band 1', ('0.8', '1.0', 1000, False), 'reject'),\n  ('regression two-sided-band 2', ('0.91604868', '1.0968', 25, True), 'reject'),\n  ('partial repair guard 1', ('1.2', '1.0', 1000, False), 'reject'),\n  ('partial repair guard 2', ('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  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression two-sided-band 1', ('0.74336731', '1.4947', 1000, True), 'reject'),\n  ('regression two-sided-band 2', ('0.87740214', '1.3928', 1000, True), 'reject'),\n  ('partial repair guard 1', ('0.59568663', '0.5929', 25, False), 'reject'),\n  ('partial repair guard 2', ('0.95162298', '0.8547', 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  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression two-sided-band 1', ('0.85059956', '0.8572', 50, False), 'reject'),\n  ('regression two-sided-band 2', ('1.03353628', '1.0354', 10, False), 'reject'),\n  ('partial repair guard 1', ('0.57265770', '0.5718', 10, False), 'reject'),\n  ('partial repair guard 2', ('0.96278577', '1.0229', 100, True), 'reject'),\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 two-sided-band 1', ('1.6275668', '1.6574', 100, False), 'reject'),\n  ('regression two-sided-band 2', ('1.60129822', '1.6066', 25, False), 'reject'),\n  ('partial repair guard 1', ('0.96185726', '0.9529', 50, False), 'reject'),\n  ('partial repair guard 2', ('1.35897716', '1.3564', 10, False), '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 two-sided-band 1', ('1.66306861', '1.6649', 10, False), 'reject'),\n  ('regression two-sided-band 2', ('0.55485514', '0.5558', 10, False), 'reject'),\n  ('partial repair guard 1', ('1.41436370', '0.6093', 1000, True), 'reject'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\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":"31cb9a96168543d15b2b70ba1000a59b9d8b1f89f208e56cc7d339bcdd9d6b3c","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 two-sided-band 1', ('0.8', '1.0', 1000, False), 'reject'),\n  ('regression two-sided-band 2', ('0.91604868', '1.0968', 25, True), 'reject'),\n  ('partial repair guard 1', ('1.2', '1.0', 1000, False), 'reject'),\n  ('partial repair guard 2', ('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  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression two-sided-band 1', ('0.74336731', '1.4947', 1000, True), 'reject'),\n  ('regression two-sided-band 2', ('0.87740214', '1.3928', 1000, True), 'reject'),\n  ('partial repair guard 1', ('0.59568663', '0.5929', 25, False), 'reject'),\n  ('partial repair guard 2', ('0.95162298', '0.8547', 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  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject')],\n [('regression two-sided-band 1', ('0.85059956', '0.8572', 50, False), 'reject'),\n  ('regression two-sided-band 2', ('1.03353628', '1.0354', 10, False), 'reject'),\n  ('partial repair guard 1', ('0.57265770', '0.5718', 10, False), 'reject'),\n  ('partial repair guard 2', ('0.96278577', '1.0229', 100, True), 'reject'),\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 two-sided-band 1', ('1.6275668', '1.6574', 100, False), 'reject'),\n  ('regression two-sided-band 2', ('1.60129822', '1.6066', 25, False), 'reject'),\n  ('partial repair guard 1', ('0.96185726', '0.9529', 50, False), 'reject'),\n  ('partial repair guard 2', ('1.35897716', '1.3564', 10, False), '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 two-sided-band 1', ('1.66306861', '1.6649', 10, False), 'reject'),\n  ('regression two-sided-band 2', ('0.55485514', '0.5558', 10, False), 'reject'),\n  ('partial repair guard 1', ('1.41436370', '0.6093', 1000, True), 'reject'),\n  ('partial repair guard 2', ('0.61344857', '1.6285', 10, True), 'reject'),\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-two-sided-band","generated_at":"2026-09-29T14:47:02.686325+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":"Use the absolute deviation.","root_cause":"The deviation is signed (n - r)/r, so every drop passes.","sha256":"4dcc596f6f4d2d04c26e0bde6ba55d79a6591649cc91f826e583e454c7eebf6e","title":"Only upward rate moves are checked against the tolerance · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.094,"exit_code":1,"observations":[{"actual":"reject","check":"regression two-sided-band 1","expected":"reject","passed":true},{"actual":"reject","check":"regression two-sided-band 2","expected":"reject","passed":true},{"actual":"accept","check":"partial repair guard 1","expected":"reject","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":"accept","check":"control: inverted exact","expected":"accept","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression two-sided-band 1\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"regression two-sided-band 2\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"accept\", \"expected\": \"reject\", \"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: inverted exact\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.11,"exit_code":1,"observations":[{"actual":"accept","check":"regression two-sided-band 1","expected":"reject","passed":false},{"actual":"accept","check":"regression two-sided-band 2","expected":"reject","passed":false},{"actual":"reject","check":"partial repair guard 1","expected":"reject","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":"accept","check":"control: inverted exact","expected":"accept","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression two-sided-band 1\", \"actual\": \"accept\", \"expected\": \"reject\", \"passed\": false}, {\"check\": \"regression two-sided-band 2\", \"actual\": \"accept\", \"expected\": \"reject\", \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": \"reject\", \"expected\": \"reject\", \"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: inverted exact\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.639,"exit_code":0,"observations":[{"actual":"reject","check":"regression two-sided-band 1","expected":"reject","passed":true},{"actual":"reject","check":"regression two-sided-band 2","expected":"reject","passed":true},{"actual":"reject","check":"partial repair guard 1","expected":"reject","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":"accept","check":"control: inverted exact","expected":"accept","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression two-sided-band 1\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"regression two-sided-band 2\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"reject\", \"expected\": \"reject\", \"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: inverted exact\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}