FA-6851 / Content negotiation / Open access
Media parameters must all match selected representation · case 01
Media parameters must all match selected representation.
ROOT CAUSE
The faulty implementation uses `any(actual.get(k)==v for k,v in required.items())` for the media-parameters-must-all-match-selected-representation decision.
VERIFIED REPAIR
Apply the explicit media-parameters-must-all-match-selected-representation contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `required == actual` and still violates a separate fixture.
Case contract
Bounded offline decision model: media parameters must all match selected representation. 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-parameters-must-all-match-selected-representation 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(required, actual):
return any(actual.get(k)==v for k,v in required.items())
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'level': '1'}, {'level': '1', 'charset': 'utf8'}), True)", "check('fixture 2', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3}), False)", "check('fixture 3', solve({}, {}), True)", "check('fixture 4', solve({'x': 1}, {}), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | True | False | Failed |
| fixture 3 | False | True | Failed |
| fixture 4 | False | False | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / 29a4eff8f3873b257433ffa93b6187c4455266a207000e35de731a07eb2690a7
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(required, actual):
return required == actual
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'level': '1'}, {'level': '1', 'charset': 'utf8'}), True)", "check('fixture 2', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3}), False)", "check('fixture 3', solve({}, {}), True)", "check('fixture 4', solve({'x': 1}, {}), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | False | False | Passed |
| fixture 3 | True | True | Passed |
| fixture 4 | False | False | Passed |
| fixture 1 | False | True | Failed |
SHA-256 / 82cb2e15caa163495e886faa1f17ae3cd74b7f2dbec3fb7eacea43c50c4571fa
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(required, actual):
return all(actual.get(k)==v for k,v in required.items())
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'level': '1'}, {'level': '1', 'charset': 'utf8'}), True)", "check('fixture 2', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3}), False)", "check('fixture 3', solve({}, {}), True)", "check('fixture 4', solve({'x': 1}, {}), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | False | False | Passed |
| fixture 3 | True | True | Passed |
| fixture 4 | False | False | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / 41572b534c902fe03c8763ae8be0131b2ead6edbad416ca1f00c7a11535a02b0
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.706080+00:00.
Case digest / f3ad409179af4fc78fbf61bda80e7c485fdecc40b265cb33e993aba96fa8dad9