FAILURE MAP
← Case archive

FA-99636 / RAG context assembly / Open access

A feasible context contains fewer complete chunks than possible · case 01

A feasible context contains fewer complete chunks than possible.

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

ROOT CAUSE

The implementation commits to a priority prefix and stops at the first non-fitting chunk without comparing feasible subsets by count.

THE FAILURE

The implementation commits to a priority prefix and stops at the first non-fitting chunk without comparing feasible subsets by count.

Unsuccessful approach: Taking the cheapest chunks greedily may return a maximum-size set in the wrong priority order.

Case contract

Rows are [id,cost]. Select the maximum number of whole chunks within budget; ties prefer the lexicographically earliest tuple of input positions. Return selected IDs in input 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, budget):
    out=[]; used=0
    for i,c in rows:
        if used+c>budget: break
        out.append(i); used+=c
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('maximum count over costly lead', solve([['a',N+3],['b',N],['c',2]],N+2), ['b','c'])
check('stable priority among equal counts', solve([['a',2],['b',1],['c',2],['d',1]],3), ['a','b'])
check('all fit', solve([['x',1],['y',1]],2), ['x','y'])
check('empty', solve([],N), [])
check('zero budget', solve([['x',0],['y',1]],0), ['x'])
check('none feasible except empty', 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
maximum count over costly lead[]['b', 'c']Failed
stable priority among equal counts['a', 'b']['a', 'b']Passed
all fit['x', 'y']['x', 'y']Passed
empty[][]Passed
zero budget['x']['x']Passed
none feasible except empty[][]Passed

SHA-256 / f419a483fd851015a4208687837a97b9e4659ff823bb7ad00be0a6907c064651

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows, budget):
    chosen=[]; used=0
    for i,c in sorted(rows,key=lambda r:r[1]):
        if used+c<=budget: chosen.append(i); used+=c
    return chosen
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('maximum count over costly lead', solve([['a',N+3],['b',N],['c',2]],N+2), ['b','c'])
check('stable priority among equal counts', solve([['a',2],['b',1],['c',2],['d',1]],3), ['a','b'])
check('all fit', solve([['x',1],['y',1]],2), ['x','y'])
check('empty', solve([],N), [])
check('zero budget', solve([['x',0],['y',1]],0), ['x'])
check('none feasible except empty', 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
maximum count over costly lead['b', 'c']['b', 'c']Passed
stable priority among equal counts['b', 'd']['a', 'b']Failed
all fit['x', 'y']['x', 'y']Passed
empty[][]Passed
zero budget['x']['x']Passed
none feasible except empty[][]Passed

SHA-256 / 1a7aca8241855e1e563c79469e7995fa6d71575a9b64b3a8184701e06b6efc70

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

Case digest / cfc5b04c68f7b6344af37d8e85cb8dbb7548a99cdbf9ad097143126db8f1a4de