broken_source:
"""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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif text: text+='\n'
    for row in data['rows']:
        text+=','.join(row)+'\n'
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

source:
"""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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)+'\n'
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

prompt:
A structured table violates the declared record or column contract.

Append comma rows to existing serialized text. Existing text is either empty or ends in a complete physical record, optionally lacking its final LF. On an empty file emit the supplied header once, followed by new rows. For a nonempty unterminated tail insert exactly one LF before new rows. With no new rows return existing text unchanged.

split: open-access


broken_source:
"""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):
    if False: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)+'\n'
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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):
    if not data['rows']: return data['existing']+'\n'
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)+'\n'
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

prompt:
A structured table violates the declared record or column contract.

Append comma rows to existing serialized text. Existing text is either empty or ends in a complete physical record, optionally lacking its final LF. On an empty file emit the supplied header once, followed by new rows. For a nonempty unterminated tail insert exactly one LF before new rows. With no new rows return existing text unchanged.

split: open-access


broken_source:
"""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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

source:
"""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):
    if not data['rows']: return data['existing']
    text=data['existing']
    if not text: text=','.join(data['header']) + '\n'
    elif not text.endswith('\n'): text+='\n'
    for row in data['rows']:
        text+=','.join(row)+','
    return text
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\n@,x\n'))
check('terminated', solve(_vary({'existing': 'a,b\nq,z\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('unterminated', solve(_vary({'existing': 'a,b\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\nq,z\n@,x\n'))
check('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))
check('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))
check('two appended', solve(_vary({'existing': 'a\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\n@\nz\n'))
check('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\n,\n'))
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)

prompt:
A structured table violates the declared record or column contract.

Append comma rows to existing serialized text. Existing text is either empty or ends in a complete physical record, optionally lacking its final LF. On an empty file emit the supplied header once, followed by new rows. For a nonempty unterminated tail insert exactly one LF before new rows. With no new rows return existing text unchanged.

split: open-access


broken_source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':')
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.rfind(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

prompt:
A structured table violates the declared record or column contract.

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

split: open-access


broken_source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+2; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

prompt:
A structured table violates the declared record or column contract.

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

split: open-access


broken_source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=pos+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=colon+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

prompt:
A structured table violates the declared record or column contract.

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

split: open-access


broken_source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() : return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or (len(token)>2 and token.startswith('0')): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+1
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

prompt:
A structured table violates the declared record or column contract.

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

split: open-access


broken_source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

source:
"""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=[]; pos=0
    while pos<len(data):
        colon=data.find(':',pos)
        if colon<0: return None
        token=data[pos:colon]
        if not token.isascii() or not token.isdecimal() or token != str(int(token)): return None
        size=int(token); begin=colon+1; end=begin+size
        if end>=len(data) or data[end]!=',': return None
        out.append(data[begin:end])
        pos=end+2
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two', solve(_vary('1:a,3:x,y,')), _vary(['a', 'x,y']))
check('colon payload', solve(_vary('3:a:b,')), _vary(['a:b']))
check('zero', solve(_vary('0:,')), _vary(['']))
check('unicode', solve(_vary('1:é,')), _vary(['é']))
check('truncated', solve(_vary('4:ab,')), _vary(None))
check('missing terminator', solve(_vary('1:a')), _vary(None))
check('leading zero', solve(_vary('01:a,')), _vary(None))
check('trailing junk', solve(_vary('1:a,x')), _vary(None))
check('zero stream', solve(_vary('')), _vary([]))
check('multi digit', solve(_vary('10:abcdefghij,')), _vary(['abcdefghij']))
check('variant payload extent', solve(str(N)+':'+('x'*N)+','), ['x'*N])
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)

prompt:
A structured table violates the declared record or column contract.

Read concatenated decimal-length:payload, cells, where length counts Unicode code points in this stipulated text format. Lengths are nonempty canonical ASCII decimal, including zero; payload may contain commas and colons. A terminal comma is mandatory after each payload. Return cells or null for malformed input.

split: open-access


broken_source:
"""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 cell in data:
        size=len(cell.encode('utf-8'))
        token=str(size)
        out.append(token+':'+cell+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

source:
"""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 cell in data:
        size=len(cell.encode('utf-16-le'))
        token=str(size)
        out.append(token+':'+cell+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

prompt:
A structured table violates the declared record or column contract.

Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.

split: open-access


broken_source:
"""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 cell in data:
        size=len(cell)
        token=str(size).zfill(2)
        out.append(token+':'+cell+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

source:
"""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 cell in data:
        size=len(cell)
        token='0'+str(size)
        out.append(token+':'+cell+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

prompt:
A structured table violates the declared record or column contract.

Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.

split: open-access


broken_source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell.replace(',', '\\,')+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell.replace(':', '\\:')+',')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

prompt:
A structured table violates the declared record or column contract.

Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.

split: open-access


broken_source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell)
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell+';')
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

prompt:
A structured table violates the declared record or column contract.

Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.

split: open-access


broken_source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell+',')
    return ','.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

source:
"""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 cell in data:
        size=len(cell)
        token=str(size)
        out.append(token+':'+cell+',')
    return '\n'.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unicode', solve(_vary(['é'])), _vary('1:é,'))
check('empty cell', solve(_vary([''])), _vary('0:,'))
check('delimiters', solve(_vary(['a:b,c'])), _vary('5:a:b,c,'))
check('several', solve(_vary(['a', 'bc'])), _vary('1:a,2:bc,'))
check('empty list', solve(_vary([])), _vary(''))
check('ASCII', solve(_vary(['abcd'])), _vary('4:abcd,'))
check('astral', solve(_vary(['😀'])), _vary('1:😀,'))
check('variant payload extent', solve(['x'*N]), str(N)+':'+('x'*N)+',')
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)

prompt:
A structured table violates the declared record or column contract.

Write text cells in canonical concatenated length:payload, form with Unicode-code-point lengths, not encoded byte lengths. Empty cells are explicit 0:, and an empty list emits empty text. Do not escape delimiters appearing inside payload.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
A structured table violates the declared record or column 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.

split: open-access


broken_source:
"""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=current if current is not None else []; 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)

source:
"""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=list(current) if current is not None else []; 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)

prompt:
A structured table violates the declared record or column 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.

split: open-access


broken_source:
"""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)
        elif tag=='R':
            if remaining==0: return None
            current.append(value); remaining-=2
        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)

source:
"""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)
        elif tag=='R':
            if remaining==0: return None
            current.append(value); remaining=0
        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)

prompt:
A structured table violates the declared record or column 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.

split: open-access


broken_source:
"""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)
        elif tag=='R':
            if remaining==0: return None
            current.append(value); remaining-=1
        else: 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)

source:
"""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)
        elif tag=='R':
            if remaining==0: return None
            current.append(value); remaining-=1
        else: return None
    if remaining and current==[]: 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)

prompt:
A structured table violates the declared record or column 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.

split: open-access


broken_source:
"""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)
        elif tag=='R':
            if remaining==0: continue
            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)

source:
"""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)
        elif tag=='R':
            if remaining==0: blocks.append([value]); continue
            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)

prompt:
A structured table violates the declared record or column 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.

split: open-access


broken_source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[list(active)[-1]][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[list(active)[0]][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

prompt:
A structured table violates the declared record or column contract.

Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.

split: open-access


broken_source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in closed: closed.remove(key)
            if key in active: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

prompt:
A structured table violates the declared record or column contract.

Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.

split: open-access


broken_source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return sorted(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return list(reversed(out))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

prompt:
A structured table violates the declared record or column contract.

Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.

split: open-access


broken_source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active: return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload=='badnever': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

prompt:
A structured table violates the declared record or column contract.

Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.

split: open-access


broken_source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: active.clear()
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

source:
"""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):
    active, closed, out = {},set(),[]
    for line in data:
        parts=line.split('|',2)
        if len(parts)!=3: return None
        tag,key,payload=parts
        if tag=='OPEN':
            if key in active or key in closed: return None
            active[key]=[payload.split(','),[]]
        elif tag=='ROW':
            if key not in active: return None
            row=payload.split(',')
            if len(row)!=len(active[key][0]): return None
            active[key][1].append(row)
        elif tag=='CLOSE':
            if key not in active or payload!='': return None
            out.append([key,active.pop(key)[1]]); closed.add(key)
        else: return None
    if active: out.extend([key,value[1]] for key,value in active.items())
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))
check('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))
check('unknown', solve(_vary(['ROW|a|@'])), _vary(None))
check('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))
check('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))
check('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))
check('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _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)

prompt:
A structured table violates the declared record or column contract.

Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.

split: open-access


broken_source:
"""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: 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 sorted(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)

source:
"""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: 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 reversed(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)

prompt:
A structured table violates the declared record or column 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.

split: open-access