{"abstract":"Month end is returned without aligning its weekday.","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. Last weekday of month. Exact operational definition: (date(year,month,calendar.monthrange(year,month)[1])-timedelta(days=(date(year,month,calendar.monthrange(year,month)[1]).weekday()-weekday)%7)).isoformat()","contract_signature":"year, month, weekday","evaluation_group":"model-f70e91066b2e5e6d","failed_approach":"Absolute weekday difference moves by the wrong amount across the week boundary.","family":"xn-last-weekday-of-month","id":"FA-6561","implementations":{"attempt":{"sha256":"1bd9cb074c01a3afdc6dadcbdb520e623898d144722d7589212575c8cfc2c543","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(year, month, weekday):\n    return (date(year,month,calendar.monthrange(year,month)[1])-timedelta(days=abs(date(year,month,calendar.monthrange(year,month)[1]).weekday()-weekday))).isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: (2024, 2, 0)', solve(*(2024, 2, 0)), '2024-02-26')\ncheck('fixture 2: (2024, 3, 4)', solve(*(2024, 3, 4)), '2024-03-29')\ncheck('fixture 3: (2024, 4, 4)', solve(*(2024, 4, 4)), '2024-04-26')\ncheck('fixture 4: (2024, 2, 3)', solve(*(2024, 2, 3)), '2024-02-29')\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":"166473d1699d550a4a37cd0c0898c4549d9387a4a7b7c680f39f75987051865a","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(year, month, weekday):\n    return date(year,month,calendar.monthrange(year,month)[1]).isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: (2024, 2, 0)', solve(*(2024, 2, 0)), '2024-02-26')\ncheck('fixture 2: (2024, 3, 4)', solve(*(2024, 3, 4)), '2024-03-29')\ncheck('fixture 3: (2024, 4, 4)', solve(*(2024, 4, 4)), '2024-04-26')\ncheck('fixture 4: (2024, 2, 3)', solve(*(2024, 2, 3)), '2024-02-29')\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-last-weekday-of-month","generated_at":"2026-09-29T14:38:03.124070+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.","root_cause":"Month end is returned without aligning its weekday.","sha256":"05ab49c39103f2e170e11a4d226a9bc272911d7c1c2796a4726cbb5ed9d7ea03","title":"Last weekday of month · 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":43.169,"exit_code":1,"observations":[{"actual":"2024-02-26","check":"fixture 1: (2024, 2, 0)","expected":"2024-02-26","passed":true},{"actual":"2024-03-29","check":"fixture 2: (2024, 3, 4)","expected":"2024-03-29","passed":true},{"actual":"2024-04-27","check":"fixture 3: (2024, 4, 4)","expected":"2024-04-26","passed":false},{"actual":"2024-02-29","check":"fixture 4: (2024, 2, 3)","expected":"2024-02-29","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: (2024, 2, 0)\", \"actual\": \"2024-02-26\", \"expected\": \"2024-02-26\", \"passed\": true}, {\"check\": \"fixture 2: (2024, 3, 4)\", \"actual\": \"2024-03-29\", \"expected\": \"2024-03-29\", \"passed\": true}, {\"check\": \"fixture 3: (2024, 4, 4)\", \"actual\": \"2024-04-27\", \"expected\": \"2024-04-26\", \"passed\": false}, {\"check\": \"fixture 4: (2024, 2, 3)\", \"actual\": \"2024-02-29\", \"expected\": \"2024-02-29\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.41,"exit_code":1,"observations":[{"actual":"2024-02-29","check":"fixture 1: (2024, 2, 0)","expected":"2024-02-26","passed":false},{"actual":"2024-03-31","check":"fixture 2: (2024, 3, 4)","expected":"2024-03-29","passed":false},{"actual":"2024-04-30","check":"fixture 3: (2024, 4, 4)","expected":"2024-04-26","passed":false},{"actual":"2024-02-29","check":"fixture 4: (2024, 2, 3)","expected":"2024-02-29","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: (2024, 2, 0)\", \"actual\": \"2024-02-29\", \"expected\": \"2024-02-26\", \"passed\": false}, {\"check\": \"fixture 2: (2024, 3, 4)\", \"actual\": \"2024-03-31\", \"expected\": \"2024-03-29\", \"passed\": false}, {\"check\": \"fixture 3: (2024, 4, 4)\", \"actual\": \"2024-04-30\", \"expected\": \"2024-04-26\", \"passed\": false}, {\"check\": \"fixture 4: (2024, 2, 3)\", \"actual\": \"2024-02-29\", \"expected\": \"2024-02-29\", \"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."}}