FAILURE MAP
← Case archive

FA-99606 / RAG context assembly / Open access

Repeated passages from one document remain duplicated in context · case 01

Repeated passages from one document remain duplicated in context.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The assembler preserves repeated exact passage text within the same source document.

THE FAILURE

The assembler preserves repeated exact passage text within the same source document.

Unsuccessful approach: Global text deduplication removes valid identical wording cited from different documents.

Case contract

Rows are [document,text]. Preserve first-seen order and remove repeats only when both document and exact text match.

Why this case matters

A small deterministic evidence assembly model makes context budgeting behavior inspectable.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows):
    return [text for doc,text in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='doc'+str(N); b='other'+str(N)
check('same doc repeat', solve([[a,'p'],[a,'p'],[a,'q']]), ['p','q'])
check('same text across docs', solve([[a,'p'],[b,'p']]), ['p','p'])
check('order retained', solve([[a,'x'],[a,'y'],[a,'x']]), ['x','y'])
check('empty', solve([]), [])
check('singleton', solve([[a,'x']]), ['x'])
check('different docs repeats', solve([[a,'x'],[b,'y'],[a,'x']]), ['x','y'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
same doc repeat['p', 'p', 'q']['p', 'q']Failed
same text across docs['p', 'p']['p', 'p']Passed
order retained['x', 'y', 'x']['x', 'y']Failed
empty[][]Passed
singleton['x']['x']Passed
different docs repeats['x', 'y', 'x']['x', 'y']Failed

SHA-256 / ec09e2e48a21ec2a831896fc5f27ec3ebc6e70f282192a393baf8a2a7efa896f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows):
    seen=set(); out=[]
    for doc,text in rows:
        if text not in seen: seen.add(text); out.append(text)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='doc'+str(N); b='other'+str(N)
check('same doc repeat', solve([[a,'p'],[a,'p'],[a,'q']]), ['p','q'])
check('same text across docs', solve([[a,'p'],[b,'p']]), ['p','p'])
check('order retained', solve([[a,'x'],[a,'y'],[a,'x']]), ['x','y'])
check('empty', solve([]), [])
check('singleton', solve([[a,'x']]), ['x'])
check('different docs repeats', solve([[a,'x'],[b,'y'],[a,'x']]), ['x','y'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
same doc repeat['p', 'q']['p', 'q']Passed
same text across docs['p']['p', 'p']Failed
order retained['x', 'y']['x', 'y']Passed
empty[][]Passed
singleton['x']['x']Passed
different docs repeats['x', 'y']['x', 'y']Passed

SHA-256 / 4edd196c046bd4791f8590dfdab59d5a4e7411c0b3b721a2bc3b47aac6a2b466

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:26.270949+00:00.

Case digest / 380cee1349fac707ac5b7c937b640c6b3738d1578bf3d03fd762fac41a8b48e5