{"abstract":"Factory calls fail to consume exactly one attempt allowance","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 calls+=2 but still violates a regression oracle.","family":"s3-http_retries-factory-body-charge","id":"FA-29471","implementations":{"attempt":{"sha256":"c15194d89359b52f5d2ceb3b44da244ab14193b5e7d98590930d73363af2c889","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+=2\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":"27f0ca9fc1c7914968cd5b29afc52e37df3a52070a5c39361622ae949bf1021c","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-charge","generated_at":"2026-09-29T14:41:43.526217+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 calls+=1.","root_cause":"Factory calls fail to consume exactly one attempt allowance","sha256":"b16f55eaf78838e925a67fe44f60272ef2daeb62ad9b7746ed54c400b8e98a5e","title":"Fresh body factories on retries: Factory calls fail to consume exactly one attempt allowance · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.766,"exit_code":1,"observations":[{"actual":[],"check":"0","expected":[],"passed":true},{"actual":["factory",[1,2],[3],[],"exhausted","inactive","exhausted"],"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":["exhausted","inactive"],"check":"4","expected":["exhausted","inactive"],"passed":true},{"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], [], \"exhausted\", \"inactive\", \"exhausted\"], \"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\": [\"exhausted\", \"inactive\"], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": true}, {\"check\": \"5\", \"actual\": [\"factory\", \"inactive\", \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.825,"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":["exhausted","inactive"],"check":"4","expected":["exhausted","inactive"],"passed":true},{"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\": [\"exhausted\", \"inactive\"], \"expected\": [\"exhausted\", \"inactive\"], \"passed\": true}, {\"check\": \"5\", \"actual\": [\"factory\", \"inactive\", \"factory\", [2]], \"expected\": [\"factory\", \"inactive\", \"factory\", [2]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":46.069,"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"}