{"abstract":"Opening a recipe exposes a stale previous body before invoking its factory","category":"HTTP retries","checks":6,"contract":"open sets a body factory recipe; attempt calls it to make a fresh cursor, read consumes the current body, change changes the recipe for future logical requests only, new snapshots the changed recipe. Return emitted chunks; attempts beyond allowance return exhausted. Recipe is snapshotted on open/new.","evaluation_group":"s3-http_retries-factory-body","failed_approach":"The attempted repair changes the faulty site to active=calls==0\n    elif but still violates a regression oracle.","family":"s3-http_retries-factory-body-new-inactive","id":"FA-29451","implementations":{"attempt":{"sha256":"79cecbba6d54757bcc525d0a13e2dda77e2c3c547b2e5355d8d4ea7b9f213f16","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(events):\n    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False\n    for e in events:\n        if e[0] in ('open','new'):\n            recipe=list(e[1]); limit=e[2]\n            snapshot=tuple(recipe)\n            calls=0\n            active=calls==0\n        elif e[0]=='change': recipe[:]=e[1]\n        elif e[0]=='attempt':\n            if calls>=limit:\n                out.append('exhausted'); active=False; continue\n            body=list(snapshot)\n            cursor=0\n            calls+=1\n            active=True\n            out.append('factory')\n        elif e[0]=='read':\n            if not active: out.append('inactive'); continue\n            chunk=body[cursor:cursor+e[1]]\n            cursor+=len(chunk)\n            out.append(chunk)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([]), [])\ncheck('1', solve([('open',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])\ncheck('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])\ncheck('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])\ncheck('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])\ncheck('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])\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":"d505b5a0e55c16c068fcf0bee21a4651e68104b35f29c260574c7fa4664977f4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(events):\n    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False\n    for e in events:\n        if e[0] in ('open','new'):\n            recipe=list(e[1]); limit=e[2]\n            snapshot=tuple(recipe)\n            calls=0\n            active=True\n        elif e[0]=='change': recipe[:]=e[1]\n        elif e[0]=='attempt':\n            if calls>=limit:\n                out.append('exhausted'); active=False; continue\n            body=list(snapshot)\n            cursor=0\n            calls+=1\n            active=True\n            out.append('factory')\n        elif e[0]=='read':\n            if not active: out.append('inactive'); continue\n            chunk=body[cursor:cursor+e[1]]\n            cursor+=len(chunk)\n            out.append(chunk)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([]), [])\ncheck('1', solve([('open',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])\ncheck('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])\ncheck('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])\ncheck('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])\ncheck('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])\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":"583b9d90190284a19466c10aa3e48e7523c10605c9675147686d38e8c17a45fd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(events):\n    recipe=[]; snapshot=(); body=[]; cursor=0; calls=0; limit=0; out=[]; active=False\n    for e in events:\n        if e[0] in ('open','new'):\n            recipe=list(e[1]); limit=e[2]\n            snapshot=tuple(recipe)\n            calls=0\n            active=False\n        elif e[0]=='change': recipe[:]=e[1]\n        elif e[0]=='attempt':\n            if calls>=limit:\n                out.append('exhausted'); active=False; continue\n            body=list(snapshot)\n            cursor=0\n            calls+=1\n            active=True\n            out.append('factory')\n        elif e[0]=='read':\n            if not active: out.append('inactive'); continue\n            chunk=body[cursor:cursor+e[1]]\n            cursor+=len(chunk)\n            out.append(chunk)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([]), [])\ncheck('1', solve([('open',[N,N+1,N+2],2),('attempt',),('read',2),('read',1),('read',1),('attempt',),('read',3),('attempt',)]), ['factory',[N,N+1],[N+2],[],'factory',[N,N+1,N+2],'exhausted'])\ncheck('2', solve([('open',[N,N+1],1),('change',[9]),('attempt',),('read',2)]), ['factory',[N,N+1]])\ncheck('3', solve([('open',[],1),('attempt',),('read',1)]), ['factory',[]])\ncheck('4', solve([('open',[N],0),('attempt',),('read',1)]), ['exhausted','inactive'])\ncheck('5', solve([('open',[N],1),('attempt',),('new',[N+1],1),('read',1),('attempt',),('read',1)]), ['factory','inactive','factory',[N+1]])\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":"Stipulated bounded simulator, not a complete HTTP implementation or a standards 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-http_retries-factory-body-new-inactive","generated_at":"2026-09-29T14:41:43.340056+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Offline deterministic model of HTTP request retries.","repair":"Restore the specified transition active=False\n    elif.","root_cause":"Opening a recipe exposes a stale previous body before invoking its factory","sha256":"122a065795810a1e266cbb1564f4718f707c26f9a9dd1b84d67bfc2579399077","title":"Fresh body factories on retries: Opening a recipe exposes a stale previous body before invoking its factory · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.882,"exit_code":1,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"check":"1","expected":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"passed":true},{"actual":["factory",[1,2]],"check":"2","expected":["factory",[1,2]],"passed":true},{"actual":["factory",[]],"check":"3","expected":["factory",[]],"passed":true},{"actual":["exhausted","inactive"],"check":"4","expected":["exhausted","inactive"],"passed":true},{"actual":["factory",[1],"factory",[2]],"check":"5","expected":["factory","inactive","factory",[2]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"1\", \"actual\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"expected\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"passed\": true}, {\"check\": \"2\", \"actual\": [\"factory\", [1, 2]], \"expected\": [\"factory\", [1, 2]], \"passed\": true}, {\"check\": \"3\", \"actual\": [\"factory\", []], \"expected\": [\"factory\", []], \"passed\": true}, {\"check\": \"4\", \"actual\": [\"exhausted\", \"inactive\"], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": true}, {\"check\": \"5\", \"actual\": [\"factory\", [1], \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.297,"exit_code":1,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"check":"1","expected":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"passed":true},{"actual":["factory",[1,2]],"check":"2","expected":["factory",[1,2]],"passed":true},{"actual":["factory",[]],"check":"3","expected":["factory",[]],"passed":true},{"actual":["exhausted","inactive"],"check":"4","expected":["exhausted","inactive"],"passed":true},{"actual":["factory",[1],"factory",[2]],"check":"5","expected":["factory","inactive","factory",[2]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"1\", \"actual\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"expected\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"passed\": true}, {\"check\": \"2\", \"actual\": [\"factory\", [1, 2]], \"expected\": [\"factory\", [1, 2]], \"passed\": true}, {\"check\": \"3\", \"actual\": [\"factory\", []], \"expected\": [\"factory\", []], \"passed\": true}, {\"check\": \"4\", \"actual\": [\"exhausted\", \"inactive\"], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": true}, {\"check\": \"5\", \"actual\": [\"factory\", [1], \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.134,"exit_code":0,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"check":"1","expected":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"passed":true},{"actual":["factory",[1,2]],"check":"2","expected":["factory",[1,2]],"passed":true},{"actual":["factory",[]],"check":"3","expected":["factory",[]],"passed":true},{"actual":["exhausted","inactive"],"check":"4","expected":["exhausted","inactive"],"passed":true},{"actual":["factory","inactive","factory",[2]],"check":"5","expected":["factory","inactive","factory",[2]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"1\", \"actual\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"expected\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"passed\": true}, {\"check\": \"2\", \"actual\": [\"factory\", [1, 2]], \"expected\": [\"factory\", [1, 2]], \"passed\": true}, {\"check\": \"3\", \"actual\": [\"factory\", []], \"expected\": [\"factory\", []], \"passed\": true}, {\"check\": \"4\", \"actual\": [\"exhausted\", \"inactive\"], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": true}, {\"check\": \"5\", \"actual\": [\"factory\", \"inactive\", \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}