FA-32011 / Keyboard interactions / Open access
Keyboard numeric character entry transaction: Numeric keyboard digits are prepended or replace the accumulated number · case 01
The event trace violates the digit order rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Numeric keyboard digits are prepended or replace the accumulated number.
THE FAILURE
Numeric keyboard digits are prepended or replace the accumulated number.
Unsuccessful approach: The partial repair changes this transition to digits=char, which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,value]. Begin with radix 10 or16 resets digit buffer and activates. Digit is one ASCII hexadecimal character admitted only if below radix and fewer than6digits; rejection increments invalid count. Backspace removes last buffered digit. Commit with digits emits the integer Unicode scalar value if <=0x10ffff and outside surrogate range, else rejects; commit always closes and clears. Cancel closes without committing. Text outside mode appends as literal string. Return chunks, active radix or None, digits and invalid count. 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):
radix=None; digits=''; out=[]; invalid=0
for kind,value in c:
if kind=='begin' and value in (10,16):
radix=value; digits=''
elif kind=='digit' and radix is not None:
char=str(value).lower()
valid=len(char)==1 and char in '0123456789abcdef'
if valid and int(char,16)<radix and len(digits)<6:
digits=char+digits
else: invalid+=1
elif kind=='backspace' and radix is not None: digits=digits[:-1]
elif kind=='commit' and radix is not None:
if digits:
number=int(digits,radix)
if number<=0x10ffff and not 0xd800<=number<=0xdfff: out.append(number)
else: invalid+=1
radix=None; digits=''
elif kind=='cancel': radix=None; digits=''
elif kind=='text' and radix is None: out.append(value)
return [out,radix,digits,invalid]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('numeric-character-entry scenario 0', solve([[]] * N), [[[], None, '', 0]] * N)
check('numeric-character-entry scenario 1', solve([[['begin', 16], ['digit', '4'], ['digit', '1'], ['commit', '']]] * N), [[[65], None, '', 0]] * N)
check('numeric-character-entry scenario 2', solve([[['begin', 10], ['digit', '6'], ['digit', '5'], ['commit', '']]] * N), [[[65], None, '', 0]] * N)
check('numeric-character-entry scenario 3', solve([[['begin', 16], ['digit', 'a'], ['digit', 'F']]] * N), [[[], 16, 'af', 0]] * N)
check('numeric-character-entry scenario 4', solve([[['begin', 10], ['digit', 'A']]] * N), [[[], 10, '', 1]] * N)
check('numeric-character-entry scenario 5', solve([[['begin', 16], ['digit', '1'], ['digit', '2'], ['digit', '3'], ['digit', '4'], ['digit', '5'], ['digit', '6'], ['digit', '7']]] * N), [[[], 16, '123456', 1]] * N)
check('numeric-character-entry scenario 6', solve([[['begin', 16], ['digit', '1'], ['digit', '2'], ['digit', '3'], ['backspace', '']]] * N), [[[], 16, '12', 0]] * N)
check('numeric-character-entry scenario 7', solve([[['begin', 16], ['digit', '1'], ['digit', '0'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['commit', '']]] * N), [[[1114111], None, '', 0]] * N)
check('numeric-character-entry scenario 8', solve([[['begin', 16], ['digit', 'd'], ['digit', '8'], ['digit', '0'], ['digit', '0'], ['commit', '']]] * N), [[[], None, '', 1]] * N)
check('numeric-character-entry scenario 9', solve([[['begin', 16], ['digit', 'd'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['commit', '']]] * N), [[[], None, '', 1]] * N)
check('numeric-character-entry scenario 10', solve([[['begin', 16], ['digit', '4'], ['begin', 10]]] * N), [[[], 10, '', 0]] * N)
check('numeric-character-entry scenario 11', solve([[['begin', 10], ['commit', ''], ['text', 'ok']]] * N), [[['ok'], None, '', 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 |
|---|---|---|---|
| numeric-character-entry scenario 0 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| numeric-character-entry scenario 1 | [[[20], None, '', 0]] | [[[65], None, '', 0]] | Failed |
| numeric-character-entry scenario 2 | [[[56], None, '', 0]] | [[[65], None, '', 0]] | Failed |
| numeric-character-entry scenario 3 | [[[], 16, 'fa', 0]] | [[[], 16, 'af', 0]] | Failed |
| numeric-character-entry scenario 4 | [[[], 10, '', 1]] | [[[], 10, '', 1]] | Passed |
| numeric-character-entry scenario 5 | [[[], 16, '654321', 1]] | [[[], 16, '123456', 1]] | Failed |
| numeric-character-entry scenario 6 | [[[], 16, '32', 0]] | [[[], 16, '12', 0]] | Failed |
| numeric-character-entry scenario 7 | [[[], None, '', 1]] | [[[1114111], None, '', 0]] | Failed |
| numeric-character-entry scenario 8 | [[[141], None, '', 0]] | [[[], None, '', 1]] | Failed |
| numeric-character-entry scenario 9 | [[[65533], None, '', 0]] | [[[], None, '', 1]] | Failed |
| numeric-character-entry scenario 10 | [[[], 10, '', 0]] | [[[], 10, '', 0]] | Passed |
| numeric-character-entry scenario 11 | [[['ok'], None, '', 0]] | [[['ok'], None, '', 0]] | Passed |
SHA-256 / 172ca04a919d6a758f0565977d9336bfbcd51b2b29ebb4f54479e802c6634fd7
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):
radix=None; digits=''; out=[]; invalid=0
for kind,value in c:
if kind=='begin' and value in (10,16):
radix=value; digits=''
elif kind=='digit' and radix is not None:
char=str(value).lower()
valid=len(char)==1 and char in '0123456789abcdef'
if valid and int(char,16)<radix and len(digits)<6:
digits=char
else: invalid+=1
elif kind=='backspace' and radix is not None: digits=digits[:-1]
elif kind=='commit' and radix is not None:
if digits:
number=int(digits,radix)
if number<=0x10ffff and not 0xd800<=number<=0xdfff: out.append(number)
else: invalid+=1
radix=None; digits=''
elif kind=='cancel': radix=None; digits=''
elif kind=='text' and radix is None: out.append(value)
return [out,radix,digits,invalid]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('numeric-character-entry scenario 0', solve([[]] * N), [[[], None, '', 0]] * N)
check('numeric-character-entry scenario 1', solve([[['begin', 16], ['digit', '4'], ['digit', '1'], ['commit', '']]] * N), [[[65], None, '', 0]] * N)
check('numeric-character-entry scenario 2', solve([[['begin', 10], ['digit', '6'], ['digit', '5'], ['commit', '']]] * N), [[[65], None, '', 0]] * N)
check('numeric-character-entry scenario 3', solve([[['begin', 16], ['digit', 'a'], ['digit', 'F']]] * N), [[[], 16, 'af', 0]] * N)
check('numeric-character-entry scenario 4', solve([[['begin', 10], ['digit', 'A']]] * N), [[[], 10, '', 1]] * N)
check('numeric-character-entry scenario 5', solve([[['begin', 16], ['digit', '1'], ['digit', '2'], ['digit', '3'], ['digit', '4'], ['digit', '5'], ['digit', '6'], ['digit', '7']]] * N), [[[], 16, '123456', 1]] * N)
check('numeric-character-entry scenario 6', solve([[['begin', 16], ['digit', '1'], ['digit', '2'], ['digit', '3'], ['backspace', '']]] * N), [[[], 16, '12', 0]] * N)
check('numeric-character-entry scenario 7', solve([[['begin', 16], ['digit', '1'], ['digit', '0'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['commit', '']]] * N), [[[1114111], None, '', 0]] * N)
check('numeric-character-entry scenario 8', solve([[['begin', 16], ['digit', 'd'], ['digit', '8'], ['digit', '0'], ['digit', '0'], ['commit', '']]] * N), [[[], None, '', 1]] * N)
check('numeric-character-entry scenario 9', solve([[['begin', 16], ['digit', 'd'], ['digit', 'f'], ['digit', 'f'], ['digit', 'f'], ['commit', '']]] * N), [[[], None, '', 1]] * N)
check('numeric-character-entry scenario 10', solve([[['begin', 16], ['digit', '4'], ['begin', 10]]] * N), [[[], 10, '', 0]] * N)
check('numeric-character-entry scenario 11', solve([[['begin', 10], ['commit', ''], ['text', 'ok']]] * N), [[['ok'], None, '', 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 |
|---|---|---|---|
| numeric-character-entry scenario 0 | [[[], None, '', 0]] | [[[], None, '', 0]] | Passed |
| numeric-character-entry scenario 1 | [[[1], None, '', 0]] | [[[65], None, '', 0]] | Failed |
| numeric-character-entry scenario 2 | [[[5], None, '', 0]] | [[[65], None, '', 0]] | Failed |
| numeric-character-entry scenario 3 | [[[], 16, 'f', 0]] | [[[], 16, 'af', 0]] | Failed |
| numeric-character-entry scenario 4 | [[[], 10, '', 1]] | [[[], 10, '', 1]] | Passed |
| numeric-character-entry scenario 5 | [[[], 16, '7', 0]] | [[[], 16, '123456', 1]] | Failed |
| numeric-character-entry scenario 6 | [[[], 16, '', 0]] | [[[], 16, '12', 0]] | Failed |
| numeric-character-entry scenario 7 | [[[15], None, '', 0]] | [[[1114111], None, '', 0]] | Failed |
| numeric-character-entry scenario 8 | [[[0], None, '', 0]] | [[[], None, '', 1]] | Failed |
| numeric-character-entry scenario 9 | [[[15], None, '', 0]] | [[[], None, '', 1]] | Failed |
| numeric-character-entry scenario 10 | [[[], 10, '', 0]] | [[[], 10, '', 0]] | Passed |
| numeric-character-entry scenario 11 | [[['ok'], None, '', 0]] | [[['ok'], None, '', 0]] | Passed |
SHA-256 / 0866ef39e3d8aa6d71c885c91f5f4587aa5b3d2c0a5db384299ef55f16588369
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 12 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:08.080118+00:00.
Case digest / a6ac69a01d34aff53f9635045e9593e43ced99e7b92d8766aa330314f843654c