FA-26771 / HTTP ranges / Open access
A checkpoint beyond local file size must be discarded before a range request · case 01
A checkpoint beyond local file size must be discarded before a range request.
ROOT CAUSE
The resume-local-file-truncation decision uses return checkpoint.
VERIFIED REPAIR
Apply the bounded decision exactly: return checkpoint if checkpoint<=file_size else 0
Unsuccessful approach: The partial repair uses return min(checkpoint,file_size), which still violates the stated contract.
Case contract
Return checkpoint if checkpoint<=file_size else zero; nonnegative integers. Extra uncheckpointed file bytes do not advance checkpoint.
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(checkpoint, file_size):
return checkpoint
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-local-file-truncation fixture 0', solve(N+1,N), 0)
check('resume-local-file-truncation fixture 1', solve(N,2*N), N)
check('resume-local-file-truncation fixture 2', solve(N,N), N)
check('resume-local-file-truncation fixture 3', solve(0,N), 0)
check('resume-local-file-truncation fixture 4', solve(N,0), 0)
check('resume-local-file-truncation fixture 5', solve(0,0), 0)
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 |
|---|---|---|---|
| resume-local-file-truncation fixture 0 | 2 | 0 | Failed |
| resume-local-file-truncation fixture 1 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 2 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 3 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 4 | 1 | 0 | Failed |
| resume-local-file-truncation fixture 5 | 0 | 0 | Passed |
SHA-256 / a580d83d85ed18b1452ef2c7de4739e4b9f77b725596291c322b656efa15f261
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(checkpoint, file_size):
return min(checkpoint,file_size)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-local-file-truncation fixture 0', solve(N+1,N), 0)
check('resume-local-file-truncation fixture 1', solve(N,2*N), N)
check('resume-local-file-truncation fixture 2', solve(N,N), N)
check('resume-local-file-truncation fixture 3', solve(0,N), 0)
check('resume-local-file-truncation fixture 4', solve(N,0), 0)
check('resume-local-file-truncation fixture 5', solve(0,0), 0)
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 |
|---|---|---|---|
| resume-local-file-truncation fixture 0 | 1 | 0 | Failed |
| resume-local-file-truncation fixture 1 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 2 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 3 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 4 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 5 | 0 | 0 | Passed |
SHA-256 / 400150d5c96ca2c8a86c865a33dee2d473a270f4ae5c5c660a66dc2ae68c1e1a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(checkpoint, file_size):
return checkpoint if checkpoint<=file_size else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('resume-local-file-truncation fixture 0', solve(N+1,N), 0)
check('resume-local-file-truncation fixture 1', solve(N,2*N), N)
check('resume-local-file-truncation fixture 2', solve(N,N), N)
check('resume-local-file-truncation fixture 3', solve(0,N), 0)
check('resume-local-file-truncation fixture 4', solve(N,0), 0)
check('resume-local-file-truncation fixture 5', solve(0,0), 0)
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 |
|---|---|---|---|
| resume-local-file-truncation fixture 0 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 1 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 2 | 1 | 1 | Passed |
| resume-local-file-truncation fixture 3 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 4 | 0 | 0 | Passed |
| resume-local-file-truncation fixture 5 | 0 | 0 | Passed |
SHA-256 / 7b338170c2e94356f4dfc0a81a8b0524aa229cc03b54282f53bda1edc96dac8f
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:18.929919+00:00.
Case digest / ae52925e98505df66266962eba72a66cc0946670f199397e1b155c58ef7f7df2