FAILURE MAP
← Case archive

FA-7791 / Connection lifecycle / Open access

Partial write advances only by successfully written count · case 01

Partial write advances only by successfully written count.

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

ROOT CAUSE

The faulty implementation uses `""` for the partial-write-advances-only-by-successfully-written-count decision.

VERIFIED REPAIR

Apply the explicit partial-write-advances-only-by-successfully-written-count contract, including the tested boundary and negative cases.

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

Case contract

Bounded offline decision model: partial write advances only by successfully written count. 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 partial-write-advances-only-by-successfully-written-count 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, written):
    return ""
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('abcdef', 2), 'cdef')", "check('fixture 2', solve('abc', 0), 'abc')", "check('fixture 3', solve('abc', 3), '')", "check('fixture 4', solve('', 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 fixtureActualExpectedOutcome
fixture 2abcFailed
fixture 3Passed
fixture 4Passed
fixture 1cdefFailed

SHA-256 / ac7a57ed6c76973a9d2030ac23ce17a9963cf7d77e02d34ad104313073e1cdb9

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, 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('abcdef', 2), 'cdef')", "check('fixture 2', solve('abc', 0), 'abc')", "check('fixture 3', solve('abc', 3), '')", "check('fixture 4', solve('', 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 fixtureActualExpectedOutcome
fixture 2abcFailed
fixture 3abcFailed
fixture 4Passed
fixture 1abcdefFailed

SHA-256 / 743fc66b81e8c3ddecf5d837a75cbb497377c87a4f7f0e39b0ee89e7f050bb60

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, 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('abcdef', 2), 'cdef')", "check('fixture 2', solve('abc', 0), 'abc')", "check('fixture 3', solve('abc', 3), '')", "check('fixture 4', solve('', 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 fixtureActualExpectedOutcome
fixture 2abcabcPassed
fixture 3Passed
fixture 4Passed
fixture 1cdefcdefPassed

SHA-256 / 009bf130a67272f714893805dd0bf5e292ef9ac1d96afe39e61d83ceba9db58a

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

Case digest / cc1953f07f2ffb6bb072a1dbd97983b385ad14bbf802269d445f1c83e0009c99