{"abstract":"A multipart sender resumes framing and payload segments across transport credit windows: zero transport credit cannot emit a pending delimiter byte.","category":"HTTP ranges","checks":7,"contract":"x has nonempty ASCII segments representing alternating boundary/header/body/framing bytes, and nonnegative write budgets. Drain in order, consuming each budget across segment boundaries. Return [one emitted string per budget,segment-index,intra-segment-offset]. Empty segments are skipped even with zero budget. A exhausted plan is stable. These preframed segments isolate cursor management from wire-format construction.","evaluation_group":"s3-http_ranges-multipart-write-cursor","failed_approach":"The partial repair uses segments=x['segments']\nindex=0\noffset=0\nout=[]\nfor budget in x['budgets']:\n    sent=''\n    while index<len(segments):\n        segment=segments[index]\n        if offset>=len(segment):\n            index+=1\n            offset=0\n            continue\n        if budget==0 and sent: break\n        if budget==0: budget=1\n        amount=min(budget,len(segment)-offset)\n        sent+=segment[offset:offset+amount]\n        offset+=amount\n        budget-=amount\n    out.append(sent)\nreturn [out,index,offset], which still violates the stated contract.","family":"s3-http_ranges-multipart-write-cursor-zero-credit","id":"FA-27151","implementations":{"attempt":{"sha256":"1edbfc53a24625e312483c83ce9307477447156c1773085b5557c9f4e6acc2ae","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    segments=x['segments']\n    index=0\n    offset=0\n    out=[]\n    for budget in x['budgets']:\n        sent=''\n        while index<len(segments):\n            segment=segments[index]\n            if offset>=len(segment):\n                index+=1\n                offset=0\n                continue\n            if budget==0 and sent: break\n            if budget==0: budget=1\n            amount=min(budget,len(segment)-offset)\n            sent+=segment[offset:offset+amount]\n            offset+=amount\n            budget-=amount\n        out.append(sent)\n    return [out,index,offset]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero-credit fixture 0', json.loads(json.dumps(solve({'segments':['--b','H','BODY','\\r\\n'],'budgets':[2,2,3,3]}))), json.loads(json.dumps([['--','bH','BOD','Y\\r\\n'],4,0])))\ncheck('zero-credit fixture 1', json.loads(json.dumps(solve({'segments':['A','BC'],'budgets':[1,0,1,1,1]}))), json.loads(json.dumps([['A','','B','C',''],2,0])))\ncheck('zero-credit fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))\ncheck('zero-credit fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))\ncheck('zero-credit fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))\ncheck('zero-credit fixture 5', json.loads(json.dumps(solve({'segments':[\"p\"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([[\"p\"*N,'X'],2,0])))\ncheck('zero-credit fixture 6', json.loads(json.dumps(solve({'segments':['AB','CDE'],'budgets':[4]}))), json.loads(json.dumps([['ABCD'],1,2])))\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":"3f9cb56746e2c652084b87cb854fb5b95c49e40a72b9f0610d3982204172feb6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    segments=x['segments']\n    index=0\n    offset=0\n    out=[]\n    for budget in x['budgets']:\n        sent=''\n        while index<len(segments):\n            segment=segments[index]\n            if offset>=len(segment):\n                index+=1\n                offset=0\n                continue\n            if budget==0: budget=1\n            amount=min(budget,len(segment)-offset)\n            sent+=segment[offset:offset+amount]\n            offset+=amount\n            budget-=amount\n        out.append(sent)\n    return [out,index,offset]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero-credit fixture 0', json.loads(json.dumps(solve({'segments':['--b','H','BODY','\\r\\n'],'budgets':[2,2,3,3]}))), json.loads(json.dumps([['--','bH','BOD','Y\\r\\n'],4,0])))\ncheck('zero-credit fixture 1', json.loads(json.dumps(solve({'segments':['A','BC'],'budgets':[1,0,1,1,1]}))), json.loads(json.dumps([['A','','B','C',''],2,0])))\ncheck('zero-credit fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))\ncheck('zero-credit fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))\ncheck('zero-credit fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))\ncheck('zero-credit fixture 5', json.loads(json.dumps(solve({'segments':[\"p\"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([[\"p\"*N,'X'],2,0])))\ncheck('zero-credit fixture 6', json.loads(json.dumps(solve({'segments':['AB','CDE'],'budgets':[4]}))), json.loads(json.dumps([['ABCD'],1,2])))\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":"6d0021779c7db0de4e3403b26ccd4a46981dc5ecf7f7f8e92567a310064ea542","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    segments=x['segments']\n    index=0\n    offset=0\n    out=[]\n    for budget in x['budgets']:\n        sent=''\n        while index<len(segments):\n            segment=segments[index]\n            if offset>=len(segment):\n                index+=1\n                offset=0\n                continue\n            if budget==0: break\n            amount=min(budget,len(segment)-offset)\n            sent+=segment[offset:offset+amount]\n            offset+=amount\n            budget-=amount\n        out.append(sent)\n    return [out,index,offset]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero-credit fixture 0', json.loads(json.dumps(solve({'segments':['--b','H','BODY','\\r\\n'],'budgets':[2,2,3,3]}))), json.loads(json.dumps([['--','bH','BOD','Y\\r\\n'],4,0])))\ncheck('zero-credit fixture 1', json.loads(json.dumps(solve({'segments':['A','BC'],'budgets':[1,0,1,1,1]}))), json.loads(json.dumps([['A','','B','C',''],2,0])))\ncheck('zero-credit fixture 2', json.loads(json.dumps(solve({'segments':['','A','','BC',''],'budgets':[0,2,1]}))), json.loads(json.dumps([['','AB','C'],5,0])))\ncheck('zero-credit fixture 3', json.loads(json.dumps(solve({'segments':[],'budgets':[0,1]}))), json.loads(json.dumps([['',''],0,0])))\ncheck('zero-credit fixture 4', json.loads(json.dumps(solve({'segments':['ABCDE'],'budgets':[2,1]}))), json.loads(json.dumps([['AB','C'],0,3])))\ncheck('zero-credit fixture 5', json.loads(json.dumps(solve({'segments':[\"p\"*N,'X'],'budgets':[N,1]}))), json.loads(json.dumps([[\"p\"*N,'X'],2,0])))\ncheck('zero-credit fixture 6', json.loads(json.dumps(solve({'segments':['AB','CDE'],'budgets':[4]}))), json.loads(json.dumps([['ABCD'],1,2])))\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":"Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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_ranges-multipart-write-cursor-zero-credit","generated_at":"2026-09-29T14:41:22.616766+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Range responses combine representation identity, conditional requests, framing, and partial-object state.","repair":"Apply the bounded decision exactly: segments=x['segments']\nindex=0\noffset=0\nout=[]\nfor budget in x['budgets']:\n    sent=''\n    while index<len(segments):\n        segment=segments[index]\n        if offset>=len(segment):\n            index+=1\n            offset=0\n            continue\n        if budget==0: break\n        amount=min(budget,len(segment)-offset)\n        sent+=segment[offset:offset+amount]\n        offset+=amount\n        budget-=amount\n    out.append(sent)\nreturn [out,index,offset]","root_cause":"The multipart-write-cursor-zero-credit decision uses segments=x['segments']\nindex=0\noffset=0\nout=[]\nfor budget in x['budgets']:\n    sent=''\n    while index<len(segments):\n        segment=segments[index]\n        if offset>=len(segment):\n            index+=1\n            offset=0\n            continue\n        if budget==0: budget=1\n        amount=min(budget,len(segment)-offset)\n        sent+=segment[offset:offset+amount]\n        offset+=amount\n        budget-=amount\n    out.append(sent)\nreturn [out,index,offset].","sha256":"2f859c4614ef5f38534dc6f6292ace2cf8f740dd8fe3ae16287798c206f622c3","title":"A multipart sender resumes framing and payload segments across transport credit windows: zero transport credit cannot emit a pending delimiter byte · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.25,"exit_code":1,"observations":[{"actual":[["--","bH","BOD","Y\r\n"],4,0],"check":"zero-credit fixture 0","expected":[["--","bH","BOD","Y\r\n"],4,0],"passed":true},{"actual":[["A","B","C","",""],2,0],"check":"zero-credit fixture 1","expected":[["A","","B","C",""],2,0],"passed":false},{"actual":[["A","BC",""],5,0],"check":"zero-credit fixture 2","expected":[["","AB","C"],5,0],"passed":false},{"actual":[["",""],0,0],"check":"zero-credit fixture 3","expected":[["",""],0,0],"passed":true},{"actual":[["AB","C"],0,3],"check":"zero-credit fixture 4","expected":[["AB","C"],0,3],"passed":true},{"actual":[["p","X"],2,0],"check":"zero-credit fixture 5","expected":[["p","X"],2,0],"passed":true},{"actual":[["ABCD"],1,2],"check":"zero-credit fixture 6","expected":[["ABCD"],1,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero-credit fixture 0\", \"actual\": [[\"--\", \"bH\", \"BOD\", \"Y\\r\\n\"], 4, 0], \"expected\": [[\"--\", \"bH\", \"BOD\", \"Y\\r\\n\"], 4, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 1\", \"actual\": [[\"A\", \"B\", \"C\", \"\", \"\"], 2, 0], \"expected\": [[\"A\", \"\", \"B\", \"C\", \"\"], 2, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 2\", \"actual\": [[\"A\", \"BC\", \"\"], 5, 0], \"expected\": [[\"\", \"AB\", \"C\"], 5, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 3\", \"actual\": [[\"\", \"\"], 0, 0], \"expected\": [[\"\", \"\"], 0, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 4\", \"actual\": [[\"AB\", \"C\"], 0, 3], \"expected\": [[\"AB\", \"C\"], 0, 3], \"passed\": true}, {\"check\": \"zero-credit fixture 5\", \"actual\": [[\"p\", \"X\"], 2, 0], \"expected\": [[\"p\", \"X\"], 2, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 6\", \"actual\": [[\"ABCD\"], 1, 2], \"expected\": [[\"ABCD\"], 1, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.336,"exit_code":1,"observations":[{"actual":[["--bHBODY\r\n","","",""],4,0],"check":"zero-credit fixture 0","expected":[["--","bH","BOD","Y\r\n"],4,0],"passed":false},{"actual":[["ABC","","","",""],2,0],"check":"zero-credit fixture 1","expected":[["A","","B","C",""],2,0],"passed":false},{"actual":[["ABC","",""],5,0],"check":"zero-credit fixture 2","expected":[["","AB","C"],5,0],"passed":false},{"actual":[["",""],0,0],"check":"zero-credit fixture 3","expected":[["",""],0,0],"passed":true},{"actual":[["ABCDE",""],1,0],"check":"zero-credit fixture 4","expected":[["AB","C"],0,3],"passed":false},{"actual":[["pX",""],2,0],"check":"zero-credit fixture 5","expected":[["p","X"],2,0],"passed":false},{"actual":[["ABCDE"],2,0],"check":"zero-credit fixture 6","expected":[["ABCD"],1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero-credit fixture 0\", \"actual\": [[\"--bHBODY\\r\\n\", \"\", \"\", \"\"], 4, 0], \"expected\": [[\"--\", \"bH\", \"BOD\", \"Y\\r\\n\"], 4, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 1\", \"actual\": [[\"ABC\", \"\", \"\", \"\", \"\"], 2, 0], \"expected\": [[\"A\", \"\", \"B\", \"C\", \"\"], 2, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 2\", \"actual\": [[\"ABC\", \"\", \"\"], 5, 0], \"expected\": [[\"\", \"AB\", \"C\"], 5, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 3\", \"actual\": [[\"\", \"\"], 0, 0], \"expected\": [[\"\", \"\"], 0, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 4\", \"actual\": [[\"ABCDE\", \"\"], 1, 0], \"expected\": [[\"AB\", \"C\"], 0, 3], \"passed\": false}, {\"check\": \"zero-credit fixture 5\", \"actual\": [[\"pX\", \"\"], 2, 0], \"expected\": [[\"p\", \"X\"], 2, 0], \"passed\": false}, {\"check\": \"zero-credit fixture 6\", \"actual\": [[\"ABCDE\"], 2, 0], \"expected\": [[\"ABCD\"], 1, 2], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.166,"exit_code":0,"observations":[{"actual":[["--","bH","BOD","Y\r\n"],4,0],"check":"zero-credit fixture 0","expected":[["--","bH","BOD","Y\r\n"],4,0],"passed":true},{"actual":[["A","","B","C",""],2,0],"check":"zero-credit fixture 1","expected":[["A","","B","C",""],2,0],"passed":true},{"actual":[["","AB","C"],5,0],"check":"zero-credit fixture 2","expected":[["","AB","C"],5,0],"passed":true},{"actual":[["",""],0,0],"check":"zero-credit fixture 3","expected":[["",""],0,0],"passed":true},{"actual":[["AB","C"],0,3],"check":"zero-credit fixture 4","expected":[["AB","C"],0,3],"passed":true},{"actual":[["p","X"],2,0],"check":"zero-credit fixture 5","expected":[["p","X"],2,0],"passed":true},{"actual":[["ABCD"],1,2],"check":"zero-credit fixture 6","expected":[["ABCD"],1,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero-credit fixture 0\", \"actual\": [[\"--\", \"bH\", \"BOD\", \"Y\\r\\n\"], 4, 0], \"expected\": [[\"--\", \"bH\", \"BOD\", \"Y\\r\\n\"], 4, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 1\", \"actual\": [[\"A\", \"\", \"B\", \"C\", \"\"], 2, 0], \"expected\": [[\"A\", \"\", \"B\", \"C\", \"\"], 2, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 2\", \"actual\": [[\"\", \"AB\", \"C\"], 5, 0], \"expected\": [[\"\", \"AB\", \"C\"], 5, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 3\", \"actual\": [[\"\", \"\"], 0, 0], \"expected\": [[\"\", \"\"], 0, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 4\", \"actual\": [[\"AB\", \"C\"], 0, 3], \"expected\": [[\"AB\", \"C\"], 0, 3], \"passed\": true}, {\"check\": \"zero-credit fixture 5\", \"actual\": [[\"p\", \"X\"], 2, 0], \"expected\": [[\"p\", \"X\"], 2, 0], \"passed\": true}, {\"check\": \"zero-credit fixture 6\", \"actual\": [[\"ABCD\"], 1, 2], \"expected\": [[\"ABCD\"], 1, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}