FAILURE MAP
← Case archive

FA-48356 / Delimited text / Open access

A dictionary cell definition is overwritten by a later record · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

A dictionary cell definition is overwritten by a later record.

THE FAILURE

A dictionary cell definition is overwritten by a later record.

Unsuccessful approach: The alternate implementation still violates the same declared invariant: a dictionary cell definition is overwritten by a later record.

Case contract

Read pipe records DEF|id|literal and ROW|comma-separated IDs. Definitions are immutable; rows may reference only preceding IDs, and preserve repeated references. Literal definition payloads may contain pipes. Return expanded text rows. An empty ROW payload is a zero-cell row.

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):
    dictionary,rows={},[]
    for line in data:
        parts=line.split('|',2)
        if parts[0]=='DEF' and len(parts)==3:
            if False: return None
            dictionary[parts[1]]=parts[2]
        elif parts[0]=='ROW' and len(parts)==2:
            ids=parts[1].split(',') if parts[1] else []
            if any(key not in dictionary for key in ids): return None
            rows.append([dictionary[key] for key in ids])
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))
check('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))
check('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))
check('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))
check('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))
check('empty row', solve(_vary(['ROW|'])), _vary([[]]))
check('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))
check('zero', solve(_vary([])), _vary([]))
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
repeat refs[['cell', 'z', 'cell']][['cell', 'z', 'cell']]Passed
ordered refs[['cell', 'z']][['cell', 'z']]Passed
literal pipes[['x|y']][['x|y']]Passed
unknownNoneNonePassed
redefine[]NoneFailed
empty row[[]][[]]Passed
empty literal[['']][['']]Passed
zero[][]Passed

SHA-256 / 0a84f17f85c3542b70c281d32f6c7f6fbcc2dc8e76c1714c2592afde0f01870e

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):
    dictionary,rows={},[]
    for line in data:
        parts=line.split('|',2)
        if parts[0]=='DEF' and len(parts)==3:
            if parts[1] in dictionary: continue
            dictionary[parts[1]]=parts[2]
        elif parts[0]=='ROW' and len(parts)==2:
            ids=parts[1].split(',') if parts[1] else []
            if any(key not in dictionary for key in ids): return None
            rows.append([dictionary[key] for key in ids])
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))
check('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))
check('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))
check('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))
check('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))
check('empty row', solve(_vary(['ROW|'])), _vary([[]]))
check('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))
check('zero', solve(_vary([])), _vary([]))
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
repeat refs[['cell', 'z', 'cell']][['cell', 'z', 'cell']]Passed
ordered refs[['cell', 'z']][['cell', 'z']]Passed
literal pipes[['x|y']][['x|y']]Passed
unknownNoneNonePassed
redefine[]NoneFailed
empty row[[]][[]]Passed
empty literal[['']][['']]Passed
zero[][]Passed

SHA-256 / d0d1124b6422af8e106fd77c136cfa5f1c86165a6e215ab496bff4d66dec2e81

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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

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

Case digest / addcd3fc1967b7537c7ce8464dbeb716c424b6b29a8199393bb41fd191cdb4bb