{"abstract":"The match-key completion transition produces an incorrect observable state.","category":"Autocomplete interactions","checks":22,"contract":"This controlled ASCII picker normalizes lookup by stripping outer whitespace and lowercasing, while preserving exact user draft and canonical option labels for display and commit. Matching offsets apply to the normalized query only; a normalization-equivalent edit still advances the display epoch.","evaluation_group":"s3-autocomplete-query-display","failed_approach":"The attempted repair uses `False`, which still violates a normal or boundary completion fixture.","family":"s3-autocomplete-interactions-query-display-match-key","id":"FA-23211","implementations":{"attempt":{"sha256":"2209a7dfa272bea531ff34aa3449618e2cdee4b637f01052f6b7327d80922bac","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'lookup': return d['draft'].strip().lower()\n    if event == 'display': return d['draft']\n    if event == 'commit-label': return d['label']\n    if event == 'commit-id': return d['id']\n    if event == 'match-key': return False\n    if event == 'offset': return [d['prefix_space'],d['prefix_space']+len(d['normalized'])]\n    if event == 'display-epoch': return d['epoch']+1\n    if event == 'query-equivalent': return d['old']==d['normalized']\n    if event == 'caret-display': return d['caret']\n    if event == 'empty-query': return 'empty' if not d['normalized'] else 'typed'\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'draft':'  PeA  ','label':'Pear','id':'p1','normalized':'pea','prefix_space':2,'epoch':N,'old':'pea','result_query':'pea','caret':5}\nboundary = {'draft':'','label':'','id':'','normalized':'','prefix_space':0,'epoch':N,'old':'','result_query':'','caret':0}\ncheck('normal lookup', solve('lookup', normal), 'pea')\ncheck('boundary lookup', solve('lookup', boundary), '')\ncheck('normal display', solve('display', normal), '  PeA  ')\ncheck('boundary display', solve('display', boundary), '')\ncheck('normal commit-label', solve('commit-label', normal), 'Pear')\ncheck('boundary commit-label', solve('commit-label', boundary), '')\ncheck('normal commit-id', solve('commit-id', normal), 'p1')\ncheck('boundary commit-id', solve('commit-id', boundary), '')\ncheck('normal match-key', solve('match-key', normal), True)\ncheck('boundary match-key', solve('match-key', boundary), True)\ncheck('normal offset', solve('offset', normal), [2,5])\ncheck('boundary offset', solve('offset', boundary), [0,0])\ncheck('normal display-epoch', solve('display-epoch', normal), N+1)\ncheck('boundary display-epoch', solve('display-epoch', boundary), N+1)\ncheck('normal query-equivalent', solve('query-equivalent', normal), True)\ncheck('boundary query-equivalent', solve('query-equivalent', boundary), True)\ncheck('normal caret-display', solve('caret-display', normal), 5)\ncheck('boundary caret-display', solve('caret-display', boundary), 0)\ncheck('normal empty-query', solve('empty-query', normal), 'typed')\ncheck('boundary empty-query', solve('empty-query', boundary), 'empty')\nvariant = dict(normal, **{'draft':' '*N+'PEAR'+' '*N})\ncheck('variant query or selection payload', solve('lookup', variant), 'pear')\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":"bde2f4b1d10a140e58b24a9606a022a8a3ae4c865726b3e45a29552c78d61ae2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'lookup': return d['draft'].strip().lower()\n    if event == 'display': return d['draft']\n    if event == 'commit-label': return d['label']\n    if event == 'commit-id': return d['id']\n    if event == 'match-key': return d['result_query']==d['draft']\n    if event == 'offset': return [d['prefix_space'],d['prefix_space']+len(d['normalized'])]\n    if event == 'display-epoch': return d['epoch']+1\n    if event == 'query-equivalent': return d['old']==d['normalized']\n    if event == 'caret-display': return d['caret']\n    if event == 'empty-query': return 'empty' if not d['normalized'] else 'typed'\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'draft':'  PeA  ','label':'Pear','id':'p1','normalized':'pea','prefix_space':2,'epoch':N,'old':'pea','result_query':'pea','caret':5}\nboundary = {'draft':'','label':'','id':'','normalized':'','prefix_space':0,'epoch':N,'old':'','result_query':'','caret':0}\ncheck('normal lookup', solve('lookup', normal), 'pea')\ncheck('boundary lookup', solve('lookup', boundary), '')\ncheck('normal display', solve('display', normal), '  PeA  ')\ncheck('boundary display', solve('display', boundary), '')\ncheck('normal commit-label', solve('commit-label', normal), 'Pear')\ncheck('boundary commit-label', solve('commit-label', boundary), '')\ncheck('normal commit-id', solve('commit-id', normal), 'p1')\ncheck('boundary commit-id', solve('commit-id', boundary), '')\ncheck('normal match-key', solve('match-key', normal), True)\ncheck('boundary match-key', solve('match-key', boundary), True)\ncheck('normal offset', solve('offset', normal), [2,5])\ncheck('boundary offset', solve('offset', boundary), [0,0])\ncheck('normal display-epoch', solve('display-epoch', normal), N+1)\ncheck('boundary display-epoch', solve('display-epoch', boundary), N+1)\ncheck('normal query-equivalent', solve('query-equivalent', normal), True)\ncheck('boundary query-equivalent', solve('query-equivalent', boundary), True)\ncheck('normal caret-display', solve('caret-display', normal), 5)\ncheck('boundary caret-display', solve('caret-display', boundary), 0)\ncheck('normal empty-query', solve('empty-query', normal), 'typed')\ncheck('boundary empty-query', solve('empty-query', boundary), 'empty')\nvariant = dict(normal, **{'draft':' '*N+'PEAR'+' '*N})\ncheck('variant query or selection payload', solve('lookup', variant), 'pear')\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":"e1011903c77a7f2dd23116983bb8581562c25d3d682a4fd7e477381fa5590de1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(event, d):\n    if event == 'lookup': return d['draft'].strip().lower()\n    if event == 'display': return d['draft']\n    if event == 'commit-label': return d['label']\n    if event == 'commit-id': return d['id']\n    if event == 'match-key': return d['result_query']==d['normalized']\n    if event == 'offset': return [d['prefix_space'],d['prefix_space']+len(d['normalized'])]\n    if event == 'display-epoch': return d['epoch']+1\n    if event == 'query-equivalent': return d['old']==d['normalized']\n    if event == 'caret-display': return d['caret']\n    if event == 'empty-query': return 'empty' if not d['normalized'] else 'typed'\n    return {'unchanged': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nnormal = {'draft':'  PeA  ','label':'Pear','id':'p1','normalized':'pea','prefix_space':2,'epoch':N,'old':'pea','result_query':'pea','caret':5}\nboundary = {'draft':'','label':'','id':'','normalized':'','prefix_space':0,'epoch':N,'old':'','result_query':'','caret':0}\ncheck('normal lookup', solve('lookup', normal), 'pea')\ncheck('boundary lookup', solve('lookup', boundary), '')\ncheck('normal display', solve('display', normal), '  PeA  ')\ncheck('boundary display', solve('display', boundary), '')\ncheck('normal commit-label', solve('commit-label', normal), 'Pear')\ncheck('boundary commit-label', solve('commit-label', boundary), '')\ncheck('normal commit-id', solve('commit-id', normal), 'p1')\ncheck('boundary commit-id', solve('commit-id', boundary), '')\ncheck('normal match-key', solve('match-key', normal), True)\ncheck('boundary match-key', solve('match-key', boundary), True)\ncheck('normal offset', solve('offset', normal), [2,5])\ncheck('boundary offset', solve('offset', boundary), [0,0])\ncheck('normal display-epoch', solve('display-epoch', normal), N+1)\ncheck('boundary display-epoch', solve('display-epoch', boundary), N+1)\ncheck('normal query-equivalent', solve('query-equivalent', normal), True)\ncheck('boundary query-equivalent', solve('query-equivalent', boundary), True)\ncheck('normal caret-display', solve('caret-display', normal), 5)\ncheck('boundary caret-display', solve('caret-display', boundary), 0)\ncheck('normal empty-query', solve('empty-query', normal), 'typed')\ncheck('boundary empty-query', solve('empty-query', boundary), 'empty')\nvariant = dict(normal, **{'draft':' '*N+'PEAR'+' '*N})\ncheck('variant query or selection payload', solve('lookup', variant), 'pear')\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-query-display-match-key","generated_at":"2026-09-29T14:40:45.535259+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 match-key contract using `d['result_query']==d['normalized']`.","root_cause":"At query-display/match-key, the implementation evaluates `d['result_query']==d['draft']` instead of preserving the specified completion transition.","sha256":"c2c0e457b917e3b60ae2ff98fe1388ce60054b681b740644bd4d5a803d87c910","title":"Search normalization versus displayed autocomplete text: result query is compared with unnormalized visible draft · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.215,"exit_code":1,"observations":[{"actual":"pea","check":"normal lookup","expected":"pea","passed":true},{"actual":"","check":"boundary lookup","expected":"","passed":true},{"actual":"  PeA  ","check":"normal display","expected":"  PeA  ","passed":true},{"actual":"","check":"boundary display","expected":"","passed":true},{"actual":"Pear","check":"normal commit-label","expected":"Pear","passed":true},{"actual":"","check":"boundary commit-label","expected":"","passed":true},{"actual":"p1","check":"normal commit-id","expected":"p1","passed":true},{"actual":"","check":"boundary commit-id","expected":"","passed":true},{"actual":false,"check":"normal match-key","expected":true,"passed":false},{"actual":false,"check":"boundary match-key","expected":true,"passed":false},{"actual":[2,5],"check":"normal offset","expected":[2,5],"passed":true},{"actual":[0,0],"check":"boundary offset","expected":[0,0],"passed":true},{"actual":2,"check":"normal display-epoch","expected":2,"passed":true},{"actual":2,"check":"boundary display-epoch","expected":2,"passed":true},{"actual":true,"check":"normal query-equivalent","expected":true,"passed":true},{"actual":true,"check":"boundary query-equivalent","expected":true,"passed":true},{"actual":5,"check":"normal caret-display","expected":5,"passed":true},{"actual":0,"check":"boundary caret-display","expected":0,"passed":true},{"actual":"typed","check":"normal empty-query","expected":"typed","passed":true},{"actual":"empty","check":"boundary empty-query","expected":"empty","passed":true},{"actual":"pear","check":"variant query or selection payload","expected":"pear","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal lookup\", \"actual\": \"pea\", \"expected\": \"pea\", \"passed\": true}, {\"check\": \"boundary lookup\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal display\", \"actual\": \"  PeA  \", \"expected\": \"  PeA  \", \"passed\": true}, {\"check\": \"boundary display\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-label\", \"actual\": \"Pear\", \"expected\": \"Pear\", \"passed\": true}, {\"check\": \"boundary commit-label\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-id\", \"actual\": \"p1\", \"expected\": \"p1\", \"passed\": true}, {\"check\": \"boundary commit-id\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal match-key\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"boundary match-key\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"normal offset\", \"actual\": [2, 5], \"expected\": [2, 5], \"passed\": true}, {\"check\": \"boundary offset\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"normal display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"normal query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"boundary query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal caret-display\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"boundary caret-display\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal empty-query\", \"actual\": \"typed\", \"expected\": \"typed\", \"passed\": true}, {\"check\": \"boundary empty-query\", \"actual\": \"empty\", \"expected\": \"empty\", \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"pear\", \"expected\": \"pear\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.027,"exit_code":1,"observations":[{"actual":"pea","check":"normal lookup","expected":"pea","passed":true},{"actual":"","check":"boundary lookup","expected":"","passed":true},{"actual":"  PeA  ","check":"normal display","expected":"  PeA  ","passed":true},{"actual":"","check":"boundary display","expected":"","passed":true},{"actual":"Pear","check":"normal commit-label","expected":"Pear","passed":true},{"actual":"","check":"boundary commit-label","expected":"","passed":true},{"actual":"p1","check":"normal commit-id","expected":"p1","passed":true},{"actual":"","check":"boundary commit-id","expected":"","passed":true},{"actual":false,"check":"normal match-key","expected":true,"passed":false},{"actual":true,"check":"boundary match-key","expected":true,"passed":true},{"actual":[2,5],"check":"normal offset","expected":[2,5],"passed":true},{"actual":[0,0],"check":"boundary offset","expected":[0,0],"passed":true},{"actual":2,"check":"normal display-epoch","expected":2,"passed":true},{"actual":2,"check":"boundary display-epoch","expected":2,"passed":true},{"actual":true,"check":"normal query-equivalent","expected":true,"passed":true},{"actual":true,"check":"boundary query-equivalent","expected":true,"passed":true},{"actual":5,"check":"normal caret-display","expected":5,"passed":true},{"actual":0,"check":"boundary caret-display","expected":0,"passed":true},{"actual":"typed","check":"normal empty-query","expected":"typed","passed":true},{"actual":"empty","check":"boundary empty-query","expected":"empty","passed":true},{"actual":"pear","check":"variant query or selection payload","expected":"pear","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal lookup\", \"actual\": \"pea\", \"expected\": \"pea\", \"passed\": true}, {\"check\": \"boundary lookup\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal display\", \"actual\": \"  PeA  \", \"expected\": \"  PeA  \", \"passed\": true}, {\"check\": \"boundary display\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-label\", \"actual\": \"Pear\", \"expected\": \"Pear\", \"passed\": true}, {\"check\": \"boundary commit-label\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-id\", \"actual\": \"p1\", \"expected\": \"p1\", \"passed\": true}, {\"check\": \"boundary commit-id\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal match-key\", \"actual\": false, \"expected\": true, \"passed\": false}, {\"check\": \"boundary match-key\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal offset\", \"actual\": [2, 5], \"expected\": [2, 5], \"passed\": true}, {\"check\": \"boundary offset\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"normal display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"normal query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"boundary query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal caret-display\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"boundary caret-display\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal empty-query\", \"actual\": \"typed\", \"expected\": \"typed\", \"passed\": true}, {\"check\": \"boundary empty-query\", \"actual\": \"empty\", \"expected\": \"empty\", \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"pear\", \"expected\": \"pear\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.424,"exit_code":0,"observations":[{"actual":"pea","check":"normal lookup","expected":"pea","passed":true},{"actual":"","check":"boundary lookup","expected":"","passed":true},{"actual":"  PeA  ","check":"normal display","expected":"  PeA  ","passed":true},{"actual":"","check":"boundary display","expected":"","passed":true},{"actual":"Pear","check":"normal commit-label","expected":"Pear","passed":true},{"actual":"","check":"boundary commit-label","expected":"","passed":true},{"actual":"p1","check":"normal commit-id","expected":"p1","passed":true},{"actual":"","check":"boundary commit-id","expected":"","passed":true},{"actual":true,"check":"normal match-key","expected":true,"passed":true},{"actual":true,"check":"boundary match-key","expected":true,"passed":true},{"actual":[2,5],"check":"normal offset","expected":[2,5],"passed":true},{"actual":[0,0],"check":"boundary offset","expected":[0,0],"passed":true},{"actual":2,"check":"normal display-epoch","expected":2,"passed":true},{"actual":2,"check":"boundary display-epoch","expected":2,"passed":true},{"actual":true,"check":"normal query-equivalent","expected":true,"passed":true},{"actual":true,"check":"boundary query-equivalent","expected":true,"passed":true},{"actual":5,"check":"normal caret-display","expected":5,"passed":true},{"actual":0,"check":"boundary caret-display","expected":0,"passed":true},{"actual":"typed","check":"normal empty-query","expected":"typed","passed":true},{"actual":"empty","check":"boundary empty-query","expected":"empty","passed":true},{"actual":"pear","check":"variant query or selection payload","expected":"pear","passed":true},{"actual":{"unchanged":true},"check":"unknown completion event","expected":{"unchanged":true},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normal lookup\", \"actual\": \"pea\", \"expected\": \"pea\", \"passed\": true}, {\"check\": \"boundary lookup\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal display\", \"actual\": \"  PeA  \", \"expected\": \"  PeA  \", \"passed\": true}, {\"check\": \"boundary display\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-label\", \"actual\": \"Pear\", \"expected\": \"Pear\", \"passed\": true}, {\"check\": \"boundary commit-label\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal commit-id\", \"actual\": \"p1\", \"expected\": \"p1\", \"passed\": true}, {\"check\": \"boundary commit-id\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"normal match-key\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"boundary match-key\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal offset\", \"actual\": [2, 5], \"expected\": [2, 5], \"passed\": true}, {\"check\": \"boundary offset\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"normal display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary display-epoch\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"normal query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"boundary query-equivalent\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"normal caret-display\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"boundary caret-display\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal empty-query\", \"actual\": \"typed\", \"expected\": \"typed\", \"passed\": true}, {\"check\": \"boundary empty-query\", \"actual\": \"empty\", \"expected\": \"empty\", \"passed\": true}, {\"check\": \"variant query or selection payload\", \"actual\": \"pear\", \"expected\": \"pear\", \"passed\": true}, {\"check\": \"unknown completion event\", \"actual\": {\"unchanged\": true}, \"expected\": {\"unchanged\": true}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}