FA-7651 / WebSocket and browser transport policies / Open access
Sse data lines join with newlines not concatenation · case 01
Sse data lines join with newlines not concatenation.
ROOT CAUSE
The faulty implementation uses `"".join(lines)` for the sse-data-lines-join-with-newlines-not-concatenation decision.
VERIFIED REPAIR
Apply the explicit sse-data-lines-join-with-newlines-not-concatenation contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `"\n".join(lines)+"\n"` and still violates a separate fixture.
Case contract
Bounded offline decision model: sse data lines join with newlines not concatenation. 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 sse-data-lines-join-with-newlines-not-concatenation 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(lines):
return "".join(lines)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['a', 'b']), 'a\\nb')", "check('fixture 2', solve([]), '')", "check('fixture 3', solve(['']), '')", "check('fixture 4', solve(['a']), 'a')"]
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 | | | Passed |
| fixture 3 | | | Passed |
| fixture 4 | a | a | Passed |
| fixture 1 | ab | a
b | Failed |
SHA-256 / 498767c1bec8b657cd245d00c619314a9bf45a3c8b09cbf439bb4784fa24c8cd
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(lines):
return "\n".join(lines)+"\n"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['a', 'b']), 'a\\nb')", "check('fixture 2', solve([]), '')", "check('fixture 3', solve(['']), '')", "check('fixture 4', solve(['a']), 'a')"]
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 |
| | Failed |
| fixture 3 |
| | Failed |
| fixture 4 | a
| a | Failed |
| fixture 1 | a
b
| a
b | Failed |
SHA-256 / afbebd5a05484145c9344eaac18ac03f9c2a140660d66aa43152bf13289ad21f
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(lines):
return "\n".join(lines)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(['a', 'b']), 'a\\nb')", "check('fixture 2', solve([]), '')", "check('fixture 3', solve(['']), '')", "check('fixture 4', solve(['a']), 'a')"]
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 | | | Passed |
| fixture 3 | | | Passed |
| fixture 4 | a | a | Passed |
| fixture 1 | a
b | a
b | Passed |
SHA-256 / 84b4f2554d2bce91de6ae53d2ebf164ef408b64610b4732da8b0e24cd5c1f1c1
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:14.036162+00:00.
Case digest / a78227716f7bf63540891cf26c90846895f072603f46e792ce97d281488557e4