FA-48701 / Delimited text / Open access
A tagged message uses its recipient as message text · case 01
A structured table violates the declared record or column contract.
ROOT CAUSE
A tagged message uses its recipient as message text.
VERIFIED REPAIR
Preserve the named invariant at the faulty decision: 'text':cells[3]
Unsuccessful approach: The alternate implementation still violates the same declared invariant: a tagged message uses its recipient as message text.
Case contract
Decode tagged comma rows. P,name,age represents a person with canonical unsigned ASCII integer age; M,from,to,text represents a message with text that may be empty. Unknown tags and wrong arities reject. Return tagged dictionaries in source order.
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):
out=[]
for line in data:
cells=line.split(',')
if cells[0]=='P':
if len(cells)!=3: return None
if not cells[2].isascii() or not cells[2].isdecimal() or str(int(cells[2]))!=cells[2]: return None
out.append({'kind':'person','name':cells[1],'age':int(cells[2])})
elif cells[0]=='M':
if len(cells)!=4: return None
out.append({'kind':'message','from':cells[1],'to':cells[2],'text':cells[2]})
else: return None
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary(['P,@,12', 'M,a,b,hello'])), _vary([{'kind': 'person', 'name': '@', 'age': 12}, {'kind': 'message', 'from': 'a', 'to': 'b', 'text': 'hello'}]))
check('empty text', solve(_vary(['M,a,b,'])), _vary([{'kind': 'message', 'from': 'a', 'to': 'b', 'text': ''}]))
check('zero age', solve(_vary(['P,@,0'])), _vary([{'kind': 'person', 'name': '@', 'age': 0}]))
check('bad tag', solve(_vary(['X,a,b'])), _vary(None))
check('wrong person', solve(_vary(['P,a,12,x'])), _vary(None))
check('wrong message', solve(_vary(['M,a,b'])), _vary(None))
check('leading zero', solve(_vary(['P,@,01'])), _vary(None))
check('empty', 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 |
|---|---|---|---|
| mixed | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'b', 'to': 'b'}] | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'hello', 'to': 'b'}] | Failed |
| empty text | [{'from': 'a', 'kind': 'message', 'text': 'b', 'to': 'b'}] | [{'from': 'a', 'kind': 'message', 'text': '', 'to': 'b'}] | Failed |
| zero age | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | Passed |
| bad tag | None | None | Passed |
| wrong person | None | None | Passed |
| wrong message | None | None | Passed |
| leading zero | None | None | Passed |
| empty | [] | [] | Passed |
SHA-256 / 4913c2c0aa14662318faedd5d138f22150a71685cef086745bff295c65dce6de
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):
out=[]
for line in data:
cells=line.split(',')
if cells[0]=='P':
if len(cells)!=3: return None
if not cells[2].isascii() or not cells[2].isdecimal() or str(int(cells[2]))!=cells[2]: return None
out.append({'kind':'person','name':cells[1],'age':int(cells[2])})
elif cells[0]=='M':
if len(cells)!=4: return None
out.append({'kind':'message','from':cells[1],'to':cells[2],'text':','.join(cells[1:])})
else: return None
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary(['P,@,12', 'M,a,b,hello'])), _vary([{'kind': 'person', 'name': '@', 'age': 12}, {'kind': 'message', 'from': 'a', 'to': 'b', 'text': 'hello'}]))
check('empty text', solve(_vary(['M,a,b,'])), _vary([{'kind': 'message', 'from': 'a', 'to': 'b', 'text': ''}]))
check('zero age', solve(_vary(['P,@,0'])), _vary([{'kind': 'person', 'name': '@', 'age': 0}]))
check('bad tag', solve(_vary(['X,a,b'])), _vary(None))
check('wrong person', solve(_vary(['P,a,12,x'])), _vary(None))
check('wrong message', solve(_vary(['M,a,b'])), _vary(None))
check('leading zero', solve(_vary(['P,@,01'])), _vary(None))
check('empty', 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 |
|---|---|---|---|
| mixed | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'a,b,hello', 'to': 'b'}] | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'hello', 'to': 'b'}] | Failed |
| empty text | [{'from': 'a', 'kind': 'message', 'text': 'a,b,', 'to': 'b'}] | [{'from': 'a', 'kind': 'message', 'text': '', 'to': 'b'}] | Failed |
| zero age | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | Passed |
| bad tag | None | None | Passed |
| wrong person | None | None | Passed |
| wrong message | None | None | Passed |
| leading zero | None | None | Passed |
| empty | [] | [] | Passed |
SHA-256 / 253d3c778697006c0f971b068ebaa65cdf7c0fc6671e898a528a942864d33c0a
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):
out=[]
for line in data:
cells=line.split(',')
if cells[0]=='P':
if len(cells)!=3: return None
if not cells[2].isascii() or not cells[2].isdecimal() or str(int(cells[2]))!=cells[2]: return None
out.append({'kind':'person','name':cells[1],'age':int(cells[2])})
elif cells[0]=='M':
if len(cells)!=4: return None
out.append({'kind':'message','from':cells[1],'to':cells[2],'text':cells[3]})
else: return None
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary(['P,@,12', 'M,a,b,hello'])), _vary([{'kind': 'person', 'name': '@', 'age': 12}, {'kind': 'message', 'from': 'a', 'to': 'b', 'text': 'hello'}]))
check('empty text', solve(_vary(['M,a,b,'])), _vary([{'kind': 'message', 'from': 'a', 'to': 'b', 'text': ''}]))
check('zero age', solve(_vary(['P,@,0'])), _vary([{'kind': 'person', 'name': '@', 'age': 0}]))
check('bad tag', solve(_vary(['X,a,b'])), _vary(None))
check('wrong person', solve(_vary(['P,a,12,x'])), _vary(None))
check('wrong message', solve(_vary(['M,a,b'])), _vary(None))
check('leading zero', solve(_vary(['P,@,01'])), _vary(None))
check('empty', 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 |
|---|---|---|---|
| mixed | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'hello', 'to': 'b'}] | [{'age': 12, 'kind': 'person', 'name': 'cell'}, {'from': 'a', 'kind': 'message', 'text': 'hello', 'to': 'b'}] | Passed |
| empty text | [{'from': 'a', 'kind': 'message', 'text': '', 'to': 'b'}] | [{'from': 'a', 'kind': 'message', 'text': '', 'to': 'b'}] | Passed |
| zero age | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | [{'age': 0, 'kind': 'person', 'name': 'cell'}] | Passed |
| bad tag | None | None | Passed |
| wrong person | None | None | Passed |
| wrong message | None | None | Passed |
| leading zero | None | None | Passed |
| empty | [] | [] | Passed |
SHA-256 / d62b2209ed5e60b6b25b7ee1edd34e1ddd582a9ddbe5ee76b17a91ffdae93fe8
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:53.182698+00:00.
Case digest / 8b7a7c42abb4dc75262a0c4f63faf64435ef847c92e1e9497c637a7b20be70c6