FAILURE MAP
← Case archive

FA-9011 / Keyboard interactions / Open access

Scoped keyboard shortcut dispatch: Held shortcut keys repeatedly dispatch one-shot actions · case 01

Held shortcut keys repeatedly dispatch one-shot actions.

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

ROOT CAUSE

The repeat operation uses `if prevented:` where the contract requires `if prevented or repeat:`.

THE FAILURE

The repeat operation uses `if prevented:` where the contract requires `if prevented or repeat:`.

Unsuccessful approach: Requiring both flags still allows unprevented repeats.

Case contract

Ignore prevented, repeated, and editable-origin events; use platform primary modifier; Alt blocks shortcuts; Shift-Z redoes, Z undoes, unshifted S saves.

Why this case matters

A deterministic model of scoped keyboard shortcut dispatch; this isolates one interface invariant without requiring a browser.

1 / The failure

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

N = 1
observations = []
def solve(key, ctrl, meta, alt, shift, platform, editable, repeat, prevented):
    if prevented: return None
    if editable: return None
    primary = meta if platform == 'mac' else ctrl
    if not primary or alt: return None
    if key.lower() == 'z': return 'redo' if shift else 'undo'
    if key.lower() == 's' and not shift: return 'save'
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prevented', solve('z', True, False, False, False, 'win', False, False, True), None)
check('repeat', solve('z', True, False, False, False, 'win', False, True, False), None)
check('editable', solve('z', True, False, False, False, 'win', True, False, False), None)
check('mac', solve('z', False, True, False, False, 'mac', False, False, False), 'undo')
check('win', solve('z', True, False, False, False, 'win', False, False, False), 'undo')
check('redo', solve('z', True, False, False, True, 'win', False, False, False), 'redo')
check('alt', solve('z', True, False, True, False, 'win', False, False, False), None)
check('parameterized target context', solve('z',True,False,False,False,'win',bool(N%2),False,False), None if N%2 else 'undo')
for repetition in range(N):
    check('repeat alt', solve('z', True, False, True, False, 'win', False, False, False), None)
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
preventedNoneNonePassed
repeatundoNoneFailed
editableNoneNonePassed
macundoundoPassed
winundoundoPassed
redoredoredoPassed
altNoneNonePassed
parameterized target contextNoneNonePassed
repeat altNoneNonePassed

SHA-256 / 2d5d82927f73a0d314782968993aa41a339415dc85584568ccbe6eadb2ec7c6b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(key, ctrl, meta, alt, shift, platform, editable, repeat, prevented):
    if prevented and repeat: return None
    if editable: return None
    primary = meta if platform == 'mac' else ctrl
    if not primary or alt: return None
    if key.lower() == 'z': return 'redo' if shift else 'undo'
    if key.lower() == 's' and not shift: return 'save'
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prevented', solve('z', True, False, False, False, 'win', False, False, True), None)
check('repeat', solve('z', True, False, False, False, 'win', False, True, False), None)
check('editable', solve('z', True, False, False, False, 'win', True, False, False), None)
check('mac', solve('z', False, True, False, False, 'mac', False, False, False), 'undo')
check('win', solve('z', True, False, False, False, 'win', False, False, False), 'undo')
check('redo', solve('z', True, False, False, True, 'win', False, False, False), 'redo')
check('alt', solve('z', True, False, True, False, 'win', False, False, False), None)
check('parameterized target context', solve('z',True,False,False,False,'win',bool(N%2),False,False), None if N%2 else 'undo')
for repetition in range(N):
    check('repeat alt', solve('z', True, False, True, False, 'win', False, False, False), None)
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
preventedundoNoneFailed
repeatundoNoneFailed
editableNoneNonePassed
macundoundoPassed
winundoundoPassed
redoredoredoPassed
altNoneNonePassed
parameterized target contextNoneNonePassed
repeat altNoneNonePassed

SHA-256 / bb257173271b73b2801e1e946c743fa93ddde6808398a4c562ef536c97a2eff6

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 9 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

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:38:26.451863+00:00.

Case digest / ea060a367ec0d6b7a870dedfcbab78f91c1af1a61f75c7813cddb1d846114d90