FAILURE MAP
← Case archive

FA-6921 / Content negotiation / Open access

Range on encoded response addresses coded representation · case 01

Range on encoded response addresses coded representation.

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

ROOT CAUSE

The faulty implementation uses `plain[start:end+1]` for the range-on-encoded-response-addresses-coded-representation decision.

VERIFIED REPAIR

Apply the explicit range-on-encoded-response-addresses-coded-representation contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `(coded if encoded else plain)[start:end]` and still violates a separate fixture.

Case contract

Given encoded, coded, plain, start, end, range on encoded response addresses coded representation. Return the protocol decision or transformed value; fields are validated and fixtures state boundary outcomes.

Why this case matters

This deterministic content negotiation model isolates the range-on-encoded-response-addresses-coded-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(encoded, coded, plain, start, end):
    return plain[start:end+1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, 'abcd', '0123456789', 1, 2), 'bc')", "check('fixture 2', solve(False, 'abcd', '0123456789', 1, 2), '12')", "check('fixture 3', solve(True, 'abc', 'x', 0, 0), 'a')", "check('fixture 4', solve(False, 'a', 'xyz', 1, 9), 'yz')"]
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 21212Passed
fixture 3xaFailed
fixture 4yzyzPassed
fixture 112bcFailed

SHA-256 / 1352aeb370c09957f674594b7a282662efa1c69004e58ccc4aec5b53583bd3e2

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(encoded, coded, plain, start, end):
    return (coded if encoded else plain)[start:end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, 'abcd', '0123456789', 1, 2), 'bc')", "check('fixture 2', solve(False, 'abcd', '0123456789', 1, 2), '12')", "check('fixture 3', solve(True, 'abc', 'x', 0, 0), 'a')", "check('fixture 4', solve(False, 'a', 'xyz', 1, 9), 'yz')"]
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 2112Failed
fixture 3aFailed
fixture 4yzyzPassed
fixture 1bbcFailed

SHA-256 / 5f0a417ebb262a65357d3ffb62c2c626e5e1937b5a93f826cb60fcfe83aecef8

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(encoded, coded, plain, start, end):
    return (coded if encoded else plain)[start:end+1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, 'abcd', '0123456789', 1, 2), 'bc')", "check('fixture 2', solve(False, 'abcd', '0123456789', 1, 2), '12')", "check('fixture 3', solve(True, 'abc', 'x', 0, 0), 'a')", "check('fixture 4', solve(False, 'a', 'xyz', 1, 9), 'yz')"]
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 21212Passed
fixture 3aaPassed
fixture 4yzyzPassed
fixture 1bcbcPassed

SHA-256 / 849e54e063319b1484b31fb069cfd04bfe43000e6f505f38ded4aa93a022f800

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

Case digest / cc1f7de087ee0b1b2cc5711d6263203499f6b62cd844de15c12974a6d403d358