{"abstract":"The operation returns a result or retained state that violates this contract: Listeners have identity, event name, once flag, and registration order. Dispatch uses a snapshot; listener actions remove another listener or add a new one. Return callback identities in invocation order. A once listener is removed before callback actions; a callback may explicitly re-register that identity.","category":"Listener lifecycle","checks":5,"contract":"Listeners have identity, event name, once flag, and registration order. Dispatch uses a snapshot; listener actions remove another listener or add a new one. Return callback identities in invocation order. A once listener is removed before callback actions; a callback may explicitly re-register that identity. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","contract_signature":"x, y=None","evaluation_group":"xr-suite-listener-registration-replaces-identity","failed_approach":"The attempted transition changes the behavior but still violates the same invariant in at least one independent regression fixture.","family":"xr-once-listener-removed-before-action","id":"FA-4526","implementations":{"attempt":{"sha256":"69b3091aef9affce61db0ba779b0ccf0a4d2ad62d4474dd41fcccfe93ba23c1b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    listeners={}; out=[]\n    for event in x:\n        op=event[0]\n        if op=='on':\n            _,k,name,once,action=event\n            if True: listeners[k]=[name,once,action]\n        elif op=='off':\n            listeners.pop(event[1],None)\n        elif op=='emit':\n            name=event[1]\n            batch=list(listeners.items())\n            for k,entry in batch:\n                if entry[0]==name:\n                    if entry[1]:\n                        listeners={i:e for i,e in listeners.items() if e[0]!=entry[0]}\n                    out.append(k)\n                    action=entry[2]\n                    if action and action[0]=='off':\n                        listeners.pop(action[1],None)\n                    elif action and action[0]=='on':\n                        listeners[action[1]]=[action[2],False,None]\n        elif op=='names': out.append(list(listeners))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('replacement changes event but preserves order', solve([['on', 'a', 'old', False, None], ['on', 'b', 'new', False, None], ['on', 'a', 'new', False, None], ['emit', 'new'], ['names']]), ['a', 'b', ['a', 'b']])\ncheck('snapshot removal and once lifetime', solve([['on', 'a', 'e', True, ['off', 'b']], ['on', 'b', 'e', False, None], ['on', 'c', 'e', False, None], ['emit', 'e'], ['emit', 'e'], ['names']]), ['a', 'b', 'c', 'c', ['c']])\ncheck('explicit identity removal and event filtering', solve([['on', 'a', 'e', False, None], ['on', 'b', '*', False, None], ['on', 'c', 'e', False, None], ['off', 'a'], ['emit', 'e'], ['names']]), ['c', ['b', 'c']])\ncheck('callback replaces existing target event', solve([['on', 'a', 'e', True, ['on', 'b', 'later']], ['on', 'b', 'old', False, None], ['emit', 'e'], ['emit', 'later'], ['emit', 'old'], ['names']]), ['a', 'b', ['b']])\ncheck('callback replaces metadata rather than setdefault', solve([['on','a','e',True,['on','b','later']],['on','b','old',False,None],['emit','e'],['emit','later'],['emit','later'],['emit','old']]), ['a','b','b'])\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":"65de2190eb793690b5564da5fc4a354d142e622ecf2f7d5a50c2f005cdacaa0e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x, y=None):\n    listeners={}; out=[]\n    for event in x:\n        op=event[0]\n        if op=='on':\n            _,k,name,once,action=event\n            if True: listeners[k]=[name,once,action]\n        elif op=='off':\n            listeners.pop(event[1],None)\n        elif op=='emit':\n            name=event[1]\n            batch=list(listeners.items())\n            for k,entry in batch:\n                if entry[0]==name:\n                    if entry[1]:\n                        pass\n                    out.append(k)\n                    action=entry[2]\n                    if action and action[0]=='off':\n                        listeners.pop(action[1],None)\n                    elif action and action[0]=='on':\n                        listeners[action[1]]=[action[2],False,None]\n        elif op=='names': out.append(list(listeners))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('replacement changes event but preserves order', solve([['on', 'a', 'old', False, None], ['on', 'b', 'new', False, None], ['on', 'a', 'new', False, None], ['emit', 'new'], ['names']]), ['a', 'b', ['a', 'b']])\ncheck('snapshot removal and once lifetime', solve([['on', 'a', 'e', True, ['off', 'b']], ['on', 'b', 'e', False, None], ['on', 'c', 'e', False, None], ['emit', 'e'], ['emit', 'e'], ['names']]), ['a', 'b', 'c', 'c', ['c']])\ncheck('explicit identity removal and event filtering', solve([['on', 'a', 'e', False, None], ['on', 'b', '*', False, None], ['on', 'c', 'e', False, None], ['off', 'a'], ['emit', 'e'], ['names']]), ['c', ['b', 'c']])\ncheck('callback replaces existing target event', solve([['on', 'a', 'e', True, ['on', 'b', 'later']], ['on', 'b', 'old', False, None], ['emit', 'e'], ['emit', 'later'], ['emit', 'old'], ['names']]), ['a', 'b', ['b']])\ncheck('callback replaces metadata rather than setdefault', solve([['on','a','e',True,['on','b','later']],['on','b','old',False,None],['emit','e'],['emit','later'],['emit','later'],['emit','old']]), ['a','b','b'])\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":" 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":"xr-once-listener-removed-before-action","generated_at":"2026-09-29T14:37:40.080052+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.","root_cause":"A once listener is removed before callback actions; a callback may explicitly re-register that identity. The broken transition violates that invariant.","sha256":"c928076d15a3a3a472f3e893c1753ffbf7c65d5ed5af036a860af60a656c195c","title":"Once listener removed before action · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.786,"exit_code":1,"observations":[{"actual":["a","b",["a","b"]],"check":"replacement changes event but preserves order","expected":["a","b",["a","b"]],"passed":true},{"actual":["a","b","c",[]],"check":"snapshot removal and once lifetime","expected":["a","b","c","c",["c"]],"passed":false},{"actual":["c",["b","c"]],"check":"explicit identity removal and event filtering","expected":["c",["b","c"]],"passed":true},{"actual":["a","b",["b"]],"check":"callback replaces existing target event","expected":["a","b",["b"]],"passed":true},{"actual":["a","b","b"],"check":"callback replaces metadata rather than setdefault","expected":["a","b","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"replacement changes event but preserves order\", \"actual\": [\"a\", \"b\", [\"a\", \"b\"]], \"expected\": [\"a\", \"b\", [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"snapshot removal and once lifetime\", \"actual\": [\"a\", \"b\", \"c\", []], \"expected\": [\"a\", \"b\", \"c\", \"c\", [\"c\"]], \"passed\": false}, {\"check\": \"explicit identity removal and event filtering\", \"actual\": [\"c\", [\"b\", \"c\"]], \"expected\": [\"c\", [\"b\", \"c\"]], \"passed\": true}, {\"check\": \"callback replaces existing target event\", \"actual\": [\"a\", \"b\", [\"b\"]], \"expected\": [\"a\", \"b\", [\"b\"]], \"passed\": true}, {\"check\": \"callback replaces metadata rather than setdefault\", \"actual\": [\"a\", \"b\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.305,"exit_code":1,"observations":[{"actual":["a","b",["a","b"]],"check":"replacement changes event but preserves order","expected":["a","b",["a","b"]],"passed":true},{"actual":["a","b","c","a","c",["a","c"]],"check":"snapshot removal and once lifetime","expected":["a","b","c","c",["c"]],"passed":false},{"actual":["c",["b","c"]],"check":"explicit identity removal and event filtering","expected":["c",["b","c"]],"passed":true},{"actual":["a","b",["a","b"]],"check":"callback replaces existing target event","expected":["a","b",["b"]],"passed":false},{"actual":["a","b","b"],"check":"callback replaces metadata rather than setdefault","expected":["a","b","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"replacement changes event but preserves order\", \"actual\": [\"a\", \"b\", [\"a\", \"b\"]], \"expected\": [\"a\", \"b\", [\"a\", \"b\"]], \"passed\": true}, {\"check\": \"snapshot removal and once lifetime\", \"actual\": [\"a\", \"b\", \"c\", \"a\", \"c\", [\"a\", \"c\"]], \"expected\": [\"a\", \"b\", \"c\", \"c\", [\"c\"]], \"passed\": false}, {\"check\": \"explicit identity removal and event filtering\", \"actual\": [\"c\", [\"b\", \"c\"]], \"expected\": [\"c\", [\"b\", \"c\"]], \"passed\": true}, {\"check\": \"callback replaces existing target event\", \"actual\": [\"a\", \"b\", [\"a\", \"b\"]], \"expected\": [\"a\", \"b\", [\"b\"]], \"passed\": false}, {\"check\": \"callback replaces metadata rather than setdefault\", \"actual\": [\"a\", \"b\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"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."}}