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=list(dict.fromkeys(parts[1].split(','))) if parts[1] else []
            if any(key not in dictionary for key in ids): return None
            rows.append([dictionary[key] for key in ids])
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))
check('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))
check('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))
check('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))
check('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))
check('empty row', solve(_vary(['ROW|'])), _vary([[]]))
check('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))
check('zero', solve(_vary([])), _vary([]))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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=sorted(set(parts[1].split(','))) if parts[1] else []
            if any(key not in dictionary for key in ids): return None
            rows.append([dictionary[key] for key in ids])
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))
check('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))
check('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))
check('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))
check('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))
check('empty row', solve(_vary(['ROW|'])), _vary([[]]))
check('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))
check('zero', solve(_vary([])), _vary([]))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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


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('|')
        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 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)

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):
    dictionary,rows={},[]
    for line in data:
        parts=line.rsplit('|',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 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


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

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

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


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
            if ids: rows.append([dictionary[key] for key in ids])
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))
check('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))
check('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))
check('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))
check('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))
check('empty row', solve(_vary(['ROW|'])), _vary([[]]))
check('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))
check('zero', solve(_vary([])), _vary([]))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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 ids] if ids else None)
        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


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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='0': out.append(None)
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit!='0': out.append('')
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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 bitmap|comma-payload rows. Bitmap consists of 0 and 1; 1 denotes null and consumes no payload, 0 consumes one payload field. Empty payload encodes zero fields only when bitmap has no zero bits; otherwise it is one empty field. Reject leftover or insufficient values. Return logical cells.

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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None); cursor+=1
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None); cursor=max(1,cursor)
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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 bitmap|comma-payload rows. Bitmap consists of 0 and 1; 1 denotes null and consumes no payload, 0 consumes one payload field. Empty payload encodes zero fields only when bitmap has no zero bits; otherwise it is one empty field. Reject leftover or insufficient values. Return logical cells.

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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None)
        else:
            if cursor>=len(values): return None
            out.append(values[0]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None)
        else:
            if cursor>=len(values): return None
            out.append(values[-1]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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 bitmap|comma-payload rows. Bitmap consists of 0 and 1; 1 denotes null and consumes no payload, 0 consumes one payload field. Empty payload encodes zero fields only when bitmap has no zero bits; otherwise it is one empty field. Reject leftover or insufficient values. Return logical cells.

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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None)
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if False: return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append(None)
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor>len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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 bitmap|comma-payload rows. Bitmap consists of 0 and 1; 1 denotes null and consumes no payload, 0 consumes one payload field. Empty payload encodes zero fields only when bitmap has no zero bits; otherwise it is one empty field. Reject leftover or insufficient values. Return logical cells.

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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': pass
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    bits,payload=parts
    if any(bit not in '01' for bit in bits): return None
    values=payload.split(',') if payload or '0' in bits else []
    out=[]; cursor=0
    for bit in bits:
        if bit=='1': out.append([])
        else:
            if cursor>=len(values): return None
            out.append(values[cursor]); cursor+=1
    if cursor!=len(values): return None
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed', solve(_vary('010|@,z')), _vary(['@', None, 'z']))
check('all null', solve(_vary('111|')), _vary([None, None, None]))
check('empty text', solve(_vary('0|')), _vary(['']))
check('insufficient', solve(_vary('00|x')), _vary(None))
check('extra', solve(_vary('1|x')), _vary(None))
check('empty bitmap', solve(_vary('|')), _vary([]))
check('invalid bit', solve(_vary('02|x,y')), _vary(None))
check('several nulls', solve(_vary('1101|@')), _vary([None, None, '@', None]))
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 bitmap|comma-payload rows. Bitmap consists of 0 and 1; 1 denotes null and consumes no payload, 0 consumes one payload field. Empty payload encodes zero fields only when bitmap has no zero bits; otherwise it is one empty field. Reject leftover or insufficient values. Return logical cells.

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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[position]=fields[original]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[position]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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.

Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.

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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=[order[i] for i in proposal]
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=list(reversed(proposal))
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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.

Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.

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):
    width=len(data[0].split(',')); order=list(reversed(range(width))); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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):
    width=len(data[0].split(',')); order=sorted(range(width),reverse=True); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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.

Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.

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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if len(proposal)!=width: return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if any(x>=width for x in proposal): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*width
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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.

Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.

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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*(width+1)
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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):
    width=len(data[0].split(',')); order=list(range(width)); rows=[]
    for line in data[1:]:
        tag,payload=(line.split('|',1)+[''])[:2]
        fields=payload.split(',')
        if tag=='ORDER':
            if any(not x.isascii() or not x.isdecimal() for x in fields): return None
            proposal=[int(x) for x in fields]
            if sorted(proposal)!=list(range(width)): return None
            order=proposal
        elif tag=='DATA':
            if len(fields)!=width: return None
            row=[None]*(width*2)
            for position,original in enumerate(order): row[original]=fields[position]
            rows.append(row)
        else: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))
check('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))
check('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))
check('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))
check('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))
check('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))
check('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))
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.

Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.

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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[0]+=text
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[len(cells)//2]+=text
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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.

Process pipe records ROW|count, CELL|text, MORE|text, END|empty. CELL starts a new field; MORE concatenates to the most recent field without inserting characters. Each row declares a positive field count, completed at END. MORE without a field and excess fields reject. Multiple rows are allowed.

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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]=text
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]=text+cells[-1]
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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.

Process pipe records ROW|count, CELL|text, MORE|text, END|empty. CELL starts a new field; MORE concatenates to the most recent field without inserting characters. Each row declares a positive field count, completed at END. MORE without a field and excess fields reject. Multiple rows are allowed.

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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells.append(text)
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells.extend(text)
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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.

Process pipe records ROW|count, CELL|text, MORE|text, END|empty. CELL starts a new field; MORE concatenates to the most recent field without inserting characters. Each row declares a positive field count, completed at END. MORE without a field and excess fields reject. Multiple rows are allowed.

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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]+=text
        elif tag=='END':
            if cells is None or text: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]+=text
        elif tag=='END':
            if cells is None or text or len(cells)>expected: return None
            rows.append(cells); cells=None
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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.

Process pipe records ROW|count, CELL|text, MORE|text, END|empty. CELL starts a new field; MORE concatenates to the most recent field without inserting characters. Each row declares a positive field count, completed at END. MORE without a field and excess fields reject. Multiple rows are allowed.

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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]+=text
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells)
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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):
    rows=[]; cells=None; expected=0
    for line in data:
        tag,text=(line.split('|',1)+[''])[:2]
        if tag=='ROW':
            if cells is not None or not text.isascii() or not text.isdecimal() or int(text)<1: return None
            cells=[]; expected=int(text)
        elif tag=='CELL':
            if cells is None or len(cells)>=expected: return None
            cells.append(text)
        elif tag=='MORE':
            if not cells: return None
            cells[-1]+=text
        elif tag=='END':
            if cells is None or text or len(cells)!=expected: return None
            rows.append(cells); cells=[]
        else: return None
    if cells is not None: return None
    return rows
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('continuation', solve(_vary(['ROW|2', 'CELL|@', 'MORE|x', 'CELL|y', 'MORE|z', 'END|'])), _vary([['@x', 'yz']]))
check('third-field continuation', solve(_vary(['ROW|3', 'CELL|a', 'CELL|b', 'CELL|@', 'MORE|z', 'END|'])), _vary([['a', 'b', '@z']]))
check('empty pieces', solve(_vary(['ROW|1', 'CELL|', 'MORE|@', 'MORE|', 'END|'])), _vary([['@']]))
check('orphan more', solve(_vary(['ROW|1', 'MORE|@'])), _vary(None))
check('excess', solve(_vary(['ROW|1', 'CELL|@', 'CELL|x'])), _vary(None))
check('too few', solve(_vary(['ROW|2', 'CELL|@', 'END|'])), _vary(None))
check('unfinished', solve(_vary(['ROW|1', 'CELL|@'])), _vary(None))
check('two rows', solve(_vary(['ROW|1', 'CELL|@', 'END|', 'ROW|1', 'CELL|z', 'END|'])), _vary([['@'], ['z']]))
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.

Process pipe records ROW|count, CELL|text, MORE|text, END|empty. CELL starts a new field; MORE concatenates to the most recent field without inserting characters. Each row declares a positive field count, completed at END. MORE without a field and excess fields reject. Multiple rows are allowed.

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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(ord(ch) for ch in payload if ch!=',')%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(ord(ch) for ch in payload.replace(',', ' '))%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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.

Decode rows encoded as comma cells followed by |decimal check. The check is the sum of Unicode code points in the exact comma payload modulo 97; this is only a corruption-detection toy, not cryptographic integrity. Use the last pipe as trailer separator, permitting pipes in cells. Reject malformed or mismatched checks. Return fields.

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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(payload.encode('utf-8'))%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(payload.encode('utf-16-le'))%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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.

Decode rows encoded as comma cells followed by |decimal check. The check is the sum of Unicode code points in the exact comma payload modulo 97; this is only a corruption-detection toy, not cryptographic integrity. Use the last pipe as trailer separator, permitting pipes in cells. Reject malformed or mismatched checks. Return fields.

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):
    parts=data.split('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(ord(ch) for ch in payload)%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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):
    parts=data.split('|')
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check>=97: return None
    expected=sum(ord(ch) for ch in payload)%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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.

Decode rows encoded as comma cells followed by |decimal check. The check is the sum of Unicode code points in the exact comma payload modulo 97; this is only a corruption-detection toy, not cryptographic integrity. Use the last pipe as trailer separator, permitting pipes in cells. Reject malformed or mismatched checks. Return fields.

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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    check%=97
    expected=sum(ord(ch) for ch in payload)%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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):
    parts=data.rsplit('|',1)
    if len(parts)!=2: return None
    payload,token=parts
    if not token.isascii() or not token.isdecimal(): return None
    check=int(token)
    if check==97: check=0
    if check>97: return None
    expected=sum(ord(ch) for ch in payload)%97
    if check!=expected: return None
    return payload.split(',')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('comma', solve(_vary('a,b|45')), _vary(['a', 'b']))
check('empty', solve(_vary('|0')), _vary(['']))
check('pipe data', solve(_vary('a|b|28')), _vary(['a|b']))
check('unicode', solve(_vary('é|39')), _vary(['é']))
check('astral checksum', solve(_vary('😀|84')), _vary(['😀']))
check('bad checksum', solve(_vary('a|1')), _vary(None))
check('bad trailer', solve(_vary('a|-1')), _vary(None))
check('unreduced', solve(_vary('a|97')), _vary(None))
check('normal', solve(_vary('z|25')), _vary(['z']))
check('variant checksum width', solve(('x'*N)+'|'+str((120*N)%97)), ['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.

Decode rows encoded as comma cells followed by |decimal check. The check is the sum of Unicode code points in the exact comma payload modulo 97; this is only a corruption-detection toy, not cryptographic integrity. Use the last pipe as trailer separator, permitting pipes in cells. Reject malformed or mismatched checks. Return fields.

split: open-access