{"abstract":"Repeated passages from one document remain duplicated in context.","category":"RAG context assembly","checks":6,"contract":"Rows are [document,text]. Preserve first-seen order and remove repeats only when both document and exact text match.","contract_signature":"rows","evaluation_group":"ragctx-same-doc-content","failed_approach":"Global text deduplication removes valid identical wording cited from different documents.","family":"w3-rag-context-assembly-same-document-content-dedup","id":"FA-99606","implementations":{"attempt":{"sha256":"4edd196c046bd4791f8590dfdab59d5a4e7411c0b3b721a2bc3b47aac6a2b466","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    seen=set(); out=[]\n    for doc,text in rows:\n        if text not in seen: seen.add(text); out.append(text)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='doc'+str(N); b='other'+str(N)\ncheck('same doc repeat', solve([[a,'p'],[a,'p'],[a,'q']]), ['p','q'])\ncheck('same text across docs', solve([[a,'p'],[b,'p']]), ['p','p'])\ncheck('order retained', solve([[a,'x'],[a,'y'],[a,'x']]), ['x','y'])\ncheck('empty', solve([]), [])\ncheck('singleton', solve([[a,'x']]), ['x'])\ncheck('different docs repeats', solve([[a,'x'],[b,'y'],[a,'x']]), ['x','y'])\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":"ec09e2e48a21ec2a831896fc5f27ec3ebc6e70f282192a393baf8a2a7efa896f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return [text for doc,text in rows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='doc'+str(N); b='other'+str(N)\ncheck('same doc repeat', solve([[a,'p'],[a,'p'],[a,'q']]), ['p','q'])\ncheck('same text across docs', solve([[a,'p'],[b,'p']]), ['p','p'])\ncheck('order retained', solve([[a,'x'],[a,'y'],[a,'x']]), ['x','y'])\ncheck('empty', solve([]), [])\ncheck('singleton', solve([[a,'x']]), ['x'])\ncheck('different docs repeats', solve([[a,'x'],[b,'y'],[a,'x']]), ['x','y'])\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 inputs and token counts only; this does not claim compatibility with a tokenizer, prompt format, or production retrieval system. 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-rag-context-assembly-same-document-content-dedup","generated_at":"2026-09-30T16:48:26.270949+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic evidence assembly model makes context budgeting behavior inspectable.","root_cause":"The assembler preserves repeated exact passage text within the same source document.","sha256":"380cee1349fac707ac5b7c937b640c6b3738d1578bf3d03fd762fac41a8b48e5","title":"Repeated passages from one document remain duplicated in context · 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":29.045,"exit_code":1,"observations":[{"actual":["p","q"],"check":"same doc repeat","expected":["p","q"],"passed":true},{"actual":["p"],"check":"same text across docs","expected":["p","p"],"passed":false},{"actual":["x","y"],"check":"order retained","expected":["x","y"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x"],"check":"singleton","expected":["x"],"passed":true},{"actual":["x","y"],"check":"different docs repeats","expected":["x","y"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same doc repeat\", \"actual\": [\"p\", \"q\"], \"expected\": [\"p\", \"q\"], \"passed\": true}, {\"check\": \"same text across docs\", \"actual\": [\"p\"], \"expected\": [\"p\", \"p\"], \"passed\": false}, {\"check\": \"order retained\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"x\"], \"expected\": [\"x\"], \"passed\": true}, {\"check\": \"different docs repeats\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.721,"exit_code":1,"observations":[{"actual":["p","p","q"],"check":"same doc repeat","expected":["p","q"],"passed":false},{"actual":["p","p"],"check":"same text across docs","expected":["p","p"],"passed":true},{"actual":["x","y","x"],"check":"order retained","expected":["x","y"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x"],"check":"singleton","expected":["x"],"passed":true},{"actual":["x","y","x"],"check":"different docs repeats","expected":["x","y"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same doc repeat\", \"actual\": [\"p\", \"p\", \"q\"], \"expected\": [\"p\", \"q\"], \"passed\": false}, {\"check\": \"same text across docs\", \"actual\": [\"p\", \"p\"], \"expected\": [\"p\", \"p\"], \"passed\": true}, {\"check\": \"order retained\", \"actual\": [\"x\", \"y\", \"x\"], \"expected\": [\"x\", \"y\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"x\"], \"expected\": [\"x\"], \"passed\": true}, {\"check\": \"different docs repeats\", \"actual\": [\"x\", \"y\", \"x\"], \"expected\": [\"x\", \"y\"], \"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."}}