FA-31576 / Keyboard interactions / Open access
Keyboard macro recording timebase: Macro capture omits key releases or records text notifications as physical strokes · case 01
The event trace violates the phase filter rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Macro capture omits key releases or records text notifications as physical strokes.
THE FAILURE
Macro capture omits key releases or records text notifications as physical strokes.
Unsuccessful approach: The partial repair changes this transition to kind in ('down','up','text') and recording, which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,key,time,injected]. Start resets capture and origin; physical down/up record relative active time; injected events are ignored. Pause freezes recording and resume excludes paused duration. Stop ends recording; clear erases recording. Return [kind,key,offset] records, recording flag, paused flag and excluded time. Ordered times and paired pause/resume. 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):
recording=False; origin=0; paused=None; excluded=0; records=[]
for kind,key,now,injected in c:
if kind=='start':
recording=True; origin=now; paused=None; excluded=0; records=[]
elif kind=='pause' and recording and paused is None:
paused=now
elif kind=='resume' and recording and paused is not None:
excluded+=now-paused
paused=None
elif kind=='stop': recording=False; paused=None
elif kind=='clear': records=[]
elif kind=='down' and recording and paused is None and not injected:
records.append([kind,key,now-origin-excluded])
return [records,recording,paused is not None,excluded]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('macro-record scenario 0', solve([[]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 1', solve([[['start', '', 10, False], ['down', 'A', 12, False], ['up', 'A', 13, False], ['text', 'A', 14, False]]] * N), [[[['down', 'A', 2], ['up', 'A', 3]], True, False, 0]] * N)
check('macro-record scenario 2', solve([[['start', '', 10, False], ['down', 'A', 12, True], ['up', 'A', 13, True]]] * N), [[[], True, False, 0]] * N)
check('macro-record scenario 3', solve([[['start', '', 10, False], ['pause', '', 12, False], ['pause', '', 13, False], ['resume', '', 15, False], ['down', 'A', 16, False]]] * N), [[[['down', 'A', 3]], True, False, 3]] * N)
check('macro-record scenario 4', solve([[['start', '', 10, False], ['pause', '', 12, False], ['resume', '', 15, False], ['pause', '', 17, False], ['resume', '', 20, False], ['down', 'A', 21, False]]] * N), [[[['down', 'A', 5]], True, False, 6]] * N)
check('macro-record scenario 5', solve([[['start', '', 10, False], ['down', 'A', 11, False], ['start', '', 20, False]]] * N), [[[], True, False, 0]] * N)
check('macro-record scenario 6', solve([[['start', '', 10, False], ['pause', '', 12, False], ['resume', '', 15, False], ['start', '', 20, False], ['down', 'A', 21, False]]] * N), [[[['down', 'A', 1]], True, False, 0]] * N)
check('macro-record scenario 7', solve([[['start', '', 10, False], ['pause', '', 12, False], ['stop', '', 15, False], ['down', 'A', 16, False]]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 8', solve([[['pause', '', 10, False]]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 9', solve([[['start', '', 10, False], ['down', 'A', 11, False], ['up', 'A', 12, False], ['clear', '', 13, False]]] * N), [[[], True, False, 0]] * 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 |
|---|---|---|---|
| macro-record scenario 0 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 1 | [[[['down', 'A', 2]], True, False, 0]] | [[[['down', 'A', 2], ['up', 'A', 3]], True, False, 0]] | Failed |
| macro-record scenario 2 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
| macro-record scenario 3 | [[[['down', 'A', 3]], True, False, 3]] | [[[['down', 'A', 3]], True, False, 3]] | Passed |
| macro-record scenario 4 | [[[['down', 'A', 5]], True, False, 6]] | [[[['down', 'A', 5]], True, False, 6]] | Passed |
| macro-record scenario 5 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
| macro-record scenario 6 | [[[['down', 'A', 1]], True, False, 0]] | [[[['down', 'A', 1]], True, False, 0]] | Passed |
| macro-record scenario 7 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 8 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 9 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
SHA-256 / 5bfa5d020001f599abd8ad94716c254fe36adc5a804e5d97b5c199543867de56
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):
recording=False; origin=0; paused=None; excluded=0; records=[]
for kind,key,now,injected in c:
if kind=='start':
recording=True; origin=now; paused=None; excluded=0; records=[]
elif kind=='pause' and recording and paused is None:
paused=now
elif kind=='resume' and recording and paused is not None:
excluded+=now-paused
paused=None
elif kind=='stop': recording=False; paused=None
elif kind=='clear': records=[]
elif kind in ('down','up','text') and recording and paused is None and not injected:
records.append([kind,key,now-origin-excluded])
return [records,recording,paused is not None,excluded]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('macro-record scenario 0', solve([[]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 1', solve([[['start', '', 10, False], ['down', 'A', 12, False], ['up', 'A', 13, False], ['text', 'A', 14, False]]] * N), [[[['down', 'A', 2], ['up', 'A', 3]], True, False, 0]] * N)
check('macro-record scenario 2', solve([[['start', '', 10, False], ['down', 'A', 12, True], ['up', 'A', 13, True]]] * N), [[[], True, False, 0]] * N)
check('macro-record scenario 3', solve([[['start', '', 10, False], ['pause', '', 12, False], ['pause', '', 13, False], ['resume', '', 15, False], ['down', 'A', 16, False]]] * N), [[[['down', 'A', 3]], True, False, 3]] * N)
check('macro-record scenario 4', solve([[['start', '', 10, False], ['pause', '', 12, False], ['resume', '', 15, False], ['pause', '', 17, False], ['resume', '', 20, False], ['down', 'A', 21, False]]] * N), [[[['down', 'A', 5]], True, False, 6]] * N)
check('macro-record scenario 5', solve([[['start', '', 10, False], ['down', 'A', 11, False], ['start', '', 20, False]]] * N), [[[], True, False, 0]] * N)
check('macro-record scenario 6', solve([[['start', '', 10, False], ['pause', '', 12, False], ['resume', '', 15, False], ['start', '', 20, False], ['down', 'A', 21, False]]] * N), [[[['down', 'A', 1]], True, False, 0]] * N)
check('macro-record scenario 7', solve([[['start', '', 10, False], ['pause', '', 12, False], ['stop', '', 15, False], ['down', 'A', 16, False]]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 8', solve([[['pause', '', 10, False]]] * N), [[[], False, False, 0]] * N)
check('macro-record scenario 9', solve([[['start', '', 10, False], ['down', 'A', 11, False], ['up', 'A', 12, False], ['clear', '', 13, False]]] * N), [[[], True, False, 0]] * 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 |
|---|---|---|---|
| macro-record scenario 0 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 1 | [[[['down', 'A', 2], ['up', 'A', 3], ['text', 'A', 4]], True, False, 0]] | [[[['down', 'A', 2], ['up', 'A', 3]], True, False, 0]] | Failed |
| macro-record scenario 2 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
| macro-record scenario 3 | [[[['down', 'A', 3]], True, False, 3]] | [[[['down', 'A', 3]], True, False, 3]] | Passed |
| macro-record scenario 4 | [[[['down', 'A', 5]], True, False, 6]] | [[[['down', 'A', 5]], True, False, 6]] | Passed |
| macro-record scenario 5 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
| macro-record scenario 6 | [[[['down', 'A', 1]], True, False, 0]] | [[[['down', 'A', 1]], True, False, 0]] | Passed |
| macro-record scenario 7 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 8 | [[[], False, False, 0]] | [[[], False, False, 0]] | Passed |
| macro-record scenario 9 | [[[], True, False, 0]] | [[[], True, False, 0]] | Passed |
SHA-256 / c0d6b58b7ca8da8de6a1eaeb5df51188d2352bed5c6e32805217425a2d4a5d74
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:03.583640+00:00.
Case digest / 835b3ec088ad0a6c05635a6505d7b3cdaef6f39557002c2247db55ddcaeb912c