FA-59236 / Payroll withholding rules / Open access
Pay dates in a calendar year: extra period flag · case 01
Normal years are flagged as having an extra pay period.
ROOT CAUSE
The extra-period test is inclusive of the nominal count.
VERIFIED REPAIR
Restore the contract rule at the extra period flag step: use `count > periods`.
Unsuccessful approach: The attempt compares every frequency against 26, flagging all weekly calendars.
Case contract
Input {anchor [y,m,d] (any pay date), step 7|14 days, year}. Pay dates are anchor + k*step for all integers k. Return [count of pay dates within Jan 1..Dec 31 of year inclusive, ISO date of the first one, whether the count exceeds the nominal periods (26 biweekly, 52 weekly)].
Why this case matters
Annualization factors change in 27-pay-period years; missing or extra pay dates distort per-period withholding.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
anchor = datetime.date(*x['anchor'])
lo = datetime.date(x['year'], 1, 1)
hi = datetime.date(x['year'], 12, 31)
off = (lo - anchor).days
k = -(-off // x['step'])
first = anchor + datetime.timedelta(days=k * x['step'])
count = (hi - first).days // x['step'] + 1
periods = 26 if x['step'] == 14 else 52
return [count, first.isoformat(), count >= periods]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression (boundary)', {'anchor': [2024, 1, 5], 'step': 14, 'year': 2024}, [26, '2024-01-05', False]), ('partial-repair probe', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2021, 6, 20], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2024, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-01', True]), ('normal control', {'anchor': [2021, 1, 17], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2019, 8, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True])], [('regression', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('regression', {'anchor': [2023, 8, 10], 'step': 14, 'year': 2024}, [26, '2024-01-11', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2022, 8, 16], 'step': 7, 'year': 2024}, [53, '2024-01-02', True]), ('normal control', {'anchor': [2025, 3, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2020, 3, 26], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2024, 10, 27], 'step': 7, 'year': 2023}, [53, '2023-01-01', True])], [('regression', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression', {'anchor': [2024, 3, 10], 'step': 14, 'year': 2024}, [26, '2024-01-14', False]), ('partial-repair probe', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('partial-repair probe', {'anchor': [2018, 10, 22], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2018, 3, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True]), ('normal control', {'anchor': [2023, 3, 28], 'step': 14, 'year': 2024}, [27, '2024-01-02', True]), ('normal control', {'anchor': [2021, 5, 2], 'step': 7, 'year': 2023}, [53, '2023-01-01', True]), ('normal control', {'anchor': [2025, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-02', True])], [('regression', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('regression', {'anchor': [2020, 3, 23], 'step': 14, 'year': 2020}, [26, '2020-01-13', False]), ('partial-repair probe', {'anchor': [2027, 8, 13], 'step': 7, 'year': 2026}, [52, '2026-01-02', False]), ('partial-repair probe', {'anchor': [2022, 1, 14], 'step': 7, 'year': 2024}, [52, '2024-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2020, 7, 16], 'step': 7, 'year': 2020}, [53, '2020-01-02', True]), ('normal control', {'anchor': [2025, 9, 4], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2024, 6, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2023, 2, 26], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])], [('regression', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2024, 6, 12], 'step': 7, 'year': 2023}, [52, '2023-01-04', False]), ('partial-repair probe', {'anchor': [2026, 12, 25], 'step': 7, 'year': 2025}, [52, '2025-01-03', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2025, 7, 10], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2026, 5, 21], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('normal control', {'anchor': [2024, 3, 20], 'step': 7, 'year': 2025}, [53, '2025-01-01', True]), ('normal control', {'anchor': [2023, 3, 12], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), 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 0 | [52, '2020-01-05', True] | [52, '2020-01-05', False] | Failed |
| regression (boundary) 1 | [26, '2024-01-05', True] | [26, '2024-01-05', False] | Failed |
| partial-repair probe 2 | [52, '2023-01-06', True] | [52, '2023-01-06', False] | Failed |
| partial-repair probe 3 | [52, '2020-01-05', True] | [52, '2020-01-05', False] | Failed |
| boundary control 4 | [27, '2026-01-01', True] | [27, '2026-01-01', True] | Passed |
| boundary control 5 | [27, '2020-01-02', True] | [27, '2020-01-02', True] | Passed |
| normal control 6 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 7 | [53, '2024-01-01', True] | [53, '2024-01-01', True] | Passed |
| normal control 8 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 9 | [27, '2020-01-01', True] | [27, '2020-01-01', True] | Passed |
SHA-256 / 928cf475eb4e0a835d475c157a71358ddcbf8120367e87feee134cb4d17da249
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
anchor = datetime.date(*x['anchor'])
lo = datetime.date(x['year'], 1, 1)
hi = datetime.date(x['year'], 12, 31)
off = (lo - anchor).days
k = -(-off // x['step'])
first = anchor + datetime.timedelta(days=k * x['step'])
count = (hi - first).days // x['step'] + 1
periods = 26 if x['step'] == 14 else 52
return [count, first.isoformat(), count > 26]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression (boundary)', {'anchor': [2024, 1, 5], 'step': 14, 'year': 2024}, [26, '2024-01-05', False]), ('partial-repair probe', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2021, 6, 20], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2024, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-01', True]), ('normal control', {'anchor': [2021, 1, 17], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2019, 8, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True])], [('regression', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('regression', {'anchor': [2023, 8, 10], 'step': 14, 'year': 2024}, [26, '2024-01-11', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2022, 8, 16], 'step': 7, 'year': 2024}, [53, '2024-01-02', True]), ('normal control', {'anchor': [2025, 3, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2020, 3, 26], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2024, 10, 27], 'step': 7, 'year': 2023}, [53, '2023-01-01', True])], [('regression', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression', {'anchor': [2024, 3, 10], 'step': 14, 'year': 2024}, [26, '2024-01-14', False]), ('partial-repair probe', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('partial-repair probe', {'anchor': [2018, 10, 22], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2018, 3, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True]), ('normal control', {'anchor': [2023, 3, 28], 'step': 14, 'year': 2024}, [27, '2024-01-02', True]), ('normal control', {'anchor': [2021, 5, 2], 'step': 7, 'year': 2023}, [53, '2023-01-01', True]), ('normal control', {'anchor': [2025, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-02', True])], [('regression', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('regression', {'anchor': [2020, 3, 23], 'step': 14, 'year': 2020}, [26, '2020-01-13', False]), ('partial-repair probe', {'anchor': [2027, 8, 13], 'step': 7, 'year': 2026}, [52, '2026-01-02', False]), ('partial-repair probe', {'anchor': [2022, 1, 14], 'step': 7, 'year': 2024}, [52, '2024-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2020, 7, 16], 'step': 7, 'year': 2020}, [53, '2020-01-02', True]), ('normal control', {'anchor': [2025, 9, 4], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2024, 6, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2023, 2, 26], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])], [('regression', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2024, 6, 12], 'step': 7, 'year': 2023}, [52, '2023-01-04', False]), ('partial-repair probe', {'anchor': [2026, 12, 25], 'step': 7, 'year': 2025}, [52, '2025-01-03', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2025, 7, 10], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2026, 5, 21], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('normal control', {'anchor': [2024, 3, 20], 'step': 7, 'year': 2025}, [53, '2025-01-01', True]), ('normal control', {'anchor': [2023, 3, 12], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), 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 0 | [52, '2020-01-05', True] | [52, '2020-01-05', False] | Failed |
| regression (boundary) 1 | [26, '2024-01-05', False] | [26, '2024-01-05', False] | Passed |
| partial-repair probe 2 | [52, '2023-01-06', True] | [52, '2023-01-06', False] | Failed |
| partial-repair probe 3 | [52, '2020-01-05', True] | [52, '2020-01-05', False] | Failed |
| boundary control 4 | [27, '2026-01-01', True] | [27, '2026-01-01', True] | Passed |
| boundary control 5 | [27, '2020-01-02', True] | [27, '2020-01-02', True] | Passed |
| normal control 6 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 7 | [53, '2024-01-01', True] | [53, '2024-01-01', True] | Passed |
| normal control 8 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 9 | [27, '2020-01-01', True] | [27, '2020-01-01', True] | Passed |
SHA-256 / 3c9caf597094c7fa83b2fcc9c4dfff8f7575966b376dd73f802e0c602bf6be3c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(x):
anchor = datetime.date(*x['anchor'])
lo = datetime.date(x['year'], 1, 1)
hi = datetime.date(x['year'], 12, 31)
off = (lo - anchor).days
k = -(-off // x['step'])
first = anchor + datetime.timedelta(days=k * x['step'])
count = (hi - first).days // x['step'] + 1
periods = 26 if x['step'] == 14 else 52
return [count, first.isoformat(), count > periods]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression (boundary)', {'anchor': [2024, 1, 5], 'step': 14, 'year': 2024}, [26, '2024-01-05', False]), ('partial-repair probe', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2021, 6, 20], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2024, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-01', True]), ('normal control', {'anchor': [2021, 1, 17], 'step': 14, 'year': 2023}, [27, '2023-01-01', True]), ('normal control', {'anchor': [2019, 8, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True])], [('regression', {'anchor': [2021, 6, 11], 'step': 7, 'year': 2023}, [52, '2023-01-06', False]), ('regression', {'anchor': [2023, 8, 10], 'step': 14, 'year': 2024}, [26, '2024-01-11', False]), ('partial-repair probe', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2022, 8, 16], 'step': 7, 'year': 2024}, [53, '2024-01-02', True]), ('normal control', {'anchor': [2025, 3, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2020, 3, 26], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2024, 10, 27], 'step': 7, 'year': 2023}, [53, '2023-01-01', True])], [('regression', {'anchor': [2020, 3, 29], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('regression', {'anchor': [2024, 3, 10], 'step': 14, 'year': 2024}, [26, '2024-01-14', False]), ('partial-repair probe', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('partial-repair probe', {'anchor': [2018, 10, 22], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2018, 3, 28], 'step': 14, 'year': 2020}, [27, '2020-01-01', True]), ('normal control', {'anchor': [2023, 3, 28], 'step': 14, 'year': 2024}, [27, '2024-01-02', True]), ('normal control', {'anchor': [2021, 5, 2], 'step': 7, 'year': 2023}, [53, '2023-01-01', True]), ('normal control', {'anchor': [2025, 10, 14], 'step': 7, 'year': 2024}, [53, '2024-01-02', True])], [('regression', {'anchor': [2025, 8, 7], 'step': 7, 'year': 2025}, [52, '2025-01-02', False]), ('regression', {'anchor': [2020, 3, 23], 'step': 14, 'year': 2020}, [26, '2020-01-13', False]), ('partial-repair probe', {'anchor': [2027, 8, 13], 'step': 7, 'year': 2026}, [52, '2026-01-02', False]), ('partial-repair probe', {'anchor': [2022, 1, 14], 'step': 7, 'year': 2024}, [52, '2024-01-05', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2020, 7, 16], 'step': 7, 'year': 2020}, [53, '2020-01-02', True]), ('normal control', {'anchor': [2025, 9, 4], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2024, 6, 13], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2023, 2, 26], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])], [('regression', {'anchor': [2018, 9, 17], 'step': 7, 'year': 2020}, [52, '2020-01-06', False]), ('regression', {'anchor': [2019, 7, 21], 'step': 7, 'year': 2020}, [52, '2020-01-05', False]), ('partial-repair probe', {'anchor': [2024, 6, 12], 'step': 7, 'year': 2023}, [52, '2023-01-04', False]), ('partial-repair probe', {'anchor': [2026, 12, 25], 'step': 7, 'year': 2025}, [52, '2025-01-03', False]), ('boundary control', {'anchor': [2026, 1, 1], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('boundary control', {'anchor': [2020, 12, 31], 'step': 14, 'year': 2020}, [27, '2020-01-02', True]), ('normal control', {'anchor': [2025, 7, 10], 'step': 7, 'year': 2026}, [53, '2026-01-01', True]), ('normal control', {'anchor': [2026, 5, 21], 'step': 14, 'year': 2026}, [27, '2026-01-01', True]), ('normal control', {'anchor': [2024, 3, 20], 'step': 7, 'year': 2025}, [53, '2025-01-01', True]), ('normal control', {'anchor': [2023, 3, 12], 'step': 14, 'year': 2023}, [27, '2023-01-01', True])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), 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 0 | [52, '2020-01-05', False] | [52, '2020-01-05', False] | Passed |
| regression (boundary) 1 | [26, '2024-01-05', False] | [26, '2024-01-05', False] | Passed |
| partial-repair probe 2 | [52, '2023-01-06', False] | [52, '2023-01-06', False] | Passed |
| partial-repair probe 3 | [52, '2020-01-05', False] | [52, '2020-01-05', False] | Passed |
| boundary control 4 | [27, '2026-01-01', True] | [27, '2026-01-01', True] | Passed |
| boundary control 5 | [27, '2020-01-02', True] | [27, '2020-01-02', True] | Passed |
| normal control 6 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 7 | [53, '2024-01-01', True] | [53, '2024-01-01', True] | Passed |
| normal control 8 | [27, '2023-01-01', True] | [27, '2023-01-01', True] | Passed |
| normal control 9 | [27, '2020-01-01', True] | [27, '2020-01-01', True] | Passed |
SHA-256 / 9f5573e83e0b2996c9d346db67425518555d2dab09c5303cf6dc22f433a31159
Verification & scope
A deterministic teaching model of a stipulated payroll rule with toy thresholds and rates. It makes no claim of conformance to any tax authority, statute or jurisdiction and is not payroll software. 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:46:34.303345+00:00.
Case digest / 20b728c7324df00643109410de5c0f6ddb1a276f283aec2c0f0b196a5cefb7a1