FA-32136 / Keyboard interactions / Open access
Asynchronous keyboard capture grant lifecycle: Explicit unlock leaves pending or already granted key capture active · case 01
The event trace violates the release all rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Explicit unlock leaves pending or already granted key capture active.
THE FAILURE
Explicit unlock leaves pending or already granted key capture active.
Unsuccessful approach: The partial repair changes this transition to elif kind=='release': active=[], which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,id,keys]. Initial window is focused. Request replaces pending id and deduplicated requested keys while focused. Grant applies only to current pending id while focused, filters Escape from captured keys, replaces active grant and clears pending. Deny clears only matching pending. Blur clears pending and active; focus restores eligibility; release clears both. Return focused flag, pending [id,keys] or None and active keys. 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):
focused=True; pending=None; active=[]
for kind,ident,keys in c:
if kind=='request' and focused:
pending=[ident,sorted(set(keys))]
elif kind=='grant' and focused and pending is not None and ident==pending[0]:
active=[k for k in pending[1] if k!='Escape']
pending=None
elif kind=='deny' and pending is not None and ident==pending[0]:
pending=None
elif kind=='blur':
focused=False; pending=None; active=[]
elif kind=='focus': focused=True
elif kind=='release': pending=None
return [focused,pending,active]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('keyboard-lock scenario 0', solve([[]] * N), [[True, None, []]] * N)
check('keyboard-lock scenario 1', solve([[['request', 1, ['B', 'A', 'A']]]] * N), [[True, [1, ['A', 'B']], []]] * N)
check('keyboard-lock scenario 2', solve([[['request', 1, ['A', 'Escape']], ['grant', 1, []]]] * N), [[True, None, ['A']]] * N)
check('keyboard-lock scenario 3', solve([[['request', 1, ['A']], ['request', 2, ['B']], ['grant', 1, []]]] * N), [[True, [2, ['B']], []]] * N)
check('keyboard-lock scenario 4', solve([[['request', 1, ['A']], ['request', 2, ['B']], ['deny', 1, []]]] * N), [[True, [2, ['B']], []]] * N)
check('keyboard-lock scenario 5', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['grant', 2, []]]] * N), [[True, None, ['B']]] * N)
check('keyboard-lock scenario 6', solve([[['blur', 0, []], ['request', 1, ['A']]]] * N), [[False, None, []]] * N)
check('keyboard-lock scenario 7', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['blur', 0, []]]] * N), [[False, None, []]] * N)
check('keyboard-lock scenario 8', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['release', 0, []]]] * N), [[True, None, []]] * N)
check('keyboard-lock scenario 9', solve([[['request', 1, ['A']], ['deny', 1, []]]] * N), [[True, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| keyboard-lock scenario 0 | [[True, None, []]] | [[True, None, []]] | Passed |
| keyboard-lock scenario 1 | [[True, [1, ['A', 'B']], []]] | [[True, [1, ['A', 'B']], []]] | Passed |
| keyboard-lock scenario 2 | [[True, None, ['A']]] | [[True, None, ['A']]] | Passed |
| keyboard-lock scenario 3 | [[True, [2, ['B']], []]] | [[True, [2, ['B']], []]] | Passed |
| keyboard-lock scenario 4 | [[True, [2, ['B']], []]] | [[True, [2, ['B']], []]] | Passed |
| keyboard-lock scenario 5 | [[True, None, ['B']]] | [[True, None, ['B']]] | Passed |
| keyboard-lock scenario 6 | [[False, None, []]] | [[False, None, []]] | Passed |
| keyboard-lock scenario 7 | [[False, None, []]] | [[False, None, []]] | Passed |
| keyboard-lock scenario 8 | [[True, None, ['A']]] | [[True, None, []]] | Failed |
| keyboard-lock scenario 9 | [[True, None, []]] | [[True, None, []]] | Passed |
SHA-256 / c2dcc11d0bd594609d8854e5a403ff08d013bdf9e940867771d73c076816e255
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):
focused=True; pending=None; active=[]
for kind,ident,keys in c:
if kind=='request' and focused:
pending=[ident,sorted(set(keys))]
elif kind=='grant' and focused and pending is not None and ident==pending[0]:
active=[k for k in pending[1] if k!='Escape']
pending=None
elif kind=='deny' and pending is not None and ident==pending[0]:
pending=None
elif kind=='blur':
focused=False; pending=None; active=[]
elif kind=='focus': focused=True
elif kind=='release': active=[]
return [focused,pending,active]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('keyboard-lock scenario 0', solve([[]] * N), [[True, None, []]] * N)
check('keyboard-lock scenario 1', solve([[['request', 1, ['B', 'A', 'A']]]] * N), [[True, [1, ['A', 'B']], []]] * N)
check('keyboard-lock scenario 2', solve([[['request', 1, ['A', 'Escape']], ['grant', 1, []]]] * N), [[True, None, ['A']]] * N)
check('keyboard-lock scenario 3', solve([[['request', 1, ['A']], ['request', 2, ['B']], ['grant', 1, []]]] * N), [[True, [2, ['B']], []]] * N)
check('keyboard-lock scenario 4', solve([[['request', 1, ['A']], ['request', 2, ['B']], ['deny', 1, []]]] * N), [[True, [2, ['B']], []]] * N)
check('keyboard-lock scenario 5', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['grant', 2, []]]] * N), [[True, None, ['B']]] * N)
check('keyboard-lock scenario 6', solve([[['blur', 0, []], ['request', 1, ['A']]]] * N), [[False, None, []]] * N)
check('keyboard-lock scenario 7', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['blur', 0, []]]] * N), [[False, None, []]] * N)
check('keyboard-lock scenario 8', solve([[['request', 1, ['A']], ['grant', 1, []], ['request', 2, ['B']], ['release', 0, []]]] * N), [[True, None, []]] * N)
check('keyboard-lock scenario 9', solve([[['request', 1, ['A']], ['deny', 1, []]]] * N), [[True, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| keyboard-lock scenario 0 | [[True, None, []]] | [[True, None, []]] | Passed |
| keyboard-lock scenario 1 | [[True, [1, ['A', 'B']], []]] | [[True, [1, ['A', 'B']], []]] | Passed |
| keyboard-lock scenario 2 | [[True, None, ['A']]] | [[True, None, ['A']]] | Passed |
| keyboard-lock scenario 3 | [[True, [2, ['B']], []]] | [[True, [2, ['B']], []]] | Passed |
| keyboard-lock scenario 4 | [[True, [2, ['B']], []]] | [[True, [2, ['B']], []]] | Passed |
| keyboard-lock scenario 5 | [[True, None, ['B']]] | [[True, None, ['B']]] | Passed |
| keyboard-lock scenario 6 | [[False, None, []]] | [[False, None, []]] | Passed |
| keyboard-lock scenario 7 | [[False, None, []]] | [[False, None, []]] | Passed |
| keyboard-lock scenario 8 | [[True, [2, ['B']], []]] | [[True, None, []]] | Failed |
| keyboard-lock scenario 9 | [[True, None, []]] | [[True, None, []]] | Passed |
SHA-256 / 36d9206ba5f605d4172dba7dc8186c3295d114142e3fbf200ca828f73fe530e8
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:09.071638+00:00.
Case digest / ea13013a6383063a3dbc4d0e695d63089aa0279c61cc42ff22c8605827287d2d