FAILURE MAP
← Case archive

FA-99616 / RAG context assembly / Open access

Document chunks are merged across an unrelated source · case 01

Document chunks are merged across an unrelated source.

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

ROOT CAUSE

Grouping uses a single last-document marker and fails to preserve all chunks belonging to a source.

THE FAILURE

Grouping uses a single last-document marker and fails to preserve all chunks belonging to a source.

Unsuccessful approach: Sorting source names groups rows but changes the first-seen order and within-source order.

Case contract

Rows are [source,text]. Return a list of groups in first-seen source order; each group preserves row order.

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):
    groups=[]; last=None
    for s,t in rows:
        if s!=last: groups.append([]); last=s
        groups[-1].append(t)
    return groups
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='z'+str(N); b='a'+str(N)
check('interleaved group', solve([[a,'1'],[b,'2'],[a,'3']]), [['1','3'],['2']])
check('first seen order', solve([[b,'x'],[a,'y']],), [['x'],['y']])
check('empty', solve([]), [])
check('one source', solve([[a,'x'],[a,'y']]), [['x','y']])
check('singleton', solve([[a,'x']]), [['x']])
check('three sources', solve([[a,'1'],[b,'2'],['c','3']]), [['1'],['2'],['3']])
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 group[['1'], ['2'], ['3']][['1', '3'], ['2']]Failed
first seen order[['x'], ['y']][['x'], ['y']]Passed
empty[][]Passed
one source[['x', 'y']][['x', 'y']]Passed
singleton[['x']][['x']]Passed
three sources[['1'], ['2'], ['3']][['1'], ['2'], ['3']]Passed

SHA-256 / ed54a4b767f0ea0a57fa16210446189ee2a20f24f2e02e5705dfabf8241cd1d7

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    d={}
    for s,t in rows: d.setdefault(s,[]).append(t)
    return [d[s] for s in sorted(d)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
a='z'+str(N); b='a'+str(N)
check('interleaved group', solve([[a,'1'],[b,'2'],[a,'3']]), [['1','3'],['2']])
check('first seen order', solve([[b,'x'],[a,'y']],), [['x'],['y']])
check('empty', solve([]), [])
check('one source', solve([[a,'x'],[a,'y']]), [['x','y']])
check('singleton', solve([[a,'x']]), [['x']])
check('three sources', solve([[a,'1'],[b,'2'],['c','3']]), [['1'],['2'],['3']])
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 group[['2'], ['1', '3']][['1', '3'], ['2']]Failed
first seen order[['x'], ['y']][['x'], ['y']]Passed
empty[][]Passed
one source[['x', 'y']][['x', 'y']]Passed
singleton[['x']][['x']]Passed
three sources[['2'], ['3'], ['1']][['1'], ['2'], ['3']]Failed

SHA-256 / ec0cd07a4517e631fd5c9022f9b4cd1484204a17072f3f12bd355a93205ad3a0

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

Case digest / ff5da8c5b4861bc3010ea91c4637ccf957f5a4d0af2f411a98803d25eba8bf68