FAILURE MAP
← Case archive

FA-6941 / Content negotiation / Open access

Parameter specificity counts matched constraints · case 01

Parameter specificity counts matched constraints.

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

ROOT CAUSE

The faulty implementation uses `len(actual)` for the parameter-specificity-counts-matched-constraints decision.

VERIFIED REPAIR

Apply the explicit parameter-specificity-counts-matched-constraints contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `len(required)` and still violates a separate fixture.

Case contract

Bounded offline decision model: parameter specificity counts matched constraints. 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 parameter-specificity-counts-matched-constraints 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 len(actual)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3, 'c': 4}), 1)", "check('fixture 2', solve({}, {'x': 1}), 0)", "check('fixture 3', solve({'a': 1}, {'a': 1}), 1)", "check('fixture 4', solve({'a': 1}, {}), 0)"]
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 210Failed
fixture 311Passed
fixture 400Passed
fixture 131Failed

SHA-256 / 4fc5a657aae69ed703437d516e416d8bc8d38db2f8983f6869da2777262cd6ee

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 len(required)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'a': 1, 'b': 2}, {'a': 1, 'b': 3, 'c': 4}), 1)", "check('fixture 2', solve({}, {'x': 1}), 0)", "check('fixture 3', solve({'a': 1}, {'a': 1}), 1)", "check('fixture 4', solve({'a': 1}, {}), 0)"]
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 200Passed
fixture 311Passed
fixture 410Failed
fixture 121Failed

SHA-256 / a01a628b60fdd6cce1e57d74c132d0b837cd36d491a457b53eb8eaf19c71a6a4

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 sum(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({'a': 1, 'b': 2}, {'a': 1, 'b': 3, 'c': 4}), 1)", "check('fixture 2', solve({}, {'x': 1}), 0)", "check('fixture 3', solve({'a': 1}, {'a': 1}), 1)", "check('fixture 4', solve({'a': 1}, {}), 0)"]
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 200Passed
fixture 311Passed
fixture 400Passed
fixture 111Passed

SHA-256 / 6f2bb9badaec73ab23b09bf827acfe3d9e642ad8dbfcefb83be47384f10c7528

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

Case digest / 64847fa3344142171d1776af86844c0b11beeb6f33fdbdb1cc1711862293b8bc