{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":10,"contract":"Frame raw TSV records from arbitrary string chunks using CRLF only. Bare CR and bare LF are invalid. A trailing nonterminated record is allowed; a final CR is invalid. Return records without terminators, retaining empty records.","evaluation_group":"s3-delimited-text-crlf-chunk-framer","failed_approach":"Deriving pending state from the just-consumed LF keeps it incorrectly armed.","family":"s3-delimited-text-crlf-chunk-framer-pending-clear","id":"FA-47521","implementations":{"attempt":{"sha256":"92c75cb6bb2d0211ad5c5a194087c121d044617d4c0b3807101cf80f07d8a3a2","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    rows, buf, pending = [], [], False\n    for chunk in data:\n        for ch in chunk:\n            if pending:\n                if ch != '\\n': return None\n                rows.append(''.join(buf))\n                buf, pending = [], ch == '\\n'\n            elif ch == '\\r': pending = True\n            elif ch == '\\n': return None\n            else: buf.append(ch)\n    if pending: return None\n    if buf: rows.append(''.join(buf))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split terminator', solve(_vary(['@\\r', '\\nZ\\r', '\\n'])), _vary(['@', 'Z']))\ncheck('whole', solve(_vary(['@\\tA\\r\\nB'])), _vary(['@\\tA', 'B']))\ncheck('empty records', solve(_vary(['\\r\\n\\r\\n'])), _vary(['', '']))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\r', '', '\\n', ''])), _vary(['@']))\ncheck('trailing CR', solve(_vary(['@\\r'])), _vary(None))\ncheck('bare LF', solve(_vary(['@\\n'])), _vary(None))\ncheck('bad CR', solve(_vary(['@\\rZ'])), _vary(None))\ncheck('no data', solve(_vary([])), _vary([]))\ncheck('trailing unframed', solve(_vary(['@'])), _vary(['@']))\ncheck('three chunks', solve(_vary(['@\\r', '\\n', 'X'])), _vary(['@', 'X']))\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":"e1773a14681c3921947251d9f98bff559cd8c8f4803bc0333155e35f20ead42f","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    rows, buf, pending = [], [], False\n    for chunk in data:\n        for ch in chunk:\n            if pending:\n                if ch != '\\n': return None\n                rows.append(''.join(buf))\n                buf, pending = [], True\n            elif ch == '\\r': pending = True\n            elif ch == '\\n': return None\n            else: buf.append(ch)\n    if pending: return None\n    if buf: rows.append(''.join(buf))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split terminator', solve(_vary(['@\\r', '\\nZ\\r', '\\n'])), _vary(['@', 'Z']))\ncheck('whole', solve(_vary(['@\\tA\\r\\nB'])), _vary(['@\\tA', 'B']))\ncheck('empty records', solve(_vary(['\\r\\n\\r\\n'])), _vary(['', '']))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\r', '', '\\n', ''])), _vary(['@']))\ncheck('trailing CR', solve(_vary(['@\\r'])), _vary(None))\ncheck('bare LF', solve(_vary(['@\\n'])), _vary(None))\ncheck('bad CR', solve(_vary(['@\\rZ'])), _vary(None))\ncheck('no data', solve(_vary([])), _vary([]))\ncheck('trailing unframed', solve(_vary(['@'])), _vary(['@']))\ncheck('three chunks', solve(_vary(['@\\r', '\\n', 'X'])), _vary(['@', 'X']))\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":"f495bf941e395e1a4d39a9c3aa637de71fe7a5e1e9f5955fd1bc41eb65d05334","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    rows, buf, pending = [], [], False\n    for chunk in data:\n        for ch in chunk:\n            if pending:\n                if ch != '\\n': return None\n                rows.append(''.join(buf))\n                buf, pending = [], False\n            elif ch == '\\r': pending = True\n            elif ch == '\\n': return None\n            else: buf.append(ch)\n    if pending: return None\n    if buf: rows.append(''.join(buf))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split terminator', solve(_vary(['@\\r', '\\nZ\\r', '\\n'])), _vary(['@', 'Z']))\ncheck('whole', solve(_vary(['@\\tA\\r\\nB'])), _vary(['@\\tA', 'B']))\ncheck('empty records', solve(_vary(['\\r\\n\\r\\n'])), _vary(['', '']))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\r', '', '\\n', ''])), _vary(['@']))\ncheck('trailing CR', solve(_vary(['@\\r'])), _vary(None))\ncheck('bare LF', solve(_vary(['@\\n'])), _vary(None))\ncheck('bad CR', solve(_vary(['@\\rZ'])), _vary(None))\ncheck('no data', solve(_vary([])), _vary([]))\ncheck('trailing unframed', solve(_vary(['@'])), _vary(['@']))\ncheck('three chunks', solve(_vary(['@\\r', '\\n', 'X'])), _vary(['@', 'X']))\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-crlf-chunk-framer-pending-clear","generated_at":"2026-09-29T14:44:42.262196+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: buf, pending = [], False","root_cause":"The completed terminator does not clear its prefix state.","sha256":"6dd98430e6f3a7c8aa93f7fabcb789e82f5760086d208a9b1186e76b9cce9ed2","title":"A consumed CRLF leaves the terminator prefix pending · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.071,"exit_code":1,"observations":[{"actual":null,"check":"split terminator","expected":["cell","Z"],"passed":false},{"actual":null,"check":"whole","expected":["cell\tA","B"],"passed":false},{"actual":null,"check":"empty records","expected":["",""],"passed":false},{"actual":null,"check":"empty chunks","expected":["cell"],"passed":false},{"actual":null,"check":"trailing CR","expected":null,"passed":true},{"actual":null,"check":"bare LF","expected":null,"passed":true},{"actual":null,"check":"bad CR","expected":null,"passed":true},{"actual":[],"check":"no data","expected":[],"passed":true},{"actual":["cell"],"check":"trailing unframed","expected":["cell"],"passed":true},{"actual":null,"check":"three chunks","expected":["cell","X"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split terminator\", \"actual\": null, \"expected\": [\"cell\", \"Z\"], \"passed\": false}, {\"check\": \"whole\", \"actual\": null, \"expected\": [\"cell\\tA\", \"B\"], \"passed\": false}, {\"check\": \"empty records\", \"actual\": null, \"expected\": [\"\", \"\"], \"passed\": false}, {\"check\": \"empty chunks\", \"actual\": null, \"expected\": [\"cell\"], \"passed\": false}, {\"check\": \"trailing CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bare LF\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"no data\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"trailing unframed\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}, {\"check\": \"three chunks\", \"actual\": null, \"expected\": [\"cell\", \"X\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":48.085,"exit_code":1,"observations":[{"actual":null,"check":"split terminator","expected":["cell","Z"],"passed":false},{"actual":null,"check":"whole","expected":["cell\tA","B"],"passed":false},{"actual":null,"check":"empty records","expected":["",""],"passed":false},{"actual":null,"check":"empty chunks","expected":["cell"],"passed":false},{"actual":null,"check":"trailing CR","expected":null,"passed":true},{"actual":null,"check":"bare LF","expected":null,"passed":true},{"actual":null,"check":"bad CR","expected":null,"passed":true},{"actual":[],"check":"no data","expected":[],"passed":true},{"actual":["cell"],"check":"trailing unframed","expected":["cell"],"passed":true},{"actual":null,"check":"three chunks","expected":["cell","X"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split terminator\", \"actual\": null, \"expected\": [\"cell\", \"Z\"], \"passed\": false}, {\"check\": \"whole\", \"actual\": null, \"expected\": [\"cell\\tA\", \"B\"], \"passed\": false}, {\"check\": \"empty records\", \"actual\": null, \"expected\": [\"\", \"\"], \"passed\": false}, {\"check\": \"empty chunks\", \"actual\": null, \"expected\": [\"cell\"], \"passed\": false}, {\"check\": \"trailing CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bare LF\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"no data\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"trailing unframed\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}, {\"check\": \"three chunks\", \"actual\": null, \"expected\": [\"cell\", \"X\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":48.259,"exit_code":0,"observations":[{"actual":["cell","Z"],"check":"split terminator","expected":["cell","Z"],"passed":true},{"actual":["cell\tA","B"],"check":"whole","expected":["cell\tA","B"],"passed":true},{"actual":["",""],"check":"empty records","expected":["",""],"passed":true},{"actual":["cell"],"check":"empty chunks","expected":["cell"],"passed":true},{"actual":null,"check":"trailing CR","expected":null,"passed":true},{"actual":null,"check":"bare LF","expected":null,"passed":true},{"actual":null,"check":"bad CR","expected":null,"passed":true},{"actual":[],"check":"no data","expected":[],"passed":true},{"actual":["cell"],"check":"trailing unframed","expected":["cell"],"passed":true},{"actual":["cell","X"],"check":"three chunks","expected":["cell","X"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split terminator\", \"actual\": [\"cell\", \"Z\"], \"expected\": [\"cell\", \"Z\"], \"passed\": true}, {\"check\": \"whole\", \"actual\": [\"cell\\tA\", \"B\"], \"expected\": [\"cell\\tA\", \"B\"], \"passed\": true}, {\"check\": \"empty records\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"empty chunks\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}, {\"check\": \"trailing CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bare LF\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad CR\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"no data\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"trailing unframed\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}, {\"check\": \"three chunks\", \"actual\": [\"cell\", \"X\"], \"expected\": [\"cell\", \"X\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}