FA-31226 / Keyboard interactions / Open access
Keyboard binding registration lifecycle: Binding precedence uses recency before explicit priority or reverses priority · case 01
The event trace violates the priority sort rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Binding precedence uses recency before explicit priority or reverses priority.
THE FAILURE
Binding precedence uses recency before explicit priority or reverses priority.
Unsuccessful approach: The partial repair changes this transition to (-pair[1][2],pair[1][3]), which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,id,scope,chord,priority]. Register replaces the same id with a fresh serial. Remove deletes id; clear deletes a scope. Resolve returns highest priority matching scope/chord, breaking ties by newest registration. Empty chord never resolves. Return resolution IDs and live registrations [id,scope,chord,priority,serial]. 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):
registry={}; serial=0; resolved=[]
for kind,ident,scope,chord,priority in c:
if kind=='register':
serial+=1
registry[ident]=[scope,chord,priority,serial]
elif kind=='remove':
registry.pop(ident,None)
elif kind=='clear':
registry={k:v for k,v in registry.items() if v[0]!=scope}
elif kind=='resolve':
eligible=[(k,v) for k,v in registry.items() if v[0]==scope and v[1]==chord and chord!='']
eligible.sort(key=lambda pair:(pair[1][3],pair[1][2]),reverse=True)
resolved.append(eligible[0][0] if eligible else None)
return [resolved,sorted([[k]+v for k,v in registry.items()])]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('binding-registry scenario 0', solve([[]] * N), [[[], []]] * N)
check('binding-registry scenario 1', solve([[['resolve', '', 'x', 'A', 0]]] * N), [[[None], []]] * N)
check('binding-registry scenario 2', solve([[['register', 'a', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['a'], [['a', 'x', 'A', 1, 1]]]] * N)
check('binding-registry scenario 3', solve([[['register', 'a', 'x', 'A', 2], ['register', 'b', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] * N)
check('binding-registry scenario 4', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] * N)
check('binding-registry scenario 5', solve([[['register', 'a', 'x', 'A', 1], ['register', 'a', 'y', 'B', 3], ['resolve', '', 'y', 'B', 0]]] * N), [[['a'], [['a', 'y', 'B', 3, 2]]]] * N)
check('binding-registry scenario 6', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'y', 'B', 1], ['clear', '', 'x', '', 0]]] * N), [[[], [['b', 'y', 'B', 1, 2]]]] * N)
check('binding-registry scenario 7', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'x', 'B', 1], ['remove', 'a', '', '', 0]]] * N), [[[], [['b', 'x', 'B', 1, 2]]]] * N)
check('binding-registry scenario 8', solve([[['register', 'a', 'x', 'AB', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[[None], [['a', 'x', 'AB', 1, 1]]]] * N)
check('binding-registry scenario 9', solve([[['register', 'a', 'y', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[[None], [['a', 'y', 'A', 1, 1]]]] * N)
check('binding-registry scenario 10', solve([[['register', 'a', 'x', '', 1], ['resolve', '', 'x', '', 0]]] * N), [[[None], [['a', 'x', '', 1, 1]]]] * 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 |
|---|---|---|---|
| binding-registry scenario 0 | [[[], []]] | [[[], []]] | Passed |
| binding-registry scenario 1 | [[[None], []]] | [[[None], []]] | Passed |
| binding-registry scenario 2 | [[['a'], [['a', 'x', 'A', 1, 1]]]] | [[['a'], [['a', 'x', 'A', 1, 1]]]] | Passed |
| binding-registry scenario 3 | [[['b'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | Failed |
| binding-registry scenario 4 | [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | Passed |
| binding-registry scenario 5 | [[['a'], [['a', 'y', 'B', 3, 2]]]] | [[['a'], [['a', 'y', 'B', 3, 2]]]] | Passed |
| binding-registry scenario 6 | [[[], [['b', 'y', 'B', 1, 2]]]] | [[[], [['b', 'y', 'B', 1, 2]]]] | Passed |
| binding-registry scenario 7 | [[[], [['b', 'x', 'B', 1, 2]]]] | [[[], [['b', 'x', 'B', 1, 2]]]] | Passed |
| binding-registry scenario 8 | [[[None], [['a', 'x', 'AB', 1, 1]]]] | [[[None], [['a', 'x', 'AB', 1, 1]]]] | Passed |
| binding-registry scenario 9 | [[[None], [['a', 'y', 'A', 1, 1]]]] | [[[None], [['a', 'y', 'A', 1, 1]]]] | Passed |
| binding-registry scenario 10 | [[[None], [['a', 'x', '', 1, 1]]]] | [[[None], [['a', 'x', '', 1, 1]]]] | Passed |
SHA-256 / f3d003388a88d300c428f2634fc36d2dbf14717fdb875c799e1f1f20070fc936
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):
registry={}; serial=0; resolved=[]
for kind,ident,scope,chord,priority in c:
if kind=='register':
serial+=1
registry[ident]=[scope,chord,priority,serial]
elif kind=='remove':
registry.pop(ident,None)
elif kind=='clear':
registry={k:v for k,v in registry.items() if v[0]!=scope}
elif kind=='resolve':
eligible=[(k,v) for k,v in registry.items() if v[0]==scope and v[1]==chord and chord!='']
eligible.sort(key=lambda pair:(-pair[1][2],pair[1][3]),reverse=True)
resolved.append(eligible[0][0] if eligible else None)
return [resolved,sorted([[k]+v for k,v in registry.items()])]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('binding-registry scenario 0', solve([[]] * N), [[[], []]] * N)
check('binding-registry scenario 1', solve([[['resolve', '', 'x', 'A', 0]]] * N), [[[None], []]] * N)
check('binding-registry scenario 2', solve([[['register', 'a', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['a'], [['a', 'x', 'A', 1, 1]]]] * N)
check('binding-registry scenario 3', solve([[['register', 'a', 'x', 'A', 2], ['register', 'b', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] * N)
check('binding-registry scenario 4', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'x', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] * N)
check('binding-registry scenario 5', solve([[['register', 'a', 'x', 'A', 1], ['register', 'a', 'y', 'B', 3], ['resolve', '', 'y', 'B', 0]]] * N), [[['a'], [['a', 'y', 'B', 3, 2]]]] * N)
check('binding-registry scenario 6', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'y', 'B', 1], ['clear', '', 'x', '', 0]]] * N), [[[], [['b', 'y', 'B', 1, 2]]]] * N)
check('binding-registry scenario 7', solve([[['register', 'a', 'x', 'A', 1], ['register', 'b', 'x', 'B', 1], ['remove', 'a', '', '', 0]]] * N), [[[], [['b', 'x', 'B', 1, 2]]]] * N)
check('binding-registry scenario 8', solve([[['register', 'a', 'x', 'AB', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[[None], [['a', 'x', 'AB', 1, 1]]]] * N)
check('binding-registry scenario 9', solve([[['register', 'a', 'y', 'A', 1], ['resolve', '', 'x', 'A', 0]]] * N), [[[None], [['a', 'y', 'A', 1, 1]]]] * N)
check('binding-registry scenario 10', solve([[['register', 'a', 'x', '', 1], ['resolve', '', 'x', '', 0]]] * N), [[[None], [['a', 'x', '', 1, 1]]]] * 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 |
|---|---|---|---|
| binding-registry scenario 0 | [[[], []]] | [[[], []]] | Passed |
| binding-registry scenario 1 | [[[None], []]] | [[[None], []]] | Passed |
| binding-registry scenario 2 | [[['a'], [['a', 'x', 'A', 1, 1]]]] | [[['a'], [['a', 'x', 'A', 1, 1]]]] | Passed |
| binding-registry scenario 3 | [[['b'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | Failed |
| binding-registry scenario 4 | [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | Passed |
| binding-registry scenario 5 | [[['a'], [['a', 'y', 'B', 3, 2]]]] | [[['a'], [['a', 'y', 'B', 3, 2]]]] | Passed |
| binding-registry scenario 6 | [[[], [['b', 'y', 'B', 1, 2]]]] | [[[], [['b', 'y', 'B', 1, 2]]]] | Passed |
| binding-registry scenario 7 | [[[], [['b', 'x', 'B', 1, 2]]]] | [[[], [['b', 'x', 'B', 1, 2]]]] | Passed |
| binding-registry scenario 8 | [[[None], [['a', 'x', 'AB', 1, 1]]]] | [[[None], [['a', 'x', 'AB', 1, 1]]]] | Passed |
| binding-registry scenario 9 | [[[None], [['a', 'y', 'A', 1, 1]]]] | [[[None], [['a', 'y', 'A', 1, 1]]]] | Passed |
| binding-registry scenario 10 | [[[None], [['a', 'x', '', 1, 1]]]] | [[[None], [['a', 'x', '', 1, 1]]]] | Passed |
SHA-256 / 760a563b11300c8bedb4a69d86267b10f4623380891aa04df82527932af06e02
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 11 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:00.212789+00:00.
Case digest / 102da40470c64d25d84ded1260bd54fe876b7bcef2fec755ab9dda3b3f376c1b