FAILURE MAP
← Case archive

FA-171 / Parsing / Open access

An escaped separator becomes a field boundary · case 01

An escaped pipe splits a field, or an even run of escape characters hides a real separator.

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

ROOT CAUSE

A delimiter split ignores the escape-state parity immediately before each separator.

THE FAILURE

A delimiter split ignores the escape-state parity immediately before each separator.

Unsuccessful approach: A negative lookbehind handles one backslash but mistakes an escaped backslash for an active escape.

Case contract

Split a pipe-delimited string. Only backslash-pipe and backslash-backslash are legal escapes. Preserve empty fields; reject incomplete or unknown escapes by returning None.

Why this case matters

Small transport and configuration grammars often need both literal separators and literal escape characters; checking only the previous character loses this distinction.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(text):
    return text.split('|')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
label = 'field' * N
check('literal escaped separator', solve(label + r'\|inside|tail'), [label + '|inside', 'tail'])
check('even escape run leaves separator active', solve(label + '\\\\|tail'), [label + '\\', 'tail'])
check('multiple escaped backslashes', solve('\\\\' * N + '|end'), ['\\' * N, 'end'])
check('empty fields remain positioned', solve('|a||'), ['', 'a', '', ''])
check('empty record is one empty field', solve(''), [''])
check('dangling escape rejected', solve(label + '\\'), None)
check('unknown escape rejected', solve(label + r'\q'), None)
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
literal escaped separator['field\\', 'inside', 'tail']['field|inside', 'tail']Failed
even escape run leaves separator active['field\\\\', 'tail']['field\\', 'tail']Failed
multiple escaped backslashes['\\\\', 'end']['\\', 'end']Failed
empty fields remain positioned['', 'a', '', '']['', 'a', '', '']Passed
empty record is one empty field['']['']Passed
dangling escape rejected['field\\']NoneFailed
unknown escape rejected['field\\q']NoneFailed

SHA-256 / 09dfb8f5b8a95787deb4e7c157ce72f4e9da27d437bd2930aed78de4f11aa284

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(text):
    fields = re.split(r'(?<!\\)\|', text)
    return [value.replace(r'\|', '|').replace('\\\\', '\\') for value in fields]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
label = 'field' * N
check('literal escaped separator', solve(label + r'\|inside|tail'), [label + '|inside', 'tail'])
check('even escape run leaves separator active', solve(label + '\\\\|tail'), [label + '\\', 'tail'])
check('multiple escaped backslashes', solve('\\\\' * N + '|end'), ['\\' * N, 'end'])
check('empty fields remain positioned', solve('|a||'), ['', 'a', '', ''])
check('empty record is one empty field', solve(''), [''])
check('dangling escape rejected', solve(label + '\\'), None)
check('unknown escape rejected', solve(label + r'\q'), None)
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
literal escaped separator['field|inside', 'tail']['field|inside', 'tail']Passed
even escape run leaves separator active['field\\|tail']['field\\', 'tail']Failed
multiple escaped backslashes['\\|end']['\\', 'end']Failed
empty fields remain positioned['', 'a', '', '']['', 'a', '', '']Passed
empty record is one empty field['']['']Passed
dangling escape rejected['field\\']NoneFailed
unknown escape rejected['field\\q']NoneFailed

SHA-256 / dee3f734a27c681922b3a68085764896bd4a536a45460c0b031fc720b1c97af7

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 5d8975f8ccf77174bfea4a7f5c53f84068458f1e31381b3990617f0525667c72