FA-62161 / Currency rounding and FX conversion / Open access
A USD holiday on the day before spot delays the value date · case 01
EURUSD traded before a USD-only holiday settles a day late.
ROOT CAUSE
Intermediate days are checked against both currencies' holidays, including USD.
VERIFIED REPAIR
Intermediate days need only be business days for the non-USD currencies.
Unsuccessful approach: Ignoring all holidays on intermediate days also skips the non-USD holiday check.
Case 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.
Why this case matters
Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(trade, pair, holidays):
d = date.fromisoformat(trade)
base, quote = pair[:3], pair[3:]
def good(x, ccys):
return x.weekday() < 5 and all(x.isoformat() not in holidays.get(c, []) for c in ccys)
lag = 1 if {base, quote} == {'USD', 'CAD'} else 2
non_usd = [c for c in (base, quote) if c != 'USD']
x, n = d, 0
while n < lag:
x += timedelta(days=1)
if good(x, [base, quote]):
n += 1
return x.isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression intermediate-usd-holiday 1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('regression intermediate-usd-holiday 2',
('2026-03-02', 'USDJPY',
{'USD': ['2026-03-03'], 'JPY': ['2026-03-04', '2026-03-06'], 'CAD': [], 'GBP': ['2026-03-04', '2026-03-06']}),
'2026-03-05'),
('partial repair guard 1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('partial repair guard 2', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03')],
[('regression intermediate-usd-holiday 1',
('2026-06-29', 'EURUSD',
{'USD': ['2026-06-30', '2026-07-01', '2026-07-03', '2026-07-04'],
'EUR': ['2026-07-01', '2026-07-04'],
'CAD': ['2026-07-03'],
'GBP': ['2026-07-04']}),
'2026-07-02'),
('regression intermediate-usd-holiday 2',
('2026-07-23', 'USDJPY', {'USD': ['2026-07-24', '2026-07-26', '2026-07-27'], 'CAD': ['2026-07-28']}), '2026-07-28'),
('partial repair guard 1',
('2026-03-30', 'EURGBP', {'EUR': ['2026-03-31', '2026-04-04'], 'CAD': ['2026-04-02'], 'GBP': ['2026-04-03']}),
'2026-04-02'),
('partial repair guard 2',
('2026-10-09', 'GBPJPY',
{'JPY': ['2026-10-11', '2026-10-12', '2026-10-13'],
'EUR': ['2026-10-14'],
'CAD': ['2026-10-10', '2026-10-11', '2026-10-12', '2026-10-13'],
'GBP': ['2026-10-12', '2026-10-14']}),
'2026-10-16'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-03-30', 'EURUSD',
{'USD': ['2026-03-31', '2026-04-01', '2026-04-03', '2026-04-04'],
'EUR': ['2026-03-31', '2026-04-04'],
'CAD': ['2026-04-02', '2026-04-04']}),
'2026-04-02'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD', {'USD': ['2026-07-20'], 'EUR': ['2026-07-18'], 'CAD': ['2026-07-20']}), '2026-07-21'),
('partial repair guard 1',
('2026-08-14', 'GBPJPY',
{'USD': [], 'JPY': ['2026-08-15', '2026-08-17', '2026-08-19'], 'EUR': ['2026-08-15', '2026-08-17']}),
'2026-08-20'),
('partial repair guard 2',
('2026-07-22', 'EURUSD', {'EUR': ['2026-07-23', '2026-07-24', '2026-07-25'], 'CAD': ['2026-07-23', '2026-07-26']}),
'2026-07-28'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04'),
('control: cad usd holiday', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),
('control: yen cross', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-09-24', 'USDJPY',
{'USD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'EUR': [],
'CAD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'GBP': ['2026-09-27', '2026-09-29']}),
'2026-09-30'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD',
{'USD': ['2026-07-18', '2026-07-19', '2026-07-21'],
'JPY': ['2026-07-18'],
'EUR': ['2026-07-20'],
'CAD': ['2026-07-18', '2026-07-22']}),
'2026-07-22'),
('partial repair guard 1',
('2026-02-16', 'EURCAD',
{'USD': ['2026-02-17', '2026-02-18', '2026-02-20'],
'EUR': ['2026-02-17', '2026-02-21'],
'CAD': [],
'GBP': ['2026-02-17', '2026-02-20']}),
'2026-02-19'),
('partial repair guard 2',
('2026-03-23', 'EURCAD',
{'JPY': ['2026-03-27'], 'EUR': ['2026-03-25'], 'CAD': ['2026-03-24', '2026-03-26'], 'GBP': ['2026-03-25']}),
'2026-03-30'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05')],
[('regression intermediate-usd-holiday 1',
('2026-09-08', 'EURUSD',
{'USD': ['2026-09-09', '2026-09-10', '2026-09-12', '2026-09-13'], 'JPY': ['2026-09-13'], 'EUR': ['2026-09-13']}),
'2026-09-11'),
('regression intermediate-usd-holiday 2',
('2026-04-10', 'USDJPY', {'USD': ['2026-04-13'], 'JPY': ['2026-04-14'], 'GBP': ['2026-04-14', '2026-04-15']}),
'2026-04-15'),
('partial repair guard 1',
('2026-08-28', 'EURCAD',
{'USD': ['2026-08-30', '2026-08-31', '2026-09-01'],
'EUR': ['2026-08-31', '2026-09-01'],
'CAD': ['2026-08-29', '2026-08-31'],
'GBP': ['2026-08-29', '2026-09-01']}),
'2026-09-03'),
('partial repair guard 2',
('2026-03-19', 'EURCAD', {'USD': ['2026-03-21'], 'JPY': ['2026-03-20'], 'EUR': ['2026-03-20'], 'CAD': []}),
'2026-03-24'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')]]
for label, args, expected in cases[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression intermediate-usd-holiday 1 | 2026-03-05 | 2026-03-04 | Failed |
| regression intermediate-usd-holiday 2 | 2026-03-09 | 2026-03-05 | Failed |
| partial repair guard 1 | 2026-03-05 | 2026-03-05 | Passed |
| partial repair guard 2 | 2026-05-04 | 2026-05-04 | Passed |
| control: plain t+2 | 2026-03-04 | 2026-03-04 | Passed |
| control: over weekend | 2026-03-09 | 2026-03-09 | Passed |
| control: usd holiday on spot | 2026-03-05 | 2026-03-05 | Passed |
| control: cad t+1 | 2026-03-03 | 2026-03-03 | Passed |
SHA-256 / 14f0074404cadffc4af7cc34157c861d603def92b887b99dd85eb5f85ab042ed
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(trade, pair, holidays):
d = date.fromisoformat(trade)
base, quote = pair[:3], pair[3:]
def good(x, ccys):
return x.weekday() < 5 and all(x.isoformat() not in holidays.get(c, []) for c in ccys)
lag = 1 if {base, quote} == {'USD', 'CAD'} else 2
non_usd = [c for c in (base, quote) if c != 'USD']
x, n = d, 0
while n < lag:
x += timedelta(days=1)
if good(x, [] if n < lag - 1 else [base, quote]):
n += 1
return x.isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression intermediate-usd-holiday 1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('regression intermediate-usd-holiday 2',
('2026-03-02', 'USDJPY',
{'USD': ['2026-03-03'], 'JPY': ['2026-03-04', '2026-03-06'], 'CAD': [], 'GBP': ['2026-03-04', '2026-03-06']}),
'2026-03-05'),
('partial repair guard 1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('partial repair guard 2', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03')],
[('regression intermediate-usd-holiday 1',
('2026-06-29', 'EURUSD',
{'USD': ['2026-06-30', '2026-07-01', '2026-07-03', '2026-07-04'],
'EUR': ['2026-07-01', '2026-07-04'],
'CAD': ['2026-07-03'],
'GBP': ['2026-07-04']}),
'2026-07-02'),
('regression intermediate-usd-holiday 2',
('2026-07-23', 'USDJPY', {'USD': ['2026-07-24', '2026-07-26', '2026-07-27'], 'CAD': ['2026-07-28']}), '2026-07-28'),
('partial repair guard 1',
('2026-03-30', 'EURGBP', {'EUR': ['2026-03-31', '2026-04-04'], 'CAD': ['2026-04-02'], 'GBP': ['2026-04-03']}),
'2026-04-02'),
('partial repair guard 2',
('2026-10-09', 'GBPJPY',
{'JPY': ['2026-10-11', '2026-10-12', '2026-10-13'],
'EUR': ['2026-10-14'],
'CAD': ['2026-10-10', '2026-10-11', '2026-10-12', '2026-10-13'],
'GBP': ['2026-10-12', '2026-10-14']}),
'2026-10-16'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-03-30', 'EURUSD',
{'USD': ['2026-03-31', '2026-04-01', '2026-04-03', '2026-04-04'],
'EUR': ['2026-03-31', '2026-04-04'],
'CAD': ['2026-04-02', '2026-04-04']}),
'2026-04-02'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD', {'USD': ['2026-07-20'], 'EUR': ['2026-07-18'], 'CAD': ['2026-07-20']}), '2026-07-21'),
('partial repair guard 1',
('2026-08-14', 'GBPJPY',
{'USD': [], 'JPY': ['2026-08-15', '2026-08-17', '2026-08-19'], 'EUR': ['2026-08-15', '2026-08-17']}),
'2026-08-20'),
('partial repair guard 2',
('2026-07-22', 'EURUSD', {'EUR': ['2026-07-23', '2026-07-24', '2026-07-25'], 'CAD': ['2026-07-23', '2026-07-26']}),
'2026-07-28'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04'),
('control: cad usd holiday', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),
('control: yen cross', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-09-24', 'USDJPY',
{'USD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'EUR': [],
'CAD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'GBP': ['2026-09-27', '2026-09-29']}),
'2026-09-30'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD',
{'USD': ['2026-07-18', '2026-07-19', '2026-07-21'],
'JPY': ['2026-07-18'],
'EUR': ['2026-07-20'],
'CAD': ['2026-07-18', '2026-07-22']}),
'2026-07-22'),
('partial repair guard 1',
('2026-02-16', 'EURCAD',
{'USD': ['2026-02-17', '2026-02-18', '2026-02-20'],
'EUR': ['2026-02-17', '2026-02-21'],
'CAD': [],
'GBP': ['2026-02-17', '2026-02-20']}),
'2026-02-19'),
('partial repair guard 2',
('2026-03-23', 'EURCAD',
{'JPY': ['2026-03-27'], 'EUR': ['2026-03-25'], 'CAD': ['2026-03-24', '2026-03-26'], 'GBP': ['2026-03-25']}),
'2026-03-30'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05')],
[('regression intermediate-usd-holiday 1',
('2026-09-08', 'EURUSD',
{'USD': ['2026-09-09', '2026-09-10', '2026-09-12', '2026-09-13'], 'JPY': ['2026-09-13'], 'EUR': ['2026-09-13']}),
'2026-09-11'),
('regression intermediate-usd-holiday 2',
('2026-04-10', 'USDJPY', {'USD': ['2026-04-13'], 'JPY': ['2026-04-14'], 'GBP': ['2026-04-14', '2026-04-15']}),
'2026-04-15'),
('partial repair guard 1',
('2026-08-28', 'EURCAD',
{'USD': ['2026-08-30', '2026-08-31', '2026-09-01'],
'EUR': ['2026-08-31', '2026-09-01'],
'CAD': ['2026-08-29', '2026-08-31'],
'GBP': ['2026-08-29', '2026-09-01']}),
'2026-09-03'),
('partial repair guard 2',
('2026-03-19', 'EURCAD', {'USD': ['2026-03-21'], 'JPY': ['2026-03-20'], 'EUR': ['2026-03-20'], 'CAD': []}),
'2026-03-24'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')]]
for label, args, expected in cases[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression intermediate-usd-holiday 1 | 2026-03-04 | 2026-03-04 | Passed |
| regression intermediate-usd-holiday 2 | 2026-03-05 | 2026-03-05 | Passed |
| partial repair guard 1 | 2026-03-04 | 2026-03-05 | Failed |
| partial repair guard 2 | 2026-05-01 | 2026-05-04 | Failed |
| control: plain t+2 | 2026-03-04 | 2026-03-04 | Passed |
| control: over weekend | 2026-03-09 | 2026-03-09 | Passed |
| control: usd holiday on spot | 2026-03-05 | 2026-03-05 | Passed |
| control: cad t+1 | 2026-03-03 | 2026-03-03 | Passed |
SHA-256 / 1e89db000d7edb8b6a44fad4d5214330d6d5711145ab6eb9c876d93e062eabde
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from datetime import date, timedelta
N = 1
observations = []
def solve(trade, pair, holidays):
d = date.fromisoformat(trade)
base, quote = pair[:3], pair[3:]
def good(x, ccys):
return x.weekday() < 5 and all(x.isoformat() not in holidays.get(c, []) for c in ccys)
lag = 1 if {base, quote} == {'USD', 'CAD'} else 2
non_usd = [c for c in (base, quote) if c != 'USD']
x, n = d, 0
while n < lag:
x += timedelta(days=1)
if good(x, non_usd if n < lag - 1 else [base, quote]):
n += 1
return x.isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression intermediate-usd-holiday 1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('regression intermediate-usd-holiday 2',
('2026-03-02', 'USDJPY',
{'USD': ['2026-03-03'], 'JPY': ['2026-03-04', '2026-03-06'], 'CAD': [], 'GBP': ['2026-03-04', '2026-03-06']}),
'2026-03-05'),
('partial repair guard 1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('partial repair guard 2', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03')],
[('regression intermediate-usd-holiday 1',
('2026-06-29', 'EURUSD',
{'USD': ['2026-06-30', '2026-07-01', '2026-07-03', '2026-07-04'],
'EUR': ['2026-07-01', '2026-07-04'],
'CAD': ['2026-07-03'],
'GBP': ['2026-07-04']}),
'2026-07-02'),
('regression intermediate-usd-holiday 2',
('2026-07-23', 'USDJPY', {'USD': ['2026-07-24', '2026-07-26', '2026-07-27'], 'CAD': ['2026-07-28']}), '2026-07-28'),
('partial repair guard 1',
('2026-03-30', 'EURGBP', {'EUR': ['2026-03-31', '2026-04-04'], 'CAD': ['2026-04-02'], 'GBP': ['2026-04-03']}),
'2026-04-02'),
('partial repair guard 2',
('2026-10-09', 'GBPJPY',
{'JPY': ['2026-10-11', '2026-10-12', '2026-10-13'],
'EUR': ['2026-10-14'],
'CAD': ['2026-10-10', '2026-10-11', '2026-10-12', '2026-10-13'],
'GBP': ['2026-10-12', '2026-10-14']}),
'2026-10-16'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-03-30', 'EURUSD',
{'USD': ['2026-03-31', '2026-04-01', '2026-04-03', '2026-04-04'],
'EUR': ['2026-03-31', '2026-04-04'],
'CAD': ['2026-04-02', '2026-04-04']}),
'2026-04-02'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD', {'USD': ['2026-07-20'], 'EUR': ['2026-07-18'], 'CAD': ['2026-07-20']}), '2026-07-21'),
('partial repair guard 1',
('2026-08-14', 'GBPJPY',
{'USD': [], 'JPY': ['2026-08-15', '2026-08-17', '2026-08-19'], 'EUR': ['2026-08-15', '2026-08-17']}),
'2026-08-20'),
('partial repair guard 2',
('2026-07-22', 'EURUSD', {'EUR': ['2026-07-23', '2026-07-24', '2026-07-25'], 'CAD': ['2026-07-23', '2026-07-26']}),
'2026-07-28'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04'),
('control: cad usd holiday', ('2026-03-06', 'CADUSD', {'USD': ['2026-03-09']}), '2026-03-10'),
('control: yen cross', ('2026-04-28', 'GBPJPY', {'JPY': ['2026-04-29', '2026-04-30']}), '2026-05-04'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04')],
[('regression intermediate-usd-holiday 1',
('2026-09-24', 'USDJPY',
{'USD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'EUR': [],
'CAD': ['2026-09-25', '2026-09-28', '2026-09-29'],
'GBP': ['2026-09-27', '2026-09-29']}),
'2026-09-30'),
('regression intermediate-usd-holiday 2',
('2026-07-17', 'EURUSD',
{'USD': ['2026-07-18', '2026-07-19', '2026-07-21'],
'JPY': ['2026-07-18'],
'EUR': ['2026-07-20'],
'CAD': ['2026-07-18', '2026-07-22']}),
'2026-07-22'),
('partial repair guard 1',
('2026-02-16', 'EURCAD',
{'USD': ['2026-02-17', '2026-02-18', '2026-02-20'],
'EUR': ['2026-02-17', '2026-02-21'],
'CAD': [],
'GBP': ['2026-02-17', '2026-02-20']}),
'2026-02-19'),
('partial repair guard 2',
('2026-03-23', 'EURCAD',
{'JPY': ['2026-03-27'], 'EUR': ['2026-03-25'], 'CAD': ['2026-03-24', '2026-03-26'], 'GBP': ['2026-03-25']}),
'2026-03-30'),
('control: plain t+2', ('2026-03-02', 'EURUSD', {}), '2026-03-04'),
('control: over weekend', ('2026-03-05', 'EURUSD', {}), '2026-03-09'),
('control: usd holiday t+1', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-03']}), '2026-03-04'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05')],
[('regression intermediate-usd-holiday 1',
('2026-09-08', 'EURUSD',
{'USD': ['2026-09-09', '2026-09-10', '2026-09-12', '2026-09-13'], 'JPY': ['2026-09-13'], 'EUR': ['2026-09-13']}),
'2026-09-11'),
('regression intermediate-usd-holiday 2',
('2026-04-10', 'USDJPY', {'USD': ['2026-04-13'], 'JPY': ['2026-04-14'], 'GBP': ['2026-04-14', '2026-04-15']}),
'2026-04-15'),
('partial repair guard 1',
('2026-08-28', 'EURCAD',
{'USD': ['2026-08-30', '2026-08-31', '2026-09-01'],
'EUR': ['2026-08-31', '2026-09-01'],
'CAD': ['2026-08-29', '2026-08-31'],
'GBP': ['2026-08-29', '2026-09-01']}),
'2026-09-03'),
('partial repair guard 2',
('2026-03-19', 'EURCAD', {'USD': ['2026-03-21'], 'JPY': ['2026-03-20'], 'EUR': ['2026-03-20'], 'CAD': []}),
'2026-03-24'),
('control: usd holiday on spot', ('2026-03-02', 'EURUSD', {'USD': ['2026-03-04']}), '2026-03-05'),
('control: cad t+1', ('2026-03-02', 'USDCAD', {}), '2026-03-03'),
('control: euro holiday t+1', ('2026-03-02', 'EURUSD', {'EUR': ['2026-03-03']}), '2026-03-05'),
('control: cross with cad', ('2026-03-02', 'EURCAD', {}), '2026-03-04')]]
for label, args, expected in cases[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression intermediate-usd-holiday 1 | 2026-03-04 | 2026-03-04 | Passed |
| regression intermediate-usd-holiday 2 | 2026-03-05 | 2026-03-05 | Passed |
| partial repair guard 1 | 2026-03-05 | 2026-03-05 | Passed |
| partial repair guard 2 | 2026-05-04 | 2026-05-04 | Passed |
| control: plain t+2 | 2026-03-04 | 2026-03-04 | Passed |
| control: over weekend | 2026-03-09 | 2026-03-09 | Passed |
| control: usd holiday on spot | 2026-03-05 | 2026-03-05 | Passed |
| control: cad t+1 | 2026-03-03 | 2026-03-03 | Passed |
SHA-256 / 94c9240c95114eb76b06773258796cab9aab7f7596de0759f5822e3878a72e74
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:47:02.040244+00:00.
Case digest / c17198914c5d18f917cb9a8b75d6d107d99bf2173d03c60f1edab5f3fc74ae77