FAILURE MAP
← Case archive

FA-99551 / RAG context assembly / Open access

Context assembly omits separator tokens from its budget · case 01

Context assembly omits separator tokens from its budget.

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

ROOT CAUSE

Chunk costs are added without accounting for separators inserted between chunks.

THE FAILURE

Chunk costs are added without accounting for separators inserted between chunks.

Unsuccessful approach: Charging a separator after every chunk also charges a nonexistent trailing boundary.

Case contract

Select the longest input prefix fitting budget; each chunk has cost and each inter-chunk separator costs sep. Return texts.

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, budget, sep):
    out=[]; used=0
    for text,cost in chunks:
        if used+cost>budget: break
        out.append(text); used+=cost
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separator blocks second', solve([['a',N],['b',1]],N+1,1), ['a'])
check('exact with boundary', solve([['a',1],['b',1]],3,1), ['a','b'])
check('single no separator', solve([['a',N]],N,2), ['a'])
check('empty', solve([],N,1), [])
check('zero costs', solve([['a',0],['b',0]],1,1), ['a','b'])
check('first too large', solve([['x',N+1]],N,1), [])
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
separator blocks second['a', 'b']['a']Failed
exact with boundary['a', 'b']['a', 'b']Passed
single no separator['a']['a']Passed
empty[][]Passed
zero costs['a', 'b']['a', 'b']Passed
first too large[][]Passed

SHA-256 / fa1606fcdad0d0ee7639aeb366672c22294958f5f03dcd7242088a7422bdb6bd

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(chunks, budget, sep):
    out=[]; used=0
    for text,cost in chunks:
        if used+cost+sep>budget: break
        out.append(text); used+=cost+sep
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separator blocks second', solve([['a',N],['b',1]],N+1,1), ['a'])
check('exact with boundary', solve([['a',1],['b',1]],3,1), ['a','b'])
check('single no separator', solve([['a',N]],N,2), ['a'])
check('empty', solve([],N,1), [])
check('zero costs', solve([['a',0],['b',0]],1,1), ['a','b'])
check('first too large', solve([['x',N+1]],N,1), [])
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
separator blocks second['a']['a']Passed
exact with boundary['a']['a', 'b']Failed
single no separator[]['a']Failed
empty[][]Passed
zero costs['a']['a', 'b']Failed
first too large[][]Passed

SHA-256 / feab9a9e4bb22a03013760d222ed3dca5588a17b4f56a89d1395d0d7086c359a

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

Case digest / 164b0e56ffbac8d8d580c00fbce36eab747de571c833c6fa8a21e54d4931b3fa