{"abstract":"Document chunks are merged across an unrelated source.","category":"RAG context assembly","checks":6,"contract":"Rows are [source,text]. Return a list of groups in first-seen source order; each group preserves row order.","contract_signature":"rows","evaluation_group":"ragctx-source-grouping","failed_approach":"Sorting source names groups rows but changes the first-seen order and within-source order.","family":"w3-rag-context-assembly-source-contiguous-grouping","id":"FA-99616","implementations":{"attempt":{"sha256":"ec0cd07a4517e631fd5c9022f9b4cd1484204a17072f3f12bd355a93205ad3a0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    d={}\n    for s,t in rows: d.setdefault(s,[]).append(t)\n    return [d[s] for s in sorted(d)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='z'+str(N); b='a'+str(N)\ncheck('interleaved group', solve([[a,'1'],[b,'2'],[a,'3']]), [['1','3'],['2']])\ncheck('first seen order', solve([[b,'x'],[a,'y']],), [['x'],['y']])\ncheck('empty', solve([]), [])\ncheck('one source', solve([[a,'x'],[a,'y']]), [['x','y']])\ncheck('singleton', solve([[a,'x']]), [['x']])\ncheck('three sources', solve([[a,'1'],[b,'2'],['c','3']]), [['1'],['2'],['3']])\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":"ed54a4b767f0ea0a57fa16210446189ee2a20f24f2e02e5705dfabf8241cd1d7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    groups=[]; last=None\n    for s,t in rows:\n        if s!=last: groups.append([]); last=s\n        groups[-1].append(t)\n    return groups\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='z'+str(N); b='a'+str(N)\ncheck('interleaved group', solve([[a,'1'],[b,'2'],[a,'3']]), [['1','3'],['2']])\ncheck('first seen order', solve([[b,'x'],[a,'y']],), [['x'],['y']])\ncheck('empty', solve([]), [])\ncheck('one source', solve([[a,'x'],[a,'y']]), [['x','y']])\ncheck('singleton', solve([[a,'x']]), [['x']])\ncheck('three sources', solve([[a,'1'],[b,'2'],['c','3']]), [['1'],['2'],['3']])\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-source-contiguous-grouping","generated_at":"2026-09-30T16:48:26.270349+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":"Grouping uses a single last-document marker and fails to preserve all chunks belonging to a source.","sha256":"ff5da8c5b4861bc3010ea91c4637ccf957f5a4d0af2f411a98803d25eba8bf68","title":"Document chunks are merged across an unrelated source · 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.532,"exit_code":1,"observations":[{"actual":[["2"],["1","3"]],"check":"interleaved group","expected":[["1","3"],["2"]],"passed":false},{"actual":[["x"],["y"]],"check":"first seen order","expected":[["x"],["y"]],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["x","y"]],"check":"one source","expected":[["x","y"]],"passed":true},{"actual":[["x"]],"check":"singleton","expected":[["x"]],"passed":true},{"actual":[["2"],["3"],["1"]],"check":"three sources","expected":[["1"],["2"],["3"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved group\", \"actual\": [[\"2\"], [\"1\", \"3\"]], \"expected\": [[\"1\", \"3\"], [\"2\"]], \"passed\": false}, {\"check\": \"first seen order\", \"actual\": [[\"x\"], [\"y\"]], \"expected\": [[\"x\"], [\"y\"]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one source\", \"actual\": [[\"x\", \"y\"]], \"expected\": [[\"x\", \"y\"]], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[\"x\"]], \"expected\": [[\"x\"]], \"passed\": true}, {\"check\": \"three sources\", \"actual\": [[\"2\"], [\"3\"], [\"1\"]], \"expected\": [[\"1\"], [\"2\"], [\"3\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.028,"exit_code":1,"observations":[{"actual":[["1"],["2"],["3"]],"check":"interleaved group","expected":[["1","3"],["2"]],"passed":false},{"actual":[["x"],["y"]],"check":"first seen order","expected":[["x"],["y"]],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["x","y"]],"check":"one source","expected":[["x","y"]],"passed":true},{"actual":[["x"]],"check":"singleton","expected":[["x"]],"passed":true},{"actual":[["1"],["2"],["3"]],"check":"three sources","expected":[["1"],["2"],["3"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved group\", \"actual\": [[\"1\"], [\"2\"], [\"3\"]], \"expected\": [[\"1\", \"3\"], [\"2\"]], \"passed\": false}, {\"check\": \"first seen order\", \"actual\": [[\"x\"], [\"y\"]], \"expected\": [[\"x\"], [\"y\"]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one source\", \"actual\": [[\"x\", \"y\"]], \"expected\": [[\"x\", \"y\"]], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[\"x\"]], \"expected\": [[\"x\"]], \"passed\": true}, {\"check\": \"three sources\", \"actual\": [[\"1\"], [\"2\"], [\"3\"]], \"expected\": [[\"1\"], [\"2\"], [\"3\"]], \"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."}}