{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":8,"contract":"Consume arbitrary text chunks of an unquoted LF-delimited table. Complete records emit immediately into an output list; carry partial records across chunks. EOF emits a nonempty remaining fragment, but not a phantom row after final LF. Empty complete physical records are retained. Return comma-split rows.","evaluation_group":"s3-delimited-text-chunked-lf-records","failed_approach":"The alternate implementation still violates the same declared invariant: only one complete record is drained from each input chunk.","family":"s3-delimited-text-chunked-lf-records-drain-loop","id":"FA-48771","implementations":{"attempt":{"sha256":"d0444c26975043bd57aadfe99d1a0fc19a8b7a196ed862938e9a9889257e722f","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=[]; carry=''\n    for chunk in data:\n        carry+=chunk\n        if carry.count('\\n')==1:\n            record,carry=carry.split('\\n',1)\n            rows.append(record.split(','))\n    if carry: rows.append(carry.split(','))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split cell', solve(_vary(['a,', '@', '\\nx,y\\n'])), _vary([['a', '@'], ['x', 'y']]))\ncheck('several per chunk', solve(_vary(['a,b\\n@,z\\n'])), _vary([['a', 'b'], ['@', 'z']]))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\n', ''])), _vary([['@']]))\ncheck('partial final', solve(_vary(['a,b\\n@'])), _vary([['a', 'b'], ['@']]))\ncheck('empty rows', solve(_vary(['\\n\\n'])), _vary([[''], ['']]))\ncheck('empty input', solve(_vary([])), _vary([]))\ncheck('no newline', solve(_vary(['@'])), _vary([['@']]))\ncheck('split delimiter', solve(_vary(['a', '\\n', 'b'])), _vary([['a'], ['b']]))\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":"2bc0a0ce824ee73d80b859283906770053ce72369423086b6b34f669b6b8ad55","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=[]; carry=''\n    for chunk in data:\n        carry+=chunk\n        if '\\n' in carry:\n            record,carry=carry.split('\\n',1)\n            rows.append(record.split(','))\n    if carry: rows.append(carry.split(','))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split cell', solve(_vary(['a,', '@', '\\nx,y\\n'])), _vary([['a', '@'], ['x', 'y']]))\ncheck('several per chunk', solve(_vary(['a,b\\n@,z\\n'])), _vary([['a', 'b'], ['@', 'z']]))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\n', ''])), _vary([['@']]))\ncheck('partial final', solve(_vary(['a,b\\n@'])), _vary([['a', 'b'], ['@']]))\ncheck('empty rows', solve(_vary(['\\n\\n'])), _vary([[''], ['']]))\ncheck('empty input', solve(_vary([])), _vary([]))\ncheck('no newline', solve(_vary(['@'])), _vary([['@']]))\ncheck('split delimiter', solve(_vary(['a', '\\n', 'b'])), _vary([['a'], ['b']]))\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":"85410585cfb2fad32494d3b27709ac40176364ac6f648ab54678ed08bd179c6b","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=[]; carry=''\n    for chunk in data:\n        carry+=chunk\n        while '\\n' in carry:\n            record,carry=carry.split('\\n',1)\n            rows.append(record.split(','))\n    if carry: rows.append(carry.split(','))\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('split cell', solve(_vary(['a,', '@', '\\nx,y\\n'])), _vary([['a', '@'], ['x', 'y']]))\ncheck('several per chunk', solve(_vary(['a,b\\n@,z\\n'])), _vary([['a', 'b'], ['@', 'z']]))\ncheck('empty chunks', solve(_vary(['', '@', '', '\\n', ''])), _vary([['@']]))\ncheck('partial final', solve(_vary(['a,b\\n@'])), _vary([['a', 'b'], ['@']]))\ncheck('empty rows', solve(_vary(['\\n\\n'])), _vary([[''], ['']]))\ncheck('empty input', solve(_vary([])), _vary([]))\ncheck('no newline', solve(_vary(['@'])), _vary([['@']]))\ncheck('split delimiter', solve(_vary(['a', '\\n', 'b'])), _vary([['a'], ['b']]))\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-chunked-lf-records-drain-loop","generated_at":"2026-09-29T14:44:53.821014+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: while '\\n' in carry:","root_cause":"Only one complete record is drained from each input chunk.","sha256":"cc87a6a5e61efa4f1389e3f488448dff8d99e1ac5369b4725bb2a3a52390cb34","title":"Only one complete record is drained from each input chunk · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.201,"exit_code":1,"observations":[{"actual":[["a","cell\nx","y\n"]],"check":"split cell","expected":[["a","cell"],["x","y"]],"passed":false},{"actual":[["a","b\ncell","z\n"]],"check":"several per chunk","expected":[["a","b"],["cell","z"]],"passed":false},{"actual":[["cell"]],"check":"empty chunks","expected":[["cell"]],"passed":true},{"actual":[["a","b"],["cell"]],"check":"partial final","expected":[["a","b"],["cell"]],"passed":true},{"actual":[["\n\n"]],"check":"empty rows","expected":[[""],[""]],"passed":false},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[["cell"]],"check":"no newline","expected":[["cell"]],"passed":true},{"actual":[["a"],["b"]],"check":"split delimiter","expected":[["a"],["b"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split cell\", \"actual\": [[\"a\", \"cell\\nx\", \"y\\n\"]], \"expected\": [[\"a\", \"cell\"], [\"x\", \"y\"]], \"passed\": false}, {\"check\": \"several per chunk\", \"actual\": [[\"a\", \"b\\ncell\", \"z\\n\"]], \"expected\": [[\"a\", \"b\"], [\"cell\", \"z\"]], \"passed\": false}, {\"check\": \"empty chunks\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"partial final\", \"actual\": [[\"a\", \"b\"], [\"cell\"]], \"expected\": [[\"a\", \"b\"], [\"cell\"]], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [[\"\\n\\n\"]], \"expected\": [[\"\"], [\"\"]], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"no newline\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"split delimiter\", \"actual\": [[\"a\"], [\"b\"]], \"expected\": [[\"a\"], [\"b\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.488,"exit_code":1,"observations":[{"actual":[["a","cell"],["x","y\n"]],"check":"split cell","expected":[["a","cell"],["x","y"]],"passed":false},{"actual":[["a","b"],["cell","z\n"]],"check":"several per chunk","expected":[["a","b"],["cell","z"]],"passed":false},{"actual":[["cell"]],"check":"empty chunks","expected":[["cell"]],"passed":true},{"actual":[["a","b"],["cell"]],"check":"partial final","expected":[["a","b"],["cell"]],"passed":true},{"actual":[[""],["\n"]],"check":"empty rows","expected":[[""],[""]],"passed":false},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[["cell"]],"check":"no newline","expected":[["cell"]],"passed":true},{"actual":[["a"],["b"]],"check":"split delimiter","expected":[["a"],["b"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split cell\", \"actual\": [[\"a\", \"cell\"], [\"x\", \"y\\n\"]], \"expected\": [[\"a\", \"cell\"], [\"x\", \"y\"]], \"passed\": false}, {\"check\": \"several per chunk\", \"actual\": [[\"a\", \"b\"], [\"cell\", \"z\\n\"]], \"expected\": [[\"a\", \"b\"], [\"cell\", \"z\"]], \"passed\": false}, {\"check\": \"empty chunks\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"partial final\", \"actual\": [[\"a\", \"b\"], [\"cell\"]], \"expected\": [[\"a\", \"b\"], [\"cell\"]], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [[\"\"], [\"\\n\"]], \"expected\": [[\"\"], [\"\"]], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"no newline\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"split delimiter\", \"actual\": [[\"a\"], [\"b\"]], \"expected\": [[\"a\"], [\"b\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.551,"exit_code":0,"observations":[{"actual":[["a","cell"],["x","y"]],"check":"split cell","expected":[["a","cell"],["x","y"]],"passed":true},{"actual":[["a","b"],["cell","z"]],"check":"several per chunk","expected":[["a","b"],["cell","z"]],"passed":true},{"actual":[["cell"]],"check":"empty chunks","expected":[["cell"]],"passed":true},{"actual":[["a","b"],["cell"]],"check":"partial final","expected":[["a","b"],["cell"]],"passed":true},{"actual":[[""],[""]],"check":"empty rows","expected":[[""],[""]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[["cell"]],"check":"no newline","expected":[["cell"]],"passed":true},{"actual":[["a"],["b"]],"check":"split delimiter","expected":[["a"],["b"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"split cell\", \"actual\": [[\"a\", \"cell\"], [\"x\", \"y\"]], \"expected\": [[\"a\", \"cell\"], [\"x\", \"y\"]], \"passed\": true}, {\"check\": \"several per chunk\", \"actual\": [[\"a\", \"b\"], [\"cell\", \"z\"]], \"expected\": [[\"a\", \"b\"], [\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"empty chunks\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"partial final\", \"actual\": [[\"a\", \"b\"], [\"cell\"]], \"expected\": [[\"a\", \"b\"], [\"cell\"]], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [[\"\"], [\"\"]], \"expected\": [[\"\"], [\"\"]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"no newline\", \"actual\": [[\"cell\"]], \"expected\": [[\"cell\"]], \"passed\": true}, {\"check\": \"split delimiter\", \"actual\": [[\"a\"], [\"b\"]], \"expected\": [[\"a\"], [\"b\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}