{"abstract":"A query vector retrieves its own record.","category":"Vector retrieval ranking","checks":6,"contract":"Rows [id,distance]; omit query_id then return nearest k IDs.","contract_signature":"rows, query_id, k","evaluation_group":"vector-retrieval-self-match-exclusion","failed_approach":"Filtering the ID and then skipping the first result loses the true nearest neighbor.","family":"w3-vector-retrieval-ranking-self-match-exclusion","id":"FA-99536","implementations":{"attempt":{"sha256":"07fe0c4c2f4c6e3f81d7fd4ff78f02737ebac768d4da6d7286b81d252b40305c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, query_id, k):\n    return [r[0] for r in sorted((r for r in rows if r[0]!=query_id),key=lambda r:(r[1],r[0]))[1:k+1]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('self nearest',solve([['self',0],['a',N],['b',N+1]],'self',1),['a'])\ncheck('self after filter',solve([['a',N],['self',0],['b',N+1]],'self',2),['a','b'])\ncheck('query absent',solve([['a',N],['b',N+1]],'self',1),['a'])\ncheck('only self',solve([['self',0]],'self',1),[])\ncheck('zero limit',solve([['self',0],['a',N]],'self',0),[])\ncheck('empty',solve([],'self',N),[])\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":"f1577c5265713a4315b9b3fd121a4437b91d33013e9df612c3ffc5a2322180ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, query_id, 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})\ncheck('self nearest',solve([['self',0],['a',N],['b',N+1]],'self',1),['a'])\ncheck('self after filter',solve([['a',N],['self',0],['b',N+1]],'self',2),['a','b'])\ncheck('query absent',solve([['a',N],['b',N+1]],'self',1),['a'])\ncheck('only self',solve([['self',0]],'self',1),[])\ncheck('zero limit',solve([['self',0],['a',N]],'self',0),[])\ncheck('empty',solve([],'self',N),[])\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-self-match-exclusion","generated_at":"2026-09-30T16:48:25.349039+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 query identity is not removed before top-k selection.","sha256":"bdae26ae900fbbb8e97c4427d053d14f81e7ad97b6c6fc8af2ded76cd29be901","title":"Vector retrieval: A query vector retrieves its own 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":27.002,"exit_code":1,"observations":[{"actual":["b"],"check":"self nearest","expected":["a"],"passed":false},{"actual":["b"],"check":"self after filter","expected":["a","b"],"passed":false},{"actual":["b"],"check":"query absent","expected":["a"],"passed":false},{"actual":[],"check":"only self","expected":[],"passed":true},{"actual":[],"check":"zero limit","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"self nearest\", \"actual\": [\"b\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"self after filter\", \"actual\": [\"b\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"query absent\", \"actual\": [\"b\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"only self\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.095,"exit_code":1,"observations":[{"actual":["self"],"check":"self nearest","expected":["a"],"passed":false},{"actual":["self","a"],"check":"self after filter","expected":["a","b"],"passed":false},{"actual":["a"],"check":"query absent","expected":["a"],"passed":true},{"actual":["self"],"check":"only self","expected":[],"passed":false},{"actual":[],"check":"zero limit","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"self nearest\", \"actual\": [\"self\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"self after filter\", \"actual\": [\"self\", \"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"query absent\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"only self\", \"actual\": [\"self\"], \"expected\": [], \"passed\": false}, {\"check\": \"zero limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"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."}}