{"abstract":"Early Monday morning runs the Monday wake setpoint instead of Sunday night's sleep setpoint.","category":"HVAC thermostat control","checks":8,"contract":"Programmable thermostat weekly schedule. schedule is an unordered list of [day 0=Monday..6, minute_of_day, setpoint]; queries are [day, minute]. The active setpoint is that of the latest event at or before the query time within the week; if none, the last event of the week carries over from the previous week. Return the active setpoint per query.","evaluation_group":"w2-hvac-thermostat-control-weekly-schedule-lookup","failed_approach":"Wrapping only on Monday still mishandles queries before the first event when the week starts later.","family":"w2-hvac-thermostat-control-weekly-schedule-lookup-week-wrap","id":"FA-92461","implementations":{"attempt":{"sha256":"3180d7b70be3a1557bf52d3cd08c8da928805c069458ce53314447d18b69a6bc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(schedule, queries):\n    events = sorted((d * 1440 + m, sp) for d, m, sp in schedule)\n    out = []\n    for d, m in queries:\n        t = d * 1440 + m\n        current = events[-1][1] if d == 0 else events[0][1]\n        for et, sp in events:\n            if et <= t:\n                current = sp\n            else:\n                break\n        out.append(current)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[3, 1140, 720], [5, 1170, 700], [5, 510, 600]],\n    [[3, 1242], [2, 953], [2, 1283], [4, 1029], [3, 1140], [5, 1170]]],\n   [720, 700, 700, 720, 720, 700]],\n  ['control: scenario 2',\n   [[[3, 1200, 650], [1, 690, 650]],\n    [[1, 1355], [2, 28], [0, 994], [6, 594], [4, 142], [3, 1098], [3, 630], [3, 1200], [1, 690]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650]],\n  ['regression: scenario 3',\n   [[[2, 480, 600], [6, 900, 720], [3, 750, 650]],\n    [[5, 771], [4, 147], [0, 469], [1, 1048], [0, 854], [0, 1005], [2, 379], [2, 480], [6, 900]]],\n   [650, 650, 720, 720, 720, 720, 720, 600, 720]],\n  ['control: scenario 4',\n   [[[5, 420, 720], [2, 420, 650], [4, 0, 680], [6, 750, 650], [4, 1170, 680], [4, 90, 680], [4, 150, 600]],\n    [[4, 703], [5, 1293], [2, 238], [6, 1060], [2, 806], [5, 420], [2, 420]]],\n   [600, 720, 650, 650, 650, 720, 650]]],\n [['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['regression: scenario 4',\n   [[[2, 810, 700], [3, 180, 700], [2, 1260, 600], [5, 960, 720], [3, 1230, 700]],\n    [[1, 1267], [2, 448], [6, 679], [6, 778], [1, 1017], [0, 371], [2, 810], [3, 180]]],\n   [720, 720, 720, 720, 720, 720, 700, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[2, 240, 600], [1, 810, 620], [4, 1320, 620], [5, 690, 680], [0, 960, 720], [5, 1230, 680]],\n    [[3, 1330], [0, 340], [5, 693], [6, 1037], [2, 240], [1, 810]]],\n   [600, 680, 680, 680, 600, 620]],\n  ['regression: scenario 2',\n   [[[0, 360, 600], [2, 210, 720], [2, 1200, 620], [5, 330, 680], [6, 1410, 680], [4, 0, 620], [1, 390, 720]],\n    [[1, 1030], [0, 695], [3, 1138], [3, 1242], [0, 264], [0, 360], [2, 210]]],\n   [720, 600, 620, 620, 680, 600, 720]],\n  ['control: scenario 3',\n   [[[2, 1290, 720], [1, 300, 600], [4, 900, 700], [4, 960, 650], [5, 870, 650]],\n    [[4, 157], [3, 57], [4, 1382], [5, 1288], [2, 1290], [1, 300]]],\n   [720, 720, 650, 650, 720, 600]]],\n [['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 18',\n   [[[5, 810, 620], [1, 1320, 620], [4, 1200, 650], [6, 1350, 600]],\n    [[0, 763], [5, 95], [1, 755], [3, 258], [5, 810], [1, 1320]]],\n   [600, 650, 600, 620, 620, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['control: scenario 1',\n   [[[2, 870, 650], [2, 1260, 700], [0, 1050, 600]],\n    [[6, 998], [2, 333], [4, 1015], [1, 556], [2, 389], [5, 846], [4, 1066], [3, 53], [2, 870], [2, 1260]]],\n   [700, 600, 700, 600, 600, 700, 700, 700, 650, 700]],\n  ['control: scenario 2',\n   [[[5, 60, 600], [0, 810, 680]], [[3, 524], [2, 1316], [2, 829], [1, 1320], [5, 60], [0, 810]]],\n   [680, 680, 680, 680, 600, 680]],\n  ['control: scenario 3',\n   [[[5, 390, 700], [1, 990, 600], [5, 1260, 720], [1, 720, 720], [0, 840, 650], [0, 330, 700], [2, 0, 600]],\n    [[3, 1359], [2, 341], [5, 1109], [1, 674], [5, 884], [6, 597], [6, 156], [6, 1198], [5, 390], [1, 990]]],\n   [600, 600, 700, 650, 700, 720, 720, 720, 700, 600]]],\n [['regression: scenario 3',\n   [[[3, 1260, 720], [2, 450, 680]],\n    [[3, 594], [1, 866], [2, 623], [6, 394], [4, 309], [4, 881], [3, 1260], [2, 450]]],\n   [680, 720, 680, 720, 720, 720, 720, 680]],\n  ['regression: scenario 10',\n   [[[4, 420, 650], [4, 270, 620]],\n    [[6, 742], [5, 839], [5, 598], [2, 332], [3, 217], [5, 1258], [5, 148], [4, 556], [4, 420], [4, 270]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['control: scenario 1',\n   [[[0, 1050, 720], [6, 0, 650]],\n    [[3, 1304], [4, 593], [3, 411], [0, 1396], [2, 508], [2, 1205], [1, 360], [5, 1314], [0, 1050], [6, 0]]],\n   [720, 720, 720, 720, 720, 720, 720, 720, 720, 650]],\n  ['control: scenario 2',\n   [[[0, 450, 600],\n     [2, 480, 600],\n     [0, 510, 720],\n     [4, 690, 700],\n     [1, 1020, 680],\n     [6, 330, 620],\n     [2, 120, 720]],\n    [[1, 971], [4, 1250], [6, 999], [5, 1034], [4, 1097], [1, 624], [1, 447], [0, 450], [2, 480]]],\n   [720, 700, 620, 700, 700, 720, 720, 600, 600]]],\n [['regression: scenario 2',\n   [[[3, 330, 700],\n     [1, 960, 700],\n     [2, 540, 650],\n     [3, 810, 600],\n     [5, 1080, 700],\n     [1, 300, 680],\n     [6, 1020, 650]],\n    [[6, 811], [3, 629], [0, 1103], [3, 1144], [4, 229], [3, 330], [1, 960]]],\n   [700, 700, 650, 600, 600, 700, 700]],\n  ['regression: scenario 15',\n   [[[5, 510, 650], [2, 1170, 700]], [[0, 1360], [2, 24], [0, 1230], [5, 46], [5, 510], [2, 1170]]],\n   [650, 650, 650, 700, 650, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[5, 1020, 600], [4, 900, 620], [5, 510, 680], [1, 1200, 680]],\n    [[4, 860], [4, 862], [4, 1233], [4, 668], [4, 180], [0, 208], [2, 1192], [5, 1020], [4, 900]]],\n   [680, 680, 620, 680, 680, 600, 680, 600, 620]],\n  ['regression: scenario 3',\n   [[[1, 30, 650],\n     [3, 0, 620],\n     [3, 300, 700],\n     [5, 1050, 720],\n     [3, 1410, 700],\n     [4, 1380, 680],\n     [4, 240, 700],\n     [4, 1350, 620]],\n    [[0, 1419], [0, 281], [0, 1177], [3, 645], [6, 230], [0, 799], [1, 30], [3, 0]]],\n   [720, 720, 720, 700, 720, 720, 650, 620]]]]\nfor label, args, expected in fixtures[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":"0540bdae51194b73aef1a02e6179970c16e49b7fb803e23c447e1d8cc7987d63","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(schedule, queries):\n    events = sorted((d * 1440 + m, sp) for d, m, sp in schedule)\n    out = []\n    for d, m in queries:\n        t = d * 1440 + m\n        current = events[0][1]\n        for et, sp in events:\n            if et <= t:\n                current = sp\n            else:\n                break\n        out.append(current)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[3, 1140, 720], [5, 1170, 700], [5, 510, 600]],\n    [[3, 1242], [2, 953], [2, 1283], [4, 1029], [3, 1140], [5, 1170]]],\n   [720, 700, 700, 720, 720, 700]],\n  ['control: scenario 2',\n   [[[3, 1200, 650], [1, 690, 650]],\n    [[1, 1355], [2, 28], [0, 994], [6, 594], [4, 142], [3, 1098], [3, 630], [3, 1200], [1, 690]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650]],\n  ['regression: scenario 3',\n   [[[2, 480, 600], [6, 900, 720], [3, 750, 650]],\n    [[5, 771], [4, 147], [0, 469], [1, 1048], [0, 854], [0, 1005], [2, 379], [2, 480], [6, 900]]],\n   [650, 650, 720, 720, 720, 720, 720, 600, 720]],\n  ['control: scenario 4',\n   [[[5, 420, 720], [2, 420, 650], [4, 0, 680], [6, 750, 650], [4, 1170, 680], [4, 90, 680], [4, 150, 600]],\n    [[4, 703], [5, 1293], [2, 238], [6, 1060], [2, 806], [5, 420], [2, 420]]],\n   [600, 720, 650, 650, 650, 720, 650]]],\n [['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['regression: scenario 4',\n   [[[2, 810, 700], [3, 180, 700], [2, 1260, 600], [5, 960, 720], [3, 1230, 700]],\n    [[1, 1267], [2, 448], [6, 679], [6, 778], [1, 1017], [0, 371], [2, 810], [3, 180]]],\n   [720, 720, 720, 720, 720, 720, 700, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[2, 240, 600], [1, 810, 620], [4, 1320, 620], [5, 690, 680], [0, 960, 720], [5, 1230, 680]],\n    [[3, 1330], [0, 340], [5, 693], [6, 1037], [2, 240], [1, 810]]],\n   [600, 680, 680, 680, 600, 620]],\n  ['regression: scenario 2',\n   [[[0, 360, 600], [2, 210, 720], [2, 1200, 620], [5, 330, 680], [6, 1410, 680], [4, 0, 620], [1, 390, 720]],\n    [[1, 1030], [0, 695], [3, 1138], [3, 1242], [0, 264], [0, 360], [2, 210]]],\n   [720, 600, 620, 620, 680, 600, 720]],\n  ['control: scenario 3',\n   [[[2, 1290, 720], [1, 300, 600], [4, 900, 700], [4, 960, 650], [5, 870, 650]],\n    [[4, 157], [3, 57], [4, 1382], [5, 1288], [2, 1290], [1, 300]]],\n   [720, 720, 650, 650, 720, 600]]],\n [['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 18',\n   [[[5, 810, 620], [1, 1320, 620], [4, 1200, 650], [6, 1350, 600]],\n    [[0, 763], [5, 95], [1, 755], [3, 258], [5, 810], [1, 1320]]],\n   [600, 650, 600, 620, 620, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['control: scenario 1',\n   [[[2, 870, 650], [2, 1260, 700], [0, 1050, 600]],\n    [[6, 998], [2, 333], [4, 1015], [1, 556], [2, 389], [5, 846], [4, 1066], [3, 53], [2, 870], [2, 1260]]],\n   [700, 600, 700, 600, 600, 700, 700, 700, 650, 700]],\n  ['control: scenario 2',\n   [[[5, 60, 600], [0, 810, 680]], [[3, 524], [2, 1316], [2, 829], [1, 1320], [5, 60], [0, 810]]],\n   [680, 680, 680, 680, 600, 680]],\n  ['control: scenario 3',\n   [[[5, 390, 700], [1, 990, 600], [5, 1260, 720], [1, 720, 720], [0, 840, 650], [0, 330, 700], [2, 0, 600]],\n    [[3, 1359], [2, 341], [5, 1109], [1, 674], [5, 884], [6, 597], [6, 156], [6, 1198], [5, 390], [1, 990]]],\n   [600, 600, 700, 650, 700, 720, 720, 720, 700, 600]]],\n [['regression: scenario 3',\n   [[[3, 1260, 720], [2, 450, 680]],\n    [[3, 594], [1, 866], [2, 623], [6, 394], [4, 309], [4, 881], [3, 1260], [2, 450]]],\n   [680, 720, 680, 720, 720, 720, 720, 680]],\n  ['regression: scenario 10',\n   [[[4, 420, 650], [4, 270, 620]],\n    [[6, 742], [5, 839], [5, 598], [2, 332], [3, 217], [5, 1258], [5, 148], [4, 556], [4, 420], [4, 270]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['control: scenario 1',\n   [[[0, 1050, 720], [6, 0, 650]],\n    [[3, 1304], [4, 593], [3, 411], [0, 1396], [2, 508], [2, 1205], [1, 360], [5, 1314], [0, 1050], [6, 0]]],\n   [720, 720, 720, 720, 720, 720, 720, 720, 720, 650]],\n  ['control: scenario 2',\n   [[[0, 450, 600],\n     [2, 480, 600],\n     [0, 510, 720],\n     [4, 690, 700],\n     [1, 1020, 680],\n     [6, 330, 620],\n     [2, 120, 720]],\n    [[1, 971], [4, 1250], [6, 999], [5, 1034], [4, 1097], [1, 624], [1, 447], [0, 450], [2, 480]]],\n   [720, 700, 620, 700, 700, 720, 720, 600, 600]]],\n [['regression: scenario 2',\n   [[[3, 330, 700],\n     [1, 960, 700],\n     [2, 540, 650],\n     [3, 810, 600],\n     [5, 1080, 700],\n     [1, 300, 680],\n     [6, 1020, 650]],\n    [[6, 811], [3, 629], [0, 1103], [3, 1144], [4, 229], [3, 330], [1, 960]]],\n   [700, 700, 650, 600, 600, 700, 700]],\n  ['regression: scenario 15',\n   [[[5, 510, 650], [2, 1170, 700]], [[0, 1360], [2, 24], [0, 1230], [5, 46], [5, 510], [2, 1170]]],\n   [650, 650, 650, 700, 650, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[5, 1020, 600], [4, 900, 620], [5, 510, 680], [1, 1200, 680]],\n    [[4, 860], [4, 862], [4, 1233], [4, 668], [4, 180], [0, 208], [2, 1192], [5, 1020], [4, 900]]],\n   [680, 680, 620, 680, 680, 600, 680, 600, 620]],\n  ['regression: scenario 3',\n   [[[1, 30, 650],\n     [3, 0, 620],\n     [3, 300, 700],\n     [5, 1050, 720],\n     [3, 1410, 700],\n     [4, 1380, 680],\n     [4, 240, 700],\n     [4, 1350, 620]],\n    [[0, 1419], [0, 281], [0, 1177], [3, 645], [6, 230], [0, 799], [1, 30], [3, 0]]],\n   [720, 720, 720, 700, 720, 720, 650, 620]]]]\nfor label, args, expected in fixtures[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":"cc1694750b8e211c1301dbed2a4b39578de0da3d988023149bdcd6ed067ff2cb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(schedule, queries):\n    events = sorted((d * 1440 + m, sp) for d, m, sp in schedule)\n    out = []\n    for d, m in queries:\n        t = d * 1440 + m\n        current = events[-1][1]\n        for et, sp in events:\n            if et <= t:\n                current = sp\n            else:\n                break\n        out.append(current)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[3, 1140, 720], [5, 1170, 700], [5, 510, 600]],\n    [[3, 1242], [2, 953], [2, 1283], [4, 1029], [3, 1140], [5, 1170]]],\n   [720, 700, 700, 720, 720, 700]],\n  ['control: scenario 2',\n   [[[3, 1200, 650], [1, 690, 650]],\n    [[1, 1355], [2, 28], [0, 994], [6, 594], [4, 142], [3, 1098], [3, 630], [3, 1200], [1, 690]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650]],\n  ['regression: scenario 3',\n   [[[2, 480, 600], [6, 900, 720], [3, 750, 650]],\n    [[5, 771], [4, 147], [0, 469], [1, 1048], [0, 854], [0, 1005], [2, 379], [2, 480], [6, 900]]],\n   [650, 650, 720, 720, 720, 720, 720, 600, 720]],\n  ['control: scenario 4',\n   [[[5, 420, 720], [2, 420, 650], [4, 0, 680], [6, 750, 650], [4, 1170, 680], [4, 90, 680], [4, 150, 600]],\n    [[4, 703], [5, 1293], [2, 238], [6, 1060], [2, 806], [5, 420], [2, 420]]],\n   [600, 720, 650, 650, 650, 720, 650]]],\n [['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['regression: scenario 4',\n   [[[2, 810, 700], [3, 180, 700], [2, 1260, 600], [5, 960, 720], [3, 1230, 700]],\n    [[1, 1267], [2, 448], [6, 679], [6, 778], [1, 1017], [0, 371], [2, 810], [3, 180]]],\n   [720, 720, 720, 720, 720, 720, 700, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[2, 240, 600], [1, 810, 620], [4, 1320, 620], [5, 690, 680], [0, 960, 720], [5, 1230, 680]],\n    [[3, 1330], [0, 340], [5, 693], [6, 1037], [2, 240], [1, 810]]],\n   [600, 680, 680, 680, 600, 620]],\n  ['regression: scenario 2',\n   [[[0, 360, 600], [2, 210, 720], [2, 1200, 620], [5, 330, 680], [6, 1410, 680], [4, 0, 620], [1, 390, 720]],\n    [[1, 1030], [0, 695], [3, 1138], [3, 1242], [0, 264], [0, 360], [2, 210]]],\n   [720, 600, 620, 620, 680, 600, 720]],\n  ['control: scenario 3',\n   [[[2, 1290, 720], [1, 300, 600], [4, 900, 700], [4, 960, 650], [5, 870, 650]],\n    [[4, 157], [3, 57], [4, 1382], [5, 1288], [2, 1290], [1, 300]]],\n   [720, 720, 650, 650, 720, 600]]],\n [['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 18',\n   [[[5, 810, 620], [1, 1320, 620], [4, 1200, 650], [6, 1350, 600]],\n    [[0, 763], [5, 95], [1, 755], [3, 258], [5, 810], [1, 1320]]],\n   [600, 650, 600, 620, 620, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['control: scenario 1',\n   [[[2, 870, 650], [2, 1260, 700], [0, 1050, 600]],\n    [[6, 998], [2, 333], [4, 1015], [1, 556], [2, 389], [5, 846], [4, 1066], [3, 53], [2, 870], [2, 1260]]],\n   [700, 600, 700, 600, 600, 700, 700, 700, 650, 700]],\n  ['control: scenario 2',\n   [[[5, 60, 600], [0, 810, 680]], [[3, 524], [2, 1316], [2, 829], [1, 1320], [5, 60], [0, 810]]],\n   [680, 680, 680, 680, 600, 680]],\n  ['control: scenario 3',\n   [[[5, 390, 700], [1, 990, 600], [5, 1260, 720], [1, 720, 720], [0, 840, 650], [0, 330, 700], [2, 0, 600]],\n    [[3, 1359], [2, 341], [5, 1109], [1, 674], [5, 884], [6, 597], [6, 156], [6, 1198], [5, 390], [1, 990]]],\n   [600, 600, 700, 650, 700, 720, 720, 720, 700, 600]]],\n [['regression: scenario 3',\n   [[[3, 1260, 720], [2, 450, 680]],\n    [[3, 594], [1, 866], [2, 623], [6, 394], [4, 309], [4, 881], [3, 1260], [2, 450]]],\n   [680, 720, 680, 720, 720, 720, 720, 680]],\n  ['regression: scenario 10',\n   [[[4, 420, 650], [4, 270, 620]],\n    [[6, 742], [5, 839], [5, 598], [2, 332], [3, 217], [5, 1258], [5, 148], [4, 556], [4, 420], [4, 270]]],\n   [650, 650, 650, 650, 650, 650, 650, 650, 650, 620]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['control: scenario 1',\n   [[[0, 1050, 720], [6, 0, 650]],\n    [[3, 1304], [4, 593], [3, 411], [0, 1396], [2, 508], [2, 1205], [1, 360], [5, 1314], [0, 1050], [6, 0]]],\n   [720, 720, 720, 720, 720, 720, 720, 720, 720, 650]],\n  ['control: scenario 2',\n   [[[0, 450, 600],\n     [2, 480, 600],\n     [0, 510, 720],\n     [4, 690, 700],\n     [1, 1020, 680],\n     [6, 330, 620],\n     [2, 120, 720]],\n    [[1, 971], [4, 1250], [6, 999], [5, 1034], [4, 1097], [1, 624], [1, 447], [0, 450], [2, 480]]],\n   [720, 700, 620, 700, 700, 720, 720, 600, 600]]],\n [['regression: scenario 2',\n   [[[3, 330, 700],\n     [1, 960, 700],\n     [2, 540, 650],\n     [3, 810, 600],\n     [5, 1080, 700],\n     [1, 300, 680],\n     [6, 1020, 650]],\n    [[6, 811], [3, 629], [0, 1103], [3, 1144], [4, 229], [3, 330], [1, 960]]],\n   [700, 700, 650, 600, 600, 700, 700]],\n  ['regression: scenario 15',\n   [[[5, 510, 650], [2, 1170, 700]], [[0, 1360], [2, 24], [0, 1230], [5, 46], [5, 510], [2, 1170]]],\n   [650, 650, 650, 700, 650, 700]],\n  ['regression: week wrap and exact times',\n   [[[0, 360, 700], [0, 1320, 620], [4, 360, 700], [4, 1380, 640]],\n    [[0, 0], [0, 360], [1, 100], [4, 1379], [4, 1380], [6, 1439]]],\n   [640, 700, 620, 700, 640, 640]],\n  ['regression: unsorted entries',\n   [[[2, 1200, 640], [2, 420, 700], [5, 480, 680]], [[2, 600], [3, 0], [1, 1439], [5, 480]]],\n   [700, 640, 680, 680]],\n  ['control: late evening event',\n   [[[1, 1300, 600], [2, 200, 690]], [[1, 1350], [2, 100], [2, 300]]],\n   [600, 600, 690]],\n  ['regression: tuesday first event',\n   [[[1, 360, 700], [1, 1320, 620], [3, 600, 680]], [[1, 100], [2, 100], [0, 500]]],\n   [680, 620, 680]],\n  ['regression: scenario 1',\n   [[[5, 1020, 600], [4, 900, 620], [5, 510, 680], [1, 1200, 680]],\n    [[4, 860], [4, 862], [4, 1233], [4, 668], [4, 180], [0, 208], [2, 1192], [5, 1020], [4, 900]]],\n   [680, 680, 620, 680, 680, 600, 680, 600, 620]],\n  ['regression: scenario 3',\n   [[[1, 30, 650],\n     [3, 0, 620],\n     [3, 300, 700],\n     [5, 1050, 720],\n     [3, 1410, 700],\n     [4, 1380, 680],\n     [4, 240, 700],\n     [4, 1350, 620]],\n    [[0, 1419], [0, 281], [0, 1177], [3, 645], [6, 230], [0, 799], [1, 30], [3, 0]]],\n   [720, 720, 720, 700, 720, 720, 650, 620]]]]\nfor label, args, expected in fixtures[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 of one thermostat or HVAC controller decision evaluated per sample. Temperatures are integer tenths of a degree Fahrenheit unless stated otherwise. The contract is a stipulated toy convention, not a claim of conformance to any manufacturer, ASHRAE guideline or code. 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-hvac-thermostat-control-weekly-schedule-lookup-week-wrap","generated_at":"2026-09-29T14:51:45.863359+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Residential and light-commercial thermostats make these decisions sample by sample; each defect changes equipment calls in a way that shows up as short cycling, comfort complaints or equipment stress.","repair":"Before the first event of the week, carry over the last event.","root_cause":"The carried-over setpoint defaults to the first event instead of the last event of the week.","sha256":"f5886d343c1d43dcab6d753a30e86816ec8745ead38348b2ab45797da13cc8df","title":"Schedule lookup before the first event of the week uses the first event · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.052,"exit_code":1,"observations":[{"actual":[640,700,620,700,640,640],"check":"regression: week wrap and exact times","expected":[640,700,620,700,640,640],"passed":true},{"actual":[700,640,700,680],"check":"regression: unsorted entries","expected":[700,640,680,680],"passed":false},{"actual":[600,600,690],"check":"control: late evening event","expected":[600,600,690],"passed":true},{"actual":[700,620,680],"check":"regression: tuesday first event","expected":[680,620,680],"passed":false},{"actual":[720,720,720,720,720,700],"check":"regression: scenario 1","expected":[720,700,700,720,720,700],"passed":false},{"actual":[650,650,650,650,650,650,650,650,650],"check":"control: scenario 2","expected":[650,650,650,650,650,650,650,650,650],"passed":true},{"actual":[650,650,720,600,720,720,600,600,720],"check":"regression: scenario 3","expected":[650,650,720,720,720,720,720,600,720],"passed":false},{"actual":[600,720,650,650,650,720,650],"check":"control: scenario 4","expected":[600,720,650,650,650,720,650],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: week wrap and exact times\", \"actual\": [640, 700, 620, 700, 640, 640], \"expected\": [640, 700, 620, 700, 640, 640], \"passed\": true}, {\"check\": \"regression: unsorted entries\", \"actual\": [700, 640, 700, 680], \"expected\": [700, 640, 680, 680], \"passed\": false}, {\"check\": \"control: late evening event\", \"actual\": [600, 600, 690], \"expected\": [600, 600, 690], \"passed\": true}, {\"check\": \"regression: tuesday first event\", \"actual\": [700, 620, 680], \"expected\": [680, 620, 680], \"passed\": false}, {\"check\": \"regression: scenario 1\", \"actual\": [720, 720, 720, 720, 720, 700], \"expected\": [720, 700, 700, 720, 720, 700], \"passed\": false}, {\"check\": \"control: scenario 2\", \"actual\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"expected\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"passed\": true}, {\"check\": \"regression: scenario 3\", \"actual\": [650, 650, 720, 600, 720, 720, 600, 600, 720], \"expected\": [650, 650, 720, 720, 720, 720, 720, 600, 720], \"passed\": false}, {\"check\": \"control: scenario 4\", \"actual\": [600, 720, 650, 650, 650, 720, 650], \"expected\": [600, 720, 650, 650, 650, 720, 650], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.348,"exit_code":1,"observations":[{"actual":[700,700,620,700,640,640],"check":"regression: week wrap and exact times","expected":[640,700,620,700,640,640],"passed":false},{"actual":[700,640,700,680],"check":"regression: unsorted entries","expected":[700,640,680,680],"passed":false},{"actual":[600,600,690],"check":"control: late evening event","expected":[600,600,690],"passed":true},{"actual":[700,620,700],"check":"regression: tuesday first event","expected":[680,620,680],"passed":false},{"actual":[720,720,720,720,720,700],"check":"regression: scenario 1","expected":[720,700,700,720,720,700],"passed":false},{"actual":[650,650,650,650,650,650,650,650,650],"check":"control: scenario 2","expected":[650,650,650,650,650,650,650,650,650],"passed":true},{"actual":[650,650,600,600,600,600,600,600,720],"check":"regression: scenario 3","expected":[650,650,720,720,720,720,720,600,720],"passed":false},{"actual":[600,720,650,650,650,720,650],"check":"control: scenario 4","expected":[600,720,650,650,650,720,650],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: week wrap and exact times\", \"actual\": [700, 700, 620, 700, 640, 640], \"expected\": [640, 700, 620, 700, 640, 640], \"passed\": false}, {\"check\": \"regression: unsorted entries\", \"actual\": [700, 640, 700, 680], \"expected\": [700, 640, 680, 680], \"passed\": false}, {\"check\": \"control: late evening event\", \"actual\": [600, 600, 690], \"expected\": [600, 600, 690], \"passed\": true}, {\"check\": \"regression: tuesday first event\", \"actual\": [700, 620, 700], \"expected\": [680, 620, 680], \"passed\": false}, {\"check\": \"regression: scenario 1\", \"actual\": [720, 720, 720, 720, 720, 700], \"expected\": [720, 700, 700, 720, 720, 700], \"passed\": false}, {\"check\": \"control: scenario 2\", \"actual\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"expected\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"passed\": true}, {\"check\": \"regression: scenario 3\", \"actual\": [650, 650, 600, 600, 600, 600, 600, 600, 720], \"expected\": [650, 650, 720, 720, 720, 720, 720, 600, 720], \"passed\": false}, {\"check\": \"control: scenario 4\", \"actual\": [600, 720, 650, 650, 650, 720, 650], \"expected\": [600, 720, 650, 650, 650, 720, 650], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.051,"exit_code":0,"observations":[{"actual":[640,700,620,700,640,640],"check":"regression: week wrap and exact times","expected":[640,700,620,700,640,640],"passed":true},{"actual":[700,640,680,680],"check":"regression: unsorted entries","expected":[700,640,680,680],"passed":true},{"actual":[600,600,690],"check":"control: late evening event","expected":[600,600,690],"passed":true},{"actual":[680,620,680],"check":"regression: tuesday first event","expected":[680,620,680],"passed":true},{"actual":[720,700,700,720,720,700],"check":"regression: scenario 1","expected":[720,700,700,720,720,700],"passed":true},{"actual":[650,650,650,650,650,650,650,650,650],"check":"control: scenario 2","expected":[650,650,650,650,650,650,650,650,650],"passed":true},{"actual":[650,650,720,720,720,720,720,600,720],"check":"regression: scenario 3","expected":[650,650,720,720,720,720,720,600,720],"passed":true},{"actual":[600,720,650,650,650,720,650],"check":"control: scenario 4","expected":[600,720,650,650,650,720,650],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: week wrap and exact times\", \"actual\": [640, 700, 620, 700, 640, 640], \"expected\": [640, 700, 620, 700, 640, 640], \"passed\": true}, {\"check\": \"regression: unsorted entries\", \"actual\": [700, 640, 680, 680], \"expected\": [700, 640, 680, 680], \"passed\": true}, {\"check\": \"control: late evening event\", \"actual\": [600, 600, 690], \"expected\": [600, 600, 690], \"passed\": true}, {\"check\": \"regression: tuesday first event\", \"actual\": [680, 620, 680], \"expected\": [680, 620, 680], \"passed\": true}, {\"check\": \"regression: scenario 1\", \"actual\": [720, 700, 700, 720, 720, 700], \"expected\": [720, 700, 700, 720, 720, 700], \"passed\": true}, {\"check\": \"control: scenario 2\", \"actual\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"expected\": [650, 650, 650, 650, 650, 650, 650, 650, 650], \"passed\": true}, {\"check\": \"regression: scenario 3\", \"actual\": [650, 650, 720, 720, 720, 720, 720, 600, 720], \"expected\": [650, 650, 720, 720, 720, 720, 720, 600, 720], \"passed\": true}, {\"check\": \"control: scenario 4\", \"actual\": [600, 720, 650, 650, 650, 720, 650], \"expected\": [600, 720, 650, 650, 650, 720, 650], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}