FA-48291 / Delimited text / Open access
A zero-count record block disappears from the decoded stream · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A zero-count record block disappears from the decoded stream.
THE FAILURE
A zero-count record block disappears from the decoded stream.
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a zero-count record block disappears from the decoded stream.
Case contract
Decode pipe records arranged as C|count followed by exactly count R|value rows. Multiple blocks may follow. Counts are ASCII nonnegative decimals; values contain no pipe in this bounded grammar. Empty blocks are emitted as empty lists. Missing, unexpected, and surplus R records reject.
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):
blocks=[]; current=None; remaining=0
for line in data:
cells=line.split('|')
if len(cells)!=2: return None
tag,value=cells
if tag=='C':
if remaining: return None
if not value.isascii() or not value.isdecimal(): return None
remaining=int(value); current=[]
if remaining: blocks.append(current)
elif tag=='R':
if remaining==0: return None
current.append(value); remaining-=1
else: return None
if remaining: return None
return blocks
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('blocks', solve(_vary(['C|2', 'R|@', 'R|x', 'C|1', 'R|z'])), _vary([['@', 'x'], ['z']]))
check('empty block', solve(_vary(['C|0', 'C|1', 'R|@'])), _vary([[], ['@']]))
check('short', solve(_vary(['C|2', 'R|@'])), _vary(None))
check('extra', solve(_vary(['C|1', 'R|@', 'R|x'])), _vary(None))
check('orphan', solve(_vary(['R|@'])), _vary(None))
check('premature block', solve(_vary(['C|2', 'R|@', 'C|0'])), _vary(None))
check('bad tag', solve(_vary(['X|0'])), _vary(None))
check('zero stream', 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| blocks | [['cell', 'x'], ['z']] | [['cell', 'x'], ['z']] | Passed |
| empty block | [['cell']] | [[], ['cell']] | Failed |
| short | None | None | Passed |
| extra | None | None | Passed |
| orphan | None | None | Passed |
| premature block | None | None | Passed |
| bad tag | None | None | Passed |
| zero stream | [] | [] | Passed |
SHA-256 / 1ca319a68fd5fb498b2f87ae1ad238d6251ff0c91a432158d18d4b9ada898973
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):
blocks=[]; current=None; remaining=0
for line in data:
cells=line.split('|')
if len(cells)!=2: return None
tag,value=cells
if tag=='C':
if remaining: return None
if not value.isascii() or not value.isdecimal(): return None
remaining=int(value); current=[]; blocks.append(current if remaining else None)
elif tag=='R':
if remaining==0: return None
current.append(value); remaining-=1
else: return None
if remaining: return None
return blocks
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('blocks', solve(_vary(['C|2', 'R|@', 'R|x', 'C|1', 'R|z'])), _vary([['@', 'x'], ['z']]))
check('empty block', solve(_vary(['C|0', 'C|1', 'R|@'])), _vary([[], ['@']]))
check('short', solve(_vary(['C|2', 'R|@'])), _vary(None))
check('extra', solve(_vary(['C|1', 'R|@', 'R|x'])), _vary(None))
check('orphan', solve(_vary(['R|@'])), _vary(None))
check('premature block', solve(_vary(['C|2', 'R|@', 'C|0'])), _vary(None))
check('bad tag', solve(_vary(['X|0'])), _vary(None))
check('zero stream', 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| blocks | [['cell', 'x'], ['z']] | [['cell', 'x'], ['z']] | Passed |
| empty block | [None, ['cell']] | [[], ['cell']] | Failed |
| short | None | None | Passed |
| extra | None | None | Passed |
| orphan | None | None | Passed |
| premature block | None | None | Passed |
| bad tag | None | None | Passed |
| zero stream | [] | [] | Passed |
SHA-256 / 3613ad0b74d3f6eda5e254a267aee611e7192aa5142a6c5b694a054b0c011be4
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:49.596061+00:00.
Case digest / 95694ddaed451c675351cb1c39a15401434045d7a9122dcac74b9feb75aa0669