FA-6886 / Content negotiation / Open access
Language basic filtering requires subtag boundary · case 01
Language basic filtering requires subtag boundary.
ROOT CAUSE
The faulty implementation uses `language.lower().startswith(range_.lower())` for the language-basic-filtering-requires-subtag-boundary decision.
VERIFIED REPAIR
Apply the explicit language-basic-filtering-requires-subtag-boundary contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `language.lower() == range_.lower()` and still violates a separate fixture.
Case contract
Bounded offline decision model: language basic filtering requires subtag boundary. 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 language-basic-filtering-requires-subtag-boundary 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(range_, language):
return language.lower().startswith(range_.lower())
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('en', 'en-US'), True)", "check('fixture 2', solve('en', 'english'), False)", "check('fixture 3', solve('*', 'fr'), True)", "check('fixture 4', solve('fr', 'EN-us'), 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 / 4a33530f4c1d0ca962bd801cde47306accf27347d1a0db3d8f4f5217eda00847
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(range_, language):
return language.lower() == range_.lower()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('en', 'en-US'), True)", "check('fixture 2', solve('en', 'english'), False)", "check('fixture 3', solve('*', 'fr'), True)", "check('fixture 4', solve('fr', 'EN-us'), 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 | False | True | Failed |
| fixture 4 | False | False | Passed |
| fixture 1 | False | True | Failed |
SHA-256 / c349d9fade16eb8dc6526faa030d1aab9a19da314e9dfc27eedafce41e17546c
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(range_, language):
return range_ == '*' or language.lower() == range_.lower() or language.lower().startswith(range_.lower()+'-')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('en', 'en-US'), True)", "check('fixture 2', solve('en', 'english'), False)", "check('fixture 3', solve('*', 'fr'), True)", "check('fixture 4', solve('fr', 'EN-us'), 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 / 25039d3478887d66f33fb9f9fa613d330540737d3c841255cf39cf7797ed8b25
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.360548+00:00.
Case digest / 1ab1c31a5d3a424f7cf80b20eaa4f51a751bd839086ea4e396996c630a2c0215