{"abstract":"Inserting, deleting or replacing source elements alters an iteration that promised a stable snapshot.","category":"Runtime and resources","checks":7,"contract":"Initial is a list of immutable scalar values. Edits are [yield index,operation,position,value] applied immediately before that snapshot yield. Operations append/delete/replace/insert/clear have valid positions at application time. Return [yielded original values,mutated source]. No yields means no scheduled edits execute. This is a shallow scalar snapshot, not object-graph isolation.","evaluation_group":"model-1061e9b93b7d364e","failed_approach":"Remembering the initial length prevents visiting appended items but still reads shifted or replaced live values.","family":"runtime-iterator-snapshot-isolation","id":"FA-286","implementations":{"attempt":{"sha256":"5acae9ab63bbb0dc125eab574482c895739209dff559f525e69b2afbc3f1de43","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, edits):\n    source, snapshot, yielded, index = list(initial), list(initial), [], 0\n    while index < len(snapshot):\n        for step, kind, position, value in edits:\n            if step != index:\n                continue\n            if kind == 'append':\n                source.append(value)\n            elif kind == 'delete':\n                del source[position]\n            elif kind == 'replace':\n                source[position] = value\n            elif kind == 'insert':\n                source.insert(position, value)\n            elif kind == 'clear':\n                source.clear()\n        yielded.append(source[index] if index < len(source) else None)\n        index += 1\n    return [yielded, source]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ninitial = list(range(N+2))\ncheck('appended element is not visited', solve(initial, [[0, 'append', 0, 99]]), [initial, initial+[99]])\ncheck('deleting first cannot skip original', solve(initial, [[0, 'delete', 0, None]]), [initial, initial[1:]])\ncheck('replacement does not rewrite snapshot', solve(initial, [[0, 'replace', 0, 99]]), [initial, [99]+initial[1:]])\ncheck('insertion does not repeat original', solve(initial, [[0, 'insert', 0, 99]]), [initial, [99]+initial])\ncheck('clear still yields captured values', solve(initial, [[0, 'clear', 0, None]]), [initial, []])\ncheck('empty iterator never invokes callbacks', solve([], [[0, 'append', 0, 99]]), [[], []])\ncheck('no mutation preserves order', solve(initial, []), [initial, initial])\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":"a82e71d4f86a42163295afc5171ef766b548e48583ca73a67eb9d11ac8e0f295","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, edits):\n    source, snapshot, yielded, index = list(initial), list(initial), [], 0\n    while index < len(source):\n        for step, kind, position, value in edits:\n            if step != index:\n                continue\n            if kind == 'append':\n                source.append(value)\n            elif kind == 'delete':\n                del source[position]\n            elif kind == 'replace':\n                source[position] = value\n            elif kind == 'insert':\n                source.insert(position, value)\n            elif kind == 'clear':\n                source.clear()\n        yielded.append(source[index] if index < len(source) else None)\n        index += 1\n    return [yielded, source]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ninitial = list(range(N+2))\ncheck('appended element is not visited', solve(initial, [[0, 'append', 0, 99]]), [initial, initial+[99]])\ncheck('deleting first cannot skip original', solve(initial, [[0, 'delete', 0, None]]), [initial, initial[1:]])\ncheck('replacement does not rewrite snapshot', solve(initial, [[0, 'replace', 0, 99]]), [initial, [99]+initial[1:]])\ncheck('insertion does not repeat original', solve(initial, [[0, 'insert', 0, 99]]), [initial, [99]+initial])\ncheck('clear still yields captured values', solve(initial, [[0, 'clear', 0, None]]), [initial, []])\ncheck('empty iterator never invokes callbacks', solve([], [[0, 'append', 0, 99]]), [[], []])\ncheck('no mutation preserves order', solve(initial, []), [initial, initial])\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":"572d8a27b438efc366dbd38333311f075e177b47fbae315bc1062dc78c39a440","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(initial, edits):\n    source, snapshot, yielded, index = list(initial), list(initial), [], 0\n    while index < len(snapshot):\n        for step, kind, position, value in edits:\n            if step != index:\n                continue\n            if kind == 'append':\n                source.append(value)\n            elif kind == 'delete':\n                del source[position]\n            elif kind == 'replace':\n                source[position] = value\n            elif kind == 'insert':\n                source.insert(position, value)\n            elif kind == 'clear':\n                source.clear()\n        yielded.append(snapshot[index])\n        index += 1\n    return [yielded, source]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ninitial = list(range(N+2))\ncheck('appended element is not visited', solve(initial, [[0, 'append', 0, 99]]), [initial, initial+[99]])\ncheck('deleting first cannot skip original', solve(initial, [[0, 'delete', 0, None]]), [initial, initial[1:]])\ncheck('replacement does not rewrite snapshot', solve(initial, [[0, 'replace', 0, 99]]), [initial, [99]+initial[1:]])\ncheck('insertion does not repeat original', solve(initial, [[0, 'insert', 0, 99]]), [initial, [99]+initial])\ncheck('clear still yields captured values', solve(initial, [[0, 'clear', 0, None]]), [initial, []])\ncheck('empty iterator never invokes callbacks', solve([], [[0, 'append', 0, 99]]), [[], []])\ncheck('no mutation preserves order', solve(initial, []), [initial, initial])\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":"runtime-iterator-snapshot-isolation","generated_at":"2026-09-29T14:36:52.031230+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Models stable observer iteration over a collection mutated by callbacks, with explicit separation between snapshot membership and the final state of the source collection.","repair":"Capture the sequence at iterator creation and yield those captured values while mutations affect only the source.","root_cause":"The iterator retains the live collection or just its original length, rather than the original values.","sha256":"05523f0f8c57c528286898345060b29fd20335c633ee082b47567c835de47e25","title":"Mutation changes what an established iterator visits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":35.053,"exit_code":1,"observations":[{"actual":[[0,1,2],[0,1,2,99]],"check":"appended element is not visited","expected":[[0,1,2],[0,1,2,99]],"passed":true},{"actual":[[1,2,null],[1,2]],"check":"deleting first cannot skip original","expected":[[0,1,2],[1,2]],"passed":false},{"actual":[[99,1,2],[99,1,2]],"check":"replacement does not rewrite snapshot","expected":[[0,1,2],[99,1,2]],"passed":false},{"actual":[[99,0,1],[99,0,1,2]],"check":"insertion does not repeat original","expected":[[0,1,2],[99,0,1,2]],"passed":false},{"actual":[[null,null,null],[]],"check":"clear still yields captured values","expected":[[0,1,2],[]],"passed":false},{"actual":[[],[]],"check":"empty iterator never invokes callbacks","expected":[[],[]],"passed":true},{"actual":[[0,1,2],[0,1,2]],"check":"no mutation preserves order","expected":[[0,1,2],[0,1,2]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"appended element is not visited\", \"actual\": [[0, 1, 2], [0, 1, 2, 99]], \"expected\": [[0, 1, 2], [0, 1, 2, 99]], \"passed\": true}, {\"check\": \"deleting first cannot skip original\", \"actual\": [[1, 2, null], [1, 2]], \"expected\": [[0, 1, 2], [1, 2]], \"passed\": false}, {\"check\": \"replacement does not rewrite snapshot\", \"actual\": [[99, 1, 2], [99, 1, 2]], \"expected\": [[0, 1, 2], [99, 1, 2]], \"passed\": false}, {\"check\": \"insertion does not repeat original\", \"actual\": [[99, 0, 1], [99, 0, 1, 2]], \"expected\": [[0, 1, 2], [99, 0, 1, 2]], \"passed\": false}, {\"check\": \"clear still yields captured values\", \"actual\": [[null, null, null], []], \"expected\": [[0, 1, 2], []], \"passed\": false}, {\"check\": \"empty iterator never invokes callbacks\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}, {\"check\": \"no mutation preserves order\", \"actual\": [[0, 1, 2], [0, 1, 2]], \"expected\": [[0, 1, 2], [0, 1, 2]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":35.645,"exit_code":1,"observations":[{"actual":[[0,1,2,99],[0,1,2,99]],"check":"appended element is not visited","expected":[[0,1,2],[0,1,2,99]],"passed":false},{"actual":[[1,2],[1,2]],"check":"deleting first cannot skip original","expected":[[0,1,2],[1,2]],"passed":false},{"actual":[[99,1,2],[99,1,2]],"check":"replacement does not rewrite snapshot","expected":[[0,1,2],[99,1,2]],"passed":false},{"actual":[[99,0,1,2],[99,0,1,2]],"check":"insertion does not repeat original","expected":[[0,1,2],[99,0,1,2]],"passed":false},{"actual":[[null],[]],"check":"clear still yields captured values","expected":[[0,1,2],[]],"passed":false},{"actual":[[],[]],"check":"empty iterator never invokes callbacks","expected":[[],[]],"passed":true},{"actual":[[0,1,2],[0,1,2]],"check":"no mutation preserves order","expected":[[0,1,2],[0,1,2]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"appended element is not visited\", \"actual\": [[0, 1, 2, 99], [0, 1, 2, 99]], \"expected\": [[0, 1, 2], [0, 1, 2, 99]], \"passed\": false}, {\"check\": \"deleting first cannot skip original\", \"actual\": [[1, 2], [1, 2]], \"expected\": [[0, 1, 2], [1, 2]], \"passed\": false}, {\"check\": \"replacement does not rewrite snapshot\", \"actual\": [[99, 1, 2], [99, 1, 2]], \"expected\": [[0, 1, 2], [99, 1, 2]], \"passed\": false}, {\"check\": \"insertion does not repeat original\", \"actual\": [[99, 0, 1, 2], [99, 0, 1, 2]], \"expected\": [[0, 1, 2], [99, 0, 1, 2]], \"passed\": false}, {\"check\": \"clear still yields captured values\", \"actual\": [[null], []], \"expected\": [[0, 1, 2], []], \"passed\": false}, {\"check\": \"empty iterator never invokes callbacks\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}, {\"check\": \"no mutation preserves order\", \"actual\": [[0, 1, 2], [0, 1, 2]], \"expected\": [[0, 1, 2], [0, 1, 2]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":35.419,"exit_code":0,"observations":[{"actual":[[0,1,2],[0,1,2,99]],"check":"appended element is not visited","expected":[[0,1,2],[0,1,2,99]],"passed":true},{"actual":[[0,1,2],[1,2]],"check":"deleting first cannot skip original","expected":[[0,1,2],[1,2]],"passed":true},{"actual":[[0,1,2],[99,1,2]],"check":"replacement does not rewrite snapshot","expected":[[0,1,2],[99,1,2]],"passed":true},{"actual":[[0,1,2],[99,0,1,2]],"check":"insertion does not repeat original","expected":[[0,1,2],[99,0,1,2]],"passed":true},{"actual":[[0,1,2],[]],"check":"clear still yields captured values","expected":[[0,1,2],[]],"passed":true},{"actual":[[],[]],"check":"empty iterator never invokes callbacks","expected":[[],[]],"passed":true},{"actual":[[0,1,2],[0,1,2]],"check":"no mutation preserves order","expected":[[0,1,2],[0,1,2]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"appended element is not visited\", \"actual\": [[0, 1, 2], [0, 1, 2, 99]], \"expected\": [[0, 1, 2], [0, 1, 2, 99]], \"passed\": true}, {\"check\": \"deleting first cannot skip original\", \"actual\": [[0, 1, 2], [1, 2]], \"expected\": [[0, 1, 2], [1, 2]], \"passed\": true}, {\"check\": \"replacement does not rewrite snapshot\", \"actual\": [[0, 1, 2], [99, 1, 2]], \"expected\": [[0, 1, 2], [99, 1, 2]], \"passed\": true}, {\"check\": \"insertion does not repeat original\", \"actual\": [[0, 1, 2], [99, 0, 1, 2]], \"expected\": [[0, 1, 2], [99, 0, 1, 2]], \"passed\": true}, {\"check\": \"clear still yields captured values\", \"actual\": [[0, 1, 2], []], \"expected\": [[0, 1, 2], []], \"passed\": true}, {\"check\": \"empty iterator never invokes callbacks\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}, {\"check\": \"no mutation preserves order\", \"actual\": [[0, 1, 2], [0, 1, 2]], \"expected\": [[0, 1, 2], [0, 1, 2]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}