FAILURE MAP
← Case archive

FA-7111 / Network routing / Open access

Route method filter is applied before priority · case 01

Route method filter is applied before priority.

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

ROOT CAUSE

The faulty implementation uses `max(routes,key=lambda r:r[2],default=(None,))[0]` for the route-method-filter-is-applied-before-priority decision.

THE FAILURE

The faulty implementation uses `max(routes,key=lambda r:r[2],default=(None,))[0]` for the route-method-filter-is-applied-before-priority decision.

Unsuccessful approach: The attempted repair uses `next((r[0] for r in routes if method in r[1]),None)` and still violates a separate fixture.

Case contract

Bounded offline decision model: route method filter is applied before priority. 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-method-filter-is-applied-before-priority 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, method):
    return max(routes,key=lambda r:r[2],default=(None,))[0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', ['GET'], 1), ('b', ['POST'], 9)], 'GET'), 'a')", "check('fixture 2', solve([('a', ['GET'], 1), ('b', ['GET'], 9)], 'GET'), 'b')", "check('fixture 3', solve([], 'GET'), None)", "check('fixture 4', solve([('a', ['POST'], 1)], 'GET'), None)"]
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 2bbPassed
fixture 3NoneNonePassed
fixture 4aNoneFailed
fixture 1baFailed

SHA-256 / 938830de75fcfd121be8692196f9cfb17e77c21397f2ef2bce79139473163169

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, method):
    return next((r[0] for r in routes if method in r[1]),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('a', ['GET'], 1), ('b', ['POST'], 9)], 'GET'), 'a')", "check('fixture 2', solve([('a', ['GET'], 1), ('b', ['GET'], 9)], 'GET'), 'b')", "check('fixture 3', solve([], 'GET'), None)", "check('fixture 4', solve([('a', ['POST'], 1)], 'GET'), None)"]
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 2abFailed
fixture 3NoneNonePassed
fixture 4NoneNonePassed
fixture 1aaPassed

SHA-256 / 3ffe6ad1f03592b943accb4656a9e0019786b747f3dbebb4b78af235d49356e9

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 5b45046c6011d67c6c0d95a7a7c085af10b21c6daa787f50fbb80e428dd2f57b