{"abstract":"Token index maps to the wrong character boundary.","category":"Annotation span alignment","checks":7,"contract":"Given token intervals [start,end), return the start offset at index i; index equal to token count maps to final end; invalid indices return -1.","contract_signature":"tokens, i","evaluation_group":"annotation-span-token-prefix-offset","failed_approach":"Using the previous token end works only when adjacent tokens have no gap.","family":"w3-annotation-span-alignment-token-prefix-offset","id":"FA-100156","implementations":{"attempt":{"sha256":"6bf3e4322bad8535d763993042d31e26d78800b8292693a7fafb1380e30b9e7f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, i):\n    return tokens[i-1][1] if i>0 and i<=len(tokens) else (-1 if i<0 or i>len(tokens) else (tokens[0][0] if tokens else 0))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('first token', solve([[N,N+2],[N+5,N+7]],0), N)\ncheck('second token after gap', solve([[0,2],[5,8]],1), 5)\ncheck('terminal boundary', solve([[1,3],[6,9]],2), 9)\ncheck('negative index', solve([[1,3]],-1), -1)\ncheck('past terminal', solve([[1,3]],2), -1)\ncheck('empty token list origin', solve([],0), 0)\ncheck('singleton start', solve([[N,N+1]],0), N)\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":"bdad176652b688d09953ed37baa3eee4ee2bd31912eaf027cbca061e9e9df007","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tokens, i):\n    return tokens[i][0] if i<len(tokens) else (tokens[-1][1] if tokens else 0)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('first token', solve([[N,N+2],[N+5,N+7]],0), N)\ncheck('second token after gap', solve([[0,2],[5,8]],1), 5)\ncheck('terminal boundary', solve([[1,3],[6,9]],2), 9)\ncheck('negative index', solve([[1,3]],-1), -1)\ncheck('past terminal', solve([[1,3]],2), -1)\ncheck('empty token list origin', solve([],0), 0)\ncheck('singleton start', solve([[N,N+1]],0), N)\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-token-prefix-offset","generated_at":"2026-09-30T16:48:32.200101+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":"Token offsets are calculated from token widths without intervening separators.","sha256":"0a851c6a111adb21b5d25aca7dd01a795796fecb1127de0ced4e3a86099cfe72","title":"Token index maps to the wrong character boundary · 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.584,"exit_code":1,"observations":[{"actual":1,"check":"first token","expected":1,"passed":true},{"actual":2,"check":"second token after gap","expected":5,"passed":false},{"actual":9,"check":"terminal boundary","expected":9,"passed":true},{"actual":-1,"check":"negative index","expected":-1,"passed":true},{"actual":-1,"check":"past terminal","expected":-1,"passed":true},{"actual":0,"check":"empty token list origin","expected":0,"passed":true},{"actual":1,"check":"singleton start","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"first token\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"second token after gap\", \"actual\": 2, \"expected\": 5, \"passed\": false}, {\"check\": \"terminal boundary\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"negative index\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"past terminal\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"empty token list origin\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"singleton start\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.861,"exit_code":1,"observations":[{"actual":1,"check":"first token","expected":1,"passed":true},{"actual":5,"check":"second token after gap","expected":5,"passed":true},{"actual":9,"check":"terminal boundary","expected":9,"passed":true},{"actual":1,"check":"negative index","expected":-1,"passed":false},{"actual":3,"check":"past terminal","expected":-1,"passed":false},{"actual":0,"check":"empty token list origin","expected":0,"passed":true},{"actual":1,"check":"singleton start","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"first token\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"second token after gap\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"terminal boundary\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"negative index\", \"actual\": 1, \"expected\": -1, \"passed\": false}, {\"check\": \"past terminal\", \"actual\": 3, \"expected\": -1, \"passed\": false}, {\"check\": \"empty token list origin\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"singleton start\", \"actual\": 1, \"expected\": 1, \"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."}}