{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":7,"contract":"Append comma rows to existing serialized text. Existing text is either empty or ends in a complete physical record, optionally lacking its final LF. On an empty file emit the supplied header once, followed by new rows. For a nonempty unterminated tail insert exactly one LF before new rows. With no new rows return existing text unchanged.","contract_signature":"data","evaluation_group":"s3-delimited-text-append-table-writer","failed_approach":"The alternate implementation still violates the same declared invariant: appending to a terminated table inserts a blank physical row.","family":"s3-delimited-text-append-table-writer-blank-insertion","id":"FA-48226","implementations":{"attempt":{"sha256":"5c056d4f5291bc0c2a578745a30bc5bccdc4145b704edd70464cb687a9720407","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    if not data['rows']: return data['existing']\n    text=data['existing']\n    if not text: text=','.join(data['header']) + '\\n'\n    elif not text.endswith('\\n\\n'): text+='\\n'\n    for row in data['rows']:\n        text+=','.join(row)+'\\n'\n    return text\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\n@,x\\n'))\ncheck('terminated', solve(_vary({'existing': 'a,b\\nq,z\\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\nq,z\\n@,x\\n'))\ncheck('unterminated', solve(_vary({'existing': 'a,b\\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\nq,z\\n@,x\\n'))\ncheck('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))\ncheck('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))\ncheck('two appended', solve(_vary({'existing': 'a\\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\\n@\\nz\\n'))\ncheck('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\\n,\\n'))\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":"77e8d9f11bcc0c25004827220f32f89b47dead8a4c6dd207ca2af2cc31bd6232","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    if not data['rows']: return data['existing']\n    text=data['existing']\n    if not text: text=','.join(data['header']) + '\\n'\n    elif text: text+='\\n'\n    for row in data['rows']:\n        text+=','.join(row)+'\\n'\n    return text\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('new', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\n@,x\\n'))\ncheck('terminated', solve(_vary({'existing': 'a,b\\nq,z\\n', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\nq,z\\n@,x\\n'))\ncheck('unterminated', solve(_vary({'existing': 'a,b\\nq,z', 'header': ['a', 'b'], 'rows': [['@', 'x']]})), _vary('a,b\\nq,z\\n@,x\\n'))\ncheck('no new', solve(_vary({'existing': 'a,b', 'header': ['a', 'b'], 'rows': []})), _vary('a,b'))\ncheck('empty untouched', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': []})), _vary(''))\ncheck('two appended', solve(_vary({'existing': 'a\\n', 'header': ['a'], 'rows': [['@'], ['z']]})), _vary('a\\n@\\nz\\n'))\ncheck('empty cells', solve(_vary({'existing': '', 'header': ['a', 'b'], 'rows': [['', '']]})), _vary('a,b\\n,\\n'))\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-append-table-writer-blank-insertion","generated_at":"2026-09-29T14:44:48.937112+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.","root_cause":"Appending to a terminated table inserts a blank physical row.","sha256":"0a48847607a62c2b67b016f6bd3e57210f2109cc0577d44de176bfa1457fd643","title":"Appending to a terminated table inserts a blank physical row · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.2,"exit_code":1,"observations":[{"actual":"a,b\ncell,x\n","check":"new","expected":"a,b\ncell,x\n","passed":true},{"actual":"a,b\nq,z\n\ncell,x\n","check":"terminated","expected":"a,b\nq,z\ncell,x\n","passed":false},{"actual":"a,b\nq,z\ncell,x\n","check":"unterminated","expected":"a,b\nq,z\ncell,x\n","passed":true},{"actual":"a,b","check":"no new","expected":"a,b","passed":true},{"actual":"","check":"empty untouched","expected":"","passed":true},{"actual":"a\n\ncell\nz\n","check":"two appended","expected":"a\ncell\nz\n","passed":false},{"actual":"a,b\n,\n","check":"empty cells","expected":"a,b\n,\n","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"new\", \"actual\": \"a,b\\ncell,x\\n\", \"expected\": \"a,b\\ncell,x\\n\", \"passed\": true}, {\"check\": \"terminated\", \"actual\": \"a,b\\nq,z\\n\\ncell,x\\n\", \"expected\": \"a,b\\nq,z\\ncell,x\\n\", \"passed\": false}, {\"check\": \"unterminated\", \"actual\": \"a,b\\nq,z\\ncell,x\\n\", \"expected\": \"a,b\\nq,z\\ncell,x\\n\", \"passed\": true}, {\"check\": \"no new\", \"actual\": \"a,b\", \"expected\": \"a,b\", \"passed\": true}, {\"check\": \"empty untouched\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"two appended\", \"actual\": \"a\\n\\ncell\\nz\\n\", \"expected\": \"a\\ncell\\nz\\n\", \"passed\": false}, {\"check\": \"empty cells\", \"actual\": \"a,b\\n,\\n\", \"expected\": \"a,b\\n,\\n\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.795,"exit_code":1,"observations":[{"actual":"a,b\ncell,x\n","check":"new","expected":"a,b\ncell,x\n","passed":true},{"actual":"a,b\nq,z\n\ncell,x\n","check":"terminated","expected":"a,b\nq,z\ncell,x\n","passed":false},{"actual":"a,b\nq,z\ncell,x\n","check":"unterminated","expected":"a,b\nq,z\ncell,x\n","passed":true},{"actual":"a,b","check":"no new","expected":"a,b","passed":true},{"actual":"","check":"empty untouched","expected":"","passed":true},{"actual":"a\n\ncell\nz\n","check":"two appended","expected":"a\ncell\nz\n","passed":false},{"actual":"a,b\n,\n","check":"empty cells","expected":"a,b\n,\n","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"new\", \"actual\": \"a,b\\ncell,x\\n\", \"expected\": \"a,b\\ncell,x\\n\", \"passed\": true}, {\"check\": \"terminated\", \"actual\": \"a,b\\nq,z\\n\\ncell,x\\n\", \"expected\": \"a,b\\nq,z\\ncell,x\\n\", \"passed\": false}, {\"check\": \"unterminated\", \"actual\": \"a,b\\nq,z\\ncell,x\\n\", \"expected\": \"a,b\\nq,z\\ncell,x\\n\", \"passed\": true}, {\"check\": \"no new\", \"actual\": \"a,b\", \"expected\": \"a,b\", \"passed\": true}, {\"check\": \"empty untouched\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"two appended\", \"actual\": \"a\\n\\ncell\\nz\\n\", \"expected\": \"a\\ncell\\nz\\n\", \"passed\": false}, {\"check\": \"empty cells\", \"actual\": \"a,b\\n,\\n\", \"expected\": \"a,b\\n,\\n\", \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}