{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":9,"contract":"Read a table with optional exact first line sep=<single nonquote, nonnewline character>. A first-line BOM is removed before recognizing this directive. Without directive use comma. The directive is not data. Later sep= lines are ordinary records. Return delimiter and split records; empty input has no records.","evaluation_group":"s3-delimited-text-preamble-separator","failed_approach":"Popping the final record removes data and reads the wrong delimiter.","family":"s3-delimited-text-preamble-separator-directive-consume","id":"FA-47846","implementations":{"attempt":{"sha256":"995a5be7a8401647d7ae555ded92e5264bb160dddd5f3b1343f45dfd0d606adc","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    lines = list(data)\n    if not lines: return [',', []]\n    if lines[0].startswith('\\ufeff'): lines[0] = lines[0][1:]\n    delimiter = ','\n    if lines[0].startswith('sep='):\n        value = lines.pop()[4:]\n        if len(value) != 1 or value in '\\r\\n\"': return None\n        delimiter = value\n    return [delimiter, [line.split(delimiter) for line in lines]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('custom', solve(_vary(['sep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('BOM directive', solve(_vary(['\\ufeffsep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('default', solve(_vary(['@,x'])), _vary([',', [['@', 'x']]]))\ncheck('later directive', solve(_vary(['a,b', 'sep=;'])), _vary([',', [['a', 'b'], ['sep=;']]]))\ncheck('bad multi', solve(_vary(['sep=;;', 'x'])), _vary(None))\ncheck('bad quote', solve(_vary(['sep=\"', 'x'])), _vary(None))\ncheck('empty marker', solve(_vary(['sep=', 'x'])), _vary(None))\ncheck('directive only', solve(_vary(['sep=;'])), _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":"77ba66647db1fd425e21fb4a81c143055e8c146ca5d326370e3cd3ea584fd006","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    lines = list(data)\n    if not lines: return [',', []]\n    if lines[0].startswith('\\ufeff'): lines[0] = lines[0][1:]\n    delimiter = ','\n    if lines[0].startswith('sep='):\n        value = lines[0][4:]\n        if len(value) != 1 or value in '\\r\\n\"': return None\n        delimiter = value\n    return [delimiter, [line.split(delimiter) for line in lines]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('custom', solve(_vary(['sep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('BOM directive', solve(_vary(['\\ufeffsep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('default', solve(_vary(['@,x'])), _vary([',', [['@', 'x']]]))\ncheck('later directive', solve(_vary(['a,b', 'sep=;'])), _vary([',', [['a', 'b'], ['sep=;']]]))\ncheck('bad multi', solve(_vary(['sep=;;', 'x'])), _vary(None))\ncheck('bad quote', solve(_vary(['sep=\"', 'x'])), _vary(None))\ncheck('empty marker', solve(_vary(['sep=', 'x'])), _vary(None))\ncheck('directive only', solve(_vary(['sep=;'])), _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":"8fabc2b5931577e048a269d4a147f73b0a0137a2340e20dc50bf9d50bec13875","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    lines = list(data)\n    if not lines: return [',', []]\n    if lines[0].startswith('\\ufeff'): lines[0] = lines[0][1:]\n    delimiter = ','\n    if lines[0].startswith('sep='):\n        value = lines.pop(0)[4:]\n        if len(value) != 1 or value in '\\r\\n\"': return None\n        delimiter = value\n    return [delimiter, [line.split(delimiter) for line in lines]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('custom', solve(_vary(['sep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('BOM directive', solve(_vary(['\\ufeffsep=;', '@;x'])), _vary([';', [['@', 'x']]]))\ncheck('default', solve(_vary(['@,x'])), _vary([',', [['@', 'x']]]))\ncheck('later directive', solve(_vary(['a,b', 'sep=;'])), _vary([',', [['a', 'b'], ['sep=;']]]))\ncheck('bad multi', solve(_vary(['sep=;;', 'x'])), _vary(None))\ncheck('bad quote', solve(_vary(['sep=\"', 'x'])), _vary(None))\ncheck('empty marker', solve(_vary(['sep=', 'x'])), _vary(None))\ncheck('directive only', solve(_vary(['sep=;'])), _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-preamble-separator-directive-consume","generated_at":"2026-09-29T14:44:45.374175+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: value = lines.pop(0)[4:]","root_cause":"Recognizing the separator does not remove the metadata record.","sha256":"3a990ba9bd28bde5b6640b2d6dd8b974e7391dc08429c2b3673dcc7ab8ced93a","title":"The separator preamble is emitted as a data row · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.038,"exit_code":1,"observations":[{"actual":null,"check":"custom","expected":[";",[["cell","x"]]],"passed":false},{"actual":null,"check":"BOM directive","expected":[";",[["cell","x"]]],"passed":false},{"actual":[",",[["cell","x"]]],"check":"default","expected":[",",[["cell","x"]]],"passed":true},{"actual":[",",[["a","b"],["sep=;"]]],"check":"later directive","expected":[",",[["a","b"],["sep=;"]]],"passed":true},{"actual":null,"check":"bad multi","expected":null,"passed":true},{"actual":null,"check":"bad quote","expected":null,"passed":true},{"actual":null,"check":"empty marker","expected":null,"passed":true},{"actual":[";",[]],"check":"directive only","expected":[";",[]],"passed":true},{"actual":[",",[]],"check":"zero","expected":[",",[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"custom\", \"actual\": null, \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": false}, {\"check\": \"BOM directive\", \"actual\": null, \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": false}, {\"check\": \"default\", \"actual\": [\",\", [[\"cell\", \"x\"]]], \"expected\": [\",\", [[\"cell\", \"x\"]]], \"passed\": true}, {\"check\": \"later directive\", \"actual\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"expected\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"passed\": true}, {\"check\": \"bad multi\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad quote\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty marker\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"directive only\", \"actual\": [\";\", []], \"expected\": [\";\", []], \"passed\": true}, {\"check\": \"zero\", \"actual\": [\",\", []], \"expected\": [\",\", []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.874,"exit_code":1,"observations":[{"actual":[";",[["sep=",""],["cell","x"]]],"check":"custom","expected":[";",[["cell","x"]]],"passed":false},{"actual":[";",[["sep=",""],["cell","x"]]],"check":"BOM directive","expected":[";",[["cell","x"]]],"passed":false},{"actual":[",",[["cell","x"]]],"check":"default","expected":[",",[["cell","x"]]],"passed":true},{"actual":[",",[["a","b"],["sep=;"]]],"check":"later directive","expected":[",",[["a","b"],["sep=;"]]],"passed":true},{"actual":null,"check":"bad multi","expected":null,"passed":true},{"actual":null,"check":"bad quote","expected":null,"passed":true},{"actual":null,"check":"empty marker","expected":null,"passed":true},{"actual":[";",[["sep=",""]]],"check":"directive only","expected":[";",[]],"passed":false},{"actual":[",",[]],"check":"zero","expected":[",",[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"custom\", \"actual\": [\";\", [[\"sep=\", \"\"], [\"cell\", \"x\"]]], \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": false}, {\"check\": \"BOM directive\", \"actual\": [\";\", [[\"sep=\", \"\"], [\"cell\", \"x\"]]], \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": false}, {\"check\": \"default\", \"actual\": [\",\", [[\"cell\", \"x\"]]], \"expected\": [\",\", [[\"cell\", \"x\"]]], \"passed\": true}, {\"check\": \"later directive\", \"actual\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"expected\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"passed\": true}, {\"check\": \"bad multi\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad quote\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty marker\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"directive only\", \"actual\": [\";\", [[\"sep=\", \"\"]]], \"expected\": [\";\", []], \"passed\": false}, {\"check\": \"zero\", \"actual\": [\",\", []], \"expected\": [\",\", []], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.41,"exit_code":0,"observations":[{"actual":[";",[["cell","x"]]],"check":"custom","expected":[";",[["cell","x"]]],"passed":true},{"actual":[";",[["cell","x"]]],"check":"BOM directive","expected":[";",[["cell","x"]]],"passed":true},{"actual":[",",[["cell","x"]]],"check":"default","expected":[",",[["cell","x"]]],"passed":true},{"actual":[",",[["a","b"],["sep=;"]]],"check":"later directive","expected":[",",[["a","b"],["sep=;"]]],"passed":true},{"actual":null,"check":"bad multi","expected":null,"passed":true},{"actual":null,"check":"bad quote","expected":null,"passed":true},{"actual":null,"check":"empty marker","expected":null,"passed":true},{"actual":[";",[]],"check":"directive only","expected":[";",[]],"passed":true},{"actual":[",",[]],"check":"zero","expected":[",",[]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"custom\", \"actual\": [\";\", [[\"cell\", \"x\"]]], \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": true}, {\"check\": \"BOM directive\", \"actual\": [\";\", [[\"cell\", \"x\"]]], \"expected\": [\";\", [[\"cell\", \"x\"]]], \"passed\": true}, {\"check\": \"default\", \"actual\": [\",\", [[\"cell\", \"x\"]]], \"expected\": [\",\", [[\"cell\", \"x\"]]], \"passed\": true}, {\"check\": \"later directive\", \"actual\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"expected\": [\",\", [[\"a\", \"b\"], [\"sep=;\"]]], \"passed\": true}, {\"check\": \"bad multi\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad quote\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty marker\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"directive only\", \"actual\": [\";\", []], \"expected\": [\";\", []], \"passed\": true}, {\"check\": \"zero\", \"actual\": [\",\", []], \"expected\": [\",\", []], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}