FA-6831 / Content negotiation / Open access
Media specificity outranks wildcard before quality · case 01
Media specificity outranks wildcard before quality.
ROOT CAUSE
The faulty implementation uses `max(exact or 0,wildcard)` for the media-specificity-outranks-wildcard-before-quality decision.
VERIFIED REPAIR
Apply the explicit media-specificity-outranks-wildcard-before-quality contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `exact or wildcard` and still violates a separate fixture.
Case contract
Bounded offline decision model: media specificity outranks wildcard before quality. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.
Why this case matters
This deterministic content negotiation model isolates the media-specificity-outranks-wildcard-before-quality 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(exact, wildcard):
return max(exact or 0,wildcard)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(0, 1), 0)", "check('fixture 2', solve(0.2, 0.9), 0.2)", "check('fixture 3', solve(None, 0.7), 0.7)", "check('fixture 4', solve(1, 0), 1)"]
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 | 0.9 | 0.2 | Failed |
| fixture 3 | 0.7 | 0.7 | Passed |
| fixture 4 | 1 | 1 | Passed |
| fixture 1 | 1 | 0 | Failed |
SHA-256 / b5dc830a6a3b0968d29b879e60fb38101aab612bbcd7504d6e2e0522825e4e8e
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(exact, wildcard):
return exact or wildcard
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(0, 1), 0)", "check('fixture 2', solve(0.2, 0.9), 0.2)", "check('fixture 3', solve(None, 0.7), 0.7)", "check('fixture 4', solve(1, 0), 1)"]
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 | 0.2 | 0.2 | Passed |
| fixture 3 | 0.7 | 0.7 | Passed |
| fixture 4 | 1 | 1 | Passed |
| fixture 1 | 1 | 0 | Failed |
SHA-256 / 1cca82826238b4e9c76378184535d0a9fc203411231806beb7cc41089ab7ffa0
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(exact, wildcard):
return exact if exact is not None else wildcard
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(0, 1), 0)", "check('fixture 2', solve(0.2, 0.9), 0.2)", "check('fixture 3', solve(None, 0.7), 0.7)", "check('fixture 4', solve(1, 0), 1)"]
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 | 0.2 | 0.2 | Passed |
| fixture 3 | 0.7 | 0.7 | Passed |
| fixture 4 | 1 | 1 | Passed |
| fixture 1 | 0 | 0 | Passed |
SHA-256 / 7837f99fdfcb3cd1d0ff05a93a6f7dce65aad343d22bc5429f1dca06046c50ee
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:05.582031+00:00.
Case digest / f2832286bf3e027b5b562b8439e01a61fd04145a081c8405ba139ec8da55424a