{"abstract":"Dates near New Year receive a week number from one ISO year and a year label from another.","category":"Calendar arithmetic","checks":7,"contract":"Return YYYY-Www-d for a valid ISO date using ISO week numbering: Monday is weekday one, and week one is the week containing January fourth. The year field is the ISO week year.","contract_signature":"text","evaluation_group":"model-74c0b79b22dd3ddd","failed_approach":"Adjusting December dates in week one handles forward rollover but leaves January dates belonging to the previous ISO year incorrect.","family":"time-iso-week-year","id":"FA-301","implementations":{"attempt":{"sha256":"4143eab0782fbdf1ad12aef718b4559e000ec4c19aa519499bc67d6871cfeefe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom datetime import date\nN = 1\nobservations = []\ndef solve(text):\n    value = date.fromisoformat(text)\n    _, week, weekday = value.isocalendar()\n    year = value.year + (value.month == 12 and week == 1)\n    return f'{year:04d}-W{week:02d}-{weekday}'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\njanuary = ['2016-01-01', '2017-01-01', '2021-01-01', '2022-01-01', '2023-01-01'][N - 1]\nexpected = ['2015-W53-5', '2016-W52-7', '2020-W53-5', '2021-W52-6', '2022-W52-7'][N - 1]\ncheck('January belongs to preceding ISO year', solve(january), expected)\ncheck('December belongs to following ISO year', solve('2018-12-31'), '2019-W01-1')\ncheck('December remains in week fifty-three', solve('2020-12-31'), '2020-W53-4')\ncheck('Monday January first', solve('2024-01-01'), '2024-W01-1')\ncheck('leap day', solve('2024-02-29'), '2024-W09-4')\ncheck('Sunday ends the same ISO week', solve('2024-03-03'), '2024-W09-7')\ncheck('Monday advances the week', solve('2024-03-04'), '2024-W10-1')\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":"902338a9d54eeb406df9bcfc8316d9fb30f664b111d3ea59e3c87f896bd8b316","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom datetime import date\nN = 1\nobservations = []\ndef solve(text):\n    value = date.fromisoformat(text)\n    _, week, weekday = value.isocalendar()\n    return f'{value.year:04d}-W{week:02d}-{weekday}'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\njanuary = ['2016-01-01', '2017-01-01', '2021-01-01', '2022-01-01', '2023-01-01'][N - 1]\nexpected = ['2015-W53-5', '2016-W52-7', '2020-W53-5', '2021-W52-6', '2022-W52-7'][N - 1]\ncheck('January belongs to preceding ISO year', solve(january), expected)\ncheck('December belongs to following ISO year', solve('2018-12-31'), '2019-W01-1')\ncheck('December remains in week fifty-three', solve('2020-12-31'), '2020-W53-4')\ncheck('Monday January first', solve('2024-01-01'), '2024-W01-1')\ncheck('leap day', solve('2024-02-29'), '2024-W09-4')\ncheck('Sunday ends the same ISO week', solve('2024-03-03'), '2024-W09-7')\ncheck('Monday advances the week', solve('2024-03-04'), '2024-W10-1')\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":"time-iso-week-year","generated_at":"2026-09-29T14:36:52.069412+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Weekly partition names and report keys can collide or be assigned to the wrong year when calendar and week-based fields are mixed.","root_cause":"The calendar year field is combined with ISO week and weekday fields.","sha256":"dfcf20d4f27413604c097539ab3ba5c8e475f57279ee863325354ab81d1f8d0f","title":"A calendar year is paired with a week from the previous ISO year · 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":37.542,"exit_code":1,"observations":[{"actual":"2016-W53-5","check":"January belongs to preceding ISO year","expected":"2015-W53-5","passed":false},{"actual":"2019-W01-1","check":"December belongs to following ISO year","expected":"2019-W01-1","passed":true},{"actual":"2020-W53-4","check":"December remains in week fifty-three","expected":"2020-W53-4","passed":true},{"actual":"2024-W01-1","check":"Monday January first","expected":"2024-W01-1","passed":true},{"actual":"2024-W09-4","check":"leap day","expected":"2024-W09-4","passed":true},{"actual":"2024-W09-7","check":"Sunday ends the same ISO week","expected":"2024-W09-7","passed":true},{"actual":"2024-W10-1","check":"Monday advances the week","expected":"2024-W10-1","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"January belongs to preceding ISO year\", \"actual\": \"2016-W53-5\", \"expected\": \"2015-W53-5\", \"passed\": false}, {\"check\": \"December belongs to following ISO year\", \"actual\": \"2019-W01-1\", \"expected\": \"2019-W01-1\", \"passed\": true}, {\"check\": \"December remains in week fifty-three\", \"actual\": \"2020-W53-4\", \"expected\": \"2020-W53-4\", \"passed\": true}, {\"check\": \"Monday January first\", \"actual\": \"2024-W01-1\", \"expected\": \"2024-W01-1\", \"passed\": true}, {\"check\": \"leap day\", \"actual\": \"2024-W09-4\", \"expected\": \"2024-W09-4\", \"passed\": true}, {\"check\": \"Sunday ends the same ISO week\", \"actual\": \"2024-W09-7\", \"expected\": \"2024-W09-7\", \"passed\": true}, {\"check\": \"Monday advances the week\", \"actual\": \"2024-W10-1\", \"expected\": \"2024-W10-1\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.033,"exit_code":1,"observations":[{"actual":"2016-W53-5","check":"January belongs to preceding ISO year","expected":"2015-W53-5","passed":false},{"actual":"2018-W01-1","check":"December belongs to following ISO year","expected":"2019-W01-1","passed":false},{"actual":"2020-W53-4","check":"December remains in week fifty-three","expected":"2020-W53-4","passed":true},{"actual":"2024-W01-1","check":"Monday January first","expected":"2024-W01-1","passed":true},{"actual":"2024-W09-4","check":"leap day","expected":"2024-W09-4","passed":true},{"actual":"2024-W09-7","check":"Sunday ends the same ISO week","expected":"2024-W09-7","passed":true},{"actual":"2024-W10-1","check":"Monday advances the week","expected":"2024-W10-1","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"January belongs to preceding ISO year\", \"actual\": \"2016-W53-5\", \"expected\": \"2015-W53-5\", \"passed\": false}, {\"check\": \"December belongs to following ISO year\", \"actual\": \"2018-W01-1\", \"expected\": \"2019-W01-1\", \"passed\": false}, {\"check\": \"December remains in week fifty-three\", \"actual\": \"2020-W53-4\", \"expected\": \"2020-W53-4\", \"passed\": true}, {\"check\": \"Monday January first\", \"actual\": \"2024-W01-1\", \"expected\": \"2024-W01-1\", \"passed\": true}, {\"check\": \"leap day\", \"actual\": \"2024-W09-4\", \"expected\": \"2024-W09-4\", \"passed\": true}, {\"check\": \"Sunday ends the same ISO week\", \"actual\": \"2024-W09-7\", \"expected\": \"2024-W09-7\", \"passed\": true}, {\"check\": \"Monday advances the week\", \"actual\": \"2024-W10-1\", \"expected\": \"2024-W10-1\", \"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."}}