FA-48791 / Delimited text / Open access
CSV provenance uses logical row count for the physical ending line · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
CSV provenance uses logical row count for the physical ending line.
THE FAILURE
CSV provenance uses logical row count for the physical ending line.
Unsuccessful approach: The alternate implementation still violates the same declared invariant: csv provenance uses logical row count for the physical ending line.
Case contract
Parse bounded valid CSV text using Python csv.reader and report each logical row with inclusive one-based physical start/end line numbers. Quoted embedded newlines count as physical lines. Empty input gives no rows; blank physical lines are zero-cell rows. Return [start,end,cells].
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):
import csv,io
reader=csv.reader(io.StringIO(data,newline=''))
out=[]; start=1
for cells in reader:
end=len(out)+1
out.append([start,end,cells])
start=end+1
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiline', solve(_vary('a,"x\ny"\nz,@\n')), _vary([[1, 2, ['a', 'x\ny']], [3, 3, ['z', '@']]]))
check('blank middle', solve(_vary('a\n\nz\n')), _vary([[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]]))
check('plain', solve(_vary('@,x\n')), _vary([[1, 1, ['@', 'x']]]))
check('CRLF', solve(_vary('"a\r\nb",z\r\n')), _vary([[1, 2, ['a\r\nb', 'z']]]))
check('empty', solve(_vary('')), _vary([]))
check('unterminated final', solve(_vary('@')), _vary([[1, 1, ['@']]]))
check('two multiline', solve(_vary('"a\nb"\n"c\nd"')), _vary([[1, 2, ['a\nb']], [3, 4, ['c\nd']]]))
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 |
|---|---|---|---|
| multiline | [[1, 1, ['a', 'x\ny']], [2, 2, ['z', 'cell']]] | [[1, 2, ['a', 'x\ny']], [3, 3, ['z', 'cell']]] | Failed |
| blank middle | [[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]] | [[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]] | Passed |
| plain | [[1, 1, ['cell', 'x']]] | [[1, 1, ['cell', 'x']]] | Passed |
| CRLF | [[1, 1, ['a\r\nb', 'z']]] | [[1, 2, ['a\r\nb', 'z']]] | Failed |
| empty | [] | [] | Passed |
| unterminated final | [[1, 1, ['cell']]] | [[1, 1, ['cell']]] | Passed |
| two multiline | [[1, 1, ['a\nb']], [2, 2, ['c\nd']]] | [[1, 2, ['a\nb']], [3, 4, ['c\nd']]] | Failed |
SHA-256 / bbd588d7b4b5643226af759333c5e293882b8954bf6a4279613407f141b68ec4
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):
import csv,io
reader=csv.reader(io.StringIO(data,newline=''))
out=[]; start=1
for cells in reader:
end=start
out.append([start,end,cells])
start=end+1
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiline', solve(_vary('a,"x\ny"\nz,@\n')), _vary([[1, 2, ['a', 'x\ny']], [3, 3, ['z', '@']]]))
check('blank middle', solve(_vary('a\n\nz\n')), _vary([[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]]))
check('plain', solve(_vary('@,x\n')), _vary([[1, 1, ['@', 'x']]]))
check('CRLF', solve(_vary('"a\r\nb",z\r\n')), _vary([[1, 2, ['a\r\nb', 'z']]]))
check('empty', solve(_vary('')), _vary([]))
check('unterminated final', solve(_vary('@')), _vary([[1, 1, ['@']]]))
check('two multiline', solve(_vary('"a\nb"\n"c\nd"')), _vary([[1, 2, ['a\nb']], [3, 4, ['c\nd']]]))
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 |
|---|---|---|---|
| multiline | [[1, 1, ['a', 'x\ny']], [2, 2, ['z', 'cell']]] | [[1, 2, ['a', 'x\ny']], [3, 3, ['z', 'cell']]] | Failed |
| blank middle | [[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]] | [[1, 1, ['a']], [2, 2, []], [3, 3, ['z']]] | Passed |
| plain | [[1, 1, ['cell', 'x']]] | [[1, 1, ['cell', 'x']]] | Passed |
| CRLF | [[1, 1, ['a\r\nb', 'z']]] | [[1, 2, ['a\r\nb', 'z']]] | Failed |
| empty | [] | [] | Passed |
| unterminated final | [[1, 1, ['cell']]] | [[1, 1, ['cell']]] | Passed |
| two multiline | [[1, 1, ['a\nb']], [2, 2, ['c\nd']]] | [[1, 2, ['a\nb']], [3, 4, ['c\nd']]] | Failed |
SHA-256 / 83262e3a87d8b2bf860a43846525f2cbd2bc1526be1a9f336e6e2e07b88c66f5
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
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:54.069098+00:00.
Case digest / 8e0962bd3c6acb5c3f6856cff642d8cacf8ba843bee40525946f10ddf75ff08f