FAILURE MAP
← Case archive

FA-3891 / Parsing / Open access

A folded text header is treated as a separate field · case 01

A folded text header is treated as a separate field.

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

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Unfold each LF followed by space/tab into a single space; preserve other LF.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Unfold each LF followed by space/tab into a single space; preserve other LF.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Unfold each LF followed by space/tab into a single space; preserve other LF.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return x.replace('\n',' ')
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a\n\tb'), 'a b')
check('boundary 2', solve('a\n b'), 'a b')
check('boundary 3', solve('a\nb'), 'a\nb')
check('boundary 4', solve('a\n   b'), 'a b')
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
boundary 1a ba bFailed
boundary 2a ba bFailed
boundary 3a ba bFailed
boundary 4a ba bFailed

SHA-256 / 436c886482f134c41418773a0978fec337c48e3a44ef720221bda9bf5631c82f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return x.replace('\n ',' ')
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a\n\tb'), 'a b')
check('boundary 2', solve('a\n b'), 'a b')
check('boundary 3', solve('a\nb'), 'a\nb')
check('boundary 4', solve('a\n   b'), 'a b')
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
boundary 1a ba bFailed
boundary 2a ba bPassed
boundary 3a ba bPassed
boundary 4a ba bFailed

SHA-256 / 6cfb111b4e8effa493ca1fb2af9d2c0e365f8023004628a2942624ca66f6beef

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return re.sub(r'\n[ \x09]+',' ',x)
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a\n\tb'), 'a b')
check('boundary 2', solve('a\n b'), 'a b')
check('boundary 3', solve('a\nb'), 'a\nb')
check('boundary 4', solve('a\n   b'), 'a b')
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
boundary 1a ba bPassed
boundary 2a ba bPassed
boundary 3a ba bPassed
boundary 4a ba bPassed

SHA-256 / a6f92766249857b53a0779b448fb7d32d8b1c83ec082b2216104024ff55877c4

Verification & scope

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

Case digest / 53e6215b64bad2113ad310bfa8b4ca9041b9ff3305833d086833855d6725555d