{"abstract":"RAG assembly stops at the first over-budget chunk.","category":"RAG context assembly","checks":6,"contract":"Given ranked [text,cost] chunks, return texts in input order whose summed costs fit budget; skip oversized chunks and continue.","contract_signature":"chunks, budget","evaluation_group":"ragctx-rank-budget","failed_approach":"Filtering unaffordable chunks helps, but clipping accepted results to one chunk discards later fitting evidence.","family":"w3-rag-context-assembly-rank-prefix-budget","id":"FA-99541","implementations":{"attempt":{"sha256":"d726599b100e2424f119d14882dee8b503403790dbb817ec9c2917077129b618","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(chunks, budget):\n    out=[]; total=0\n    for text,cost in chunks:\n        if total+cost<=budget: out.append(text); total+=cost\n    return out[:1]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('skip costly lead', solve([['large',N+1],['small',1]],N), ['small'])\ncheck('both fit', solve([['a',1],['b',N]],N+1), ['a','b'])\ncheck('none fit', solve([['x',N+1]],N), [])\ncheck('empty', solve([],N), [])\ncheck('zero cost', solve([['z',0],['a',1]],1), ['z','a'])\ncheck('later after skip', solve([['x',N+2],['y',N]],N), ['y'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"84a470dd7610e38548af446d6efd071805cf491005aa061169fa4d38e383d8d9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(chunks, budget):\n    out=[]; total=0\n    for text,cost in chunks:\n        if total+cost>budget: break\n        out.append(text); total+=cost\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('skip costly lead', solve([['large',N+1],['small',1]],N), ['small'])\ncheck('both fit', solve([['a',1],['b',N]],N+1), ['a','b'])\ncheck('none fit', solve([['x',N+1]],N), [])\ncheck('empty', solve([],N), [])\ncheck('zero cost', solve([['z',0],['a',1]],1), ['z','a'])\ncheck('later after skip', solve([['x',N+2],['y',N]],N), ['y'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-rag-context-assembly-rank-prefix-budget","generated_at":"2026-09-30T16:48:25.347800+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic evidence assembly model makes context budgeting behavior inspectable.","root_cause":"The loop treats the first candidate that exceeds remaining capacity as the end of the ranked list.","sha256":"ba78abdf10a752a1c10e0d8d9a9add5188af5e21732107b3ffd5d77ce2945815","title":"RAG assembly stops at the first over-budget chunk · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":27.143,"exit_code":1,"observations":[{"actual":["small"],"check":"skip costly lead","expected":["small"],"passed":true},{"actual":["a"],"check":"both fit","expected":["a","b"],"passed":false},{"actual":[],"check":"none fit","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["z"],"check":"zero cost","expected":["z","a"],"passed":false},{"actual":["y"],"check":"later after skip","expected":["y"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"skip costly lead\", \"actual\": [\"small\"], \"expected\": [\"small\"], \"passed\": true}, {\"check\": \"both fit\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"none fit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero cost\", \"actual\": [\"z\"], \"expected\": [\"z\", \"a\"], \"passed\": false}, {\"check\": \"later after skip\", \"actual\": [\"y\"], \"expected\": [\"y\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":25.551,"exit_code":1,"observations":[{"actual":[],"check":"skip costly lead","expected":["small"],"passed":false},{"actual":["a","b"],"check":"both fit","expected":["a","b"],"passed":true},{"actual":[],"check":"none fit","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["z","a"],"check":"zero cost","expected":["z","a"],"passed":true},{"actual":[],"check":"later after skip","expected":["y"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"skip costly lead\", \"actual\": [], \"expected\": [\"small\"], \"passed\": false}, {\"check\": \"both fit\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"none fit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero cost\", \"actual\": [\"z\", \"a\"], \"expected\": [\"z\", \"a\"], \"passed\": true}, {\"check\": \"later after skip\", \"actual\": [], \"expected\": [\"y\"], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}