{"abstract":"Context misses metadata overhead for selected evidence.","category":"RAG context assembly","checks":6,"contract":"Rows are [id,text_cost]. Greedily select in order when text_cost plus wrapper fits remaining budget; return IDs.","contract_signature":"rows, budget, wrapper","evaluation_group":"ragctx-metadata-overhead","failed_approach":"Charging wrapper overhead only after selection can leave the returned context over budget.","family":"w3-rag-context-assembly-selected-set-overhead","id":"FA-99631","implementations":{"attempt":{"sha256":"af46815cfe6944652b94eac4cb9de0a03125929a8529d462bb8f417c88053dec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget, wrapper):\n    out=[]; used=0\n    for i,c in rows:\n        if used+c+wrapper<=budget: 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('wrapper excludes second', solve([['a',2],['b',1]],4,1), ['a'])\ncheck('exact overhead', solve([['a',2]],3,1), ['a'])\ncheck('zero wrapper', solve([['a',1],['b',1]],2,0), ['a','b'])\ncheck('empty', solve([],N,1), [])\ncheck('oversized first skip', solve([['a',N+1],['b',1]],N,0), ['b'])\ncheck('zero cost item', solve([['a',0]],1,1), ['a'])\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":"3c58fcff3f380da5b099240b27219a2921abf3a14808004830ffd22cad151d95","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget, wrapper):\n    out=[]; used=0\n    for i,c in rows:\n        if used+c<=budget: 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('wrapper excludes second', solve([['a',2],['b',1]],4,1), ['a'])\ncheck('exact overhead', solve([['a',2]],3,1), ['a'])\ncheck('zero wrapper', solve([['a',1],['b',1]],2,0), ['a','b'])\ncheck('empty', solve([],N,1), [])\ncheck('oversized first skip', solve([['a',N+1],['b',1]],N,0), ['b'])\ncheck('zero cost item', solve([['a',0]],1,1), ['a'])\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-selected-set-overhead","generated_at":"2026-09-30T16:48:26.270552+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 budget charges evidence text but ignores a fixed per-item metadata wrapper.","sha256":"c3f30596aa7396a637b733c486527fec011f7f2952b13db693750517b736740d","title":"Context misses metadata overhead for selected evidence · 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.167,"exit_code":1,"observations":[{"actual":["a","b"],"check":"wrapper excludes second","expected":["a"],"passed":false},{"actual":["a"],"check":"exact overhead","expected":["a"],"passed":true},{"actual":["a","b"],"check":"zero wrapper","expected":["a","b"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["b"],"check":"oversized first skip","expected":["b"],"passed":true},{"actual":["a"],"check":"zero cost item","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapper excludes second\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"exact overhead\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"zero wrapper\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"oversized first skip\", \"actual\": [\"b\"], \"expected\": [\"b\"], \"passed\": true}, {\"check\": \"zero cost item\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":32.305,"exit_code":1,"observations":[{"actual":["a","b"],"check":"wrapper excludes second","expected":["a"],"passed":false},{"actual":["a"],"check":"exact overhead","expected":["a"],"passed":true},{"actual":["a","b"],"check":"zero wrapper","expected":["a","b"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["b"],"check":"oversized first skip","expected":["b"],"passed":true},{"actual":["a"],"check":"zero cost item","expected":["a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapper excludes second\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"exact overhead\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"zero wrapper\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"oversized first skip\", \"actual\": [\"b\"], \"expected\": [\"b\"], \"passed\": true}, {\"check\": \"zero cost item\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"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."}}