FA-30906 / Keyboard interactions / Open access
Composition transaction ownership: Composition update is treated as incremental text rather than a replacement · case 01
The event trace violates the replace update rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Composition update is treated as incremental text rather than a replacement.
VERIFIED REPAIR
Use the contract transition `preedit=text updates` at the replace update fault site; preserve the other state transitions.
Unsuccessful approach: The partial repair changes this transition to preedit=text[:1] updates, which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,owner,text]. Start replaces active preedit, update applies only to active owner, commit appends supplied text once for active owner and closes, cancel closes matching owner without committing, focus switches cancel old owner. Return committed strings, active owner and preedit. 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):
owner=None; preedit=''; committed=[]; updates=0
for kind,target,text in c:
if kind=='start':
owner=target
preedit=text
elif kind=='update' and target==owner:
preedit+=text
updates+=1
elif kind=='commit' and target==owner and owner is not None:
committed.append(text)
owner=None
preedit=''
elif kind=='cancel' and target==owner:
owner=None; preedit=''
elif kind=='focus' and target!=owner:
owner=None; preedit=''
return [committed,owner,preedit,updates]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('composition-transaction scenario 0', solve([[]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 1', solve([[['start', 'a', 'x'], ['update', 'a', 'xy'], ['update', 'a', 'xyz']]] * N), [[[], 'a', 'xyz', 2]] * N)
check('composition-transaction scenario 2', solve([[['start', 'a', 'x'], ['start', 'b', 'b']]] * N), [[[], 'b', 'b', 0]] * N)
check('composition-transaction scenario 3', solve([[['start', 'a', 'x'], ['update', 'b', 'oops']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 4', solve([[['start', 'a', 'x'], ['commit', 'a', 'word'], ['commit', 'a', 'word']]] * N), [[['word'], None, '', 0]] * N)
check('composition-transaction scenario 5', solve([[['commit', 'x', 'orphan']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 6', solve([[['start', 'a', 'x'], ['commit', 'b', 'bad']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 7', solve([[['start', 'a', 'x'], ['cancel', 'b', '']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 8', solve([[['start', 'a', 'x'], ['cancel', 'a', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 9', solve([[['start', 'a', 'x'], ['focus', 'b', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 10', solve([[['start', 'a', 'x'], ['focus', 'a', '']]] * N), [[[], 'a', 'x', 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 |
|---|---|---|---|
| composition-transaction scenario 0 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 1 | [[[], 'a', 'xxyxyz', 2]] | [[[], 'a', 'xyz', 2]] | Failed |
| composition-transaction scenario 2 | [[[], 'b', 'b', 0]] | [[[], 'b', 'b', 0]] | Passed |
| composition-transaction scenario 3 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 4 | [[['word'], None, '', 0]] | [[['word'], None, '', 0]] | Passed |
| composition-transaction scenario 5 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 6 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 7 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 8 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 9 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 10 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
SHA-256 / 6d7081d01a6cdfa9b0cc62cbbda3bbbb4e5574d9564341b7df75d5d5705ab026
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):
owner=None; preedit=''; committed=[]; updates=0
for kind,target,text in c:
if kind=='start':
owner=target
preedit=text
elif kind=='update' and target==owner:
preedit=text[:1]
updates+=1
elif kind=='commit' and target==owner and owner is not None:
committed.append(text)
owner=None
preedit=''
elif kind=='cancel' and target==owner:
owner=None; preedit=''
elif kind=='focus' and target!=owner:
owner=None; preedit=''
return [committed,owner,preedit,updates]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('composition-transaction scenario 0', solve([[]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 1', solve([[['start', 'a', 'x'], ['update', 'a', 'xy'], ['update', 'a', 'xyz']]] * N), [[[], 'a', 'xyz', 2]] * N)
check('composition-transaction scenario 2', solve([[['start', 'a', 'x'], ['start', 'b', 'b']]] * N), [[[], 'b', 'b', 0]] * N)
check('composition-transaction scenario 3', solve([[['start', 'a', 'x'], ['update', 'b', 'oops']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 4', solve([[['start', 'a', 'x'], ['commit', 'a', 'word'], ['commit', 'a', 'word']]] * N), [[['word'], None, '', 0]] * N)
check('composition-transaction scenario 5', solve([[['commit', 'x', 'orphan']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 6', solve([[['start', 'a', 'x'], ['commit', 'b', 'bad']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 7', solve([[['start', 'a', 'x'], ['cancel', 'b', '']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 8', solve([[['start', 'a', 'x'], ['cancel', 'a', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 9', solve([[['start', 'a', 'x'], ['focus', 'b', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 10', solve([[['start', 'a', 'x'], ['focus', 'a', '']]] * N), [[[], 'a', 'x', 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 |
|---|---|---|---|
| composition-transaction scenario 0 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 1 | [[[], 'a', 'x', 2]] | [[[], 'a', 'xyz', 2]] | Failed |
| composition-transaction scenario 2 | [[[], 'b', 'b', 0]] | [[[], 'b', 'b', 0]] | Passed |
| composition-transaction scenario 3 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 4 | [[['word'], None, '', 0]] | [[['word'], None, '', 0]] | Passed |
| composition-transaction scenario 5 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 6 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 7 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 8 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 9 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 10 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
SHA-256 / b2b91581649a2bdd129beb06263dfd0f97801eda6285695322650384431a1806
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):
owner=None; preedit=''; committed=[]; updates=0
for kind,target,text in c:
if kind=='start':
owner=target
preedit=text
elif kind=='update' and target==owner:
preedit=text
updates+=1
elif kind=='commit' and target==owner and owner is not None:
committed.append(text)
owner=None
preedit=''
elif kind=='cancel' and target==owner:
owner=None; preedit=''
elif kind=='focus' and target!=owner:
owner=None; preedit=''
return [committed,owner,preedit,updates]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('composition-transaction scenario 0', solve([[]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 1', solve([[['start', 'a', 'x'], ['update', 'a', 'xy'], ['update', 'a', 'xyz']]] * N), [[[], 'a', 'xyz', 2]] * N)
check('composition-transaction scenario 2', solve([[['start', 'a', 'x'], ['start', 'b', 'b']]] * N), [[[], 'b', 'b', 0]] * N)
check('composition-transaction scenario 3', solve([[['start', 'a', 'x'], ['update', 'b', 'oops']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 4', solve([[['start', 'a', 'x'], ['commit', 'a', 'word'], ['commit', 'a', 'word']]] * N), [[['word'], None, '', 0]] * N)
check('composition-transaction scenario 5', solve([[['commit', 'x', 'orphan']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 6', solve([[['start', 'a', 'x'], ['commit', 'b', 'bad']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 7', solve([[['start', 'a', 'x'], ['cancel', 'b', '']]] * N), [[[], 'a', 'x', 0]] * N)
check('composition-transaction scenario 8', solve([[['start', 'a', 'x'], ['cancel', 'a', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 9', solve([[['start', 'a', 'x'], ['focus', 'b', '']]] * N), [[[], None, '', 0]] * N)
check('composition-transaction scenario 10', solve([[['start', 'a', 'x'], ['focus', 'a', '']]] * N), [[[], 'a', 'x', 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 |
|---|---|---|---|
| composition-transaction scenario 0 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 1 | [[[], 'a', 'xyz', 2]] | [[[], 'a', 'xyz', 2]] | Passed |
| composition-transaction scenario 2 | [[[], 'b', 'b', 0]] | [[[], 'b', 'b', 0]] | Passed |
| composition-transaction scenario 3 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 4 | [[['word'], None, '', 0]] | [[['word'], None, '', 0]] | Passed |
| composition-transaction scenario 5 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 6 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 7 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
| composition-transaction scenario 8 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 9 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| composition-transaction scenario 10 | [[[], 'a', 'x', 0]] | [[[], 'a', 'x', 0]] | Passed |
SHA-256 / 77f68c9bfbe67ce241dc060af7eab8f8539940cd030f354deced08ac704351a0
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:57.152435+00:00.
Case digest / 747f6e8355f720b9d55d87b59b66d6e2d703832908727f1529ada4d16e7e6d9b