{"abstract":"Slots priced exactly at the threshold are not treated as cheap.","category":"EV charging session scheduling","checks":7,"contract":"Slots with price <= threshold form runs of consecutive slots; runs shorter than min_len are ignored to avoid contactor cycling. Slots of qualifying runs are taken chronologically until need_slots are chosen. If still short, the remaining cheapest unchosen slots (ties: earlier) are added regardless of runs and fallback is True. Return [sorted slots, fallback].","contract_signature":"prices, threshold, min_len, need_slots","evaluation_group":"w2-ev_charging_session_scheduling-contiguous-cheap-blocks","failed_approach":"Excluding zero and negative prices discards the cheapest slots of all.","family":"w2-ev_charging_session_scheduling-contiguous-cheap-blocks-threshold-inclusivity","id":"FA-93226","implementations":{"attempt":{"sha256":"601dafde394a61864a12a0ad035d434c530bf6de424ead1fcdecfcb208c3b274","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(prices, threshold, min_len, need_slots):\n    runs = []\n    cur = []\n    for i, p in enumerate(prices):\n        if p <= threshold and p > 0:\n            cur.append(i)\n        else:\n            if cur:\n                runs.append(cur)\n            cur = []\n    if cur:\n        runs.append(cur)\n    chosen = []\n    for run in runs:\n        if len(run) >= min_len:\n            for i in run:\n                if len(chosen) < need_slots:\n                    chosen.append(i)\n    fallback = False\n    if len(chosen) < need_slots:\n        fallback = True\n        rest = sorted((p, i) for i, p in enumerate(prices) if i not in chosen)\n        for p, i in rest[:need_slots - len(chosen)]:\n            chosen.append(i)\n    return [sorted(chosen), fallback]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[20, 12, 10, 20, 0, 20, 15, 5, -2, 10, 30, 12, 0, 30, 12], 10, 3, 4], [[4, 7, 8, 9], True]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[0, 30, 5, 0, 20, 12, 0, 5, -2, 5, -2, 30, 30, 20, 8, 5], 12, 1, 4], [[0, 2, 3, 5], False]],\n  ['control 1', [[5, 20, 15, 10, -2], 10, 3, 5], [[0, 1, 2, 3, 4], True]],\n  ['control 2', [[30, 30, 0, -2, 20, 8, 5, 20, 0, 20], 0, 4, 1], [[3], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[-2, 10, 5, 8, 8, 0, 20, 12, 8, 12, -2, 15, -2, 8, 0, 0], 10, 4, 3], [[0, 1, 2], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[20, 5, 15, 12, 15, 30, 5, 20, 0, 20, 10, 0, 5, -2, 10], 12, 4, 6],\n   [[8, 10, 11, 12, 13, 14], True]],\n  ['control 1', [[30, -2, 5, 12, 8, 20, 20, 20], 12, 1, 7], [[1, 2, 3, 4, 5, 6, 7], True]],\n  ['control 2', [[30, 8, 15, 0, 15], 8, 2, 2], [[1, 3], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity', [[5, 15, 8, 12, 15, 20, 10, 15, 30, 15], 10, 1, 3],\n   [[0, 2, 6], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[5, 0, -2, 5, 30, 0, 30, -2, 8, 10, 5, 8, 20, 5], 8, 2, 4], [[0, 1, 2, 3], False]],\n  ['control 1', [[20, -2, 10, 8, 15, 10, 0, 8, 12, 5, 8, 0, 8], 0, 1, 1], [[1], False]],\n  ['control 2', [[-2, 8, 8, 12, -2, -2, -2, 10, 12, 15], 0, 2, 7], [[0, 1, 2, 4, 5, 6, 7], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[10, 8, 8, 8, 15, 12, 30, -2, 15, -2, 8, 12, 5, 15], 10, 4, 3], [[0, 1, 2], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[12, 20, 10, 15, 8, 12, 8, 5, 0, -2, 10, 15, 8, 15, 20], 0, 1, 1], [[8], False]],\n  ['control 1', [[-2, 12, 30, 10, 10, 10, 15, 0, 15, 10, -2, 20, 0], 12, 4, 5],\n   [[0, 3, 7, 10, 12], True]],\n  ['control 2', [[10, 30, 15, 20, -2, 20, 10, 20, -2, 8, 5, 0, 20], 8, 3, 1], [[8], False]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[10, 12, 8, 12, -2, 8, 12, 12, 30, 8, 12, 0, 0, 15, -2, 15], 12, 2, 7],\n   [[0, 1, 2, 3, 4, 5, 6], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[30, 0, -2, 12, 5, 0, 0, -2, 10, 5, 30, 15, 15], 8, 2, 1], [[1], False]],\n  ['control 1', [[20, 15, 8, 8, -2, 8, -2, 30, 12, 30, 10], 10, 2, 1], [[2], False]],\n  ['control 2', [[5, 12, 20, 0, 15, -2], 12, 4, 6], [[0, 1, 2, 3, 4, 5], True]]]]\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":"3faa4c6755006100957acf024a5f6bb1a9813dab38b688d920899ea4dcaf392c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(prices, threshold, min_len, need_slots):\n    runs = []\n    cur = []\n    for i, p in enumerate(prices):\n        if p < threshold:\n            cur.append(i)\n        else:\n            if cur:\n                runs.append(cur)\n            cur = []\n    if cur:\n        runs.append(cur)\n    chosen = []\n    for run in runs:\n        if len(run) >= min_len:\n            for i in run:\n                if len(chosen) < need_slots:\n                    chosen.append(i)\n    fallback = False\n    if len(chosen) < need_slots:\n        fallback = True\n        rest = sorted((p, i) for i, p in enumerate(prices) if i not in chosen)\n        for p, i in rest[:need_slots - len(chosen)]:\n            chosen.append(i)\n    return [sorted(chosen), fallback]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[20, 12, 10, 20, 0, 20, 15, 5, -2, 10, 30, 12, 0, 30, 12], 10, 3, 4], [[4, 7, 8, 9], True]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[0, 30, 5, 0, 20, 12, 0, 5, -2, 5, -2, 30, 30, 20, 8, 5], 12, 1, 4], [[0, 2, 3, 5], False]],\n  ['control 1', [[5, 20, 15, 10, -2], 10, 3, 5], [[0, 1, 2, 3, 4], True]],\n  ['control 2', [[30, 30, 0, -2, 20, 8, 5, 20, 0, 20], 0, 4, 1], [[3], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[-2, 10, 5, 8, 8, 0, 20, 12, 8, 12, -2, 15, -2, 8, 0, 0], 10, 4, 3], [[0, 1, 2], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[20, 5, 15, 12, 15, 30, 5, 20, 0, 20, 10, 0, 5, -2, 10], 12, 4, 6],\n   [[8, 10, 11, 12, 13, 14], True]],\n  ['control 1', [[30, -2, 5, 12, 8, 20, 20, 20], 12, 1, 7], [[1, 2, 3, 4, 5, 6, 7], True]],\n  ['control 2', [[30, 8, 15, 0, 15], 8, 2, 2], [[1, 3], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity', [[5, 15, 8, 12, 15, 20, 10, 15, 30, 15], 10, 1, 3],\n   [[0, 2, 6], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[5, 0, -2, 5, 30, 0, 30, -2, 8, 10, 5, 8, 20, 5], 8, 2, 4], [[0, 1, 2, 3], False]],\n  ['control 1', [[20, -2, 10, 8, 15, 10, 0, 8, 12, 5, 8, 0, 8], 0, 1, 1], [[1], False]],\n  ['control 2', [[-2, 8, 8, 12, -2, -2, -2, 10, 12, 15], 0, 2, 7], [[0, 1, 2, 4, 5, 6, 7], True]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[10, 8, 8, 8, 15, 12, 30, -2, 15, -2, 8, 12, 5, 15], 10, 4, 3], [[0, 1, 2], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[12, 20, 10, 15, 8, 12, 8, 5, 0, -2, 10, 15, 8, 15, 20], 0, 1, 1], [[8], False]],\n  ['control 1', [[-2, 12, 30, 10, 10, 10, 15, 0, 15, 10, -2, 20, 0], 12, 4, 5],\n   [[0, 3, 7, 10, 12], True]],\n  ['control 2', [[10, 30, 15, 20, -2, 20, 10, 20, -2, 8, 5, 0, 20], 8, 3, 1], [[8], False]]],\n [['boundary: run ending at horizon', [[20, 20, 5, 5], 8, 2, 2], [[2, 3], False]],\n  ['boundary: run exactly min_len', [[5, 5, 20, 5], 8, 2, 2], [[0, 1], False]],\n  ['boundary: nothing needed', [[5, 5, 5], 8, 1, 0], [[], False]],\n  ['regression: threshold inclusivity',\n   [[10, 12, 8, 12, -2, 8, 12, 12, 30, 8, 12, 0, 0, 15, -2, 15], 12, 2, 7],\n   [[0, 1, 2, 3, 4, 5, 6], False]],\n  ['regression: threshold inclusivity (partial repair)',\n   [[30, 0, -2, 12, 5, 0, 0, -2, 10, 5, 30, 15, 15], 8, 2, 1], [[1], False]],\n  ['control 1', [[20, 15, 8, 8, -2, 8, -2, 30, 12, 30, 10], 10, 2, 1], [[2], False]],\n  ['control 2', [[5, 12, 20, 0, 15, -2], 12, 4, 6], [[0, 1, 2, 3, 4, 5], True]]]]\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":"Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. 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-ev_charging_session_scheduling-contiguous-cheap-blocks-threshold-inclusivity","generated_at":"2026-09-29T14:51:53.158109+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Depot, workplace and public EV chargers schedule sessions against prices, circuit limits and departure deadlines; a wrong decision silently strands a driver or overloads a feeder.","root_cause":"The cheap-slot test is strict.","sha256":"d568d7cb7967b41d868f9ec4e30ad5b2a2fd53c07e6dba17d1da951d00400949","title":"Contiguous cheap charging blocks: threshold inclusivity · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.566,"exit_code":1,"observations":[{"actual":[[2,3],false],"check":"boundary: run ending at horizon","expected":[[2,3],false],"passed":true},{"actual":[[0,1],false],"check":"boundary: run exactly min_len","expected":[[0,1],false],"passed":true},{"actual":[[],false],"check":"boundary: nothing needed","expected":[[],false],"passed":true},{"actual":[[4,7,8,12],true],"check":"regression: threshold inclusivity","expected":[[4,7,8,9],true],"passed":false},{"actual":[[2,5,7,9],false],"check":"regression: threshold inclusivity (partial repair)","expected":[[0,2,3,5],false],"passed":false},{"actual":[[0,1,2,3,4],true],"check":"control 1","expected":[[0,1,2,3,4],true],"passed":true},{"actual":[[3],true],"check":"control 2","expected":[[3],true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: run ending at horizon\", \"actual\": [[2, 3], false], \"expected\": [[2, 3], false], \"passed\": true}, {\"check\": \"boundary: run exactly min_len\", \"actual\": [[0, 1], false], \"expected\": [[0, 1], false], \"passed\": true}, {\"check\": \"boundary: nothing needed\", \"actual\": [[], false], \"expected\": [[], false], \"passed\": true}, {\"check\": \"regression: threshold inclusivity\", \"actual\": [[4, 7, 8, 12], true], \"expected\": [[4, 7, 8, 9], true], \"passed\": false}, {\"check\": \"regression: threshold inclusivity (partial repair)\", \"actual\": [[2, 5, 7, 9], false], \"expected\": [[0, 2, 3, 5], false], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [[0, 1, 2, 3, 4], true], \"expected\": [[0, 1, 2, 3, 4], true], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [[3], true], \"expected\": [[3], true], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.687,"exit_code":1,"observations":[{"actual":[[2,3],false],"check":"boundary: run ending at horizon","expected":[[2,3],false],"passed":true},{"actual":[[0,1],false],"check":"boundary: run exactly min_len","expected":[[0,1],false],"passed":true},{"actual":[[],false],"check":"boundary: nothing needed","expected":[[],false],"passed":true},{"actual":[[4,7,8,12],true],"check":"regression: threshold inclusivity","expected":[[4,7,8,9],true],"passed":false},{"actual":[[0,2,3,6],false],"check":"regression: threshold inclusivity (partial repair)","expected":[[0,2,3,5],false],"passed":false},{"actual":[[0,1,2,3,4],true],"check":"control 1","expected":[[0,1,2,3,4],true],"passed":true},{"actual":[[3],true],"check":"control 2","expected":[[3],true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: run ending at horizon\", \"actual\": [[2, 3], false], \"expected\": [[2, 3], false], \"passed\": true}, {\"check\": \"boundary: run exactly min_len\", \"actual\": [[0, 1], false], \"expected\": [[0, 1], false], \"passed\": true}, {\"check\": \"boundary: nothing needed\", \"actual\": [[], false], \"expected\": [[], false], \"passed\": true}, {\"check\": \"regression: threshold inclusivity\", \"actual\": [[4, 7, 8, 12], true], \"expected\": [[4, 7, 8, 9], true], \"passed\": false}, {\"check\": \"regression: threshold inclusivity (partial repair)\", \"actual\": [[0, 2, 3, 6], false], \"expected\": [[0, 2, 3, 5], false], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [[0, 1, 2, 3, 4], true], \"expected\": [[0, 1, 2, 3, 4], true], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [[3], true], \"expected\": [[3], true], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}