FA-7611 / WebSocket and browser transport policies / Open access
Websocket mask index continues across buffer chunks · case 01
Websocket mask index continues across buffer chunks.
ROOT CAUSE
The faulty implementation uses `0` for the websocket-mask-index-continues-across-buffer-chunks decision.
VERIFIED REPAIR
Apply the explicit websocket-mask-index-continues-across-buffer-chunks contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `offset // mask_length` and still violates a separate fixture.
Case contract
Bounded offline decision model: websocket mask index continues across buffer chunks. 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-mask-index-continues-across-buffer-chunks 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(offset, mask_length):
return 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(5, 4), 1)", "check('fixture 2', solve(7, 4), 3)", "check('fixture 3', solve(0, 4), 0)", "check('fixture 4', solve(4, 4), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | 0 | 3 | Failed |
| fixture 3 | 0 | 0 | Passed |
| fixture 4 | 0 | 0 | Passed |
| fixture 1 | 0 | 1 | Failed |
SHA-256 / efd73de7c104bc49a51cae0380ba16582bbcd9b431aa5371e541841bd6b9226e
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(offset, mask_length):
return offset // mask_length
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(5, 4), 1)", "check('fixture 2', solve(7, 4), 3)", "check('fixture 3', solve(0, 4), 0)", "check('fixture 4', solve(4, 4), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | 1 | 3 | Failed |
| fixture 3 | 0 | 0 | Passed |
| fixture 4 | 1 | 0 | Failed |
| fixture 1 | 1 | 1 | Passed |
SHA-256 / 06e8a0a2c8e6e0bf83e7cd2bb3e23f6670c4127b0ba6348764f95a013c9f9365
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(offset, mask_length):
return offset % mask_length
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(5, 4), 1)", "check('fixture 2', solve(7, 4), 3)", "check('fixture 3', solve(0, 4), 0)", "check('fixture 4', solve(4, 4), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | 3 | 3 | Passed |
| fixture 3 | 0 | 0 | Passed |
| fixture 4 | 0 | 0 | Passed |
| fixture 1 | 1 | 1 | Passed |
SHA-256 / 2c42b4a30c4adc313c06a899ffdb541d2d66004bff559bdb391e8d2576ab1600
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.604467+00:00.
Case digest / 1f8754e3bf42fc25918eb8e6850d4b4a3fa7c761c90ddcfc0ca2ffb363bdbd0e