FAILURE MAP
← Case archive

FA-7086 / Network routing / Open access

Route metric breaks equal prefix ties in ascending order · case 01

Route metric breaks equal prefix ties in ascending order.

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

ROOT CAUSE

The faulty implementation uses `max(routes,key=lambda r:r[1])[0] if routes else None` for the route-metric-breaks-equal-prefix-ties-in-ascending-order decision.

VERIFIED REPAIR

Apply the explicit route-metric-breaks-equal-prefix-ties-in-ascending-order contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `routes[0][0] if routes else None` and still violates a separate fixture.

Case contract

Bounded offline decision model: route metric breaks equal prefix ties in ascending order. 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-metric-breaks-equal-prefix-ties-in-ascending-order 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[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', 20), ('b', 10)]), 'b')", "check('fixture 2', solve([('a', 10), ('b', 20)]), 'a')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 0)]), '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 fixtureActualExpectedOutcome
fixture 2baFailed
fixture 3NoneNonePassed
fixture 4aaPassed
fixture 1abFailed

SHA-256 / 8c8ce253b66bd9b7087945ee643f3b256474f5c95cc70a740711477f4d141d06

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 routes[0][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', 20), ('b', 10)]), 'b')", "check('fixture 2', solve([('a', 10), ('b', 20)]), 'a')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 0)]), '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 fixtureActualExpectedOutcome
fixture 2aaPassed
fixture 3NoneNonePassed
fixture 4aaPassed
fixture 1abFailed

SHA-256 / 20804586c7c87538cf171412ae4e686664d6bb0e4fec011b7feeba42403893cc

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 min(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', 20), ('b', 10)]), 'b')", "check('fixture 2', solve([('a', 10), ('b', 20)]), 'a')", "check('fixture 3', solve([]), None)", "check('fixture 4', solve([('a', 0)]), '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 fixtureActualExpectedOutcome
fixture 2aaPassed
fixture 3NoneNonePassed
fixture 4aaPassed
fixture 1bbPassed

SHA-256 / 49ab9f94c3422ac09fd6862484789525534dc436c633e3ba4ac6d83e3060d121

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

Case digest / 5869bed49562c6f1dac71bfb82fcde94128383d3e1bdddfef0f47487bbb7b4ce