{"abstract":"Category vocabulary encoding applies fitted state incorrectly.","category":"Feature preprocessing fit scope","checks":7,"contract":"Fit sorted unique string classes from train and return their zero-based positions for transform values; any unseen string receives sentinel -1.","contract_signature":"train, values","evaluation_group":"w3-feature-preprocessing-fit-scope-category-vocabulary","failed_approach":"The partial repair addresses the main convention but mishandles an edge case.","family":"w3-feature-preprocessing-fit-scope-category-vocabulary-transform-state","id":"FA-100376","implementations":{"attempt":{"sha256":"314d5a37fc2847a3394df8521092458164a588ecb02751e8e5549d320fa34da9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    vocab=sorted(set(train)); return [vocab.index(x) if x in vocab else (len(vocab) if x!='' else -1) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='c'+str(N); train=['b',a]; vals=[a,'b','u'+str(N),'']; check('lexical train ids',solve(train,vals),[1,0,-1,-1])\ncheck('heldout category unknown',solve(['a','c'],['b']),[-1])\ncheck('repeat',solve(['z','a','z'],['z','z']),[1,1])\ncheck('empty values',solve(['a'],[]),[])\ncheck('empty fit',solve([],['a']),[-1])\ncheck('empty string unknown',solve(['a'],['']),[-1])\ncheck('known singleton',solve(['x'],['x']),[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":"86ed59f040909c8eed30602a0b4060e7fef0093adf2bab2e376d4bf89db4f817","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    vocab=sorted(set(train)); return [vocab.index(x) if x in vocab else len(vocab) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='c'+str(N); train=['b',a]; vals=[a,'b','u'+str(N),'']; check('lexical train ids',solve(train,vals),[1,0,-1,-1])\ncheck('heldout category unknown',solve(['a','c'],['b']),[-1])\ncheck('repeat',solve(['z','a','z'],['z','z']),[1,1])\ncheck('empty values',solve(['a'],[]),[])\ncheck('empty fit',solve([],['a']),[-1])\ncheck('empty string unknown',solve(['a'],['']),[-1])\ncheck('known singleton',solve(['x'],['x']),[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":"Toy categorical ordinal encoding with deterministic lexical order and a single unknown sentinel. 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-category-vocabulary-transform-state","generated_at":"2026-09-30T16:48:34.921201+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":"83f2f9853eb674574689da3bb51c6b65cafda28bf5fb3697e0245069fd074529","title":"Category vocabulary encoding 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":27.447,"exit_code":1,"observations":[{"actual":[1,0,2,-1],"check":"lexical train ids","expected":[1,0,-1,-1],"passed":false},{"actual":[2],"check":"heldout category unknown","expected":[-1],"passed":false},{"actual":[1,1],"check":"repeat","expected":[1,1],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"empty fit","expected":[-1],"passed":false},{"actual":[-1],"check":"empty string unknown","expected":[-1],"passed":true},{"actual":[0],"check":"known singleton","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lexical train ids\", \"actual\": [1, 0, 2, -1], \"expected\": [1, 0, -1, -1], \"passed\": false}, {\"check\": \"heldout category unknown\", \"actual\": [2], \"expected\": [-1], \"passed\": false}, {\"check\": \"repeat\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty fit\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"empty string unknown\", \"actual\": [-1], \"expected\": [-1], \"passed\": true}, {\"check\": \"known singleton\", \"actual\": [0], \"expected\": [0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.008,"exit_code":1,"observations":[{"actual":[1,0,2,2],"check":"lexical train ids","expected":[1,0,-1,-1],"passed":false},{"actual":[2],"check":"heldout category unknown","expected":[-1],"passed":false},{"actual":[1,1],"check":"repeat","expected":[1,1],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"empty fit","expected":[-1],"passed":false},{"actual":[1],"check":"empty string unknown","expected":[-1],"passed":false},{"actual":[0],"check":"known singleton","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lexical train ids\", \"actual\": [1, 0, 2, 2], \"expected\": [1, 0, -1, -1], \"passed\": false}, {\"check\": \"heldout category unknown\", \"actual\": [2], \"expected\": [-1], \"passed\": false}, {\"check\": \"repeat\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty fit\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"empty string unknown\", \"actual\": [1], \"expected\": [-1], \"passed\": false}, {\"check\": \"known singleton\", \"actual\": [0], \"expected\": [0], \"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."}}