{"abstract":"EURUSD spot is set on a US holiday when dollars cannot settle.","category":"Currency rounding and FX conversion","checks":8,"contract":"solve(trade, pair, holidays): stipulated spot value-date rule. USDCAD/CADUSD settle T+1, every other pair T+2. Count forward from the trade date: a day before the final one counts only if it is a weekday and not a holiday of the non-USD currencies of the pair; the value date itself must be a weekday that is a holiday in neither currency. holidays maps currency to ISO date strings. Return the ISO value date.","contract_signature":"trade, pair, holidays","evaluation_group":"w2-currency_rounding_and_fx_conversion-fx-spot-value-date","failed_approach":"Checking only the quote currency's calendar on the final day misses base-currency holidays.","family":"w2-currency_rounding_and_fx_conversion-fx-spot-value-date-value-date-both-calendars","id":"FA-62166","implementations":{"attempt":{"sha256":"731c0d5937aa93e2c370978f823bfc8be3e7f0e3630017de7aa26f50dd811c58","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom datetime import date, timedelta\nN = 1\nobservations = []\ndef solve(trade, pair, holidays):\n    d = date.fromisoformat(trade)\n    base, quote = pair[:3], pair[3:]\n    def good(x, ccys):\n        return x.weekday() < 5 and all(x.isoformat() not in holidays.get(c, []) for c in ccys)\n    lag = 1 if {base, quote} == {'USD', 'CAD'} else 2\n    non_usd = [c for c in (base, quote) if c != 'USD']\n    x, n = d, 0\n    while n < lag:\n        x += timedelta(days=1)\n        if good(x, non_usd if n < lag - 1 else [quote]):\n            n += 1\n    return x.isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression value-date-both-calendars 1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('regression value-date-both-calendars 2', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),\n  ('partial repair guard 1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-04']}), '2026-03-05'),\n  ('partial repair guard 2', ('2026-07-17', 'CADUSD', {'EUR': ['2026-07-20', '2026-07-22'], 'CAD': ['2026-07-20']}),\n   '2026-07-21'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),\n  ('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),\n  ('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03')],\n [('regression value-date-both-calendars 1',\n   ('2026-05-26', 'CADUSD',\n    {'USD': ['2026-05-28', '2026-05-29'],\n     'JPY': ['2026-05-28'],\n     'EUR': ['2026-05-27', '2026-05-31'],\n     'CAD': ['2026-05-27', '2026-05-28', '2026-05-31']}),\n   '2026-06-01'),\n  ('regression value-date-both-calendars 2',\n   ('2026-02-09', 'USDCAD', {'USD': ['2026-02-10', '2026-02-12'], 'JPY': [], 'CAD': ['2026-02-11']}), '2026-02-13'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),\n  ('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')],\n [('regression value-date-both-calendars 1',\n   ('2026-03-30', 'CADUSD',\n    {'USD': ['2026-03-31'],\n     'JPY': ['2026-04-01', '2026-04-03', '2026-04-04'],\n     'CAD': ['2026-04-01', '2026-04-03'],\n     'GBP': ['2026-03-31']}),\n   '2026-04-02'),\n  ('regression value-date-both-calendars 2',\n   ('2026-01-12', 'EURUSD', {'USD': ['2026-01-14', '2026-01-15'], 'CAD': ['2026-01-15', '2026-01-17']}), '2026-01-16'),\n  ('partial repair guard 1',\n   ('2026-09-17', 'CADUSD',\n    {'JPY': ['2026-09-22'], 'CAD': ['2026-09-18', '2026-09-20'], 'GBP': ['2026-09-20', '2026-09-21']}),\n   '2026-09-21'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04'),\n  ('control: cad usd holiday', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),\n  ('control: yen cross', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04')],\n [('regression value-date-both-calendars 1',\n   ('2026-10-12', 'CADUSD',\n    {'USD': ['2026-10-14', '2026-10-17'], 'JPY': ['2026-10-16'], 'CAD': ['2026-10-13', '2026-10-15']}),\n   '2026-10-16'),\n  ('regression value-date-both-calendars 2',\n   ('2026-10-19', 'EURUSD',\n    {'USD': ['2026-10-21'],\n     'EUR': ['2026-10-22'],\n     'CAD': ['2026-10-20', '2026-10-22', '2026-10-23', '2026-10-24'],\n     'GBP': []}),\n   '2026-10-23'),\n  ('partial repair guard 2',\n   ('2026-07-13', 'GBPJPY',\n    {'USD': ['2026-07-18'],\n     'JPY': ['2026-07-18'],\n     'EUR': ['2026-07-14', '2026-07-16'],\n     'CAD': ['2026-07-15'],\n     'GBP': ['2026-07-15']}),\n   '2026-07-16'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),\n  ('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),\n  ('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05')],\n [('regression value-date-both-calendars 1', ('2026-05-04', 'CADUSD', {'USD': ['2026-05-05', '2026-05-06'], 'EUR': []}),\n   '2026-05-07'),\n  ('regression value-date-both-calendars 2',\n   ('2026-09-07', 'USDCAD',\n    {'USD': ['2026-09-09', '2026-09-10'],\n     'EUR': ['2026-09-09', '2026-09-11', '2026-09-12'],\n     'CAD': ['2026-09-08'],\n     'GBP': ['2026-09-09', '2026-09-10', '2026-09-11']}),\n   '2026-09-11'),\n  ('partial repair guard 1',\n   ('2026-05-18', 'EURUSD', {'USD': ['2026-05-22'], 'JPY': ['2026-05-19'], 'EUR': ['2026-05-20', '2026-05-23']}),\n   '2026-05-21'),\n  ('partial repair guard 2',\n   ('2026-10-19', 'EURUSD',\n    {'USD': ['2026-10-21'],\n     'EUR': ['2026-10-22'],\n     'CAD': ['2026-10-20', '2026-10-22', '2026-10-23', '2026-10-24'],\n     'GBP': []}),\n   '2026-10-23'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),\n  ('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')]]\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":"8435792ea846bca8a7e1c3858fa9a1f4571ffd7b60453e0137da46f87b0ffe74","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom datetime import date, timedelta\nN = 1\nobservations = []\ndef solve(trade, pair, holidays):\n    d = date.fromisoformat(trade)\n    base, quote = pair[:3], pair[3:]\n    def good(x, ccys):\n        return x.weekday() < 5 and all(x.isoformat() not in holidays.get(c, []) for c in ccys)\n    lag = 1 if {base, quote} == {'USD', 'CAD'} else 2\n    non_usd = [c for c in (base, quote) if c != 'USD']\n    x, n = d, 0\n    while n < lag:\n        x += timedelta(days=1)\n        if good(x, non_usd):\n            n += 1\n    return x.isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression value-date-both-calendars 1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('regression value-date-both-calendars 2', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),\n  ('partial repair guard 1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-04']}), '2026-03-05'),\n  ('partial repair guard 2', ('2026-07-17', 'CADUSD', {'EUR': ['2026-07-20', '2026-07-22'], 'CAD': ['2026-07-20']}),\n   '2026-07-21'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),\n  ('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),\n  ('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03')],\n [('regression value-date-both-calendars 1',\n   ('2026-05-26', 'CADUSD',\n    {'USD': ['2026-05-28', '2026-05-29'],\n     'JPY': ['2026-05-28'],\n     'EUR': ['2026-05-27', '2026-05-31'],\n     'CAD': ['2026-05-27', '2026-05-28', '2026-05-31']}),\n   '2026-06-01'),\n  ('regression value-date-both-calendars 2',\n   ('2026-02-09', 'USDCAD', {'USD': ['2026-02-10', '2026-02-12'], 'JPY': [], 'CAD': ['2026-02-11']}), '2026-02-13'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),\n  ('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')],\n [('regression value-date-both-calendars 1',\n   ('2026-03-30', 'CADUSD',\n    {'USD': ['2026-03-31'],\n     'JPY': ['2026-04-01', '2026-04-03', '2026-04-04'],\n     'CAD': ['2026-04-01', '2026-04-03'],\n     'GBP': ['2026-03-31']}),\n   '2026-04-02'),\n  ('regression value-date-both-calendars 2',\n   ('2026-01-12', 'EURUSD', {'USD': ['2026-01-14', '2026-01-15'], 'CAD': ['2026-01-15', '2026-01-17']}), '2026-01-16'),\n  ('partial repair guard 1',\n   ('2026-09-17', 'CADUSD',\n    {'JPY': ['2026-09-22'], 'CAD': ['2026-09-18', '2026-09-20'], 'GBP': ['2026-09-20', '2026-09-21']}),\n   '2026-09-21'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04'),\n  ('control: cad usd holiday', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),\n  ('control: yen cross', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04')],\n [('regression value-date-both-calendars 1',\n   ('2026-10-12', 'CADUSD',\n    {'USD': ['2026-10-14', '2026-10-17'], 'JPY': ['2026-10-16'], 'CAD': ['2026-10-13', '2026-10-15']}),\n   '2026-10-16'),\n  ('regression value-date-both-calendars 2',\n   ('2026-10-19', 'EURUSD',\n    {'USD': ['2026-10-21'],\n     'EUR': ['2026-10-22'],\n     'CAD': ['2026-10-20', '2026-10-22', '2026-10-23', '2026-10-24'],\n     'GBP': []}),\n   '2026-10-23'),\n  ('partial repair guard 2',\n   ('2026-07-13', 'GBPJPY',\n    {'USD': ['2026-07-18'],\n     'JPY': ['2026-07-18'],\n     'EUR': ['2026-07-14', '2026-07-16'],\n     'CAD': ['2026-07-15'],\n     'GBP': ['2026-07-15']}),\n   '2026-07-16'),\n  ('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),\n  ('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),\n  ('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05')],\n [('regression value-date-both-calendars 1', ('2026-05-04', 'CADUSD', {'USD': ['2026-05-05', '2026-05-06'], 'EUR': []}),\n   '2026-05-07'),\n  ('regression value-date-both-calendars 2',\n   ('2026-09-07', 'USDCAD',\n    {'USD': ['2026-09-09', '2026-09-10'],\n     'EUR': ['2026-09-09', '2026-09-11', '2026-09-12'],\n     'CAD': ['2026-09-08'],\n     'GBP': ['2026-09-09', '2026-09-10', '2026-09-11']}),\n   '2026-09-11'),\n  ('partial repair guard 1',\n   ('2026-05-18', 'EURUSD', {'USD': ['2026-05-22'], 'JPY': ['2026-05-19'], 'EUR': ['2026-05-20', '2026-05-23']}),\n   '2026-05-21'),\n  ('partial repair guard 2',\n   ('2026-10-19', 'EURUSD',\n    {'USD': ['2026-10-21'],\n     'EUR': ['2026-10-22'],\n     'CAD': ['2026-10-20', '2026-10-22', '2026-10-23', '2026-10-24'],\n     'GBP': []}),\n   '2026-10-23'),\n  ('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),\n  ('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),\n  ('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),\n  ('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')]]\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-fx-spot-value-date-value-date-both-calendars","generated_at":"2026-09-29T14:47:02.045981+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 final day is checked only against the non-USD calendars.","sha256":"0aa8d7b8605de9c4225eea84c46b4822a2617d175fe9dcceff090f029637b33b","title":"The value date may fall on a USD holiday · 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":42.332,"exit_code":1,"observations":[{"actual":"2026-03-05","check":"regression value-date-both-calendars 1","expected":"2026-03-05","passed":true},{"actual":"2026-03-10","check":"regression value-date-both-calendars 2","expected":"2026-03-10","passed":true},{"actual":"2026-03-04","check":"partial repair guard 1","expected":"2026-03-05","passed":false},{"actual":"2026-07-20","check":"partial repair guard 2","expected":"2026-07-21","passed":false},{"actual":"2026-03-04","check":"control: plain t+2","expected":"2026-03-04","passed":true},{"actual":"2026-03-09","check":"control: over weekend","expected":"2026-03-09","passed":true},{"actual":"2026-03-04","check":"control: usd holiday t+1","expected":"2026-03-04","passed":true},{"actual":"2026-03-03","check":"control: cad t+1","expected":"2026-03-03","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression value-date-both-calendars 1\", \"actual\": \"2026-03-05\", \"expected\": \"2026-03-05\", \"passed\": true}, {\"check\": \"regression value-date-both-calendars 2\", \"actual\": \"2026-03-10\", \"expected\": \"2026-03-10\", \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-05\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"2026-07-20\", \"expected\": \"2026-07-21\", \"passed\": false}, {\"check\": \"control: plain t+2\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-04\", \"passed\": true}, {\"check\": \"control: over weekend\", \"actual\": \"2026-03-09\", \"expected\": \"2026-03-09\", \"passed\": true}, {\"check\": \"control: usd holiday t+1\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-04\", \"passed\": true}, {\"check\": \"control: cad t+1\", \"actual\": \"2026-03-03\", \"expected\": \"2026-03-03\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.876,"exit_code":1,"observations":[{"actual":"2026-03-04","check":"regression value-date-both-calendars 1","expected":"2026-03-05","passed":false},{"actual":"2026-03-09","check":"regression value-date-both-calendars 2","expected":"2026-03-10","passed":false},{"actual":"2026-03-05","check":"partial repair guard 1","expected":"2026-03-05","passed":true},{"actual":"2026-07-21","check":"partial repair guard 2","expected":"2026-07-21","passed":true},{"actual":"2026-03-04","check":"control: plain t+2","expected":"2026-03-04","passed":true},{"actual":"2026-03-09","check":"control: over weekend","expected":"2026-03-09","passed":true},{"actual":"2026-03-04","check":"control: usd holiday t+1","expected":"2026-03-04","passed":true},{"actual":"2026-03-03","check":"control: cad t+1","expected":"2026-03-03","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression value-date-both-calendars 1\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-05\", \"passed\": false}, {\"check\": \"regression value-date-both-calendars 2\", \"actual\": \"2026-03-09\", \"expected\": \"2026-03-10\", \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": \"2026-03-05\", \"expected\": \"2026-03-05\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"2026-07-21\", \"expected\": \"2026-07-21\", \"passed\": true}, {\"check\": \"control: plain t+2\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-04\", \"passed\": true}, {\"check\": \"control: over weekend\", \"actual\": \"2026-03-09\", \"expected\": \"2026-03-09\", \"passed\": true}, {\"check\": \"control: usd holiday t+1\", \"actual\": \"2026-03-04\", \"expected\": \"2026-03-04\", \"passed\": true}, {\"check\": \"control: cad t+1\", \"actual\": \"2026-03-03\", \"expected\": \"2026-03-03\", \"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."}}