{"abstract":"The operation returns a result or retained state that violates this contract: Membership testing on a one-pass iterator consumes through the matched item and leaves only later items.","category":"Iterator consumption","checks":4,"contract":"Membership testing on a one-pass iterator consumes through the matched item and leaves only later items. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-ac21977f4db83a73","failed_approach":"Materializing before membership consumes the entire stream beyond the match.","family":"xr-iterator-membership-consumes-through-match","id":"FA-4646","implementations":{"attempt":{"sha256":"757ebb3544c5b6c196e59c0251aa5d84720ed66cc455c608d7697454ced5096f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport itertools as it\nfrom collections import deque\nN = 1\nobservations = []\ndef solve(x, y=None):\n    g=iter(x); a=y in list(g); return [a,list(g)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('middle match', solve(['a', 'b', 'c'], 'b'), [True, ['c']])\ncheck('first match', solve(['a', 'b'], 'a'), [True, ['b']])\ncheck('missing exhausts', solve(['a'], 'z'), [False, []])\ncheck('empty', solve([], 'z'), [False, []])\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":"cdb95e047570cf236b2518a0ea52c60b6d187226cc22ca74b9a1c529274d70d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport itertools as it\nfrom collections import deque\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return [y in x,list(x)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('middle match', solve(['a', 'b', 'c'], 'b'), [True, ['c']])\ncheck('first match', solve(['a', 'b'], 'a'), [True, ['b']])\ncheck('missing exhausts', solve(['a'], 'z'), [False, []])\ncheck('empty', solve([], 'z'), [False, []])\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":"63c3a820246230d378ae83770fa4d5d90e48bea6dcdaa2ea71f712ef3c45dce2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport itertools as it\nfrom collections import deque\nN = 1\nobservations = []\ndef solve(x, y=None):\n    g=iter(x); a=y in g; return [a,list(g)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('middle match', solve(['a', 'b', 'c'], 'b'), [True, ['c']])\ncheck('first match', solve(['a', 'b'], 'a'), [True, ['b']])\ncheck('missing exhausts', solve(['a'], 'z'), [False, []])\ncheck('empty', solve([], 'z'), [False, []])\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-iterator-membership-consumes-through-match","generated_at":"2026-09-29T14:37:41.433695+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.","repair":"Membership testing on a one-pass iterator consumes through the matched item and leaves only later items.","root_cause":"Membership is tested on the original reusable list rather than advancing the iterator.","sha256":"67688627af32774bcc90cf3d12b8e525df462d5feb5741849d85d2e825d4f8e0","title":"Iterator membership consumes through match · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verification":{"attempt":{"elapsed_ms":40.422,"exit_code":1,"observations":[{"actual":[true,[]],"check":"middle match","expected":[true,["c"]],"passed":false},{"actual":[true,[]],"check":"first match","expected":[true,["b"]],"passed":false},{"actual":[false,[]],"check":"missing exhausts","expected":[false,[]],"passed":true},{"actual":[false,[]],"check":"empty","expected":[false,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"middle match\", \"actual\": [true, []], \"expected\": [true, [\"c\"]], \"passed\": false}, {\"check\": \"first match\", \"actual\": [true, []], \"expected\": [true, [\"b\"]], \"passed\": false}, {\"check\": \"missing exhausts\", \"actual\": [false, []], \"expected\": [false, []], \"passed\": true}, {\"check\": \"empty\", \"actual\": [false, []], \"expected\": [false, []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":36.745,"exit_code":1,"observations":[{"actual":[true,["a","b","c"]],"check":"middle match","expected":[true,["c"]],"passed":false},{"actual":[true,["a","b"]],"check":"first match","expected":[true,["b"]],"passed":false},{"actual":[false,["a"]],"check":"missing exhausts","expected":[false,[]],"passed":false},{"actual":[false,[]],"check":"empty","expected":[false,[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"middle match\", \"actual\": [true, [\"a\", \"b\", \"c\"]], \"expected\": [true, [\"c\"]], \"passed\": false}, {\"check\": \"first match\", \"actual\": [true, [\"a\", \"b\"]], \"expected\": [true, [\"b\"]], \"passed\": false}, {\"check\": \"missing exhausts\", \"actual\": [false, [\"a\"]], \"expected\": [false, []], \"passed\": false}, {\"check\": \"empty\", \"actual\": [false, []], \"expected\": [false, []], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":36.277,"exit_code":0,"observations":[{"actual":[true,["c"]],"check":"middle match","expected":[true,["c"]],"passed":true},{"actual":[true,["b"]],"check":"first match","expected":[true,["b"]],"passed":true},{"actual":[false,[]],"check":"missing exhausts","expected":[false,[]],"passed":true},{"actual":[false,[]],"check":"empty","expected":[false,[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"middle match\", \"actual\": [true, [\"c\"]], \"expected\": [true, [\"c\"]], \"passed\": true}, {\"check\": \"first match\", \"actual\": [true, [\"b\"]], \"expected\": [true, [\"b\"]], \"passed\": true}, {\"check\": \"missing exhausts\", \"actual\": [false, []], \"expected\": [false, []], \"passed\": true}, {\"check\": \"empty\", \"actual\": [false, []], \"expected\": [false, []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}