{"abstract":"The event trace violates the up threshold rule and produces incorrect keyboard state or command output.","category":"Keyboard interactions","checks":9,"contract":"Case [threshold,events]. Events [kind,key,time]. Down arms an unarmed key. Tick emits hold once when age >= threshold. Up before threshold emits tap, at or after threshold emits hold if not yet emitted. Cancel removes just one key silently. Return output and pending [key,start,held] entries. Inputs are finite ordered event traces; return the stated deterministic state. Batch entries are independent. N varies the number of independent input transactions.","evaluation_group":"s3-keyboard-hold-threshold","failed_approach":"The partial repair changes this transition to 'hold' if now>=threshold else 'tap', which still violates the model contract on the explicit regression traces.","family":"s3-keyboard-interactions-hold-threshold-up-threshold","id":"FA-31126","implementations":{"attempt":{"sha256":"923fbb6b26750cf230b2f9a89a9669c727bd4e4dc8c0b94dccd8e817454e03ec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cases):\n    def run(c):\n        threshold,events=c\n        pending={}; output=[]\n        for kind,key,now in events:\n            if kind=='down' and key not in pending:\n                pending[key]=[now,False]\n            elif kind=='tick':\n                for k in sorted(pending):\n                    start,sent=pending[k]\n                    if not sent and now-start>=threshold:\n                        output.append(['hold',k])\n                        pending[k][1]=True\n            elif kind=='up' and key in pending:\n                start,sent=pending[key]\n                if not sent:\n                    output.append(['hold' if now>=threshold else 'tap',key])\n                del pending[key]\n            elif kind=='cancel':\n                pending.pop(key,None)\n        return [output,sorted([[k]+v for k,v in pending.items()])]\n    return [run(c) for c in cases]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('hold-threshold scenario 0', solve([[5, []]] * N), [[[], []]] * N)\ncheck('hold-threshold scenario 1', solve([[5, [['down', 'A', 10], ['tick', '', 12]]]] * N), [[[], [['A', 10, False]]]] * N)\ncheck('hold-threshold scenario 2', solve([[5, [['down', 'A', 10], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], []]] * N)\ncheck('hold-threshold scenario 3', solve([[5, [['down', 'A', 10], ['up', 'A', 15]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 4', solve([[5, [['down', 'A', 10], ['tick', '', 15], ['tick', '', 16], ['up', 'A', 17]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 5', solve([[5, [['down', 'A', 10], ['down', 'A', 13], ['tick', '', 15]]]] * N), [[[['hold', 'A']], [['A', 10, True]]]] * N)\ncheck('hold-threshold scenario 6', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], [['B', 11, False]]]] * N)\ncheck('hold-threshold scenario 7', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['cancel', 'A', 12], ['tick', '', 16]]]] * N), [[[['hold', 'B']], [['B', 11, True]]]] * N)\ncheck('hold-threshold scenario 8', solve([[5, [['up', 'A', 100]]]] * N), [[[], []]] * N)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"df4d2826816f84301f1aca176aa4a7f9bbdd3e7b23853adaae2d8aeb74d9e1f5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cases):\n    def run(c):\n        threshold,events=c\n        pending={}; output=[]\n        for kind,key,now in events:\n            if kind=='down' and key not in pending:\n                pending[key]=[now,False]\n            elif kind=='tick':\n                for k in sorted(pending):\n                    start,sent=pending[k]\n                    if not sent and now-start>=threshold:\n                        output.append(['hold',k])\n                        pending[k][1]=True\n            elif kind=='up' and key in pending:\n                start,sent=pending[key]\n                if not sent:\n                    output.append(['hold' if now-start>threshold else 'tap',key])\n                del pending[key]\n            elif kind=='cancel':\n                pending.pop(key,None)\n        return [output,sorted([[k]+v for k,v in pending.items()])]\n    return [run(c) for c in cases]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('hold-threshold scenario 0', solve([[5, []]] * N), [[[], []]] * N)\ncheck('hold-threshold scenario 1', solve([[5, [['down', 'A', 10], ['tick', '', 12]]]] * N), [[[], [['A', 10, False]]]] * N)\ncheck('hold-threshold scenario 2', solve([[5, [['down', 'A', 10], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], []]] * N)\ncheck('hold-threshold scenario 3', solve([[5, [['down', 'A', 10], ['up', 'A', 15]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 4', solve([[5, [['down', 'A', 10], ['tick', '', 15], ['tick', '', 16], ['up', 'A', 17]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 5', solve([[5, [['down', 'A', 10], ['down', 'A', 13], ['tick', '', 15]]]] * N), [[[['hold', 'A']], [['A', 10, True]]]] * N)\ncheck('hold-threshold scenario 6', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], [['B', 11, False]]]] * N)\ncheck('hold-threshold scenario 7', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['cancel', 'A', 12], ['tick', '', 16]]]] * N), [[[['hold', 'B']], [['B', 11, True]]]] * N)\ncheck('hold-threshold scenario 8', solve([[5, [['up', 'A', 100]]]] * N), [[[], []]] * N)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"3559c584388395b9ad7f21e5c69727bd641bfedebef31b5afa7ed39ccfc09a19","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cases):\n    def run(c):\n        threshold,events=c\n        pending={}; output=[]\n        for kind,key,now in events:\n            if kind=='down' and key not in pending:\n                pending[key]=[now,False]\n            elif kind=='tick':\n                for k in sorted(pending):\n                    start,sent=pending[k]\n                    if not sent and now-start>=threshold:\n                        output.append(['hold',k])\n                        pending[k][1]=True\n            elif kind=='up' and key in pending:\n                start,sent=pending[key]\n                if not sent:\n                    output.append(['hold' if now-start>=threshold else 'tap',key])\n                del pending[key]\n            elif kind=='cancel':\n                pending.pop(key,None)\n        return [output,sorted([[k]+v for k,v in pending.items()])]\n    return [run(c) for c in cases]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('hold-threshold scenario 0', solve([[5, []]] * N), [[[], []]] * N)\ncheck('hold-threshold scenario 1', solve([[5, [['down', 'A', 10], ['tick', '', 12]]]] * N), [[[], [['A', 10, False]]]] * N)\ncheck('hold-threshold scenario 2', solve([[5, [['down', 'A', 10], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], []]] * N)\ncheck('hold-threshold scenario 3', solve([[5, [['down', 'A', 10], ['up', 'A', 15]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 4', solve([[5, [['down', 'A', 10], ['tick', '', 15], ['tick', '', 16], ['up', 'A', 17]]]] * N), [[[['hold', 'A']], []]] * N)\ncheck('hold-threshold scenario 5', solve([[5, [['down', 'A', 10], ['down', 'A', 13], ['tick', '', 15]]]] * N), [[[['hold', 'A']], [['A', 10, True]]]] * N)\ncheck('hold-threshold scenario 6', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['up', 'A', 12]]]] * N), [[[['tap', 'A']], [['B', 11, False]]]] * N)\ncheck('hold-threshold scenario 7', solve([[5, [['down', 'A', 10], ['down', 'B', 11], ['cancel', 'A', 12], ['tick', '', 16]]]] * N), [[[['hold', 'B']], [['B', 11, True]]]] * N)\ncheck('hold-threshold scenario 8', solve([[5, [['up', 'A', 100]]]] * N), [[[], []]] * N)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-keyboard-interactions-hold-threshold-up-threshold","generated_at":"2026-09-29T14:41:59.226440+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Controlled keyboard event processing model for debugging application event logic.","repair":"Use the contract transition `'hold' if now-start>=threshold else 'tap'` at the up threshold fault site; preserve the other state transitions.","root_cause":"A release at the hold boundary is misclassified.","sha256":"c03f29dde677ae2120a14b04a237dc437ee2ecf4070aad6d11eea2d01bd37b1f","title":"Tap versus hold command arbitration: A release at the hold boundary is misclassified · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.29,"exit_code":1,"observations":[{"actual":[[[],[]]],"check":"hold-threshold scenario 0","expected":[[[],[]]],"passed":true},{"actual":[[[],[["A",10,false]]]],"check":"hold-threshold scenario 1","expected":[[[],[["A",10,false]]]],"passed":true},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 2","expected":[[[["tap","A"]],[]]],"passed":false},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 3","expected":[[[["hold","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 4","expected":[[[["hold","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[["A",10,true]]]],"check":"hold-threshold scenario 5","expected":[[[["hold","A"]],[["A",10,true]]]],"passed":true},{"actual":[[[["hold","A"]],[["B",11,false]]]],"check":"hold-threshold scenario 6","expected":[[[["tap","A"]],[["B",11,false]]]],"passed":false},{"actual":[[[["hold","B"]],[["B",11,true]]]],"check":"hold-threshold scenario 7","expected":[[[["hold","B"]],[["B",11,true]]]],"passed":true},{"actual":[[[],[]]],"check":"hold-threshold scenario 8","expected":[[[],[]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hold-threshold scenario 0\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 1\", \"actual\": [[[], [[\"A\", 10, false]]]], \"expected\": [[[], [[\"A\", 10, false]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 2\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"tap\", \"A\"]], []]], \"passed\": false}, {\"check\": \"hold-threshold scenario 3\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 4\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 5\", \"actual\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"expected\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 6\", \"actual\": [[[[\"hold\", \"A\"]], [[\"B\", 11, false]]]], \"expected\": [[[[\"tap\", \"A\"]], [[\"B\", 11, false]]]], \"passed\": false}, {\"check\": \"hold-threshold scenario 7\", \"actual\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"expected\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 8\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.613,"exit_code":1,"observations":[{"actual":[[[],[]]],"check":"hold-threshold scenario 0","expected":[[[],[]]],"passed":true},{"actual":[[[],[["A",10,false]]]],"check":"hold-threshold scenario 1","expected":[[[],[["A",10,false]]]],"passed":true},{"actual":[[[["tap","A"]],[]]],"check":"hold-threshold scenario 2","expected":[[[["tap","A"]],[]]],"passed":true},{"actual":[[[["tap","A"]],[]]],"check":"hold-threshold scenario 3","expected":[[[["hold","A"]],[]]],"passed":false},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 4","expected":[[[["hold","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[["A",10,true]]]],"check":"hold-threshold scenario 5","expected":[[[["hold","A"]],[["A",10,true]]]],"passed":true},{"actual":[[[["tap","A"]],[["B",11,false]]]],"check":"hold-threshold scenario 6","expected":[[[["tap","A"]],[["B",11,false]]]],"passed":true},{"actual":[[[["hold","B"]],[["B",11,true]]]],"check":"hold-threshold scenario 7","expected":[[[["hold","B"]],[["B",11,true]]]],"passed":true},{"actual":[[[],[]]],"check":"hold-threshold scenario 8","expected":[[[],[]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hold-threshold scenario 0\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 1\", \"actual\": [[[], [[\"A\", 10, false]]]], \"expected\": [[[], [[\"A\", 10, false]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 2\", \"actual\": [[[[\"tap\", \"A\"]], []]], \"expected\": [[[[\"tap\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 3\", \"actual\": [[[[\"tap\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": false}, {\"check\": \"hold-threshold scenario 4\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 5\", \"actual\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"expected\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 6\", \"actual\": [[[[\"tap\", \"A\"]], [[\"B\", 11, false]]]], \"expected\": [[[[\"tap\", \"A\"]], [[\"B\", 11, false]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 7\", \"actual\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"expected\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 8\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.887,"exit_code":0,"observations":[{"actual":[[[],[]]],"check":"hold-threshold scenario 0","expected":[[[],[]]],"passed":true},{"actual":[[[],[["A",10,false]]]],"check":"hold-threshold scenario 1","expected":[[[],[["A",10,false]]]],"passed":true},{"actual":[[[["tap","A"]],[]]],"check":"hold-threshold scenario 2","expected":[[[["tap","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 3","expected":[[[["hold","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[]]],"check":"hold-threshold scenario 4","expected":[[[["hold","A"]],[]]],"passed":true},{"actual":[[[["hold","A"]],[["A",10,true]]]],"check":"hold-threshold scenario 5","expected":[[[["hold","A"]],[["A",10,true]]]],"passed":true},{"actual":[[[["tap","A"]],[["B",11,false]]]],"check":"hold-threshold scenario 6","expected":[[[["tap","A"]],[["B",11,false]]]],"passed":true},{"actual":[[[["hold","B"]],[["B",11,true]]]],"check":"hold-threshold scenario 7","expected":[[[["hold","B"]],[["B",11,true]]]],"passed":true},{"actual":[[[],[]]],"check":"hold-threshold scenario 8","expected":[[[],[]]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hold-threshold scenario 0\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 1\", \"actual\": [[[], [[\"A\", 10, false]]]], \"expected\": [[[], [[\"A\", 10, false]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 2\", \"actual\": [[[[\"tap\", \"A\"]], []]], \"expected\": [[[[\"tap\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 3\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 4\", \"actual\": [[[[\"hold\", \"A\"]], []]], \"expected\": [[[[\"hold\", \"A\"]], []]], \"passed\": true}, {\"check\": \"hold-threshold scenario 5\", \"actual\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"expected\": [[[[\"hold\", \"A\"]], [[\"A\", 10, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 6\", \"actual\": [[[[\"tap\", \"A\"]], [[\"B\", 11, false]]]], \"expected\": [[[[\"tap\", \"A\"]], [[\"B\", 11, false]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 7\", \"actual\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"expected\": [[[[\"hold\", \"B\"]], [[\"B\", 11, true]]]], \"passed\": true}, {\"check\": \"hold-threshold scenario 8\", \"actual\": [[[], []]], \"expected\": [[[], []]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}