FAILURE MAP
← Case archive

FA-6606 / HTTP semantics / Open access

An Allow response includes HEAD when GET is available · case 01

An Allow response includes HEAD when GET is available.

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

ROOT CAUSE

The faulty implementation uses `sorted(set(methods))` for the allow-header decision.

VERIFIED REPAIR

Apply the explicit allow-header contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `sorted(set(methods) | {'HEAD'})` and still violates a separate fixture.

Case contract

An Allow response includes HEAD when GET is available: return the result specified by the explicit input/output boundary fixtures.

Why this case matters

This deterministic http semantics model isolates the allow-header 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(methods):
    return sorted(set(methods))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['GET']), ['GET', 'HEAD'])", "check('fixture 2', solve(['POST']), ['POST'])", "check('fixture 3', solve([]), [])", "check('fixture 4', solve(['HEAD', 'GET', 'GET']), ['GET', 'HEAD'])"]
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 2['POST']['POST']Passed
fixture 3[][]Passed
fixture 4['GET', 'HEAD']['GET', 'HEAD']Passed
fixture 1['GET']['GET', 'HEAD']Failed

SHA-256 / 20d03718125cc86b029e3cd24729ca9e57f83d495ed7bf79909cdfea0c927c68

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(methods):
    return sorted(set(methods) | {'HEAD'})
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['GET']), ['GET', 'HEAD'])", "check('fixture 2', solve(['POST']), ['POST'])", "check('fixture 3', solve([]), [])", "check('fixture 4', solve(['HEAD', 'GET', 'GET']), ['GET', 'HEAD'])"]
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 2['HEAD', 'POST']['POST']Failed
fixture 3['HEAD'][]Failed
fixture 4['GET', 'HEAD']['GET', 'HEAD']Passed
fixture 1['GET', 'HEAD']['GET', 'HEAD']Passed

SHA-256 / 8da925dcb610b2e10a7f7f6e70d2c8b80522e2991f9d8854618207bb02823b66

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(methods):
    return sorted(set(methods) | ({'HEAD'} if 'GET' in methods else set()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['GET']), ['GET', 'HEAD'])", "check('fixture 2', solve(['POST']), ['POST'])", "check('fixture 3', solve([]), [])", "check('fixture 4', solve(['HEAD', 'GET', 'GET']), ['GET', 'HEAD'])"]
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 2['POST']['POST']Passed
fixture 3[][]Passed
fixture 4['GET', 'HEAD']['GET', 'HEAD']Passed
fixture 1['GET', 'HEAD']['GET', 'HEAD']Passed

SHA-256 / fc905bbf5650d0a0ece0cc3f1ebc6f105d2b44bc5e2f5af8f5ea253d0742c1e9

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

Case digest / 523c9271660c38f5787c2c24dccd8bda265b7dd88bba5587a99536e9bc153213