{"abstract":"Leading whitespace trim leaves annotation offsets stale.","category":"Annotation span alignment","checks":7,"contract":"Trim k characters from the front. Keep spans with end>k, clip start to k, and rebase surviving endpoints by k.","contract_signature":"spans, k","evaluation_group":"annotation-span-trim-leading-whitespace","failed_approach":"Subtracting the trim count from both endpoints creates negative starts for clipped spans.","family":"w3-annotation-span-alignment-trim-leading-whitespace","id":"FA-100206","implementations":{"attempt":{"sha256":"d2751fee877940b8f20f5bce2ce8bc907860a6e41db08e220b8f61c1c40a16a4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans, k):\n    return [[s-k,e-k,l] for s,e,l in spans if e>k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('after trim', solve([[N+2,N+5,'a']],N), [[2,5,'a']])\ncheck('crosses trim point', solve([[N-2,N+2,'b']],N), [[0,2,'b']])\ncheck('fully trimmed', solve([[0,N,'c']],N), [])\ncheck('touch point empty', solve([[N,N+2,'d']],N), [[0,2,'d']])\ncheck('empty input', solve([],N), [])\ncheck('zero trim', solve([[1,3,'x']],0), [[1,3,'x']])\ncheck('span begins at new origin', solve([[N,N+1,'x']],N), [[0,1,'x']])\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":"2c6090aade7d8d6d2e76797f3c9c108318fef5a142f296aed6dab23f8a08f3bb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(spans, k):\n    return [[s,e,l] for s,e,l in spans if e>k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('after trim', solve([[N+2,N+5,'a']],N), [[2,5,'a']])\ncheck('crosses trim point', solve([[N-2,N+2,'b']],N), [[0,2,'b']])\ncheck('fully trimmed', solve([[0,N,'c']],N), [])\ncheck('touch point empty', solve([[N,N+2,'d']],N), [[0,2,'d']])\ncheck('empty input', solve([],N), [])\ncheck('zero trim', solve([[1,3,'x']],0), [[1,3,'x']])\ncheck('span begins at new origin', solve([[N,N+1,'x']],N), [[0,1,'x']])\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-trim-leading-whitespace","generated_at":"2026-09-30T16:48:33.101628+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":"Text trimming removes characters but associated spans keep their source offsets.","sha256":"92c4260d36cef3c15327772a39715a8997960c692f3e55822cb3b508443f2967","title":"Leading whitespace trim leaves annotation offsets stale · 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.761,"exit_code":1,"observations":[{"actual":[[2,5,"a"]],"check":"after trim","expected":[[2,5,"a"]],"passed":true},{"actual":[[-2,2,"b"]],"check":"crosses trim point","expected":[[0,2,"b"]],"passed":false},{"actual":[],"check":"fully trimmed","expected":[],"passed":true},{"actual":[[0,2,"d"]],"check":"touch point empty","expected":[[0,2,"d"]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[1,3,"x"]],"check":"zero trim","expected":[[1,3,"x"]],"passed":true},{"actual":[[0,1,"x"]],"check":"span begins at new origin","expected":[[0,1,"x"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"after trim\", \"actual\": [[2, 5, \"a\"]], \"expected\": [[2, 5, \"a\"]], \"passed\": true}, {\"check\": \"crosses trim point\", \"actual\": [[-2, 2, \"b\"]], \"expected\": [[0, 2, \"b\"]], \"passed\": false}, {\"check\": \"fully trimmed\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"touch point empty\", \"actual\": [[0, 2, \"d\"]], \"expected\": [[0, 2, \"d\"]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero trim\", \"actual\": [[1, 3, \"x\"]], \"expected\": [[1, 3, \"x\"]], \"passed\": true}, {\"check\": \"span begins at new origin\", \"actual\": [[0, 1, \"x\"]], \"expected\": [[0, 1, \"x\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.335,"exit_code":1,"observations":[{"actual":[[3,6,"a"]],"check":"after trim","expected":[[2,5,"a"]],"passed":false},{"actual":[[-1,3,"b"]],"check":"crosses trim point","expected":[[0,2,"b"]],"passed":false},{"actual":[],"check":"fully trimmed","expected":[],"passed":true},{"actual":[[1,3,"d"]],"check":"touch point empty","expected":[[0,2,"d"]],"passed":false},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[1,3,"x"]],"check":"zero trim","expected":[[1,3,"x"]],"passed":true},{"actual":[[1,2,"x"]],"check":"span begins at new origin","expected":[[0,1,"x"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"after trim\", \"actual\": [[3, 6, \"a\"]], \"expected\": [[2, 5, \"a\"]], \"passed\": false}, {\"check\": \"crosses trim point\", \"actual\": [[-1, 3, \"b\"]], \"expected\": [[0, 2, \"b\"]], \"passed\": false}, {\"check\": \"fully trimmed\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"touch point empty\", \"actual\": [[1, 3, \"d\"]], \"expected\": [[0, 2, \"d\"]], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero trim\", \"actual\": [[1, 3, \"x\"]], \"expected\": [[1, 3, \"x\"]], \"passed\": true}, {\"check\": \"span begins at new origin\", \"actual\": [[1, 2, \"x\"]], \"expected\": [[0, 1, \"x\"]], \"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."}}