{"abstract":"A repeated source dominates every selected result.","category":"Vector retrieval ranking","checks":6,"contract":"Rows [id,score,source]; greedily choose highest score with at most one per source.","contract_signature":"rows, k","evaluation_group":"vector-retrieval-diversity-selection","failed_approach":"Skipping every row from the first source also discards that source’s best candidate.","family":"w3-vector-retrieval-ranking-diversity-selection","id":"FA-99511","implementations":{"attempt":{"sha256":"611939cff1f6243d78dc402cd0bc6a70bb82c7bbe485f2c60b006f08b64b84f9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, k):\n    return [r[0] for r in sorted(rows,key=lambda r:(-r[1],r[0])) if r[2] != rows[0][2]][:k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['a',N+3,'x'],['b',N+2,'x'],['c',N+1,'y'],['d',N,'z']]\ncheck('source diversity',solve(rows,3),['a','c','d'])\ncheck('best from source',solve([['b',4,'x'],['a',5,'x'],['c',3,'y']],2),['a','c'])\ncheck('limit one',solve(rows,1),['a'])\ncheck('empty',solve([],N),[])\ncheck('k zero',solve(rows,0),[])\ncheck('all one source',solve([['a',3,'x'],['b',2,'x']],2),['a'])\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":"67117992bc9bf034134d98b0fe6ff54406428dcdb9e374d1277376eff49a141b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, k):\n    return [r[0] for r in sorted(rows,key=lambda r:(-r[1],r[0]))[:k]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['a',N+3,'x'],['b',N+2,'x'],['c',N+1,'y'],['d',N,'z']]\ncheck('source diversity',solve(rows,3),['a','c','d'])\ncheck('best from source',solve([['b',4,'x'],['a',5,'x'],['c',3,'y']],2),['a','c'])\ncheck('limit one',solve(rows,1),['a'])\ncheck('empty',solve([],N),[])\ncheck('k zero',solve(rows,0),[])\ncheck('all one source',solve([['a',3,'x'],['b',2,'x']],2),['a'])\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 exact toy vectors and scores. No production index, ANN recall, embedding quality, or latency claim is implied. 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-vector-retrieval-ranking-diversity-selection","generated_at":"2026-09-30T16:48:24.913008+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.","root_cause":"The selector truncates by score without tracking source ownership.","sha256":"266170bc3a41b0a3ab16df7dff81131c30478bd79a906fd327bf7fa6eab7eb06","title":"Vector retrieval: A repeated source dominates every selected result · 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.458,"exit_code":1,"observations":[{"actual":["c","d"],"check":"source diversity","expected":["a","c","d"],"passed":false},{"actual":["c"],"check":"best from source","expected":["a","c"],"passed":false},{"actual":["c"],"check":"limit one","expected":["a"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[],"check":"k zero","expected":[],"passed":true},{"actual":[],"check":"all one source","expected":["a"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"source diversity\", \"actual\": [\"c\", \"d\"], \"expected\": [\"a\", \"c\", \"d\"], \"passed\": false}, {\"check\": \"best from source\", \"actual\": [\"c\"], \"expected\": [\"a\", \"c\"], \"passed\": false}, {\"check\": \"limit one\", \"actual\": [\"c\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"k zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all one source\", \"actual\": [], \"expected\": [\"a\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.006,"exit_code":1,"observations":[{"actual":["a","b","c"],"check":"source diversity","expected":["a","c","d"],"passed":false},{"actual":["a","b"],"check":"best from source","expected":["a","c"],"passed":false},{"actual":["a"],"check":"limit one","expected":["a"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[],"check":"k zero","expected":[],"passed":true},{"actual":["a","b"],"check":"all one source","expected":["a"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"source diversity\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"c\", \"d\"], \"passed\": false}, {\"check\": \"best from source\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"c\"], \"passed\": false}, {\"check\": \"limit one\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"k zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all one source\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\"], \"passed\": false}], \"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."}}