FAILURE MAP
← Case archive

FA-3061 / Text processing / Open access

A blank line receives an unwanted prefix · case 01

A blank line receives an unwanted prefix.

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: Prefix every nonblank line with > including its original indentation.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Prefix every nonblank line with > including its original indentation.

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

Case contract

Prefix every nonblank line with > including its original indentation.

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 '\n'.join('>'+v for v in x.split('\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\nb'), '>a\n\n>b')
check('boundary 2', solve('a\n  \nb'), '>a\n  \n>b')
check('boundary 3', solve('a\n'), '>a\n')
check('boundary 4', solve(''), '')
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 1>a > >b>a >bFailed
boundary 2>a > >b>a >bFailed
boundary 3>a >>a Failed
boundary 4>Failed

SHA-256 / 23f3ae53e1e937080e040eec20eadc9bb8e0cc643ea87ac4a679a641c615ec64

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 '\n'.join('>'+v if v else v for v in x.split('\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\nb'), '>a\n\n>b')
check('boundary 2', solve('a\n  \nb'), '>a\n  \n>b')
check('boundary 3', solve('a\n'), '>a\n')
check('boundary 4', solve(''), '')
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 1>a >b>a >bPassed
boundary 2>a > >b>a >bFailed
boundary 3>a >a Passed
boundary 4Passed

SHA-256 / f7f7b4701eea3b8f32ba81021fcf834e291ccbfeee2f0f06980913a3d0c733e4

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 textwrap.indent(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\nb'), '>a\n\n>b')
check('boundary 2', solve('a\n  \nb'), '>a\n  \n>b')
check('boundary 3', solve('a\n'), '>a\n')
check('boundary 4', solve(''), '')
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 1>a >b>a >bPassed
boundary 2>a >b>a >bPassed
boundary 3>a >a Passed
boundary 4Passed

SHA-256 / fb02b8802af168cefb0c01a6067c40f25d288429ba6049811487c673d906b4bc

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

Case digest / beaadbc45ccb377806b0e599f7794e96a9ce77ebfc04ab088fba25d106801b7e