FAILURE MAP
← Case archive

FA-6646 / HTTP redirects / Open access

Loop detection ignores URL fragments but retains query identity · case 01

Loop detection ignores URL fragments but retains query identity.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The faulty implementation uses `url in visited` for the redirect-loop decision.

VERIFIED REPAIR

Apply the explicit redirect-loop contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `url.split('?',1)[0].split('#',1)[0] in {v.split('?',1)[0].split('#',1)[0] for v in visited}` and still violates a separate fixture.

Case contract

Loop detection ignores URL fragments but retains query identity: return the result specified by the explicit input/output boundary fixtures.

Why this case matters

This deterministic http redirects model isolates the redirect-loop 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(url, visited):
    return url in visited
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#new', ['/a#old']), True)", "check('fixture 2', solve('/a?q=2', ['/a?q=1']), False)", "check('fixture 3', solve('/b', ['/a']), False)", "check('fixture 4', solve('/a', []), False)"]
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 fixtureActualExpectedOutcome
fixture 2FalseFalsePassed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1FalseTrueFailed

SHA-256 / 2a28232fda0eb95173cfe29807d31234407e4b9db50fdb8485728150393960c8

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(url, visited):
    return url.split('?',1)[0].split('#',1)[0] in {v.split('?',1)[0].split('#',1)[0] for v in visited}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#new', ['/a#old']), True)", "check('fixture 2', solve('/a?q=2', ['/a?q=1']), False)", "check('fixture 3', solve('/b', ['/a']), False)", "check('fixture 4', solve('/a', []), False)"]
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 fixtureActualExpectedOutcome
fixture 2TrueFalseFailed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / fa45865151294bb6de757891317c2c3b67ff8d418e21e029bcf946a90af353e4

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(url, visited):
    return url.split('#',1)[0] in {v.split('#',1)[0] for v in visited}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a#new', ['/a#old']), True)", "check('fixture 2', solve('/a?q=2', ['/a?q=1']), False)", "check('fixture 3', solve('/b', ['/a']), False)", "check('fixture 4', solve('/a', []), False)"]
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 fixtureActualExpectedOutcome
fixture 2FalseFalsePassed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / 096636b6039c13c0502017eec0d80704948dc1f36975ff3ed5c45b669622d572

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:03.958346+00:00.

Case digest / 1bab2d15b20355cb3332386eb35986404c33f2db905f6a05baf4e13571ccfcb6