FAILURE MAP
← Case archive

FA-7796 / Connection lifecycle / Open access

Would block preserves entire unsent write buffer · case 01

Would block preserves entire unsent write buffer.

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

ROOT CAUSE

The faulty implementation uses `data[written:]` for the would-block-preserves-entire-unsent-write-buffer decision.

VERIFIED REPAIR

Apply the explicit would-block-preserves-entire-unsent-write-buffer contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `data` and still violates a separate fixture.

Case contract

Bounded offline decision model: would block preserves entire unsent write buffer. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.

Why this case matters

This deterministic connection lifecycle model isolates the would-block-preserves-entire-unsent-write-buffer 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(data, would_block, written):
    return data[written:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('abc', True, 2), 'abc')", "check('fixture 2', solve('abc', False, 2), 'c')", "check('fixture 3', solve('', True, 0), '')", "check('fixture 4', solve('abc', False, 0), 'abc')"]
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 2ccPassed
fixture 3Passed
fixture 4abcabcPassed
fixture 1cabcFailed

SHA-256 / f8720290d287933bfce12c561445d8145ee3a48ca83ad63e7fbe6bd122423f14

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(data, would_block, written):
    return data
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('abc', True, 2), 'abc')", "check('fixture 2', solve('abc', False, 2), 'c')", "check('fixture 3', solve('', True, 0), '')", "check('fixture 4', solve('abc', False, 0), 'abc')"]
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 2abccFailed
fixture 3Passed
fixture 4abcabcPassed
fixture 1abcabcPassed

SHA-256 / 54427be2b7bf52d99ddd5fa3f76a05f0318c74b849049f862caae20063bc34f4

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(data, would_block, written):
    return data if would_block else data[written:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('abc', True, 2), 'abc')", "check('fixture 2', solve('abc', False, 2), 'c')", "check('fixture 3', solve('', True, 0), '')", "check('fixture 4', solve('abc', False, 0), 'abc')"]
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 2ccPassed
fixture 3Passed
fixture 4abcabcPassed
fixture 1abcabcPassed

SHA-256 / b043a3f9866cb7a5b9dd3baee781e8cfe34700b83cbc38747e399e92951cbcff

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

Case digest / 456a4f2f2254f1c586e837f00e34499151896682a592d28add56cbbc740dbfb9