FAILURE MAP
← Case archive

FA-32271 / Keyboard interactions / Open access

Deferred short shortcut versus longer key sequence: Mismatch dispatch reports the old timeout or emits current key identity instead of delayed command · case 01

The event trace violates the mismatch pending rule and produces incorrect keyboard state or command output.

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

ROOT CAUSE

Mismatch dispatch reports the old timeout or emits current key identity instead of delayed command.

THE FAILURE

Mismatch dispatch reports the old timeout or emits current key identity instead of delayed command.

Unsuccessful approach: The partial repair changes this transition to out.append([key,now]), 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,deadline])
                candidate=[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', 15], ['other', 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 / 9c25ced74f1081e1134598f21a98203afd0ff48d3ac0877b9aa472d4f8d41645

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([key,now])
                candidate=[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[[[['C', 12], ['other', 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 / 92dde4fdd3274e0ac01afd48c379d05809fe399f2e7400ce69ac10038bcc559d

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 / 6e799a3dc7c4dbb315994d7251b56e2c8cd7bb42ae17a25e3a20c6d1fb5d5850