FAILURE MAP
← Case archive

FA-99546 / RAG context assembly / Open access

A per-source limit lets one source contribute too many chunks · case 01

A per-source limit lets one source contribute too many chunks.

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

ROOT CAUSE

The assembler applies no per-source quota and returns every candidate.

THE FAILURE

The assembler applies no per-source quota and returns every candidate.

Unsuccessful approach: A global row cap prevents overrepresented sources but underfills results when several sources qualify.

Case contract

Chunks are [source,text]. Return rank-ordered chunks with no more than cap entries per source.

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(chunks, cap):
    return chunks
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='A'+str(N); b='B'+str(N)
check('interleaved sources', solve([[a,'1'],[a,'2'],[b,'3'],[a,'4']],1), [[a,'1'],[b,'3']])
check('cap two', solve([[a,'1'],[a,'2'],[a,'3'],[b,'4']],2), [[a,'1'],[a,'2'],[b,'4']])
check('zero cap', solve([[a,'x']],0), [])
check('empty', solve([],N), [])
check('distinct sources', solve([[a,'x'],[b,'y']],1), [[a,'x'],[b,'y']])
check('one source below cap', solve([[a,'x']],3), [[a,'x']])
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
interleaved sources[['A1', '1'], ['A1', '2'], ['B1', '3'], ['A1', '4']][['A1', '1'], ['B1', '3']]Failed
cap two[['A1', '1'], ['A1', '2'], ['A1', '3'], ['B1', '4']][['A1', '1'], ['A1', '2'], ['B1', '4']]Failed
zero cap[['A1', 'x']][]Failed
empty[][]Passed
distinct sources[['A1', 'x'], ['B1', 'y']][['A1', 'x'], ['B1', 'y']]Passed
one source below cap[['A1', 'x']][['A1', 'x']]Passed

SHA-256 / 527ff364fe4fa67e76c109702da2d1d3c8ced77efd0f08750f006b91ea00d86a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(chunks, cap):
    out=[]; seen={}
    for row in chunks:
        if len(out)<cap: out.append(row)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='A'+str(N); b='B'+str(N)
check('interleaved sources', solve([[a,'1'],[a,'2'],[b,'3'],[a,'4']],1), [[a,'1'],[b,'3']])
check('cap two', solve([[a,'1'],[a,'2'],[a,'3'],[b,'4']],2), [[a,'1'],[a,'2'],[b,'4']])
check('zero cap', solve([[a,'x']],0), [])
check('empty', solve([],N), [])
check('distinct sources', solve([[a,'x'],[b,'y']],1), [[a,'x'],[b,'y']])
check('one source below cap', solve([[a,'x']],3), [[a,'x']])
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
interleaved sources[['A1', '1']][['A1', '1'], ['B1', '3']]Failed
cap two[['A1', '1'], ['A1', '2']][['A1', '1'], ['A1', '2'], ['B1', '4']]Failed
zero cap[][]Passed
empty[][]Passed
distinct sources[['A1', 'x']][['A1', 'x'], ['B1', 'y']]Failed
one source below cap[['A1', 'x']][['A1', 'x']]Passed

SHA-256 / 835b53dad29fcefea7ad3ef1feb8b377c55be06902b18bcd0fed5ec81dabee4c

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:25.348415+00:00.

Case digest / e0af9f404571a60f4161d9dc384f2368f9ffc0a6ff8535ad6af69fe60344178e