{"abstract":"Context coverage interleaves document chunks without breaking prefixes.","category":"RAG context assembly","checks":6,"contract":"Rows are [document,ordinal,text,cost] with unique contiguous ordinals per document. In first-seen document order, emit one next chunk per pass; each document contributes only a contiguous ordinal prefix. Skip a document after its next chunk cannot fit the remaining budget. Return [document,ordinal,text] rows.","contract_signature":"rows, budget","evaluation_group":"ragctx-doc-prefix-round-robin","failed_approach":"Sorting each document’s chunks by cost can emit a continuation before its required prefix chunk.","family":"w3-rag-context-assembly-document-prefix-round-robin","id":"FA-99561","implementations":{"attempt":{"sha256":"03a5dcea5a4160d476de6d7a557dc39e8ac21a2e5d5ac5ba5170435d3e8b11cc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget):\n    groups={}; order=[]\n    for doc,ordinal,text,cost in rows:\n        if doc not in groups: groups[doc]=[]; order.append(doc)\n        groups[doc].append((ordinal,[doc,ordinal,text],cost))\n    for doc in order: groups[doc].sort(key=lambda row:row[2])\n    out=[]; used=0; pos={doc:0 for doc in order}\n    while True:\n        advanced=False\n        for doc in order:\n            if pos[doc]<len(groups[doc]):\n                advanced=True; ordinal,item,cost=groups[doc][pos[doc]]\n                if used+cost<=budget: out.append(item); used+=cost; pos[doc]+=1\n                else: pos[doc]=len(groups[doc])\n        if not advanced: break\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='doc'+str(N); b='other'+str(N)\ncheck('round robin keeps local order', solve([[a,0,'a0',1],[a,1,'a1',1],[b,0,'b0',1],[b,1,'b1',1]],3), [[a,0,'a0'],[b,0,'b0'],[a,1,'a1']])\ncheck('expensive prefix keeps dependency', solve([[a,0,'a0',3],[a,1,'a1',1],[b,0,'b0',1],[b,1,'b1',0]],4), [[a,0,'a0'],[b,0,'b0'],[b,1,'b1']])\ncheck('input order inside source is ordinal', solve([[a,1,'a1',1],[b,0,'b0',1],[a,0,'a0',1]],3), [[a,0,'a0'],[b,0,'b0'],[a,1,'a1']])\ncheck('empty', solve([],N), [])\ncheck('one document prefix', solve([[a,0,'a0',1],[a,1,'a1',1]],2), [[a,0,'a0'],[a,1,'a1']])\ncheck('zero budget blocks positive chunks', solve([[a,0,'a0',1],[b,0,'b0',1]],0), [])\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":"37f48bc313a13910788ca046689cdf4867ba530f9302cddd7451c34964b69669","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, budget):\n    groups={}; order=[]\n    for doc,ordinal,text,cost in rows:\n        if doc not in groups: groups[doc]=[]; order.append(doc)\n        groups[doc].append((ordinal,[doc,ordinal,text],cost))\n    return [item for doc in order for ordinal,item,cost in sorted(groups[doc])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='doc'+str(N); b='other'+str(N)\ncheck('round robin keeps local order', solve([[a,0,'a0',1],[a,1,'a1',1],[b,0,'b0',1],[b,1,'b1',1]],3), [[a,0,'a0'],[b,0,'b0'],[a,1,'a1']])\ncheck('expensive prefix keeps dependency', solve([[a,0,'a0',3],[a,1,'a1',1],[b,0,'b0',1],[b,1,'b1',0]],4), [[a,0,'a0'],[b,0,'b0'],[b,1,'b1']])\ncheck('input order inside source is ordinal', solve([[a,1,'a1',1],[b,0,'b0',1],[a,0,'a0',1]],3), [[a,0,'a0'],[b,0,'b0'],[a,1,'a1']])\ncheck('empty', solve([],N), [])\ncheck('one document prefix', solve([[a,0,'a0',1],[a,1,'a1',1]],2), [[a,0,'a0'],[a,1,'a1']])\ncheck('zero budget blocks positive chunks', solve([[a,0,'a0',1],[b,0,'b0',1]],0), [])\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-document-prefix-round-robin","generated_at":"2026-09-30T16:48:25.802431+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":"Assembly emits whole document groups, so later documents receive no context until an earlier source is exhausted.","sha256":"0108ffaa7ece852ed633339cc40216f8f1a12e8120287d9d2db85b40e7c37403","title":"Context coverage interleaves document chunks without breaking prefixes · 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":30.454,"exit_code":1,"observations":[{"actual":[["doc1",0,"a0"],["other1",0,"b0"],["doc1",1,"a1"]],"check":"round robin keeps local order","expected":[["doc1",0,"a0"],["other1",0,"b0"],["doc1",1,"a1"]],"passed":true},{"actual":[["doc1",1,"a1"],["other1",1,"b1"],["doc1",0,"a0"]],"check":"expensive prefix keeps dependency","expected":[["doc1",0,"a0"],["other1",0,"b0"],["other1",1,"b1"]],"passed":false},{"actual":[["doc1",1,"a1"],["other1",0,"b0"],["doc1",0,"a0"]],"check":"input order inside source is ordinal","expected":[["doc1",0,"a0"],["other1",0,"b0"],["doc1",1,"a1"]],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["doc1",0,"a0"],["doc1",1,"a1"]],"check":"one document prefix","expected":[["doc1",0,"a0"],["doc1",1,"a1"]],"passed":true},{"actual":[],"check":"zero budget blocks positive chunks","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"round robin keeps local order\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"doc1\", 1, \"a1\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"doc1\", 1, \"a1\"]], \"passed\": true}, {\"check\": \"expensive prefix keeps dependency\", \"actual\": [[\"doc1\", 1, \"a1\"], [\"other1\", 1, \"b1\"], [\"doc1\", 0, \"a0\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"other1\", 1, \"b1\"]], \"passed\": false}, {\"check\": \"input order inside source is ordinal\", \"actual\": [[\"doc1\", 1, \"a1\"], [\"other1\", 0, \"b0\"], [\"doc1\", 0, \"a0\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"doc1\", 1, \"a1\"]], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one document prefix\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"]], \"passed\": true}, {\"check\": \"zero budget blocks positive chunks\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.973,"exit_code":1,"observations":[{"actual":[["doc1",0,"a0"],["doc1",1,"a1"],["other1",0,"b0"],["other1",1,"b1"]],"check":"round robin keeps local order","expected":[["doc1",0,"a0"],["other1",0,"b0"],["doc1",1,"a1"]],"passed":false},{"actual":[["doc1",0,"a0"],["doc1",1,"a1"],["other1",0,"b0"],["other1",1,"b1"]],"check":"expensive prefix keeps dependency","expected":[["doc1",0,"a0"],["other1",0,"b0"],["other1",1,"b1"]],"passed":false},{"actual":[["doc1",0,"a0"],["doc1",1,"a1"],["other1",0,"b0"]],"check":"input order inside source is ordinal","expected":[["doc1",0,"a0"],["other1",0,"b0"],["doc1",1,"a1"]],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["doc1",0,"a0"],["doc1",1,"a1"]],"check":"one document prefix","expected":[["doc1",0,"a0"],["doc1",1,"a1"]],"passed":true},{"actual":[["doc1",0,"a0"],["other1",0,"b0"]],"check":"zero budget blocks positive chunks","expected":[],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"round robin keeps local order\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"], [\"other1\", 0, \"b0\"], [\"other1\", 1, \"b1\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"doc1\", 1, \"a1\"]], \"passed\": false}, {\"check\": \"expensive prefix keeps dependency\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"], [\"other1\", 0, \"b0\"], [\"other1\", 1, \"b1\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"other1\", 1, \"b1\"]], \"passed\": false}, {\"check\": \"input order inside source is ordinal\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"], [\"other1\", 0, \"b0\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"], [\"doc1\", 1, \"a1\"]], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one document prefix\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"]], \"expected\": [[\"doc1\", 0, \"a0\"], [\"doc1\", 1, \"a1\"]], \"passed\": true}, {\"check\": \"zero budget blocks positive chunks\", \"actual\": [[\"doc1\", 0, \"a0\"], [\"other1\", 0, \"b0\"]], \"expected\": [], \"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."}}