{"abstract":"A feasible context contains fewer complete chunks than possible.","category":"RAG context assembly","checks":6,"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.","contract_signature":"rows, budget","evaluation_group":"ragctx-maximum-cardinality","failed_approach":"Taking the cheapest chunks greedily may return a maximum-size set in the wrong priority order.","family":"w3-rag-context-assembly-maximum-chunks-under-budget","id":"FA-99636","implementations":{"attempt":{"sha256":"1a7aca8241855e1e563c79469e7995fa6d71575a9b64b3a8184701e06b6efc70","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget):\n    chosen=[]; used=0\n    for i,c in sorted(rows,key=lambda r:r[1]):\n        if used+c<=budget: chosen.append(i); used+=c\n    return chosen\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('maximum count over costly lead', solve([['a',N+3],['b',N],['c',2]],N+2), ['b','c'])\ncheck('stable priority among equal counts', solve([['a',2],['b',1],['c',2],['d',1]],3), ['a','b'])\ncheck('all fit', solve([['x',1],['y',1]],2), ['x','y'])\ncheck('empty', solve([],N), [])\ncheck('zero budget', solve([['x',0],['y',1]],0), ['x'])\ncheck('none feasible except empty', solve([['x',N+1]],N), [])\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":"f419a483fd851015a4208687837a97b9e4659ff823bb7ad00be0a6907c064651","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget):\n    out=[]; used=0\n    for i,c in rows:\n        if used+c>budget: break\n        out.append(i); used+=c\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('maximum count over costly lead', solve([['a',N+3],['b',N],['c',2]],N+2), ['b','c'])\ncheck('stable priority among equal counts', solve([['a',2],['b',1],['c',2],['d',1]],3), ['a','b'])\ncheck('all fit', solve([['x',1],['y',1]],2), ['x','y'])\ncheck('empty', solve([],N), [])\ncheck('zero budget', solve([['x',0],['y',1]],0), ['x'])\ncheck('none feasible except empty', solve([['x',N+1]],N), [])\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-maximum-chunks-under-budget","generated_at":"2026-09-30T16:48:26.298628+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 implementation commits to a priority prefix and stops at the first non-fitting chunk without comparing feasible subsets by count.","sha256":"cfc5b04c68f7b6344af37d8e85cb8dbb7548a99cdbf9ad097143126db8f1a4de","title":"A feasible context contains fewer complete chunks than possible · 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":28.148,"exit_code":1,"observations":[{"actual":["b","c"],"check":"maximum count over costly lead","expected":["b","c"],"passed":true},{"actual":["b","d"],"check":"stable priority among equal counts","expected":["a","b"],"passed":false},{"actual":["x","y"],"check":"all fit","expected":["x","y"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x"],"check":"zero budget","expected":["x"],"passed":true},{"actual":[],"check":"none feasible except empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"maximum count over costly lead\", \"actual\": [\"b\", \"c\"], \"expected\": [\"b\", \"c\"], \"passed\": true}, {\"check\": \"stable priority among equal counts\", \"actual\": [\"b\", \"d\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"all fit\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero budget\", \"actual\": [\"x\"], \"expected\": [\"x\"], \"passed\": true}, {\"check\": \"none feasible except empty\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.644,"exit_code":1,"observations":[{"actual":[],"check":"maximum count over costly lead","expected":["b","c"],"passed":false},{"actual":["a","b"],"check":"stable priority among equal counts","expected":["a","b"],"passed":true},{"actual":["x","y"],"check":"all fit","expected":["x","y"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x"],"check":"zero budget","expected":["x"],"passed":true},{"actual":[],"check":"none feasible except empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"maximum count over costly lead\", \"actual\": [], \"expected\": [\"b\", \"c\"], \"passed\": false}, {\"check\": \"stable priority among equal counts\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"all fit\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"y\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero budget\", \"actual\": [\"x\"], \"expected\": [\"x\"], \"passed\": true}, {\"check\": \"none feasible except empty\", \"actual\": [], \"expected\": [], \"passed\": true}], \"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."}}