{"abstract":"Median imputation applies fitted state incorrectly.","category":"Feature preprocessing fit scope","checks":7,"contract":"Train and values are scalar numeric lists with optional None. Fit the ordinary median, averaging the two middle observations for even size; use zero if no observations.","contract_signature":"train, values","evaluation_group":"w3-feature-preprocessing-fit-scope-median-imputation","failed_approach":"The partial repair addresses the main convention but mishandles an edge case.","family":"w3-feature-preprocessing-fit-scope-median-imputation-transform-state","id":"FA-100406","implementations":{"attempt":{"sha256":"413bfaa5913e9d61c833cf6ac7161716f884df9f018199ee7416cf3a64156f1e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(x for x in train if x is not None); m=v[len(v)//2] if v else 0; return [m if x is None else x for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('odd training',solve([1,5,9],[None,4]),[5,4])\ncheck('even training midpoint',solve([0,4],[None]),[2])\ncheck('heldout does not affect median',solve([1,7],[None,100]),[4,100])\ncheck('all missing fit',solve([None],[None]),[0])\ncheck('no gaps',solve([1,2],[8]),[8])\ncheck('singleton',solve([N],[None]),[N])\ncheck('empty transform',solve([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":"23c75aed33002a1c5fe52aae8db7492e00055c8de9531cf60c60a4049624f465","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(x for x in train if x is not None); m=v[(len(v)-1)//2] if v else 0; return [m if x is None else x for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('odd training',solve([1,5,9],[None,4]),[5,4])\ncheck('even training midpoint',solve([0,4],[None]),[2])\ncheck('heldout does not affect median',solve([1,7],[None,100]),[4,100])\ncheck('all missing fit',solve([None],[None]),[0])\ncheck('no gaps',solve([1,2],[8]),[8])\ncheck('singleton',solve([N],[None]),[N])\ncheck('empty transform',solve([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":"Toy scalar median imputer with an explicit even-sample midpoint rule. 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":"w3-feature-preprocessing-fit-scope-median-imputation-transform-state","generated_at":"2026-09-30T16:48:35.363215+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic preprocessing contract makes the fit boundary and transform behavior directly inspectable.","root_cause":"The transform applies a plausible but incorrect state convention.","sha256":"d22fad577753b3b6b60099cfe18dd669f2c29cc5612b467ed94c0533cf9d07df","title":"Median imputation applies fitted state incorrectly · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":26.676,"exit_code":1,"observations":[{"actual":[5,4],"check":"odd training","expected":[5,4],"passed":true},{"actual":[4],"check":"even training midpoint","expected":[2],"passed":false},{"actual":[7,100],"check":"heldout does not affect median","expected":[4,100],"passed":false},{"actual":[0],"check":"all missing fit","expected":[0],"passed":true},{"actual":[8],"check":"no gaps","expected":[8],"passed":true},{"actual":[1],"check":"singleton","expected":[1],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"odd training\", \"actual\": [5, 4], \"expected\": [5, 4], \"passed\": true}, {\"check\": \"even training midpoint\", \"actual\": [4], \"expected\": [2], \"passed\": false}, {\"check\": \"heldout does not affect median\", \"actual\": [7, 100], \"expected\": [4, 100], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"no gaps\", \"actual\": [8], \"expected\": [8], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.231,"exit_code":1,"observations":[{"actual":[5,4],"check":"odd training","expected":[5,4],"passed":true},{"actual":[0],"check":"even training midpoint","expected":[2],"passed":false},{"actual":[1,100],"check":"heldout does not affect median","expected":[4,100],"passed":false},{"actual":[0],"check":"all missing fit","expected":[0],"passed":true},{"actual":[8],"check":"no gaps","expected":[8],"passed":true},{"actual":[1],"check":"singleton","expected":[1],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"odd training\", \"actual\": [5, 4], \"expected\": [5, 4], \"passed\": true}, {\"check\": \"even training midpoint\", \"actual\": [0], \"expected\": [2], \"passed\": false}, {\"check\": \"heldout does not affect median\", \"actual\": [1, 100], \"expected\": [4, 100], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"no gaps\", \"actual\": [8], \"expected\": [8], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"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."}}