{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":8,"contract":"Read pipe messages OPEN|id|header, ROW|id|comma-values, CLOSE|id|empty. Multiple table IDs may be open concurrently. IDs cannot reopen after close; rows require an active ID and matching width. Close emits [id, rows] in close order; EOF with open tables rejects.","evaluation_group":"s3-delimited-text-interleaved-tables","failed_approach":"The alternate implementation still violates the same declared invariant: eof commits still-open interleaved tables.","family":"s3-delimited-text-interleaved-tables-open-eof","id":"FA-48336","implementations":{"attempt":{"sha256":"53678998db0ffd9477ac04f22d631e7fc35061d0b671c47f1fa6675f47f69f2e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\ndef _vary(value):\n    if value == '@END': return 3 + 4*N\n    if isinstance(value, str): return value.replace('@', 'cell' * N)\n    if isinstance(value, list): return [_vary(x) for x in value]\n    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}\n    return value\nN = 1\nobservations = []\ndef solve(data):\n    active, closed, out = {},set(),[]\n    for line in data:\n        parts=line.split('|',2)\n        if len(parts)!=3: return None\n        tag,key,payload=parts\n        if tag=='OPEN':\n            if key in active or key in closed: return None\n            active[key]=[payload.split(','),[]]\n        elif tag=='ROW':\n            if key not in active: return None\n            row=payload.split(',')\n            if len(row)!=len(active[key][0]): return None\n            active[key][1].append(row)\n        elif tag=='CLOSE':\n            if key not in active or payload!='': return None\n            out.append([key,active.pop(key)[1]]); closed.add(key)\n        else: return None\n    if active: out.extend([key,value[1]] for key,value in active.items())\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))\ncheck('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))\ncheck('unknown', solve(_vary(['ROW|a|@'])), _vary(None))\ncheck('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))\ncheck('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))\ncheck('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))\ncheck('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _vary([['@', []]]))\ncheck('zero', solve(_vary([])), _vary([]))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"d9dd93ceaa538701dd6f1db761113cc4e68cb2dadd5116a84b34ebee500e3a8f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\ndef _vary(value):\n    if value == '@END': return 3 + 4*N\n    if isinstance(value, str): return value.replace('@', 'cell' * N)\n    if isinstance(value, list): return [_vary(x) for x in value]\n    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}\n    return value\nN = 1\nobservations = []\ndef solve(data):\n    active, closed, out = {},set(),[]\n    for line in data:\n        parts=line.split('|',2)\n        if len(parts)!=3: return None\n        tag,key,payload=parts\n        if tag=='OPEN':\n            if key in active or key in closed: return None\n            active[key]=[payload.split(','),[]]\n        elif tag=='ROW':\n            if key not in active: return None\n            row=payload.split(',')\n            if len(row)!=len(active[key][0]): return None\n            active[key][1].append(row)\n        elif tag=='CLOSE':\n            if key not in active or payload!='': return None\n            out.append([key,active.pop(key)[1]]); closed.add(key)\n        else: return None\n    if active: active.clear()\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))\ncheck('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))\ncheck('unknown', solve(_vary(['ROW|a|@'])), _vary(None))\ncheck('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))\ncheck('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))\ncheck('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))\ncheck('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _vary([['@', []]]))\ncheck('zero', solve(_vary([])), _vary([]))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"750180ba36107cbeb96429312234571c3144603ae1616f63252b60db76bd764c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\ndef _vary(value):\n    if value == '@END': return 3 + 4*N\n    if isinstance(value, str): return value.replace('@', 'cell' * N)\n    if isinstance(value, list): return [_vary(x) for x in value]\n    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}\n    return value\nN = 1\nobservations = []\ndef solve(data):\n    active, closed, out = {},set(),[]\n    for line in data:\n        parts=line.split('|',2)\n        if len(parts)!=3: return None\n        tag,key,payload=parts\n        if tag=='OPEN':\n            if key in active or key in closed: return None\n            active[key]=[payload.split(','),[]]\n        elif tag=='ROW':\n            if key not in active: return None\n            row=payload.split(',')\n            if len(row)!=len(active[key][0]): return None\n            active[key][1].append(row)\n        elif tag=='CLOSE':\n            if key not in active or payload!='': return None\n            out.append([key,active.pop(key)[1]]); closed.add(key)\n        else: return None\n    if active: return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('interleaved', solve(_vary(['OPEN|a|x', 'OPEN|b|y', 'ROW|a|@', 'ROW|b|z', 'CLOSE|b|', 'CLOSE|a|'])), _vary([['b', [['z']]], ['a', [['@']]]]))\ncheck('unclosed', solve(_vary(['OPEN|a|x'])), _vary(None))\ncheck('unknown', solve(_vary(['ROW|a|@'])), _vary(None))\ncheck('reopen', solve(_vary(['OPEN|a|x', 'CLOSE|a|', 'OPEN|a|x', 'CLOSE|a|'])), _vary(None))\ncheck('close payload', solve(_vary(['OPEN|a|x', 'CLOSE|a|bad'])), _vary(None))\ncheck('width', solve(_vary(['OPEN|a|x,y', 'ROW|a|@', 'CLOSE|a|'])), _vary(None))\ncheck('normal', solve(_vary(['OPEN|@|x', 'CLOSE|@|'])), _vary([['@', []]]))\ncheck('zero', solve(_vary([])), _vary([]))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Deterministic bounded in-memory model. No claim of complete CSV or external format conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-delimited-text-interleaved-tables-open-eof","generated_at":"2026-09-29T14:44:49.891498+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Delimited interchange needs explicit framing, schema and field semantics at ingestion and emission boundaries.","repair":"Preserve the named invariant at the faulty decision: if active: return None","root_cause":"EOF commits still-open interleaved tables.","sha256":"28686447d007d8d1084a9dfc4a31838ada160d38472675513cd86c1fbe9e0481","title":"EOF commits still-open interleaved tables · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.632,"exit_code":1,"observations":[{"actual":[["b",[["z"]]],["a",[["cell"]]]],"check":"interleaved","expected":[["b",[["z"]]],["a",[["cell"]]]],"passed":true},{"actual":[["a",[]]],"check":"unclosed","expected":null,"passed":false},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"reopen","expected":null,"passed":true},{"actual":null,"check":"close payload","expected":null,"passed":true},{"actual":null,"check":"width","expected":null,"passed":true},{"actual":[["cell",[]]],"check":"normal","expected":[["cell",[]]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved\", \"actual\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"expected\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": [[\"a\", []]], \"expected\": null, \"passed\": false}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"reopen\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"close payload\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": [[\"cell\", []]], \"expected\": [[\"cell\", []]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.076,"exit_code":1,"observations":[{"actual":[["b",[["z"]]],["a",[["cell"]]]],"check":"interleaved","expected":[["b",[["z"]]],["a",[["cell"]]]],"passed":true},{"actual":[],"check":"unclosed","expected":null,"passed":false},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"reopen","expected":null,"passed":true},{"actual":null,"check":"close payload","expected":null,"passed":true},{"actual":null,"check":"width","expected":null,"passed":true},{"actual":[["cell",[]]],"check":"normal","expected":[["cell",[]]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved\", \"actual\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"expected\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": [], \"expected\": null, \"passed\": false}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"reopen\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"close payload\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": [[\"cell\", []]], \"expected\": [[\"cell\", []]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.376,"exit_code":0,"observations":[{"actual":[["b",[["z"]]],["a",[["cell"]]]],"check":"interleaved","expected":[["b",[["z"]]],["a",[["cell"]]]],"passed":true},{"actual":null,"check":"unclosed","expected":null,"passed":true},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"reopen","expected":null,"passed":true},{"actual":null,"check":"close payload","expected":null,"passed":true},{"actual":null,"check":"width","expected":null,"passed":true},{"actual":[["cell",[]]],"check":"normal","expected":[["cell",[]]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"interleaved\", \"actual\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"expected\": [[\"b\", [[\"z\"]]], [\"a\", [[\"cell\"]]]], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"reopen\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"close payload\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": [[\"cell\", []]], \"expected\": [[\"cell\", []]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}