FA-26541 / HTTP ranges / Open access
A short socket write preserves the unsent byte suffix · case 01
A short socket write preserves the unsent byte suffix.
ROOT CAUSE
The stream-short-write-resume decision uses return "".
VERIFIED REPAIR
Apply the bounded decision exactly: return pending[accepted:]
Unsuccessful approach: The partial repair uses return pending[accepted:] if accepted else "", which still violates the stated contract.
Case contract
accepted is a valid integer count in [0,len(pending)]. Return remaining ASCII bytes after only that count was accepted.
Why this case matters
Range responses combine representation identity, conditional requests, framing, and partial-object state.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(pending, accepted):
return ""
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-short-write-resume fixture 0', solve("abc"*N,N), ("abc"*N)[N:])
check('stream-short-write-resume fixture 1', solve("abc",0), "abc")
check('stream-short-write-resume fixture 2', solve("abc",3), "")
check('stream-short-write-resume fixture 3', solve("",0), "")
check('stream-short-write-resume fixture 4', solve("x",1), "")
check('stream-short-write-resume fixture 5', solve("abcd",2), "cd")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| stream-short-write-resume fixture 0 | | bc | Failed |
| stream-short-write-resume fixture 1 | | abc | Failed |
| stream-short-write-resume fixture 2 | | | Passed |
| stream-short-write-resume fixture 3 | | | Passed |
| stream-short-write-resume fixture 4 | | | Passed |
| stream-short-write-resume fixture 5 | | cd | Failed |
SHA-256 / ac514114da33c57d75bbcc39cb766855c161633fb347374642b2f9d6f31b55d4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(pending, accepted):
return pending[accepted:] if accepted else ""
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-short-write-resume fixture 0', solve("abc"*N,N), ("abc"*N)[N:])
check('stream-short-write-resume fixture 1', solve("abc",0), "abc")
check('stream-short-write-resume fixture 2', solve("abc",3), "")
check('stream-short-write-resume fixture 3', solve("",0), "")
check('stream-short-write-resume fixture 4', solve("x",1), "")
check('stream-short-write-resume fixture 5', solve("abcd",2), "cd")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| stream-short-write-resume fixture 0 | bc | bc | Passed |
| stream-short-write-resume fixture 1 | | abc | Failed |
| stream-short-write-resume fixture 2 | | | Passed |
| stream-short-write-resume fixture 3 | | | Passed |
| stream-short-write-resume fixture 4 | | | Passed |
| stream-short-write-resume fixture 5 | cd | cd | Passed |
SHA-256 / 0ffbb15fa5decfa725df4625dfda456573706d080929989de4f2f2d6e358a286
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(pending, accepted):
return pending[accepted:]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stream-short-write-resume fixture 0', solve("abc"*N,N), ("abc"*N)[N:])
check('stream-short-write-resume fixture 1', solve("abc",0), "abc")
check('stream-short-write-resume fixture 2', solve("abc",3), "")
check('stream-short-write-resume fixture 3', solve("",0), "")
check('stream-short-write-resume fixture 4', solve("x",1), "")
check('stream-short-write-resume fixture 5', solve("abcd",2), "cd")
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| stream-short-write-resume fixture 0 | bc | bc | Passed |
| stream-short-write-resume fixture 1 | abc | abc | Passed |
| stream-short-write-resume fixture 2 | | | Passed |
| stream-short-write-resume fixture 3 | | | Passed |
| stream-short-write-resume fixture 4 | | | Passed |
| stream-short-write-resume fixture 5 | cd | cd | Passed |
SHA-256 / 42ec9089dbdbbeed4054a6707c507e83a0923e608d31aaeb4fc1f19146e2fced
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:41:16.906514+00:00.
Case digest / 0b90ec7cf24c4f3309f96c453b19fc5aba14ad858a9a6a95fc616d799f205387