{"abstract":"Weekend days are counted as working weekdays.","category":"Calendar arithmetic","checks":4,"contract":"Valid ISO Gregorian dates in years 1 through 9999; generated dates must remain in that range. Month is 1 through 12 and zero-based weekday is Monday 0 through Sunday 6 unless the output convention says otherwise. start<=end; count Monday through Friday in [start,end), without public-holiday exclusions. Exact operational definition: sum((date.fromisoformat(start)+timedelta(days=i)).weekday()<5 for i in range((date.fromisoformat(end)-date.fromisoformat(start)).days))","evaluation_group":"model-17e13ccfb1f6e7f8","failed_approach":"The exclusive terminal date is included.","family":"xn-weekday-count-half-open-date-range","id":"FA-6551","implementations":{"attempt":{"sha256":"d289dedde5e1590c50c2e56a57205ec02767175fce489c31340af5420aebcac4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(start, end):\n    return sum((date.fromisoformat(start)+timedelta(days=i)).weekday()<5 for i in range((date.fromisoformat(end)-date.fromisoformat(start)).days+1))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck(\"fixture 1: ('2024-01-01', '2024-01-08')\", solve(*('2024-01-01', '2024-01-08')), 5)\ncheck(\"fixture 2: ('2024-01-05', '2024-01-08')\", solve(*('2024-01-05', '2024-01-08')), 1)\ncheck(\"fixture 3: ('2024-01-06', '2024-01-08')\", solve(*('2024-01-06', '2024-01-08')), 0)\ncheck(\"fixture 4: ('2024-01-01', '2024-01-01')\", solve(*('2024-01-01', '2024-01-01')), 0)\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":"04b7db32764282e6f3a77e88c04e4e7520d42664b683771e562d4041de5f4666","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(start, end):\n    return (date.fromisoformat(end)-date.fromisoformat(start)).days\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck(\"fixture 1: ('2024-01-01', '2024-01-08')\", solve(*('2024-01-01', '2024-01-08')), 5)\ncheck(\"fixture 2: ('2024-01-05', '2024-01-08')\", solve(*('2024-01-05', '2024-01-08')), 1)\ncheck(\"fixture 3: ('2024-01-06', '2024-01-08')\", solve(*('2024-01-06', '2024-01-08')), 0)\ncheck(\"fixture 4: ('2024-01-01', '2024-01-01')\", solve(*('2024-01-01', '2024-01-01')), 0)\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":"6b99e7f7df4bf6323ceaaf8ded503b9417b34b958125f1084ec18556838e5baf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(start, end):\n    return sum((date.fromisoformat(start)+timedelta(days=i)).weekday()<5 for i in range((date.fromisoformat(end)-date.fromisoformat(start)).days))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck(\"fixture 1: ('2024-01-01', '2024-01-08')\", solve(*('2024-01-01', '2024-01-08')), 5)\ncheck(\"fixture 2: ('2024-01-05', '2024-01-08')\", solve(*('2024-01-05', '2024-01-08')), 1)\ncheck(\"fixture 3: ('2024-01-06', '2024-01-08')\", solve(*('2024-01-06', '2024-01-08')), 0)\ncheck(\"fixture 4: ('2024-01-01', '2024-01-01')\", solve(*('2024-01-01', '2024-01-01')), 0)\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":" 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":"xn-weekday-count-half-open-date-range","generated_at":"2026-09-29T14:38:03.075347+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Calendar conventions results depend on the stated convention.","repair":"Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum((date.fromisoformat(start)+timedelta(days=i)).weekday()<5 for i in range((date.fromisoformat(end)-date.fromisoformat(start)).days))","root_cause":"Weekend days are counted as working weekdays.","sha256":"e11f23aea624a31169e908f633ae4603cfc091607437ef6080e4a8077da4f82b","title":"Weekday count half open date range · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.504,"exit_code":1,"observations":[{"actual":6,"check":"fixture 1: ('2024-01-01', '2024-01-08')","expected":5,"passed":false},{"actual":2,"check":"fixture 2: ('2024-01-05', '2024-01-08')","expected":1,"passed":false},{"actual":1,"check":"fixture 3: ('2024-01-06', '2024-01-08')","expected":0,"passed":false},{"actual":1,"check":"fixture 4: ('2024-01-01', '2024-01-01')","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ('2024-01-01', '2024-01-08')\", \"actual\": 6, \"expected\": 5, \"passed\": false}, {\"check\": \"fixture 2: ('2024-01-05', '2024-01-08')\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"fixture 3: ('2024-01-06', '2024-01-08')\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"fixture 4: ('2024-01-01', '2024-01-01')\", \"actual\": 1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.758,"exit_code":1,"observations":[{"actual":7,"check":"fixture 1: ('2024-01-01', '2024-01-08')","expected":5,"passed":false},{"actual":3,"check":"fixture 2: ('2024-01-05', '2024-01-08')","expected":1,"passed":false},{"actual":2,"check":"fixture 3: ('2024-01-06', '2024-01-08')","expected":0,"passed":false},{"actual":0,"check":"fixture 4: ('2024-01-01', '2024-01-01')","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ('2024-01-01', '2024-01-08')\", \"actual\": 7, \"expected\": 5, \"passed\": false}, {\"check\": \"fixture 2: ('2024-01-05', '2024-01-08')\", \"actual\": 3, \"expected\": 1, \"passed\": false}, {\"check\": \"fixture 3: ('2024-01-06', '2024-01-08')\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"fixture 4: ('2024-01-01', '2024-01-01')\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.528,"exit_code":0,"observations":[{"actual":5,"check":"fixture 1: ('2024-01-01', '2024-01-08')","expected":5,"passed":true},{"actual":1,"check":"fixture 2: ('2024-01-05', '2024-01-08')","expected":1,"passed":true},{"actual":0,"check":"fixture 3: ('2024-01-06', '2024-01-08')","expected":0,"passed":true},{"actual":0,"check":"fixture 4: ('2024-01-01', '2024-01-01')","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ('2024-01-01', '2024-01-08')\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"fixture 2: ('2024-01-05', '2024-01-08')\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"fixture 3: ('2024-01-06', '2024-01-08')\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"fixture 4: ('2024-01-01', '2024-01-01')\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}