{"abstract":"later duplicate replaces the first source record.","category":"Dataset deduplication grouping","checks":6,"contract":"Rows are [key,id] in source order. Return representative IDs in first-key encounter order.","contract_signature":"rows","evaluation_group":"dedup-first-representative","failed_approach":"Sorting by key before retention changes the source-order representative.","family":"w3-dataset-deduplication-grouping-stable-first-representative","id":"FA-100266","implementations":{"attempt":{"sha256":"f794a667a8724b157dea1bc880cd39e58debaf986b3130be8c5c2be881252e2a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    out={};\n    for k,i in sorted(rows): out.setdefault(k,i)\n    return list(out.values())\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('later duplicate',solve([['k','first'],['k','later']]),['first'])\ncheck('encounter order',solve([['b','B'],['a','A']]),['B','A'])\ncheck('empty',solve([]),[])\ncheck('single row',solve([['x','X']]),['X'])\ncheck('separated duplicate',solve([['a','A'],['b','B'],['a','A2']]),['A','B'])\ncheck('N repeats',solve([['k',str(i)] for i in range(N)]),['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":"309a54805a421b8133c734a31590d9f9f372763daffedc0cc9b80ad894ce1466","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return list(dict((k,i) for k,i in rows).values())\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('later duplicate',solve([['k','first'],['k','later']]),['first'])\ncheck('encounter order',solve([['b','B'],['a','A']]),['B','A'])\ncheck('empty',solve([]),[])\ncheck('single row',solve([['x','X']]),['X'])\ncheck('separated duplicate',solve([['a','A'],['b','B'],['a','A2']]),['A','B'])\ncheck('N repeats',solve([['k',str(i)] for i in range(N)]),['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":"Inputs are small in-memory fixtures with the stated contract; results do not claim production deduplication quality. 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-dataset-deduplication-grouping-stable-first-representative","generated_at":"2026-09-30T16:48:33.557783+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This deterministic toy operation makes one dataset equivalence or representative rule explicit.","root_cause":"A last-write mapping is used where source order defines the representative.","sha256":"9ca354d41aaacbe1f910ad0f7c15fcda43a4660b96e6f4e2b56a232f8f1ffd8f","title":"Dataset deduplication: later duplicate replaces the first source record · 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":30.009,"exit_code":1,"observations":[{"actual":["first"],"check":"later duplicate","expected":["first"],"passed":true},{"actual":["A","B"],"check":"encounter order","expected":["B","A"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["X"],"check":"single row","expected":["X"],"passed":true},{"actual":["A","B"],"check":"separated duplicate","expected":["A","B"],"passed":true},{"actual":["0"],"check":"N repeats","expected":["0"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"later duplicate\", \"actual\": [\"first\"], \"expected\": [\"first\"], \"passed\": true}, {\"check\": \"encounter order\", \"actual\": [\"A\", \"B\"], \"expected\": [\"B\", \"A\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single row\", \"actual\": [\"X\"], \"expected\": [\"X\"], \"passed\": true}, {\"check\": \"separated duplicate\", \"actual\": [\"A\", \"B\"], \"expected\": [\"A\", \"B\"], \"passed\": true}, {\"check\": \"N repeats\", \"actual\": [\"0\"], \"expected\": [\"0\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.428,"exit_code":1,"observations":[{"actual":["later"],"check":"later duplicate","expected":["first"],"passed":false},{"actual":["B","A"],"check":"encounter order","expected":["B","A"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["X"],"check":"single row","expected":["X"],"passed":true},{"actual":["A2","B"],"check":"separated duplicate","expected":["A","B"],"passed":false},{"actual":["0"],"check":"N repeats","expected":["0"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"later duplicate\", \"actual\": [\"later\"], \"expected\": [\"first\"], \"passed\": false}, {\"check\": \"encounter order\", \"actual\": [\"B\", \"A\"], \"expected\": [\"B\", \"A\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single row\", \"actual\": [\"X\"], \"expected\": [\"X\"], \"passed\": true}, {\"check\": \"separated duplicate\", \"actual\": [\"A2\", \"B\"], \"expected\": [\"A\", \"B\"], \"passed\": false}, {\"check\": \"N repeats\", \"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."}}