FAILURE MAP
← Case archive

FA-48556 / Delimited text / Open access

Nested header binding splits only the first dot · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

Nested header binding splits only the first dot.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: path=header.split('.')

Unsuccessful approach: The alternate implementation still violates the same declared invariant: nested header binding splits only the first dot.

Case contract

Bind comma values to comma headers whose dots denote object paths. Empty path components, duplicate complete paths, or a path that is both leaf and parent reject. Scalar leaves remain text. Header and value counts must match. Return nested dictionaries.

Why this case matters

Delimited interchange needs explicit framing, schema and field semantics at ingestion and emission boundaries.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    headers=data['header'].split(','); values=data['row'].split(',')
    if len(headers)!=len(values): return None
    out={}
    for header,value in zip(headers,values):
        path=header.split('.',1)
        if any(not part for part in path): return None
        node=out
        for part in path[:-1]:
            if part not in node: node[part]={}
            if not isinstance(node[part],dict): return None
            node=node[part]
        if path[-1] in node: return None
        node[path[-1]]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested', solve(_vary({'header': 'user.name,user.city', 'row': '@,x'})), _vary({'user': {'name': '@', 'city': 'x'}}))
check('two roots', solve(_vary({'header': 'a.x,b.x', 'row': '@,z'})), _vary({'a': {'x': '@'}, 'b': {'x': 'z'}}))
check('scalar conflict', solve(_vary({'header': 'a,a.b', 'row': '@,z'})), _vary(None))
check('parent conflict', solve(_vary({'header': 'a.b,a', 'row': '@,z'})), _vary(None))
check('duplicate', solve(_vary({'header': 'a.b,a.b', 'row': '@,z'})), _vary(None))
check('empty component', solve(_vary({'header': 'a..b', 'row': '@'})), _vary(None))
check('deep', solve(_vary({'header': 'a.b.c', 'row': '@'})), _vary({'a': {'b': {'c': '@'}}}))
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
nested{'user': {'city': 'x', 'name': 'cell'}}{'user': {'city': 'x', 'name': 'cell'}}Passed
two roots{'a': {'x': 'cell'}, 'b': {'x': 'z'}}{'a': {'x': 'cell'}, 'b': {'x': 'z'}}Passed
scalar conflictNoneNonePassed
parent conflictNoneNonePassed
duplicateNoneNonePassed
empty component{'a': {'.b': 'cell'}}NoneFailed
deep{'a': {'b.c': 'cell'}}{'a': {'b': {'c': 'cell'}}}Failed

SHA-256 / 7f35d1c088780cfd92fedd94e541f58ab1daa9114e52a5256d22b1c15a05f28f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    headers=data['header'].split(','); values=data['row'].split(',')
    if len(headers)!=len(values): return None
    out={}
    for header,value in zip(headers,values):
        path=header.rsplit('.',1)
        if any(not part for part in path): return None
        node=out
        for part in path[:-1]:
            if part not in node: node[part]={}
            if not isinstance(node[part],dict): return None
            node=node[part]
        if path[-1] in node: return None
        node[path[-1]]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested', solve(_vary({'header': 'user.name,user.city', 'row': '@,x'})), _vary({'user': {'name': '@', 'city': 'x'}}))
check('two roots', solve(_vary({'header': 'a.x,b.x', 'row': '@,z'})), _vary({'a': {'x': '@'}, 'b': {'x': 'z'}}))
check('scalar conflict', solve(_vary({'header': 'a,a.b', 'row': '@,z'})), _vary(None))
check('parent conflict', solve(_vary({'header': 'a.b,a', 'row': '@,z'})), _vary(None))
check('duplicate', solve(_vary({'header': 'a.b,a.b', 'row': '@,z'})), _vary(None))
check('empty component', solve(_vary({'header': 'a..b', 'row': '@'})), _vary(None))
check('deep', solve(_vary({'header': 'a.b.c', 'row': '@'})), _vary({'a': {'b': {'c': '@'}}}))
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
nested{'user': {'city': 'x', 'name': 'cell'}}{'user': {'city': 'x', 'name': 'cell'}}Passed
two roots{'a': {'x': 'cell'}, 'b': {'x': 'z'}}{'a': {'x': 'cell'}, 'b': {'x': 'z'}}Passed
scalar conflictNoneNonePassed
parent conflictNoneNonePassed
duplicateNoneNonePassed
empty component{'a.': {'b': 'cell'}}NoneFailed
deep{'a.b': {'c': 'cell'}}{'a': {'b': {'c': 'cell'}}}Failed

SHA-256 / 40c29a4f738b66b0b3f08eeaac7a9d5de8bc72487f17335750627a6f64934bef

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    headers=data['header'].split(','); values=data['row'].split(',')
    if len(headers)!=len(values): return None
    out={}
    for header,value in zip(headers,values):
        path=header.split('.')
        if any(not part for part in path): return None
        node=out
        for part in path[:-1]:
            if part not in node: node[part]={}
            if not isinstance(node[part],dict): return None
            node=node[part]
        if path[-1] in node: return None
        node[path[-1]]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested', solve(_vary({'header': 'user.name,user.city', 'row': '@,x'})), _vary({'user': {'name': '@', 'city': 'x'}}))
check('two roots', solve(_vary({'header': 'a.x,b.x', 'row': '@,z'})), _vary({'a': {'x': '@'}, 'b': {'x': 'z'}}))
check('scalar conflict', solve(_vary({'header': 'a,a.b', 'row': '@,z'})), _vary(None))
check('parent conflict', solve(_vary({'header': 'a.b,a', 'row': '@,z'})), _vary(None))
check('duplicate', solve(_vary({'header': 'a.b,a.b', 'row': '@,z'})), _vary(None))
check('empty component', solve(_vary({'header': 'a..b', 'row': '@'})), _vary(None))
check('deep', solve(_vary({'header': 'a.b.c', 'row': '@'})), _vary({'a': {'b': {'c': '@'}}}))
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
nested{'user': {'city': 'x', 'name': 'cell'}}{'user': {'city': 'x', 'name': 'cell'}}Passed
two roots{'a': {'x': 'cell'}, 'b': {'x': 'z'}}{'a': {'x': 'cell'}, 'b': {'x': 'z'}}Passed
scalar conflictNoneNonePassed
parent conflictNoneNonePassed
duplicateNoneNonePassed
empty componentNoneNonePassed
deep{'a': {'b': {'c': 'cell'}}}{'a': {'b': {'c': 'cell'}}}Passed

SHA-256 / 1b72868517f36b228412356ab318231643c392854e8373ccc7153fdb2fa32d9d

Verification & scope

Deterministic bounded in-memory model. No claim of complete CSV or external format conformance. 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:44:51.892390+00:00.

Case digest / 6c353a5c7b456bbe5def8482b5c1f460af8c77219ca92be3f2788e9c8bc17dc7