FA-28516 / HTTP redirects / Open access
Select a redirect rule by explicit priority, specificity and declaration order: rule count not target count · case 01
Select a redirect rule by explicit priority, specificity and declaration order: the rule count not target count branch emits an incorrect decision.
ROOT CAUSE
The rule-count-not-target-count decision uses 'len(set(r[0] for r in rules))'; this violates the stipulated controller policy.
VERIFIED REPAIR
At this decision use 'len(rules)', preserving the other controller outputs.
Unsuccessful approach: The partial repair uses 'len(set(r[1] 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])], [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(set(r[0] for r in 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', 1, 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', 1, 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', 1, 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'} | 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 / 47f865591214171c90e1a75adb741236c727d79ab81241f8292ac5602c24b225
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(set(r[1] for r in 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', 1, 1, False, [], 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', 1, 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'} | 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 / c1fbff8d35039f98288039320aa3d31421a07138f69f86c99d5f7c3f1a5295ba
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.548591+00:00.
Case digest / 91f5c9866f2901a9b40bb365be91c0915a4ff4d2b7cb627be91737f5398c6b12