FA-7166 / Network routing / Open access
Route priority is secondary to match specificity · case 01
Route priority is secondary to match specificity.
ROOT CAUSE
The faulty implementation uses `max(routes,key=lambda r:r[2])[0] if routes else None` for the route-priority-is-secondary-to-match-specificity decision.
VERIFIED REPAIR
Apply the explicit route-priority-is-secondary-to-match-specificity contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `max(routes,key=lambda r:r[1])[0] if routes else None` and still violates a separate fixture.
Case contract
Bounded offline decision model: route priority is secondary to match specificity. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.
Why this case matters
This deterministic network routing model isolates the route-priority-is-secondary-to-match-specificity 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(routes):
return max(routes,key=lambda r:r[2])[0] if routes else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 3, 1), ('b', 2, 9)]), 'a')", "check('fixture 2', solve([('a', 3, 1), ('b', 3, 9)]), 'b')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 1, 1)]), 'a')"]
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 | b | b | Passed |
| fixture 3 | None | None | Passed |
| fixture 4 | a | a | Passed |
| fixture 1 | b | a | Failed |
SHA-256 / 945592ae660cbfef578ed61cc202ac18b836456e544e92ac9343b8212abc5a12
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(routes):
return max(routes,key=lambda r:r[1])[0] if routes else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 3, 1), ('b', 2, 9)]), 'a')", "check('fixture 2', solve([('a', 3, 1), ('b', 3, 9)]), 'b')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 1, 1)]), 'a')"]
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 | a | b | Failed |
| fixture 3 | None | None | Passed |
| fixture 4 | a | a | Passed |
| fixture 1 | a | a | Passed |
SHA-256 / 5f8277bddfc734d08115316c60a5466dbf68015d50a6615d940c351622a05889
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(routes):
return max(routes,key=lambda r:(r[1],r[2]))[0] if routes else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', 3, 1), ('b', 2, 9)]), 'a')", "check('fixture 2', solve([('a', 3, 1), ('b', 3, 9)]), 'b')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 1, 1)]), 'a')"]
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 | b | b | Passed |
| fixture 3 | None | None | Passed |
| fixture 4 | a | a | Passed |
| fixture 1 | a | a | Passed |
SHA-256 / a85cb29802c54747ed5f5465a536ca93cb717094a4281d77b66872b92e44b474
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:09.063472+00:00.
Case digest / c2de74c1846c487c13a0cc3d7d13c149029ecdb3024c32c96a4d776f922cf03f