{"abstract":"The span completion transition produces an incorrect observable state.","category":"Autocomplete interactions","checks":22,"contract":"A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.","evaluation_group":"s3-autocomplete-mention-completion","failed_approach":"The attempted repair uses `[d['start'],d['end']]`, which still violates a normal or boundary completion fixture.","family":"s3-autocomplete-interactions-mention-completion-span","id":"FA-22971","implementations":{"attempt":{"sha256":"beeb275bc37f92fa86778e92b07c1ec8f3b7ad4765a4b1df09f5d05ed4261350","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]\n    if event == 'identity': return d['id']\n    if event == 'trigger': return d['trigger']+d['label']\n    if event == 'query': return d['query']\n    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '\n    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])\n    if event == 'span': return [d['start'],d['end']]\n    if event == 'stale': return d['span_epoch']==d['epoch']\n    if event == 'tail': return d['text'][d['end']:]\n    if event == 'descriptor': return [d['trigger'],d['query']]\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}\nboundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}\ncheck('normal text', solve('text', normal), 'Hi @Alice now')\ncheck('boundary text', solve('text', boundary), '@')\ncheck('normal identity', solve('identity', normal), 'u'+str(N))\ncheck('boundary identity', solve('identity', boundary), '')\ncheck('normal trigger', solve('trigger', normal), '@Alice')\ncheck('boundary trigger', solve('trigger', boundary), '@')\ncheck('normal query', solve('query', normal), 'al')\ncheck('boundary query', solve('query', boundary), '')\ncheck('normal delimiter', solve('delimiter', normal), '')\ncheck('boundary delimiter', solve('delimiter', boundary), ' ')\ncheck('normal caret', solve('caret', normal), 9)\ncheck('boundary caret', solve('caret', boundary), 1)\ncheck('normal span', solve('span', normal), [3,9])\ncheck('boundary span', solve('span', boundary), [0,1])\ncheck('normal stale', solve('stale', normal), False)\ncheck('boundary stale', solve('stale', boundary), True)\ncheck('normal tail', solve('tail', normal), ' now')\ncheck('boundary tail', solve('tail', boundary), '')\ncheck('normal descriptor', solve('descriptor', normal), ['@','al'])\ncheck('boundary descriptor', solve('descriptor', boundary), ['@',''])\nvariant = dict(normal, **{'id':'person'+str(N)})\ncheck('variant query or selection payload', solve('identity', variant), 'person'+str(N))\ncheck('unknown completion event', solve('unrecognized', normal), {'unchanged': True})\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":"9bfc29bd13d468ef423b464087233eadeb7f6ef08ba81da017796b920449a62d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]\n    if event == 'identity': return d['id']\n    if event == 'trigger': return d['trigger']+d['label']\n    if event == 'query': return d['query']\n    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '\n    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])\n    if event == 'span': return [d['start'],len(d['text'])]\n    if event == 'stale': return d['span_epoch']==d['epoch']\n    if event == 'tail': return d['text'][d['end']:]\n    if event == 'descriptor': return [d['trigger'],d['query']]\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}\nboundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}\ncheck('normal text', solve('text', normal), 'Hi @Alice now')\ncheck('boundary text', solve('text', boundary), '@')\ncheck('normal identity', solve('identity', normal), 'u'+str(N))\ncheck('boundary identity', solve('identity', boundary), '')\ncheck('normal trigger', solve('trigger', normal), '@Alice')\ncheck('boundary trigger', solve('trigger', boundary), '@')\ncheck('normal query', solve('query', normal), 'al')\ncheck('boundary query', solve('query', boundary), '')\ncheck('normal delimiter', solve('delimiter', normal), '')\ncheck('boundary delimiter', solve('delimiter', boundary), ' ')\ncheck('normal caret', solve('caret', normal), 9)\ncheck('boundary caret', solve('caret', boundary), 1)\ncheck('normal span', solve('span', normal), [3,9])\ncheck('boundary span', solve('span', boundary), [0,1])\ncheck('normal stale', solve('stale', normal), False)\ncheck('boundary stale', solve('stale', boundary), True)\ncheck('normal tail', solve('tail', normal), ' now')\ncheck('boundary tail', solve('tail', boundary), '')\ncheck('normal descriptor', solve('descriptor', normal), ['@','al'])\ncheck('boundary descriptor', solve('descriptor', boundary), ['@',''])\nvariant = dict(normal, **{'id':'person'+str(N)})\ncheck('variant query or selection payload', solve('identity', variant), 'person'+str(N))\ncheck('unknown completion event', solve('unrecognized', normal), {'unchanged': True})\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"},"fixed":{"sha256":"485a99c33af736944bc8b12c2aca5d41ff951a888cb256a26b00b738ea6c8a47","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]\n    if event == 'identity': return d['id']\n    if event == 'trigger': return d['trigger']+d['label']\n    if event == 'query': return d['query']\n    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '\n    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])\n    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]\n    if event == 'stale': return d['span_epoch']==d['epoch']\n    if event == 'tail': return d['text'][d['end']:]\n    if event == 'descriptor': return [d['trigger'],d['query']]\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}\nboundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}\ncheck('normal text', solve('text', normal), 'Hi @Alice now')\ncheck('boundary text', solve('text', boundary), '@')\ncheck('normal identity', solve('identity', normal), 'u'+str(N))\ncheck('boundary identity', solve('identity', boundary), '')\ncheck('normal trigger', solve('trigger', normal), '@Alice')\ncheck('boundary trigger', solve('trigger', boundary), '@')\ncheck('normal query', solve('query', normal), 'al')\ncheck('boundary query', solve('query', boundary), '')\ncheck('normal delimiter', solve('delimiter', normal), '')\ncheck('boundary delimiter', solve('delimiter', boundary), ' ')\ncheck('normal caret', solve('caret', normal), 9)\ncheck('boundary caret', solve('caret', boundary), 1)\ncheck('normal span', solve('span', normal), [3,9])\ncheck('boundary span', solve('span', boundary), [0,1])\ncheck('normal stale', solve('stale', normal), False)\ncheck('boundary stale', solve('stale', boundary), True)\ncheck('normal tail', solve('tail', normal), ' now')\ncheck('boundary tail', solve('tail', boundary), '')\ncheck('normal descriptor', solve('descriptor', normal), ['@','al'])\ncheck('boundary descriptor', solve('descriptor', boundary), ['@',''])\nvariant = dict(normal, **{'id':'person'+str(N)})\ncheck('variant query or selection payload', solve('identity', variant), 'person'+str(N))\ncheck('unknown completion event', solve('unrecognized', normal), {'unchanged': True})\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":"Stipulated deterministic widget transition model; inputs are validated snapshots. It does not model browser event dispatch, network transport, or linguistic standards. 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":"s3-autocomplete-interactions-mention-completion-span","generated_at":"2026-09-29T14:40:43.431428+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Autocomplete couples draft text, suggestion identity and asynchronous presentation; this bounded lifecycle model isolates one observable interaction defect.","repair":"Implement the span contract using `[d['start'],d['start']+len(d['trigger'])+len(d['label'])]`.","root_cause":"At mention-completion/span, the implementation evaluates `[d['start'],len(d['text'])]` instead of preserving the specified completion transition.","sha256":"3f466a74c74681ff4eb1d739adb2b8e99efa40fc7cf88e8a7dd7a8bb8d7a1cb9","title":"Mention suggestion insertion: saved mention annotation includes following prose · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.55,"exit_code":1,"observations":[{"actual":"Hi @Alice now","check":"normal text","expected":"Hi @Alice now","passed":true},{"actual":"@","check":"boundary text","expected":"@","passed":true},{"actual":"u1","check":"normal identity","expected":"u1","passed":true},{"actual":"","check":"boundary identity","expected":"","passed":true},{"actual":"@Alice","check":"normal trigger","expected":"@Alice","passed":true},{"actual":"@","check":"boundary trigger","expected":"@","passed":true},{"actual":"al","check":"normal query","expected":"al","passed":true},{"actual":"","check":"boundary query","expected":"","passed":true},{"actual":"","check":"normal delimiter","expected":"","passed":true},{"actual":" ","check":"boundary delimiter","expected":" ","passed":true},{"actual":9,"check":"normal caret","expected":9,"passed":true},{"actual":1,"check":"boundary caret","expected":1,"passed":true},{"actual":[3,6],"check":"normal span","expected":[3,9],"passed":false},{"actual":[0,1],"check":"boundary span","expected":[0,1],"passed":true},{"actual":false,"check":"normal stale","expected":false,"passed":true},{"actual":true,"check":"boundary stale","expected":true,"passed":true},{"actual":" now","check":"normal tail","expected":" now","passed":true},{"actual":"","check":"boundary tail","expected":"","passed":true},{"actual":["@","al"],"check":"normal descriptor","expected":["@","al"],"passed":true},{"actual":["@",""],"check":"boundary descriptor","expected":["@",""],"passed":true},{"actual":"person1","check":"variant query or selection payload","expected":"person1","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal text\", \"actual\": \"Hi @Alice now\", \"expected\": \"Hi @Alice now\", \"passed\": true}, {\"check\": \"boundary text\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal identity\", \"actual\": \"u1\", \"expected\": \"u1\", \"passed\": true}, {\"check\": \"boundary identity\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal trigger\", \"actual\": \"@Alice\", \"expected\": \"@Alice\", \"passed\": true}, {\"check\": \"boundary trigger\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal query\", \"actual\": \"al\", \"expected\": \"al\", \"passed\": true}, {\"check\": \"boundary query\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal delimiter\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary delimiter\", \"actual\": \" \", \"expected\": \" \", \"passed\": true}, {\"check\": \"normal caret\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"boundary caret\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"normal span\", \"actual\": [3, 6], \"expected\": [3, 9], \"passed\": false}, {\"check\": \"boundary span\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"normal stale\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"boundary stale\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal tail\", \"actual\": \" now\", \"expected\": \" now\", \"passed\": true}, {\"check\": \"boundary tail\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal descriptor\", \"actual\": [\"@\", \"al\"], \"expected\": [\"@\", \"al\"], \"passed\": true}, {\"check\": \"boundary descriptor\", \"actual\": [\"@\", \"\"], \"expected\": [\"@\", \"\"], \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"person1\", \"expected\": \"person1\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.276,"exit_code":1,"observations":[{"actual":"Hi @Alice now","check":"normal text","expected":"Hi @Alice now","passed":true},{"actual":"@","check":"boundary text","expected":"@","passed":true},{"actual":"u1","check":"normal identity","expected":"u1","passed":true},{"actual":"","check":"boundary identity","expected":"","passed":true},{"actual":"@Alice","check":"normal trigger","expected":"@Alice","passed":true},{"actual":"@","check":"boundary trigger","expected":"@","passed":true},{"actual":"al","check":"normal query","expected":"al","passed":true},{"actual":"","check":"boundary query","expected":"","passed":true},{"actual":"","check":"normal delimiter","expected":"","passed":true},{"actual":" ","check":"boundary delimiter","expected":" ","passed":true},{"actual":9,"check":"normal caret","expected":9,"passed":true},{"actual":1,"check":"boundary caret","expected":1,"passed":true},{"actual":[3,10],"check":"normal span","expected":[3,9],"passed":false},{"actual":[0,1],"check":"boundary span","expected":[0,1],"passed":true},{"actual":false,"check":"normal stale","expected":false,"passed":true},{"actual":true,"check":"boundary stale","expected":true,"passed":true},{"actual":" now","check":"normal tail","expected":" now","passed":true},{"actual":"","check":"boundary tail","expected":"","passed":true},{"actual":["@","al"],"check":"normal descriptor","expected":["@","al"],"passed":true},{"actual":["@",""],"check":"boundary descriptor","expected":["@",""],"passed":true},{"actual":"person1","check":"variant query or selection payload","expected":"person1","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal text\", \"actual\": \"Hi @Alice now\", \"expected\": \"Hi @Alice now\", \"passed\": true}, {\"check\": \"boundary text\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal identity\", \"actual\": \"u1\", \"expected\": \"u1\", \"passed\": true}, {\"check\": \"boundary identity\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal trigger\", \"actual\": \"@Alice\", \"expected\": \"@Alice\", \"passed\": true}, {\"check\": \"boundary trigger\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal query\", \"actual\": \"al\", \"expected\": \"al\", \"passed\": true}, {\"check\": \"boundary query\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal delimiter\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary delimiter\", \"actual\": \" \", \"expected\": \" \", \"passed\": true}, {\"check\": \"normal caret\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"boundary caret\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"normal span\", \"actual\": [3, 10], \"expected\": [3, 9], \"passed\": false}, {\"check\": \"boundary span\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"normal stale\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"boundary stale\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal tail\", \"actual\": \" now\", \"expected\": \" now\", \"passed\": true}, {\"check\": \"boundary tail\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal descriptor\", \"actual\": [\"@\", \"al\"], \"expected\": [\"@\", \"al\"], \"passed\": true}, {\"check\": \"boundary descriptor\", \"actual\": [\"@\", \"\"], \"expected\": [\"@\", \"\"], \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"person1\", \"expected\": \"person1\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.117,"exit_code":0,"observations":[{"actual":"Hi @Alice now","check":"normal text","expected":"Hi @Alice now","passed":true},{"actual":"@","check":"boundary text","expected":"@","passed":true},{"actual":"u1","check":"normal identity","expected":"u1","passed":true},{"actual":"","check":"boundary identity","expected":"","passed":true},{"actual":"@Alice","check":"normal trigger","expected":"@Alice","passed":true},{"actual":"@","check":"boundary trigger","expected":"@","passed":true},{"actual":"al","check":"normal query","expected":"al","passed":true},{"actual":"","check":"boundary query","expected":"","passed":true},{"actual":"","check":"normal delimiter","expected":"","passed":true},{"actual":" ","check":"boundary delimiter","expected":" ","passed":true},{"actual":9,"check":"normal caret","expected":9,"passed":true},{"actual":1,"check":"boundary caret","expected":1,"passed":true},{"actual":[3,9],"check":"normal span","expected":[3,9],"passed":true},{"actual":[0,1],"check":"boundary span","expected":[0,1],"passed":true},{"actual":false,"check":"normal stale","expected":false,"passed":true},{"actual":true,"check":"boundary stale","expected":true,"passed":true},{"actual":" now","check":"normal tail","expected":" now","passed":true},{"actual":"","check":"boundary tail","expected":"","passed":true},{"actual":["@","al"],"check":"normal descriptor","expected":["@","al"],"passed":true},{"actual":["@",""],"check":"boundary descriptor","expected":["@",""],"passed":true},{"actual":"person1","check":"variant query or selection payload","expected":"person1","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal text\", \"actual\": \"Hi @Alice now\", \"expected\": \"Hi @Alice now\", \"passed\": true}, {\"check\": \"boundary text\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal identity\", \"actual\": \"u1\", \"expected\": \"u1\", \"passed\": true}, {\"check\": \"boundary identity\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal trigger\", \"actual\": \"@Alice\", \"expected\": \"@Alice\", \"passed\": true}, {\"check\": \"boundary trigger\", \"actual\": \"@\", \"expected\": \"@\", \"passed\": true}, {\"check\": \"normal query\", \"actual\": \"al\", \"expected\": \"al\", \"passed\": true}, {\"check\": \"boundary query\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal delimiter\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary delimiter\", \"actual\": \" \", \"expected\": \" \", \"passed\": true}, {\"check\": \"normal caret\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"boundary caret\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"normal span\", \"actual\": [3, 9], \"expected\": [3, 9], \"passed\": true}, {\"check\": \"boundary span\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"normal stale\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"boundary stale\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal tail\", \"actual\": \" now\", \"expected\": \" now\", \"passed\": true}, {\"check\": \"boundary tail\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal descriptor\", \"actual\": [\"@\", \"al\"], \"expected\": [\"@\", \"al\"], \"passed\": true}, {\"check\": \"boundary descriptor\", \"actual\": [\"@\", \"\"], \"expected\": [\"@\", \"\"], \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"person1\", \"expected\": \"person1\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}