FAILURE MAP
← Case archive

FA-7621 / WebSocket and browser transport policies / Open access

Websocket reserved close codes are not transmitted · case 01

Websocket reserved close codes are not transmitted.

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

ROOT CAUSE

The faulty implementation uses `1000 <= code < 5000` for the websocket-reserved-close-codes-are-not-transmitted decision.

VERIFIED REPAIR

Apply the explicit websocket-reserved-close-codes-are-not-transmitted contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `code >= 1000` and still violates a separate fixture.

Case contract

Bounded offline decision model: websocket reserved close codes are not transmitted. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

Why this case matters

This deterministic websocket and browser transport policies model isolates the websocket-reserved-close-codes-are-not-transmitted 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(code):
    return 1000 <= code < 5000
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(1006), False)", "check('fixture 2', solve(5000), False)", "check('fixture 3', solve(1000), True)", "check('fixture 4', solve(4000), True)"]
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 2FalseFalsePassed
fixture 3TrueTruePassed
fixture 4TrueTruePassed
fixture 1TrueFalseFailed

SHA-256 / 8ebe407fb98c75765df15cf2b549f0dd2f0a77bacc0a11aa31e597a89b7c6416

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(code):
    return code >= 1000
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(1006), False)", "check('fixture 2', solve(5000), False)", "check('fixture 3', solve(1000), True)", "check('fixture 4', solve(4000), True)"]
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 2TrueFalseFailed
fixture 3TrueTruePassed
fixture 4TrueTruePassed
fixture 1TrueFalseFailed

SHA-256 / 2ebba49ec0d5a1124997a3452fc5a2016260ff34cc07e6fab30dbdbd855ecb21

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(code):
    return 1000 <= code < 5000 and code not in (1004,1005,1006,1015)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(1006), False)", "check('fixture 2', solve(5000), False)", "check('fixture 3', solve(1000), True)", "check('fixture 4', solve(4000), True)"]
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 2FalseFalsePassed
fixture 3TrueTruePassed
fixture 4TrueTruePassed
fixture 1FalseFalsePassed

SHA-256 / 15deb871bfeccf9599872a8c686defda545f6f9980162793d0117dfef84c69a4

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

Case digest / 32949ff5462266cdf288008f5f6e9242ddf3e867478f00c004b5d93fe7cb8b80