{"abstract":"An exhausted factory is invoked one extra time","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 if calls>=limit+1: but still violates a regression oracle.","family":"s3-http_retries-factory-body-cap","id":"FA-29456","implementations":{"attempt":{"sha256":"7d32f4aa3ab9eda2d671e452f2af67d911e3e1c77975f7fb31f5f3b2e895b91f","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+1:\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":"848eee1399c5384d30a95eb341a1cb8d4a67c3cc4f96dc02cffd01b2c7cba2e5","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"},"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-cap","generated_at":"2026-09-29T14:41:43.434167+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 if calls>=limit:.","root_cause":"An exhausted factory is invoked one extra time","sha256":"4b4eb7c554f78cca052e6ce89ff4886f634ac372c96e78e66d7a806f1f5ae82e","title":"Fresh body factories on retries: An exhausted factory is invoked one extra time · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.23,"exit_code":1,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"factory",[1,2,3],"factory"],"check":"1","expected":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"passed":false},{"actual":["factory",[1,2]],"check":"2","expected":["factory",[1,2]],"passed":true},{"actual":["factory",[]],"check":"3","expected":["factory",[]],"passed":true},{"actual":["factory",[1]],"check":"4","expected":["exhausted","inactive"],"passed":false},{"actual":["factory","inactive","factory",[2]],"check":"5","expected":["factory","inactive","factory",[2]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"1\", \"actual\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"factory\"], \"expected\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"passed\": false}, {\"check\": \"2\", \"actual\": [\"factory\", [1, 2]], \"expected\": [\"factory\", [1, 2]], \"passed\": true}, {\"check\": \"3\", \"actual\": [\"factory\", []], \"expected\": [\"factory\", []], \"passed\": true}, {\"check\": \"4\", \"actual\": [\"factory\", [1]], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": false}, {\"check\": \"5\", \"actual\": [\"factory\", \"inactive\", \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.161,"exit_code":1,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"factory",[1,2,3],"factory"],"check":"1","expected":["factory",[1,2],[3],[],"factory",[1,2,3],"exhausted"],"passed":false},{"actual":["factory",[1,2]],"check":"2","expected":["factory",[1,2]],"passed":true},{"actual":["factory",[]],"check":"3","expected":["factory",[]],"passed":true},{"actual":["factory",[1]],"check":"4","expected":["exhausted","inactive"],"passed":false},{"actual":["factory","inactive","factory",[2]],"check":"5","expected":["factory","inactive","factory",[2]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"1\", \"actual\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"factory\"], \"expected\": [\"factory\", [1, 2], [3], [], \"factory\", [1, 2, 3], \"exhausted\"], \"passed\": false}, {\"check\": \"2\", \"actual\": [\"factory\", [1, 2]], \"expected\": [\"factory\", [1, 2]], \"passed\": true}, {\"check\": \"3\", \"actual\": [\"factory\", []], \"expected\": [\"factory\", []], \"passed\": true}, {\"check\": \"4\", \"actual\": [\"factory\", [1]], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": false}, {\"check\": \"5\", \"actual\": [\"factory\", \"inactive\", \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.482,"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"}