{"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. Only listeners registered for the emitted event run.","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. Only listeners registered for the emitted event run. 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-listener-event-name-filter","id":"FA-4521","implementations":{"attempt":{"sha256":"a422a36d74bcbf7deff3d44b4ceb0ac529a627323f5cef5f9c83e07e9fd17aef","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 or entry[0]==\"*\":\n                    if entry[1]:\n                        listeners.pop(k,None)\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":"39aa06717a3dfc08713b3d5ae90d611096391417a6a322226b7dafba83e39bf6","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 True:\n                    if entry[1]:\n                        listeners.pop(k,None)\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-listener-event-name-filter","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":"Only listeners registered for the emitted event run. The broken transition violates that invariant.","sha256":"4e314b3d20ad06dc886cb4286620d536f8f22822b4b7fedeffcb28cb0b64796e","title":"Listener event name filter · 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":39.582,"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","c",["c"]],"check":"snapshot removal and once lifetime","expected":["a","b","c","c",["c"]],"passed":true},{"actual":["b","c",["b","c"]],"check":"explicit identity removal and event filtering","expected":["c",["b","c"]],"passed":false},{"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\", \"c\", [\"c\"]], \"expected\": [\"a\", \"b\", \"c\", \"c\", [\"c\"]], \"passed\": true}, {\"check\": \"explicit identity removal and event filtering\", \"actual\": [\"b\", \"c\", [\"b\", \"c\"]], \"expected\": [\"c\", [\"b\", \"c\"]], \"passed\": false}, {\"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":36.396,"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","c",["c"]],"check":"snapshot removal and once lifetime","expected":["a","b","c","c",["c"]],"passed":true},{"actual":["b","c",["b","c"]],"check":"explicit identity removal and event filtering","expected":["c",["b","c"]],"passed":false},{"actual":["a","b","b","b",["b"]],"check":"callback replaces existing target event","expected":["a","b",["b"]],"passed":false},{"actual":["a","b","b","b","b"],"check":"callback replaces metadata rather than setdefault","expected":["a","b","b"],"passed":false}],"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\", \"c\", [\"c\"]], \"expected\": [\"a\", \"b\", \"c\", \"c\", [\"c\"]], \"passed\": true}, {\"check\": \"explicit identity removal and event filtering\", \"actual\": [\"b\", \"c\", [\"b\", \"c\"]], \"expected\": [\"c\", [\"b\", \"c\"]], \"passed\": false}, {\"check\": \"callback replaces existing target event\", \"actual\": [\"a\", \"b\", \"b\", \"b\", [\"b\"]], \"expected\": [\"a\", \"b\", [\"b\"]], \"passed\": false}, {\"check\": \"callback replaces metadata rather than setdefault\", \"actual\": [\"a\", \"b\", \"b\", \"b\", \"b\"], \"expected\": [\"a\", \"b\", \"b\"], \"passed\": false}], \"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."}}