FA-31211 / Keyboard interactions / Open access
Keyboard binding registration lifecycle: Binding resolution crosses the requested scope boundary · case 01
The event trace violates the resolve scope rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Binding resolution crosses the requested scope boundary.
VERIFIED REPAIR
Use the contract transition `v[0]==scope and` at the resolve scope fault site; preserve the other state transitions.
Unsuccessful approach: The partial repair changes this transition to v[0]!=scope and, 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 True 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 | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | Passed |
| 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 | [[['a'], [['a', 'y', 'A', 1, 1]]]] | [[[None], [['a', 'y', 'A', 1, 1]]]] | Failed |
| binding-registry scenario 10 | [[[None], [['a', 'x', '', 1, 1]]]] | [[[None], [['a', 'x', '', 1, 1]]]] | Passed |
SHA-256 / 440b33e6f0afb3ac9dd39e166883e2bc35749df9cd7a59b2391ae0c1ae9639a0
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 | [[[None], [['a', 'x', 'A', 1, 1]]]] | [[['a'], [['a', 'x', 'A', 1, 1]]]] | Failed |
| binding-registry scenario 3 | [[[None], [['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 | [[[None], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | [[['b'], [['a', 'x', 'A', 1, 1], ['b', 'x', 'A', 1, 2]]]] | Failed |
| binding-registry scenario 5 | [[[None], [['a', 'y', 'B', 3, 2]]]] | [[['a'], [['a', 'y', 'B', 3, 2]]]] | Failed |
| 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 | [[['a'], [['a', 'y', 'A', 1, 1]]]] | [[[None], [['a', 'y', 'A', 1, 1]]]] | Failed |
| binding-registry scenario 10 | [[[None], [['a', 'x', '', 1, 1]]]] | [[[None], [['a', 'x', '', 1, 1]]]] | Passed |
SHA-256 / ebee1af466701b7624d28f93375d6d82d04f0af22bd6b333b1ccd43dd0c2469b
3 / The verified repair
Exit 0"""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 | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | [[['a'], [['a', 'x', 'A', 2, 1], ['b', 'x', 'A', 1, 2]]]] | Passed |
| 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 / 0ef8ddddc20512d9714b2c91e32ce370d8586d10601425fc30790a1c5c0cf2e0
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:41:59.960408+00:00.
Case digest / ba82ccf800c9135446a0a54e577132502cc982f3a139662b6e124c6db7ecadec