FAILURE MAP
← Case archive

FA-99591 / RAG context assembly / Open access

Context is built from earliest rather than newest evidence · case 01

Context is built from earliest rather than newest evidence.

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

ROOT CAUSE

A bounded window is filled from the beginning although the contract prioritizes recent chunks.

THE FAILURE

A bounded window is filled from the beginning although the contract prioritizes recent chunks.

Unsuccessful approach: Reversing the selected suffix also reverses within-window chronology.

Case contract

Rows are [text,cost] oldest to newest. Select a newest-first suffix fitting budget, then return selected rows oldest to newest.

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, budget):
    out=[]; used=0
    for t,c in rows:
        if used+c<=budget: out.append(t); used+=c
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent suffix', solve([['old',1],['mid',1],['new',1]],2), ['mid','new'])
check('expensive recent skipped', solve([['old',1],['new',N+1]],N), ['old'])
check('all fit', solve([['a',1],['b',1]],2), ['a','b'])
check('empty', solve([],N), [])
check('one row', solve([['x',N]],N), ['x'])
check('none fit', solve([['x',N+1]],N), [])
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
recent suffix['old', 'mid']['mid', 'new']Failed
expensive recent skipped['old']['old']Passed
all fit['a', 'b']['a', 'b']Passed
empty[][]Passed
one row['x']['x']Passed
none fit[][]Passed

SHA-256 / f8a16457e5893cdb053e4889b9215b05074164a3802a957a60bba73016708f0d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows, budget):
    out=[]; used=0
    for t,c in rows[::-1]:
        if used+c<=budget: out.append(t); used+=c
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent suffix', solve([['old',1],['mid',1],['new',1]],2), ['mid','new'])
check('expensive recent skipped', solve([['old',1],['new',N+1]],N), ['old'])
check('all fit', solve([['a',1],['b',1]],2), ['a','b'])
check('empty', solve([],N), [])
check('one row', solve([['x',N]],N), ['x'])
check('none fit', solve([['x',N+1]],N), [])
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
recent suffix['new', 'mid']['mid', 'new']Failed
expensive recent skipped['old']['old']Passed
all fit['b', 'a']['a', 'b']Failed
empty[][]Passed
one row['x']['x']Passed
none fit[][]Passed

SHA-256 / 62b04da63931ea0d62c5a448adfaeb44c3956612e10abc90bc0eabb1cd1d5c17

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

Case digest / 5cc29ffca98b2fb0472d04ec4bfbe1e80d227fdc7fce5b3b2bb92e02c2525499