{"abstract":"The event trace violates the lock toggle rule and produces incorrect keyboard state or command output.","category":"Keyboard interactions","checks":10,"contract":"Events [kind,value]. Toggle flips desired lock bit 0..2. Send creates monotonically numbered snapshot request only when desired differs applied. Ack for an in-flight id newer than accepted applies that request snapshot, advances accepted id and discards requests <= ack. Unknown or stale ack is ignored. Reset sets applied=0, clears in-flight requests and accepted watermark but preserves desired and increasing request serial. Return desired,applied,serial,accepted,in-flight and sent [id,mask]. Inputs are finite ordered event traces; return the stated deterministic state. Batch entries are independent. N varies the number of independent input transactions.","contract_signature":"cases","evaluation_group":"s3-keyboard-lock-led-ack","failed_approach":"The partial repair changes this transition to desired^=value, which still violates the model contract on the explicit regression traces.","family":"s3-keyboard-interactions-lock-led-ack-lock-toggle","id":"FA-32141","implementations":{"attempt":{"sha256":"895e9e39a577649c4ba8ebcac769fcbb04b550362692e51f8989701b794fc014","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cases):\n    def run(c):\n        desired=0; applied=0; serial=0; accepted=0; inflight={}; sent=[]\n        for kind,value in c:\n            if kind=='toggle': desired^=value\n            elif kind=='send' and desired!=applied:\n                serial+=1\n                inflight[serial]=desired\n                sent.append([serial,desired])\n            elif kind=='ack' and value in inflight and value>accepted:\n                applied=inflight[value]\n                accepted=value\n                inflight={k:v for k,v in inflight.items() if k>value}\n            elif kind=='reset':\n                applied=0; inflight={}; accepted=0\n        return [desired,applied,serial,accepted,sorted([[k,v] for k,v in inflight.items()]),sent]\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('lock-led-ack scenario 0', solve([[]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 1', solve([[['send', 0]]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 2', solve([[['toggle', 0], ['toggle', 0], ['send', 0]]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 3', solve([[['toggle', 2], ['send', 0], ['ack', 1]]] * N), [[4, 4, 1, 1, [], [[1, 4]]]] * N)\ncheck('lock-led-ack scenario 4', solve([[['toggle', 0], ['send', 0], ['toggle', 1], ['send', 0], ['ack', 1]]] * N), [[3, 1, 2, 1, [[2, 3]], [[1, 1], [2, 3]]]] * N)\ncheck('lock-led-ack scenario 5', solve([[['toggle', 0], ['send', 0], ['toggle', 1], ['send', 0], ['ack', 2], ['ack', 1]]] * N), [[3, 3, 2, 2, [], [[1, 1], [2, 3]]]] * N)\ncheck('lock-led-ack scenario 6', solve([[['toggle', 1], ['send', 0], ['send', 0], ['ack', 1]]] * N), [[2, 2, 2, 1, [[2, 2]], [[1, 2], [2, 2]]]] * N)\ncheck('lock-led-ack scenario 7', solve([[['toggle', 2], ['send', 0], ['reset', 0], ['send', 0]]] * N), [[4, 0, 2, 0, [[2, 4]], [[1, 4], [2, 4]]]] * N)\ncheck('lock-led-ack scenario 8', solve([[['toggle', 0], ['send', 0], ['ack', 1], ['send', 0]]] * N), [[1, 1, 1, 1, [], [[1, 1]]]] * N)\ncheck('lock-led-ack scenario 9', solve([[['ack', 999]]] * N), [[0, 0, 0, 0, [], []]] * 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":"8f3a6db6c3a99161c9455eba2f4e5d15c60e19360b756a59cd34aa8d6c35ad17","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cases):\n    def run(c):\n        desired=0; applied=0; serial=0; accepted=0; inflight={}; sent=[]\n        for kind,value in c:\n            if kind=='toggle': desired|=1<<value\n            elif kind=='send' and desired!=applied:\n                serial+=1\n                inflight[serial]=desired\n                sent.append([serial,desired])\n            elif kind=='ack' and value in inflight and value>accepted:\n                applied=inflight[value]\n                accepted=value\n                inflight={k:v for k,v in inflight.items() if k>value}\n            elif kind=='reset':\n                applied=0; inflight={}; accepted=0\n        return [desired,applied,serial,accepted,sorted([[k,v] for k,v in inflight.items()]),sent]\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('lock-led-ack scenario 0', solve([[]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 1', solve([[['send', 0]]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 2', solve([[['toggle', 0], ['toggle', 0], ['send', 0]]] * N), [[0, 0, 0, 0, [], []]] * N)\ncheck('lock-led-ack scenario 3', solve([[['toggle', 2], ['send', 0], ['ack', 1]]] * N), [[4, 4, 1, 1, [], [[1, 4]]]] * N)\ncheck('lock-led-ack scenario 4', solve([[['toggle', 0], ['send', 0], ['toggle', 1], ['send', 0], ['ack', 1]]] * N), [[3, 1, 2, 1, [[2, 3]], [[1, 1], [2, 3]]]] * N)\ncheck('lock-led-ack scenario 5', solve([[['toggle', 0], ['send', 0], ['toggle', 1], ['send', 0], ['ack', 2], ['ack', 1]]] * N), [[3, 3, 2, 2, [], [[1, 1], [2, 3]]]] * N)\ncheck('lock-led-ack scenario 6', solve([[['toggle', 1], ['send', 0], ['send', 0], ['ack', 1]]] * N), [[2, 2, 2, 1, [[2, 2]], [[1, 2], [2, 2]]]] * N)\ncheck('lock-led-ack scenario 7', solve([[['toggle', 2], ['send', 0], ['reset', 0], ['send', 0]]] * N), [[4, 0, 2, 0, [[2, 4]], [[1, 4], [2, 4]]]] * N)\ncheck('lock-led-ack scenario 8', solve([[['toggle', 0], ['send', 0], ['ack', 1], ['send', 0]]] * N), [[1, 1, 1, 1, [], [[1, 1]]]] * N)\ncheck('lock-led-ack scenario 9', solve([[['ack', 999]]] * N), [[0, 0, 0, 0, [], []]] * 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-lock-led-ack-lock-toggle","generated_at":"2026-09-29T14:42:09.577986+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.","root_cause":"Lock indicator toggle sets a bit permanently or treats bit index as mask.","sha256":"5daa17d30f2c29393034d921fe7c0485e8d1440d4ef592e168ff8fae3367a826","title":"Keyboard lock indicator request acknowledgements: Lock indicator toggle sets a bit permanently or treats bit index as mask · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":44.079,"exit_code":1,"observations":[{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 0","expected":[[0,0,0,0,[],[]]],"passed":true},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 1","expected":[[0,0,0,0,[],[]]],"passed":true},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 2","expected":[[0,0,0,0,[],[]]],"passed":true},{"actual":[[2,2,1,1,[],[[1,2]]]],"check":"lock-led-ack scenario 3","expected":[[4,4,1,1,[],[[1,4]]]],"passed":false},{"actual":[[1,1,1,1,[],[[1,1]]]],"check":"lock-led-ack scenario 4","expected":[[3,1,2,1,[[2,3]],[[1,1],[2,3]]]],"passed":false},{"actual":[[1,1,1,1,[],[[1,1]]]],"check":"lock-led-ack scenario 5","expected":[[3,3,2,2,[],[[1,1],[2,3]]]],"passed":false},{"actual":[[1,1,2,1,[[2,1]],[[1,1],[2,1]]]],"check":"lock-led-ack scenario 6","expected":[[2,2,2,1,[[2,2]],[[1,2],[2,2]]]],"passed":false},{"actual":[[2,0,2,0,[[2,2]],[[1,2],[2,2]]]],"check":"lock-led-ack scenario 7","expected":[[4,0,2,0,[[2,4]],[[1,4],[2,4]]]],"passed":false},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 8","expected":[[1,1,1,1,[],[[1,1]]]],"passed":false},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 9","expected":[[0,0,0,0,[],[]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lock-led-ack scenario 0\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 1\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 2\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 3\", \"actual\": [[2, 2, 1, 1, [], [[1, 2]]]], \"expected\": [[4, 4, 1, 1, [], [[1, 4]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 4\", \"actual\": [[1, 1, 1, 1, [], [[1, 1]]]], \"expected\": [[3, 1, 2, 1, [[2, 3]], [[1, 1], [2, 3]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 5\", \"actual\": [[1, 1, 1, 1, [], [[1, 1]]]], \"expected\": [[3, 3, 2, 2, [], [[1, 1], [2, 3]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 6\", \"actual\": [[1, 1, 2, 1, [[2, 1]], [[1, 1], [2, 1]]]], \"expected\": [[2, 2, 2, 1, [[2, 2]], [[1, 2], [2, 2]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 7\", \"actual\": [[2, 0, 2, 0, [[2, 2]], [[1, 2], [2, 2]]]], \"expected\": [[4, 0, 2, 0, [[2, 4]], [[1, 4], [2, 4]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 8\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[1, 1, 1, 1, [], [[1, 1]]]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 9\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.941,"exit_code":1,"observations":[{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 0","expected":[[0,0,0,0,[],[]]],"passed":true},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 1","expected":[[0,0,0,0,[],[]]],"passed":true},{"actual":[[1,0,1,0,[[1,1]],[[1,1]]]],"check":"lock-led-ack scenario 2","expected":[[0,0,0,0,[],[]]],"passed":false},{"actual":[[4,4,1,1,[],[[1,4]]]],"check":"lock-led-ack scenario 3","expected":[[4,4,1,1,[],[[1,4]]]],"passed":true},{"actual":[[3,1,2,1,[[2,3]],[[1,1],[2,3]]]],"check":"lock-led-ack scenario 4","expected":[[3,1,2,1,[[2,3]],[[1,1],[2,3]]]],"passed":true},{"actual":[[3,3,2,2,[],[[1,1],[2,3]]]],"check":"lock-led-ack scenario 5","expected":[[3,3,2,2,[],[[1,1],[2,3]]]],"passed":true},{"actual":[[2,2,2,1,[[2,2]],[[1,2],[2,2]]]],"check":"lock-led-ack scenario 6","expected":[[2,2,2,1,[[2,2]],[[1,2],[2,2]]]],"passed":true},{"actual":[[4,0,2,0,[[2,4]],[[1,4],[2,4]]]],"check":"lock-led-ack scenario 7","expected":[[4,0,2,0,[[2,4]],[[1,4],[2,4]]]],"passed":true},{"actual":[[1,1,1,1,[],[[1,1]]]],"check":"lock-led-ack scenario 8","expected":[[1,1,1,1,[],[[1,1]]]],"passed":true},{"actual":[[0,0,0,0,[],[]]],"check":"lock-led-ack scenario 9","expected":[[0,0,0,0,[],[]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lock-led-ack scenario 0\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 1\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 2\", \"actual\": [[1, 0, 1, 0, [[1, 1]], [[1, 1]]]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": false}, {\"check\": \"lock-led-ack scenario 3\", \"actual\": [[4, 4, 1, 1, [], [[1, 4]]]], \"expected\": [[4, 4, 1, 1, [], [[1, 4]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 4\", \"actual\": [[3, 1, 2, 1, [[2, 3]], [[1, 1], [2, 3]]]], \"expected\": [[3, 1, 2, 1, [[2, 3]], [[1, 1], [2, 3]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 5\", \"actual\": [[3, 3, 2, 2, [], [[1, 1], [2, 3]]]], \"expected\": [[3, 3, 2, 2, [], [[1, 1], [2, 3]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 6\", \"actual\": [[2, 2, 2, 1, [[2, 2]], [[1, 2], [2, 2]]]], \"expected\": [[2, 2, 2, 1, [[2, 2]], [[1, 2], [2, 2]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 7\", \"actual\": [[4, 0, 2, 0, [[2, 4]], [[1, 4], [2, 4]]]], \"expected\": [[4, 0, 2, 0, [[2, 4]], [[1, 4], [2, 4]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 8\", \"actual\": [[1, 1, 1, 1, [], [[1, 1]]]], \"expected\": [[1, 1, 1, 1, [], [[1, 1]]]], \"passed\": true}, {\"check\": \"lock-led-ack scenario 9\", \"actual\": [[0, 0, 0, 0, [], []]], \"expected\": [[0, 0, 0, 0, [], []]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}