FA-6651 / HTTP redirects / Open access
A redirect budget charges redirects rather than the initial request · case 01
A redirect budget charges redirects rather than the initial request.
ROOT CAUSE
The faulty implementation uses `redirects <= limit` for the redirect-budget decision.
VERIFIED REPAIR
Apply the explicit redirect-budget contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `redirects + 1 < limit` and still violates a separate fixture.
Case contract
A redirect budget charges redirects rather than the initial request: return the result specified by the explicit input/output boundary fixtures.
Why this case matters
This deterministic http redirects model isolates the redirect-budget policy at a network component boundary.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(redirects, limit):
return redirects <= limit
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), False)", "check('fixture 2', solve(1, 2), True)", "check('fixture 3', solve(0, 0), False)", "check('fixture 4', solve(0, 3), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | True | True | Passed |
| fixture 3 | True | False | Failed |
| fixture 4 | True | True | Passed |
| fixture 1 | True | False | Failed |
SHA-256 / af74133717f97b7521ae3e762529f9be208ce3fd93a1d62841fd77ed9addebe6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(redirects, limit):
return redirects + 1 < limit
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), False)", "check('fixture 2', solve(1, 2), True)", "check('fixture 3', solve(0, 0), False)", "check('fixture 4', solve(0, 3), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | False | True | Failed |
| fixture 3 | False | False | Passed |
| fixture 4 | True | True | Passed |
| fixture 1 | False | False | Passed |
SHA-256 / 9b271e7d5dbb68c93c405792f17e6658a206f394d46bd6e705cb85188fd7cbbb
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(redirects, limit):
return redirects < limit
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(2, 2), False)", "check('fixture 2', solve(1, 2), True)", "check('fixture 3', solve(0, 0), False)", "check('fixture 4', solve(0, 3), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | True | True | Passed |
| fixture 3 | False | False | Passed |
| fixture 4 | True | True | Passed |
| fixture 1 | False | False | Passed |
SHA-256 / d7950513f7b2088cece039a923e47f4c7727bb2805d52fa7c1290c179fcdf2b3
Verification & scope
Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. 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:38:04.015784+00:00.
Case digest / 05bc00f8b6df94d87863cb533558757b35332eebda32ae73ef999343953a075f