FAILURE MAP
← Case archive

FA-6926 / Content negotiation / Open access

Negotiated content type retains selected parameters · case 01

Negotiated content type retains selected parameters.

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

ROOT CAUSE

The faulty implementation uses `type_` for the negotiated-content-type-retains-selected-parameters decision.

VERIFIED REPAIR

Apply the explicit negotiated-content-type-retains-selected-parameters contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `type_ + "; " + "; ".join(k+"="+v for k,v in parameters)` and still violates a separate fixture.

Case contract

Bounded offline decision model: negotiated content type retains selected parameters. 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 negotiated-content-type-retains-selected-parameters 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(type_, parameters):
    return type_
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('text/plain', [('charset', 'utf-8')]), 'text/plain; charset=utf-8')", "check('fixture 2', solve('image/png', []), 'image/png')", "check('fixture 3', solve('text/html', [('level', '1'), ('charset', 'utf-8')]), 'text/html; level=1; charset=utf-8')", "check('fixture 4', solve('application/json', []), 'application/json')"]
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 2image/pngimage/pngPassed
fixture 3text/htmltext/html; level=1; charset=utf-8Failed
fixture 4application/jsonapplication/jsonPassed
fixture 1text/plaintext/plain; charset=utf-8Failed

SHA-256 / 6c2e2b05e9a863e0c5d0243a1bf515abe104f5a79439ccc158c79657130a3de4

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(type_, parameters):
    return type_ + "; " + "; ".join(k+"="+v for k,v in parameters)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('text/plain', [('charset', 'utf-8')]), 'text/plain; charset=utf-8')", "check('fixture 2', solve('image/png', []), 'image/png')", "check('fixture 3', solve('text/html', [('level', '1'), ('charset', 'utf-8')]), 'text/html; level=1; charset=utf-8')", "check('fixture 4', solve('application/json', []), 'application/json')"]
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 2image/png; image/pngFailed
fixture 3text/html; level=1; charset=utf-8text/html; level=1; charset=utf-8Passed
fixture 4application/json; application/jsonFailed
fixture 1text/plain; charset=utf-8text/plain; charset=utf-8Passed

SHA-256 / b8797d468c1a96604bb33ba7bdca7ee9eb92945a8fafb62693e8528fdcbf2a13

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(type_, parameters):
    return type_ + "".join("; "+k+"="+v for k,v in parameters)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('text/plain', [('charset', 'utf-8')]), 'text/plain; charset=utf-8')", "check('fixture 2', solve('image/png', []), 'image/png')", "check('fixture 3', solve('text/html', [('level', '1'), ('charset', 'utf-8')]), 'text/html; level=1; charset=utf-8')", "check('fixture 4', solve('application/json', []), 'application/json')"]
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 2image/pngimage/pngPassed
fixture 3text/html; level=1; charset=utf-8text/html; level=1; charset=utf-8Passed
fixture 4application/jsonapplication/jsonPassed
fixture 1text/plain; charset=utf-8text/plain; charset=utf-8Passed

SHA-256 / d8b8def5b37ab51faa3a50a55dda2a5e863a09803bbfaa157a4af87538998dd6

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

Case digest / 54f79e7ec03e51718fa4e4edcd4d32989ae1937e5998e2785932f65b83dc66f9