FAILURE MAP
← Case archive

FA-7116 / Network routing / Open access

Route header constraint distinguishes existence from truthiness · case 01

Route header constraint distinguishes existence from truthiness.

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

ROOT CAUSE

The faulty implementation uses `any(name == key and value for name,value in headers)` for the route-header-constraint-distinguishes-existence-from-truthiness decision.

VERIFIED REPAIR

Apply the explicit route-header-constraint-distinguishes-existence-from-truthiness contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `any(name == key for name,value in headers)` and still violates a separate fixture.

Case contract

Given headers, key, route header constraint distinguishes existence from truthiness. Return the protocol decision or transformed value; fields are validated and fixtures state boundary outcomes.

Why this case matters

This deterministic network routing model isolates the route-header-constraint-distinguishes-existence-from-truthiness 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(headers, key):
    return any(name == key and value for name,value in headers)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('X', '')], 'x'), True)", "check('fixture 2', solve([('x', '')], 'x'), True)", "check('fixture 3', solve([('y', 'v')], 'x'), False)", "check('fixture 4', solve([], 'x'), False)"]
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 2FalseTrueFailed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1FalseTrueFailed

SHA-256 / 395932cbb43427fbf2903ee41fabdaa604524b40c20feda3960d7f8cf720da39

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(headers, key):
    return any(name == key for name,value in headers)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('X', '')], 'x'), True)", "check('fixture 2', solve([('x', '')], 'x'), True)", "check('fixture 3', solve([('y', 'v')], 'x'), False)", "check('fixture 4', solve([], 'x'), False)"]
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 2TrueTruePassed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1FalseTrueFailed

SHA-256 / 3f6e741acfcd4ab7a55321b564a123ba1c21bc0901026b96c5b5b6c288befb1a

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(headers, key):
    return any(name.lower() == key.lower() for name,value in headers)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve([('X', '')], 'x'), True)", "check('fixture 2', solve([('x', '')], 'x'), True)", "check('fixture 3', solve([('y', 'v')], 'x'), False)", "check('fixture 4', solve([], 'x'), False)"]
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 2TrueTruePassed
fixture 3FalseFalsePassed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / a3a9c3f12260e7e3b220fe5a0b390840b810239d92741571c50c5c31fa30cef6

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

Case digest / 75d78cd7fd7ba8d4369df3e15b069d70ffd20835149f49accc22af6452bb30b7