FA-93886 / Shift rostering labor rules / Open access
Seventh-day double time starts at the ordinary 12-hour mark · case 01
Minutes 8 to 12 on the seventh consecutive day vanish from pay entirely.
ROOT CAUSE
The seventh-day double-time band reuses the 720-minute daily threshold instead of 480.
VERIFIED REPAIR
On the seventh consecutive day, all minutes beyond 480 are double time.
Unsuccessful approach: A 600-minute threshold still loses minutes 480 to 600 on the seventh day.
Case contract
Seven daily worked minutes (Mon..Sun) and an hourly rate in cents. Daily: first 480 minutes regular, next 240 at 1.5x, beyond 720 at 2x. If all seven days are worked, day 7 pays its first 480 minutes at 1.5x and the rest at 2x. Regular minutes above 2400 in the week move to 1.5x (daily overtime minutes never count toward the weekly threshold). Pay is computed exactly and rounded half up to a cent once. Return [regular, ot15, ot2, pay_cents].
Why this case matters
Overtime classification mistakes are a classic payroll-roster defect: pyramiding, seventh-day rules and rounding stage all change what workers are paid.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(days, rate):
reg = ot15 = ot2 = 0
seventh = all(m > 0 for m in days)
for d, m in enumerate(days):
if d == 6 and seventh:
ot15 += min(m, 480)
ot2 += max(m - 720, 0)
continue
reg += min(m, 480)
ot15 += min(max(m - 480, 0), 240)
ot2 += max(m - 720, 0)
excess = max(reg - 2400, 0)
reg -= excess
ot15 += excess
units = reg * rate * 2 + ot15 * rate * 3 + ot2 * rate * 4
pay = (units + 60) // 120
return [reg, ot15, ot2, pay]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: seventh day double threshold 1', [[300, 600, 510, 600, 510, 600, 600], 1810],
[2400, 1200, 120, 133940]),
('regression variant: seventh day double threshold 2', [[480, 480, 480, 300, 510, 300, 600], 1810],
[2400, 630, 120, 108148]),
('partial repair guard 3', [[480, 510, 300, 300, 600, 510, 600], 90], [2400, 780, 120, 5715]),
('boundary control 4', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('boundary control 5', [[9, 0, 0, 0, 0, 0, 0], 30], [9, 0, 0, 5]),
('normal control 6', [[300, 600, 300, 600, 510, 600, 480], 90], [2400, 990, 0, 5828]),
('normal control 7', [[480, 0, 900, 480, 240, 450, 0], 90], [2130, 240, 180, 4275]),
('normal control 8', [[510, 300, 480, 480, 480, 510, 480], 1810], [2400, 840, 0, 110410])],
[('regression: seventh day double threshold 1', [[300, 600, 480, 600, 480, 510, 510], 90],
[2400, 1050, 30, 6053]),
('regression variant: seventh day double threshold 2', [[510, 510, 480, 510, 600, 510, 510], 1500],
[2400, 1200, 30, 106500]),
('partial repair guard 3', [[300, 510, 300, 510, 300, 480, 600], 2250], [2340, 540, 120, 127125]),
('boundary control 4', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('boundary control 5', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('normal control 6', [[480, 600, 510, 510, 600, 600, 300], 90], [2400, 1200, 0, 6300]),
('normal control 7', [[510, 510, 510, 510, 510, 510, 600], 2250], [2400, 1140, 120, 163125]),
('normal control 8', [[300, 600, 300, 300, 510, 600, 600], 30], [2340, 750, 120, 1853])],
[('regression: seventh day double threshold 1', [[540, 450, 450, 900, 720, 240, 540], 2250],
[2400, 1200, 240, 175500]),
('regression variant: seventh day double threshold 2', [[480, 600, 600, 720, 480, 780, 540], 2000],
[2400, 1680, 120, 172000]),
('partial repair guard 3', [[510, 600, 480, 480, 510, 600, 510], 1500], [2400, 1260, 30, 108750]),
('boundary control 4', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('boundary control 5', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('normal control 6', [[600, 510, 510, 480, 510, 480, 480], 2000], [2400, 1170, 0, 138500]),
('normal control 7', [[480, 300, 480, 510, 600, 300, 600], 90], [2400, 750, 120, 5648]),
('normal control 8', [[721, 240, 600, 540, 240, 240, 721], 1500], [2160, 900, 242, 99850])],
[('regression: seventh day double threshold 1', [[480, 600, 300, 300, 510, 510, 510], 90],
[2400, 780, 30, 5445]),
('regression variant: seventh day double threshold 2', [[600, 480, 300, 300, 600, 300, 600], 2250],
[2340, 720, 120, 137250]),
('partial repair guard 3', [[510, 510, 510, 480, 480, 510, 600], 2000], [2400, 1080, 120, 142000]),
('boundary control 4', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('boundary control 5', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('normal control 6', [[510, 510, 510, 300, 510, 600, 480], 2250], [2400, 1020, 0, 147375]),
('normal control 7', [[450, 240, 600, 540, 721, 0, 780], 1725], [2400, 870, 61, 110026]),
('normal control 8', [[480, 480, 600, 480, 510, 300, 600], 1810], [2400, 930, 120, 121723])],
[('regression: seventh day double threshold 1', [[600, 600, 600, 480, 600, 600, 600], 1810],
[2400, 1560, 120, 150230]),
('regression variant: seventh day double threshold 2', [[480, 720, 481, 450, 900, 900, 481], 2250],
[2400, 1651, 361, 209944]),
('partial repair guard 3', [[510, 510, 300, 300, 600, 600, 600], 2250], [2400, 900, 120, 149625]),
('boundary control 4', [[540, 540, 540, 540, 540, 540, 60], 2000], [2400, 900, 0, 125000]),
('boundary control 5', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('normal control 6', [[481, 433, 0, 0, 450, 780, 780], 2000], [2323, 481, 120, 109483]),
('normal control 7', [[481, 0, 0, 481, 900, 780, 240], 1810], [2160, 482, 240, 101451]),
('normal control 8', [[535, 540, 122, 780, 900, 900, 540], 1500], [2400, 1437, 480, 137888])]]
for label, args, expected in fixtures[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: seventh day double threshold 1 | [2400, 1200, 0, 126700] | [2400, 1200, 120, 133940] | Failed |
| regression variant: seventh day double threshold 2 | [2400, 630, 0, 100908] | [2400, 630, 120, 108148] | Failed |
| partial repair guard 3 | [2400, 780, 0, 5355] | [2400, 780, 120, 5715] | Failed |
| boundary control 4 | [2400, 480, 0, 104000] | [2400, 480, 0, 104000] | Passed |
| boundary control 5 | [9, 0, 0, 5] | [9, 0, 0, 5] | Passed |
| normal control 6 | [2400, 990, 0, 5828] | [2400, 990, 0, 5828] | Passed |
| normal control 7 | [2130, 240, 180, 4275] | [2130, 240, 180, 4275] | Passed |
| normal control 8 | [2400, 840, 0, 110410] | [2400, 840, 0, 110410] | Passed |
SHA-256 / d095de1cd8acf97eea81a39d2eb9fa86fb59d716080eb60c4c9d03e758de8f3a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(days, rate):
reg = ot15 = ot2 = 0
seventh = all(m > 0 for m in days)
for d, m in enumerate(days):
if d == 6 and seventh:
ot15 += min(m, 480)
ot2 += max(m - 600, 0)
continue
reg += min(m, 480)
ot15 += min(max(m - 480, 0), 240)
ot2 += max(m - 720, 0)
excess = max(reg - 2400, 0)
reg -= excess
ot15 += excess
units = reg * rate * 2 + ot15 * rate * 3 + ot2 * rate * 4
pay = (units + 60) // 120
return [reg, ot15, ot2, pay]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: seventh day double threshold 1', [[300, 600, 510, 600, 510, 600, 600], 1810],
[2400, 1200, 120, 133940]),
('regression variant: seventh day double threshold 2', [[480, 480, 480, 300, 510, 300, 600], 1810],
[2400, 630, 120, 108148]),
('partial repair guard 3', [[480, 510, 300, 300, 600, 510, 600], 90], [2400, 780, 120, 5715]),
('boundary control 4', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('boundary control 5', [[9, 0, 0, 0, 0, 0, 0], 30], [9, 0, 0, 5]),
('normal control 6', [[300, 600, 300, 600, 510, 600, 480], 90], [2400, 990, 0, 5828]),
('normal control 7', [[480, 0, 900, 480, 240, 450, 0], 90], [2130, 240, 180, 4275]),
('normal control 8', [[510, 300, 480, 480, 480, 510, 480], 1810], [2400, 840, 0, 110410])],
[('regression: seventh day double threshold 1', [[300, 600, 480, 600, 480, 510, 510], 90],
[2400, 1050, 30, 6053]),
('regression variant: seventh day double threshold 2', [[510, 510, 480, 510, 600, 510, 510], 1500],
[2400, 1200, 30, 106500]),
('partial repair guard 3', [[300, 510, 300, 510, 300, 480, 600], 2250], [2340, 540, 120, 127125]),
('boundary control 4', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('boundary control 5', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('normal control 6', [[480, 600, 510, 510, 600, 600, 300], 90], [2400, 1200, 0, 6300]),
('normal control 7', [[510, 510, 510, 510, 510, 510, 600], 2250], [2400, 1140, 120, 163125]),
('normal control 8', [[300, 600, 300, 300, 510, 600, 600], 30], [2340, 750, 120, 1853])],
[('regression: seventh day double threshold 1', [[540, 450, 450, 900, 720, 240, 540], 2250],
[2400, 1200, 240, 175500]),
('regression variant: seventh day double threshold 2', [[480, 600, 600, 720, 480, 780, 540], 2000],
[2400, 1680, 120, 172000]),
('partial repair guard 3', [[510, 600, 480, 480, 510, 600, 510], 1500], [2400, 1260, 30, 108750]),
('boundary control 4', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('boundary control 5', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('normal control 6', [[600, 510, 510, 480, 510, 480, 480], 2000], [2400, 1170, 0, 138500]),
('normal control 7', [[480, 300, 480, 510, 600, 300, 600], 90], [2400, 750, 120, 5648]),
('normal control 8', [[721, 240, 600, 540, 240, 240, 721], 1500], [2160, 900, 242, 99850])],
[('regression: seventh day double threshold 1', [[480, 600, 300, 300, 510, 510, 510], 90],
[2400, 780, 30, 5445]),
('regression variant: seventh day double threshold 2', [[600, 480, 300, 300, 600, 300, 600], 2250],
[2340, 720, 120, 137250]),
('partial repair guard 3', [[510, 510, 510, 480, 480, 510, 600], 2000], [2400, 1080, 120, 142000]),
('boundary control 4', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('boundary control 5', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('normal control 6', [[510, 510, 510, 300, 510, 600, 480], 2250], [2400, 1020, 0, 147375]),
('normal control 7', [[450, 240, 600, 540, 721, 0, 780], 1725], [2400, 870, 61, 110026]),
('normal control 8', [[480, 480, 600, 480, 510, 300, 600], 1810], [2400, 930, 120, 121723])],
[('regression: seventh day double threshold 1', [[600, 600, 600, 480, 600, 600, 600], 1810],
[2400, 1560, 120, 150230]),
('regression variant: seventh day double threshold 2', [[480, 720, 481, 450, 900, 900, 481], 2250],
[2400, 1651, 361, 209944]),
('partial repair guard 3', [[510, 510, 300, 300, 600, 600, 600], 2250], [2400, 900, 120, 149625]),
('boundary control 4', [[540, 540, 540, 540, 540, 540, 60], 2000], [2400, 900, 0, 125000]),
('boundary control 5', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('normal control 6', [[481, 433, 0, 0, 450, 780, 780], 2000], [2323, 481, 120, 109483]),
('normal control 7', [[481, 0, 0, 481, 900, 780, 240], 1810], [2160, 482, 240, 101451]),
('normal control 8', [[535, 540, 122, 780, 900, 900, 540], 1500], [2400, 1437, 480, 137888])]]
for label, args, expected in fixtures[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: seventh day double threshold 1 | [2400, 1200, 0, 126700] | [2400, 1200, 120, 133940] | Failed |
| regression variant: seventh day double threshold 2 | [2400, 630, 0, 100908] | [2400, 630, 120, 108148] | Failed |
| partial repair guard 3 | [2400, 780, 0, 5355] | [2400, 780, 120, 5715] | Failed |
| boundary control 4 | [2400, 480, 0, 104000] | [2400, 480, 0, 104000] | Passed |
| boundary control 5 | [9, 0, 0, 5] | [9, 0, 0, 5] | Passed |
| normal control 6 | [2400, 990, 0, 5828] | [2400, 990, 0, 5828] | Passed |
| normal control 7 | [2130, 240, 180, 4275] | [2130, 240, 180, 4275] | Passed |
| normal control 8 | [2400, 840, 0, 110410] | [2400, 840, 0, 110410] | Passed |
SHA-256 / d99c63b7108d34511f7d9c0fbb14cde776847e7953b21ffa73a8d32898456537
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(days, rate):
reg = ot15 = ot2 = 0
seventh = all(m > 0 for m in days)
for d, m in enumerate(days):
if d == 6 and seventh:
ot15 += min(m, 480)
ot2 += max(m - 480, 0)
continue
reg += min(m, 480)
ot15 += min(max(m - 480, 0), 240)
ot2 += max(m - 720, 0)
excess = max(reg - 2400, 0)
reg -= excess
ot15 += excess
units = reg * rate * 2 + ot15 * rate * 3 + ot2 * rate * 4
pay = (units + 60) // 120
return [reg, ot15, ot2, pay]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: seventh day double threshold 1', [[300, 600, 510, 600, 510, 600, 600], 1810],
[2400, 1200, 120, 133940]),
('regression variant: seventh day double threshold 2', [[480, 480, 480, 300, 510, 300, 600], 1810],
[2400, 630, 120, 108148]),
('partial repair guard 3', [[480, 510, 300, 300, 600, 510, 600], 90], [2400, 780, 120, 5715]),
('boundary control 4', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('boundary control 5', [[9, 0, 0, 0, 0, 0, 0], 30], [9, 0, 0, 5]),
('normal control 6', [[300, 600, 300, 600, 510, 600, 480], 90], [2400, 990, 0, 5828]),
('normal control 7', [[480, 0, 900, 480, 240, 450, 0], 90], [2130, 240, 180, 4275]),
('normal control 8', [[510, 300, 480, 480, 480, 510, 480], 1810], [2400, 840, 0, 110410])],
[('regression: seventh day double threshold 1', [[300, 600, 480, 600, 480, 510, 510], 90],
[2400, 1050, 30, 6053]),
('regression variant: seventh day double threshold 2', [[510, 510, 480, 510, 600, 510, 510], 1500],
[2400, 1200, 30, 106500]),
('partial repair guard 3', [[300, 510, 300, 510, 300, 480, 600], 2250], [2340, 540, 120, 127125]),
('boundary control 4', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('boundary control 5', [[480, 480, 480, 480, 480, 480, 0], 2000], [2400, 480, 0, 104000]),
('normal control 6', [[480, 600, 510, 510, 600, 600, 300], 90], [2400, 1200, 0, 6300]),
('normal control 7', [[510, 510, 510, 510, 510, 510, 600], 2250], [2400, 1140, 120, 163125]),
('normal control 8', [[300, 600, 300, 300, 510, 600, 600], 30], [2340, 750, 120, 1853])],
[('regression: seventh day double threshold 1', [[540, 450, 450, 900, 720, 240, 540], 2250],
[2400, 1200, 240, 175500]),
('regression variant: seventh day double threshold 2', [[480, 600, 600, 720, 480, 780, 540], 2000],
[2400, 1680, 120, 172000]),
('partial repair guard 3', [[510, 600, 480, 480, 510, 600, 510], 1500], [2400, 1260, 30, 108750]),
('boundary control 4', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('boundary control 5', [[0, 480, 480, 480, 480, 480, 480], 1500], [2400, 480, 0, 78000]),
('normal control 6', [[600, 510, 510, 480, 510, 480, 480], 2000], [2400, 1170, 0, 138500]),
('normal control 7', [[480, 300, 480, 510, 600, 300, 600], 90], [2400, 750, 120, 5648]),
('normal control 8', [[721, 240, 600, 540, 240, 240, 721], 1500], [2160, 900, 242, 99850])],
[('regression: seventh day double threshold 1', [[480, 600, 300, 300, 510, 510, 510], 90],
[2400, 780, 30, 5445]),
('regression variant: seventh day double threshold 2', [[600, 480, 300, 300, 600, 300, 600], 2250],
[2340, 720, 120, 137250]),
('partial repair guard 3', [[510, 510, 510, 480, 480, 510, 600], 2000], [2400, 1080, 120, 142000]),
('boundary control 4', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('boundary control 5', [[27, 0, 0, 0, 0, 0, 0], 30], [27, 0, 0, 14]),
('normal control 6', [[510, 510, 510, 300, 510, 600, 480], 2250], [2400, 1020, 0, 147375]),
('normal control 7', [[450, 240, 600, 540, 721, 0, 780], 1725], [2400, 870, 61, 110026]),
('normal control 8', [[480, 480, 600, 480, 510, 300, 600], 1810], [2400, 930, 120, 121723])],
[('regression: seventh day double threshold 1', [[600, 600, 600, 480, 600, 600, 600], 1810],
[2400, 1560, 120, 150230]),
('regression variant: seventh day double threshold 2', [[480, 720, 481, 450, 900, 900, 481], 2250],
[2400, 1651, 361, 209944]),
('partial repair guard 3', [[510, 510, 300, 300, 600, 600, 600], 2250], [2400, 900, 120, 149625]),
('boundary control 4', [[540, 540, 540, 540, 540, 540, 60], 2000], [2400, 900, 0, 125000]),
('boundary control 5', [[600, 600, 600, 600, 600, 0, 0], 1500], [2400, 600, 0, 82500]),
('normal control 6', [[481, 433, 0, 0, 450, 780, 780], 2000], [2323, 481, 120, 109483]),
('normal control 7', [[481, 0, 0, 481, 900, 780, 240], 1810], [2160, 482, 240, 101451]),
('normal control 8', [[535, 540, 122, 780, 900, 900, 540], 1500], [2400, 1437, 480, 137888])]]
for label, args, expected in fixtures[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: seventh day double threshold 1 | [2400, 1200, 120, 133940] | [2400, 1200, 120, 133940] | Passed |
| regression variant: seventh day double threshold 2 | [2400, 630, 120, 108148] | [2400, 630, 120, 108148] | Passed |
| partial repair guard 3 | [2400, 780, 120, 5715] | [2400, 780, 120, 5715] | Passed |
| boundary control 4 | [2400, 480, 0, 104000] | [2400, 480, 0, 104000] | Passed |
| boundary control 5 | [9, 0, 0, 5] | [9, 0, 0, 5] | Passed |
| normal control 6 | [2400, 990, 0, 5828] | [2400, 990, 0, 5828] | Passed |
| normal control 7 | [2130, 240, 180, 4275] | [2130, 240, 180, 4275] | Passed |
| normal control 8 | [2400, 840, 0, 110410] | [2400, 840, 0, 110410] | Passed |
SHA-256 / 544740b9b88b67ebf089466bb0c2fb3fad5ac7d2f325cb083c164e9199a3611b
Verification & scope
Stipulated toy labor rule for a bounded roster model; it is not legal advice and does not claim conformance with any jurisdiction, award, or collective agreement. 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:51:59.345290+00:00.
Case digest / 9fb1df1adb9fa0cb4276a4ce37bf702eb8ec9078a6484d25504e9504bc5ba877