FAILURE MAP
← Case archive

FA-28531 / HTTP redirects / Open access

Select a redirect rule by explicit priority, specificity and declaration order: shadowed match targets · case 01

Select a redirect rule by explicit priority, specificity and declaration order: the shadowed match targets branch emits an incorrect decision.

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

ROOT CAUSE

The shadowed-match-targets decision uses '[r[3] for r in rules][1:]'; this violates the stipulated controller policy.

VERIFIED REPAIR

At this decision use '[r[3] for r in sorted(rules,key=lambda r:r[1]) if r[0]==path and r[2]==method][1:]', preserving the other controller outputs.

Unsuccessful approach: The partial repair uses '[]' and still fails an explicit boundary or control.

Case contract

Select a redirect rule by explicit priority, specificity and declaration order. The explicit fixture inputs and outputs define a bounded offline policy; request identity must accompany the decision.

Why this case matters

Models a redirect controller decision before following a target or exposing a redirect result.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, rules, path, method):
    return {'request': request, 'decision': [[r[3] for r in rules if r[0]==path], [r[3] for r in rules if r[2]==method], [r[3] for r in sorted(rules,key=lambda r:r[1])], [r[3] for r in rules], next((r[3] for r in sorted(rules,key=lambda r:r[1]) if r[0]==path and r[2]==method),None), len(rules), sum(r[0]==path and r[2]==method for r in rules), method == 'HEAD', [r[3] for r in rules][1:], not any(r[0]==path and r[2]==method for r in rules)]} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [['/a', 3, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', 1, 'POST', '/p'], ['/a', 2, 'GET', '/g']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/1', 'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/b', 1, 'GET', '/b'], ['/a', 1, 'GET', '/a']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', 1, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/3', 'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [], '/a', 'GET'), {'request': '/requests/' + str(N) + '/4', 'decision': [[], [], [], [], None, 0, 0, False, [], True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', 1, 'HEAD', '/h'], ['/ab', 0, 'GET', '/q']], '/ab', 'HEAD'), {'request': '/requests/' + str(N) + '/5', 'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True]})
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 1{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/y'], False], 'request': '/requests/1/0'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False], 'request': '/requests/1/0'}Failed
fixture 2{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, ['/g'], False], 'request': '/requests/1/1'}{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False], 'request': '/requests/1/1'}Failed
fixture 3{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, ['/a'], False], 'request': '/requests/1/2'}{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False], 'request': '/requests/1/2'}Failed
fixture 4{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False], 'request': '/requests/1/3'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False], 'request': '/requests/1/3'}Passed
fixture 5{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, ['/q'], True], 'request': '/requests/1/5'}{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True], 'request': '/requests/1/5'}Failed

SHA-256 / c0da9a39e2a9e63de78647a7838eae200f102cee858aec376f7a9491ed6adaf3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, rules, path, method):
    return {'request': request, 'decision': [[r[3] for r in rules if r[0]==path], [r[3] for r in rules if r[2]==method], [r[3] for r in sorted(rules,key=lambda r:r[1])], [r[3] for r in rules], next((r[3] for r in sorted(rules,key=lambda r:r[1]) if r[0]==path and r[2]==method),None), len(rules), sum(r[0]==path and r[2]==method for r in rules), method == 'HEAD', [], not any(r[0]==path and r[2]==method for r in rules)]} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [['/a', 3, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', 1, 'POST', '/p'], ['/a', 2, 'GET', '/g']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/1', 'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/b', 1, 'GET', '/b'], ['/a', 1, 'GET', '/a']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', 1, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/3', 'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [], '/a', 'GET'), {'request': '/requests/' + str(N) + '/4', 'decision': [[], [], [], [], None, 0, 0, False, [], True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', 1, 'HEAD', '/h'], ['/ab', 0, 'GET', '/q']], '/ab', 'HEAD'), {'request': '/requests/' + str(N) + '/5', 'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True]})
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 1{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, [], False], 'request': '/requests/1/0'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False], 'request': '/requests/1/0'}Failed
fixture 2{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False], 'request': '/requests/1/1'}{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False], 'request': '/requests/1/1'}Passed
fixture 3{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False], 'request': '/requests/1/2'}{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False], 'request': '/requests/1/2'}Passed
fixture 4{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, [], False], 'request': '/requests/1/3'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False], 'request': '/requests/1/3'}Failed
fixture 5{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True], 'request': '/requests/1/5'}{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True], 'request': '/requests/1/5'}Passed

SHA-256 / d8e44fe74211b8e6235de7f42a4e27bb36b4950323dab192506f42bf5cf6825e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from urllib.parse import urlsplit, unquote, quote
import posixpath
import re
N = 1
observations = []
def solve(request, rules, path, method):
    return {'request': request, 'decision': [[r[3] for r in rules if r[0]==path], [r[3] for r in rules if r[2]==method], [r[3] for r in sorted(rules,key=lambda r:r[1])], [r[3] for r in rules], next((r[3] for r in sorted(rules,key=lambda r:r[1]) if r[0]==path and r[2]==method),None), len(rules), sum(r[0]==path and r[2]==method for r in rules), method == 'HEAD', [r[3] for r in sorted(rules,key=lambda r:r[1]) if r[0]==path and r[2]==method][1:], not any(r[0]==path and r[2]==method for r in rules)]} 
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve('/requests/' + str(N) + '/0', [['/a', 3, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/0', 'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False]})
check('fixture 2', solve('/requests/' + str(N) + '/1', [['/a', 1, 'POST', '/p'], ['/a', 2, 'GET', '/g']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/1', 'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False]})
check('fixture 3', solve('/requests/' + str(N) + '/2', [['/b', 1, 'GET', '/b'], ['/a', 1, 'GET', '/a']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/2', 'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False]})
check('fixture 4', solve('/requests/' + str(N) + '/3', [['/a', 1, 'GET', '/x'], ['/a', 1, 'GET', '/y']], '/a', 'GET'), {'request': '/requests/' + str(N) + '/3', 'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False]})
check('fixture 5', solve('/requests/' + str(N) + '/4', [], '/a', 'GET'), {'request': '/requests/' + str(N) + '/4', 'decision': [[], [], [], [], None, 0, 0, False, [], True]})
check('fixture 6', solve('/requests/' + str(N) + '/5', [['/a', 1, 'HEAD', '/h'], ['/ab', 0, 'GET', '/q']], '/ab', 'HEAD'), {'request': '/requests/' + str(N) + '/5', 'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True]})
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 1{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False], 'request': '/requests/1/0'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/y', '/x'], ['/x', '/y'], '/y', 2, 2, False, ['/x'], False], 'request': '/requests/1/0'}Passed
fixture 2{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False], 'request': '/requests/1/1'}{'decision': [['/p', '/g'], ['/g'], ['/p', '/g'], ['/p', '/g'], '/g', 2, 1, False, [], False], 'request': '/requests/1/1'}Passed
fixture 3{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False], 'request': '/requests/1/2'}{'decision': [['/a'], ['/b', '/a'], ['/b', '/a'], ['/b', '/a'], '/a', 2, 1, False, [], False], 'request': '/requests/1/2'}Passed
fixture 4{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False], 'request': '/requests/1/3'}{'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/x', '/y'], '/x', 2, 2, False, ['/y'], False], 'request': '/requests/1/3'}Passed
fixture 5{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}{'decision': [[], [], [], [], None, 0, 0, False, [], True], 'request': '/requests/1/4'}Passed
fixture 6{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True], 'request': '/requests/1/5'}{'decision': [['/q'], ['/h'], ['/q', '/h'], ['/h', '/q'], None, 2, 0, True, [], True], 'request': '/requests/1/5'}Passed

SHA-256 / 958e0480841026be92c80ced6fdafaa0f548e79d23e048d78c9a9d07affb5415

Verification & scope

Stipulated offline redirect policy, not a complete HTTP, browser, URL, cache, or security implementation. Numbered variants vary request correlation identity. 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:34.756351+00:00.

Case digest / 8873e1b94b942e8cb36f614d4f492d9e9bf521cee04596bcb13499460b098841