{"abstract":"Token coverage ratio counts only fully contained tokens.","category":"Annotation span alignment","checks":7,"contract":"Return covered token-character width divided by total token width, rounded to six decimal places; return 0.0 when total width is zero.","contract_signature":"tokens, start, end","evaluation_group":"annotation-span-overlap-token-ratio","failed_approach":"Capping coverage by token and span lengths ignores their relative positions and overstates disjoint coverage.","family":"w3-annotation-span-alignment-overlap-token-ratio","id":"FA-100231","implementations":{"attempt":{"sha256":"320082769ff4f720b2d1b50f22ea62ea14e3867ee3f58a6931ff08252cc1bd30","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, start, end):\n    total=sum(b-a for a,b in tokens); covered=sum(min(b-a,max(0,end-start)) for a,b in tokens); return round(covered/total,6) if total else 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial tokens', solve([[0,4],[5,9]],3,6), 0.25)\ncheck('full coverage', solve([[0,2],[2,5]],0,5), 1.0)\ncheck('no overlap', solve([[0,2]],2,4), 0.0)\ncheck('empty tokens', solve([],0,3), 0.0)\ncheck('zero width tokens', solve([[N,N]],N,N+1), 0.0)\ncheck('half one token', solve([[0,4]],1,3), 0.5)\ncheck('span crosses gap', solve([[0,2],[5,7]],1,6), 0.5)\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":"c9b1bc72aca703abe2f92282e072e98f81d011d95760d92ed710a611494abcc7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, start, end):\n    total=sum(b-a for a,b in tokens); covered=sum(b-a for a,b in tokens if start<=a and b<=end); return round(covered/total,6) if total else 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial tokens', solve([[0,4],[5,9]],3,6), 0.25)\ncheck('full coverage', solve([[0,2],[2,5]],0,5), 1.0)\ncheck('no overlap', solve([[0,2]],2,4), 0.0)\ncheck('empty tokens', solve([],0,3), 0.0)\ncheck('zero width tokens', solve([[N,N]],N,N+1), 0.0)\ncheck('half one token', solve([[0,4]],1,3), 0.5)\ncheck('span crosses gap', solve([[0,2],[5,7]],1,6), 0.5)\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-overlap-token-ratio","generated_at":"2026-09-30T16:48:33.099174+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":"Coverage numerator includes only tokens wholly contained in the annotation, excluding partial overlaps.","sha256":"8fa47f89e06fd96568832da21410d688acb1d9d01336ff383054cde269af8769","title":"Token coverage ratio counts only fully contained tokens · 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":27.298,"exit_code":1,"observations":[{"actual":0.75,"check":"partial tokens","expected":0.25,"passed":false},{"actual":1.0,"check":"full coverage","expected":1.0,"passed":true},{"actual":1.0,"check":"no overlap","expected":0.0,"passed":false},{"actual":0.0,"check":"empty tokens","expected":0.0,"passed":true},{"actual":0.0,"check":"zero width tokens","expected":0.0,"passed":true},{"actual":0.5,"check":"half one token","expected":0.5,"passed":true},{"actual":1.0,"check":"span crosses gap","expected":0.5,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial tokens\", \"actual\": 0.75, \"expected\": 0.25, \"passed\": false}, {\"check\": \"full coverage\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"no overlap\", \"actual\": 1.0, \"expected\": 0.0, \"passed\": false}, {\"check\": \"empty tokens\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"zero width tokens\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"half one token\", \"actual\": 0.5, \"expected\": 0.5, \"passed\": true}, {\"check\": \"span crosses gap\", \"actual\": 1.0, \"expected\": 0.5, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.374,"exit_code":1,"observations":[{"actual":0.0,"check":"partial tokens","expected":0.25,"passed":false},{"actual":1.0,"check":"full coverage","expected":1.0,"passed":true},{"actual":0.0,"check":"no overlap","expected":0.0,"passed":true},{"actual":0.0,"check":"empty tokens","expected":0.0,"passed":true},{"actual":0.0,"check":"zero width tokens","expected":0.0,"passed":true},{"actual":0.0,"check":"half one token","expected":0.5,"passed":false},{"actual":0.0,"check":"span crosses gap","expected":0.5,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial tokens\", \"actual\": 0.0, \"expected\": 0.25, \"passed\": false}, {\"check\": \"full coverage\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"no overlap\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"empty tokens\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"zero width tokens\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"half one token\", \"actual\": 0.0, \"expected\": 0.5, \"passed\": false}, {\"check\": \"span crosses gap\", \"actual\": 0.0, \"expected\": 0.5, \"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."}}