{"abstract":"Adjacent same-label spans remain fragmented.","category":"Annotation span alignment","checks":7,"contract":"Input spans are ordered [start,end,label]. Merge touching or overlapping spans with equal labels; preserve input order and keep different labels separate.","contract_signature":"spans","evaluation_group":"annotation-span-merge-adjacent-labels","failed_approach":"Merging all overlapping spans combines annotations whose labels differ.","family":"w3-annotation-span-alignment-merge-adjacent-labels","id":"FA-100171","implementations":{"attempt":{"sha256":"250437bc4b235225c46dfd15219dfc78f2b3d84bef37246860a95b9c7c4cdba6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans):\n    out=[]\n    for s,e,l in spans:\n     if out and s<=out[-1][1]: out[-1][1]=max(out[-1][1],e)\n     else: out.append([s,e,l])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('adjacent same label', solve([[0,N,'a'],[N,N+2,'a']]), [[0,N+2,'a']])\ncheck('gap retained', solve([[0,2,'a'],[3,5,'a']]), [[0,2,'a'],[3,5,'a']])\ncheck('different labels retained', solve([[0,3,'a'],[3,5,'b']]), [[0,3,'a'],[3,5,'b']])\ncheck('overlap same label', solve([[0,4,'a'],[2,6,'a']]), [[0,6,'a']])\ncheck('empty input', solve([]), [])\ncheck('singleton unchanged', solve([[N,N+1,'x']]), [[N,N+1,'x']])\ncheck('nested different label', solve([[0,8,'a'],[2,3,'b']]), [[0,8,'a'],[2,3,'b']])\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":"ba526f459a16b96b00fa8bb8f472cbff862df7363ac5b985c0f1402b6c32222e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans):\n    out=[]\n    for s,e,l in spans:\n     if out and out[-1][2]==l and s<out[-1][1]: out[-1][1]=max(out[-1][1],e)\n     else: out.append([s,e,l])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('adjacent same label', solve([[0,N,'a'],[N,N+2,'a']]), [[0,N+2,'a']])\ncheck('gap retained', solve([[0,2,'a'],[3,5,'a']]), [[0,2,'a'],[3,5,'a']])\ncheck('different labels retained', solve([[0,3,'a'],[3,5,'b']]), [[0,3,'a'],[3,5,'b']])\ncheck('overlap same label', solve([[0,4,'a'],[2,6,'a']]), [[0,6,'a']])\ncheck('empty input', solve([]), [])\ncheck('singleton unchanged', solve([[N,N+1,'x']]), [[N,N+1,'x']])\ncheck('nested different label', solve([[0,8,'a'],[2,3,'b']]), [[0,8,'a'],[2,3,'b']])\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":"Contracts use integer offsets, explicit edits, and supplied token boundaries; they do not define a tokenizer or production annotation format. 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-annotation-span-alignment-merge-adjacent-labels","generated_at":"2026-09-30T16:48:32.646853+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small offline annotation transformation keeps span coordinates explicit when text or token boundaries change.","root_cause":"The coalescer merges overlap but omits exactly adjacent intervals.","sha256":"acb4cab1603042f66ba368c0bdd1c8ff373f5427bffd32617f0ee51c1ca33a32","title":"Adjacent same-label spans remain fragmented · 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.485,"exit_code":1,"observations":[{"actual":[[0,3,"a"]],"check":"adjacent same label","expected":[[0,3,"a"]],"passed":true},{"actual":[[0,2,"a"],[3,5,"a"]],"check":"gap retained","expected":[[0,2,"a"],[3,5,"a"]],"passed":true},{"actual":[[0,5,"a"]],"check":"different labels retained","expected":[[0,3,"a"],[3,5,"b"]],"passed":false},{"actual":[[0,6,"a"]],"check":"overlap same label","expected":[[0,6,"a"]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[1,2,"x"]],"check":"singleton unchanged","expected":[[1,2,"x"]],"passed":true},{"actual":[[0,8,"a"]],"check":"nested different label","expected":[[0,8,"a"],[2,3,"b"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"adjacent same label\", \"actual\": [[0, 3, \"a\"]], \"expected\": [[0, 3, \"a\"]], \"passed\": true}, {\"check\": \"gap retained\", \"actual\": [[0, 2, \"a\"], [3, 5, \"a\"]], \"expected\": [[0, 2, \"a\"], [3, 5, \"a\"]], \"passed\": true}, {\"check\": \"different labels retained\", \"actual\": [[0, 5, \"a\"]], \"expected\": [[0, 3, \"a\"], [3, 5, \"b\"]], \"passed\": false}, {\"check\": \"overlap same label\", \"actual\": [[0, 6, \"a\"]], \"expected\": [[0, 6, \"a\"]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton unchanged\", \"actual\": [[1, 2, \"x\"]], \"expected\": [[1, 2, \"x\"]], \"passed\": true}, {\"check\": \"nested different label\", \"actual\": [[0, 8, \"a\"]], \"expected\": [[0, 8, \"a\"], [2, 3, \"b\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.305,"exit_code":1,"observations":[{"actual":[[0,1,"a"],[1,3,"a"]],"check":"adjacent same label","expected":[[0,3,"a"]],"passed":false},{"actual":[[0,2,"a"],[3,5,"a"]],"check":"gap retained","expected":[[0,2,"a"],[3,5,"a"]],"passed":true},{"actual":[[0,3,"a"],[3,5,"b"]],"check":"different labels retained","expected":[[0,3,"a"],[3,5,"b"]],"passed":true},{"actual":[[0,6,"a"]],"check":"overlap same label","expected":[[0,6,"a"]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[1,2,"x"]],"check":"singleton unchanged","expected":[[1,2,"x"]],"passed":true},{"actual":[[0,8,"a"],[2,3,"b"]],"check":"nested different label","expected":[[0,8,"a"],[2,3,"b"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"adjacent same label\", \"actual\": [[0, 1, \"a\"], [1, 3, \"a\"]], \"expected\": [[0, 3, \"a\"]], \"passed\": false}, {\"check\": \"gap retained\", \"actual\": [[0, 2, \"a\"], [3, 5, \"a\"]], \"expected\": [[0, 2, \"a\"], [3, 5, \"a\"]], \"passed\": true}, {\"check\": \"different labels retained\", \"actual\": [[0, 3, \"a\"], [3, 5, \"b\"]], \"expected\": [[0, 3, \"a\"], [3, 5, \"b\"]], \"passed\": true}, {\"check\": \"overlap same label\", \"actual\": [[0, 6, \"a\"]], \"expected\": [[0, 6, \"a\"]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton unchanged\", \"actual\": [[1, 2, \"x\"]], \"expected\": [[1, 2, \"x\"]], \"passed\": true}, {\"check\": \"nested different label\", \"actual\": [[0, 8, \"a\"], [2, 3, \"b\"]], \"expected\": [[0, 8, \"a\"], [2, 3, \"b\"]], \"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."}}