FAILURE MAP
← Case archive

FA-32276 / Keyboard interactions / Open access

Deferred short shortcut versus longer key sequence: Mismatch retry loses the current key or retries the already failed prefix · case 01

The event trace violates the retry current rule and produces incorrect keyboard state or command output.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Mismatch retry loses the current key or retries the already failed prefix.

THE FAILURE

Mismatch retry loses the current key or retries the already failed prefix.

Unsuccessful approach: The partial repair changes this transition to candidate=buffer+[key] candidates, which still violates the model contract on the explicit regression traces.

Case contract

Case [bindings,timeout,events]. Binding [nonempty_key_sequence,action] has unique sequence. Events [kind,key,time]. Down extends prefix. Exact match with longer candidates is delayed until deadline; exact unambiguous match dispatches immediately. Tick or next event at deadline emits pending exact match and clears prefix. Mismatch dispatches pending match then retries only current key as fresh prefix. Cancel drops pending without dispatch. Return [action,time] dispatches,buffer,pending action,deadline. Inputs are finite ordered event traces; return the stated deterministic state. Batch entries are independent. N varies the number of independent input transactions.

Why this case matters

Controlled keyboard event processing model for debugging application event logic.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cases):
    def run(c):
        bindings,timeout,events=c
        buffer=[]; pending=None; deadline=None; out=[]
        for kind,key,now in events:
            if kind=='cancel':
                buffer=[]; pending=None; deadline=None
                continue
            if deadline is not None and now>=deadline:
                if pending is not None: out.append([pending,deadline])
                buffer=[]; pending=None; deadline=None
            if kind!='down': continue
            candidate=buffer+[key]
            candidates=[b for b in bindings if b[0][:len(candidate)]==candidate]
            if not candidates:
                if pending is not None: out.append([pending,now])
                candidate=[]
                candidates=[b for b in bindings if b[0][:1]==candidate]
                pending=None
            buffer=candidate if candidates else []
            exact=[b for b in candidates if len(b[0])==len(buffer)]
            longer=[b for b in candidates if len(b[0])>len(buffer)]
            if exact and not longer:
                out.append([exact[0][1],now])
                buffer=[]; pending=None; deadline=None
            else:
                pending=exact[0][1] if exact else None
                deadline=now+timeout if candidates else None
        return [out,buffer,pending,deadline]
    return [run(c) for c in cases]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ambiguous-shortcut-prefix scenario 0', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, []]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 1', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, [['down', 'A', 10], ['tick', '', 15]]]] * N), [[[['short', 15]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 2', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['tick', '', 20]]]] * N), [[[['short', 15]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 3', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['down', 'B', 12]]]] * N), [[[['long', 12]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 4', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, [['down', 'A', 10], ['down', 'C', 12]]]] * N), [[[['short', 12], ['other', 12]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 5', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['cancel', '', 11]]]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 6', solve([[[[['A', 'B'], 'long']], 5, [['down', 'A', 10], ['up', 'B', 11]]]] * N), [[[], ['A'], None, 15]] * N)
check('ambiguous-shortcut-prefix scenario 7', solve([[[[['A', 'B'], 'long']], 5, [['down', 'A', 10], ['tick', 'B', 11]]]] * N), [[[], ['A'], None, 15]] * N)
check('ambiguous-shortcut-prefix scenario 8', solve([[[[['A', 'B'], 'long']], 5, [['down', 'Z', 10]]]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 9', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['down', 'B', 15]]]] * N), [[[['short', 15]], [], None, None]] * N)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
ambiguous-shortcut-prefix scenario 0[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 1[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 2[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 3[[[['long', 12]], [], None, None]][[[['long', 12]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 4[[[['short', 12]], [], None, None]][[[['short', 12], ['other', 12]], [], None, None]]Failed
ambiguous-shortcut-prefix scenario 5[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 6[[[], ['A'], None, 15]][[[], ['A'], None, 15]]Passed
ambiguous-shortcut-prefix scenario 7[[[], ['A'], None, 15]][[[], ['A'], None, 15]]Passed
ambiguous-shortcut-prefix scenario 8[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 9[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed

SHA-256 / a7ebaa5330f7d27dcd8d9877db716755e07247615bec09b743c7c19551f814f9

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cases):
    def run(c):
        bindings,timeout,events=c
        buffer=[]; pending=None; deadline=None; out=[]
        for kind,key,now in events:
            if kind=='cancel':
                buffer=[]; pending=None; deadline=None
                continue
            if deadline is not None and now>=deadline:
                if pending is not None: out.append([pending,deadline])
                buffer=[]; pending=None; deadline=None
            if kind!='down': continue
            candidate=buffer+[key]
            candidates=[b for b in bindings if b[0][:len(candidate)]==candidate]
            if not candidates:
                if pending is not None: out.append([pending,now])
                candidate=buffer+[key]
                candidates=[b for b in bindings if b[0][:1]==candidate]
                pending=None
            buffer=candidate if candidates else []
            exact=[b for b in candidates if len(b[0])==len(buffer)]
            longer=[b for b in candidates if len(b[0])>len(buffer)]
            if exact and not longer:
                out.append([exact[0][1],now])
                buffer=[]; pending=None; deadline=None
            else:
                pending=exact[0][1] if exact else None
                deadline=now+timeout if candidates else None
        return [out,buffer,pending,deadline]
    return [run(c) for c in cases]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ambiguous-shortcut-prefix scenario 0', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, []]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 1', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, [['down', 'A', 10], ['tick', '', 15]]]] * N), [[[['short', 15]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 2', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['tick', '', 20]]]] * N), [[[['short', 15]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 3', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['down', 'B', 12]]]] * N), [[[['long', 12]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 4', solve([[[[['A'], 'short'], [['A', 'B'], 'long'], [['C'], 'other']], 5, [['down', 'A', 10], ['down', 'C', 12]]]] * N), [[[['short', 12], ['other', 12]], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 5', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['cancel', '', 11]]]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 6', solve([[[[['A', 'B'], 'long']], 5, [['down', 'A', 10], ['up', 'B', 11]]]] * N), [[[], ['A'], None, 15]] * N)
check('ambiguous-shortcut-prefix scenario 7', solve([[[[['A', 'B'], 'long']], 5, [['down', 'A', 10], ['tick', 'B', 11]]]] * N), [[[], ['A'], None, 15]] * N)
check('ambiguous-shortcut-prefix scenario 8', solve([[[[['A', 'B'], 'long']], 5, [['down', 'Z', 10]]]] * N), [[[], [], None, None]] * N)
check('ambiguous-shortcut-prefix scenario 9', solve([[[[['A'], 'short'], [['A', 'B'], 'long']], 5, [['down', 'A', 10], ['down', 'B', 15]]]] * N), [[[['short', 15]], [], None, None]] * N)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
ambiguous-shortcut-prefix scenario 0[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 1[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 2[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 3[[[['long', 12]], [], None, None]][[[['long', 12]], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 4[[[['short', 12]], [], None, None]][[[['short', 12], ['other', 12]], [], None, None]]Failed
ambiguous-shortcut-prefix scenario 5[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 6[[[], ['A'], None, 15]][[[], ['A'], None, 15]]Passed
ambiguous-shortcut-prefix scenario 7[[[], ['A'], None, 15]][[[], ['A'], None, 15]]Passed
ambiguous-shortcut-prefix scenario 8[[[], [], None, None]][[[], [], None, None]]Passed
ambiguous-shortcut-prefix scenario 9[[[['short', 15]], [], None, None]][[[['short', 15]], [], None, None]]Passed

SHA-256 / b48b5061a6142f4e30663ba64fc09b473922b70dcd22f5c942cdf71df554ed04

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Offline stipulated event model, not a browser implementation or web standard conformance claim. 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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:42:10.677072+00:00.

Case digest / 94d97a79bc91e8e7c5d0ec18b28005bff85ea42c96a716d0546b4cec7d959a75