{"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":"Retaining only the last character still contaminates the successor.","family":"s3-delimited-text-crlf-chunk-framer-record-buffer","id":"FA-47516","implementations":{"attempt":{"sha256":"c6cbbfca0c7fb7fe342844fe767bd03b355ccf3bd0a05f5f9c23143408157638","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 = buf[-1:], 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"},"broken":{"sha256":"48490cb50c733ecf1da6933041b7241e28bd5d5097d6d0ec7460b5508690d398","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 = buf, 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"},"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-record-buffer","generated_at":"2026-09-29T14:44:42.254829+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":"Record emission resets terminator state but not content state.","sha256":"7860ce9b9f74952d07912269f34148182f39b55a32393bfd33ca3b339b9c563e","title":"Framed records retain the preceding record payload · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":46.474,"exit_code":1,"observations":[{"actual":["cell","lZ","Z"],"check":"split terminator","expected":["cell","Z"],"passed":false},{"actual":["cell\tA","AB"],"check":"whole","expected":["cell\tA","B"],"passed":false},{"actual":["",""],"check":"empty records","expected":["",""],"passed":true},{"actual":["cell","l"],"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":["cell","lX"],"check":"three chunks","expected":["cell","X"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split terminator\", \"actual\": [\"cell\", \"lZ\", \"Z\"], \"expected\": [\"cell\", \"Z\"], \"passed\": false}, {\"check\": \"whole\", \"actual\": [\"cell\\tA\", \"AB\"], \"expected\": [\"cell\\tA\", \"B\"], \"passed\": false}, {\"check\": \"empty records\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"empty chunks\", \"actual\": [\"cell\", \"l\"], \"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\": [\"cell\", \"lX\"], \"expected\": [\"cell\", \"X\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.371,"exit_code":1,"observations":[{"actual":["cell","cellZ","cellZ"],"check":"split terminator","expected":["cell","Z"],"passed":false},{"actual":["cell\tA","cell\tAB"],"check":"whole","expected":["cell\tA","B"],"passed":false},{"actual":["",""],"check":"empty records","expected":["",""],"passed":true},{"actual":["cell","cell"],"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":["cell","cellX"],"check":"three chunks","expected":["cell","X"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split terminator\", \"actual\": [\"cell\", \"cellZ\", \"cellZ\"], \"expected\": [\"cell\", \"Z\"], \"passed\": false}, {\"check\": \"whole\", \"actual\": [\"cell\\tA\", \"cell\\tAB\"], \"expected\": [\"cell\\tA\", \"B\"], \"passed\": false}, {\"check\": \"empty records\", \"actual\": [\"\", \"\"], \"expected\": [\"\", \"\"], \"passed\": true}, {\"check\": \"empty chunks\", \"actual\": [\"cell\", \"cell\"], \"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\": [\"cell\", \"cellX\"], \"expected\": [\"cell\", \"X\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":48.598,"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"}