FA-28501 / HTTP redirects / Open access
Select a redirect rule by explicit priority, specificity and declaration order: lower priority first · case 01
Select a redirect rule by explicit priority, specificity and declaration order: the lower priority first branch emits an incorrect decision.
ROOT CAUSE
The lower-priority-first decision uses '[r[3] for r in sorted(rules,key=lambda r:r[1],reverse=True)]'; this violates the stipulated controller policy.
VERIFIED REPAIR
At this decision use '[r[3] for r in sorted(rules,key=lambda r:r[1])]', preserving the other controller outputs.
Unsuccessful approach: The partial repair uses '[r[3] for r in rules]' 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],reverse=True)], [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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/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'} | Failed |
| fixture 2 | {'decision': [['/p', '/g'], ['/g'], ['/g', '/p'], ['/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'} | Failed |
| 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'], ['/h', '/q'], ['/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'} | Failed |
SHA-256 / f9b2c5b1138830f5f2405f210118fafc367a129f63113effa230df13dc1ad99d
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 rules], [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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | {'decision': [['/x', '/y'], ['/x', '/y'], ['/x', '/y'], ['/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'} | 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, ['/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'], ['/h', '/q'], ['/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'} | Failed |
SHA-256 / 50b10a40e8a246977081ae7a1cb3e2ebe7479c4510364145f3a52a102f89dd2c
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.466199+00:00.
Case digest / f62d97c8ca987a23b4e52a91ea7c919a5b2212722947f1d56c8cf38a697132dd