{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":9,"contract":"Read a bounded sectioned TSV stream: @name starts a new table, the next record is its header, subsequent records its data. Names are unique and nonempty. A blank line closes a section; body records outside sections and sections without headers reject. Return ordered [name, header, rows] sections.","evaluation_group":"s3-delimited-text-sectioned-tables","failed_approach":"Prepending preserves rows but reverses their order.","family":"s3-delimited-text-sectioned-tables-body-append","id":"FA-47551","implementations":{"attempt":{"sha256":"1bd278af1212a25cb99f4d0926df2e6b2758b4a4b53b582c837c6330ccb135dd","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    sections, current, needs_header = [], None, False\n    for line in data:\n        if line.startswith('%'):\n            if current is not None and needs_header: return None\n            name = line[1:]\n            if not name or any(s[0] == name for s in sections): return None\n            current = [name, [], []]\n            sections.append(current)\n            needs_header = True\n        elif line == '':\n            if needs_header: return None\n            current = None\n        elif current is None: return None\n        elif needs_header:\n            current[1] = line.split('\\t')\n            needs_header = False\n        else: current[2].insert(0, line.split('\\t'))\n    if needs_header: return None\n    return sections\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two sections', solve(_vary(['%one', 'a\\tb', '@\\tz', '%two', 'x', 'q'])), _vary([['one', ['a', 'b'], [['@', 'z']]], ['two', ['x'], [['q']]]]))\ncheck('section close', solve(_vary(['%one', 'a', 'x', '', 'orphan'])), _vary(None))\ncheck('empty section', solve(_vary(['%one', '%two', 'a'])), _vary(None))\ncheck('missing eof header', solve(_vary(['%one'])), _vary(None))\ncheck('duplicate', solve(_vary(['%one', 'a', '%one', 'b'])), _vary(None))\ncheck('empty name', solve(_vary(['%', 'a'])), _vary(None))\ncheck('normal', solve(_vary(['%one', 'a', '%'])), _vary(None))\ncheck('zero', solve(_vary([])), _vary([]))\ncheck('body control', solve(_vary(['%one', 'a', 'cell', 'two'])), _vary([['one', ['a'], [['cell'], ['two']]]]))\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":"eab592e2ac1bbc1632a2dae1193c9c815dd9a31a35579dbba9a8880bbfa87741","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    sections, current, needs_header = [], None, False\n    for line in data:\n        if line.startswith('%'):\n            if current is not None and needs_header: return None\n            name = line[1:]\n            if not name or any(s[0] == name for s in sections): return None\n            current = [name, [], []]\n            sections.append(current)\n            needs_header = True\n        elif line == '':\n            if needs_header: return None\n            current = None\n        elif current is None: return None\n        elif needs_header:\n            current[1] = line.split('\\t')\n            needs_header = False\n        else: current[2] = [line.split('\\t')]\n    if needs_header: return None\n    return sections\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two sections', solve(_vary(['%one', 'a\\tb', '@\\tz', '%two', 'x', 'q'])), _vary([['one', ['a', 'b'], [['@', 'z']]], ['two', ['x'], [['q']]]]))\ncheck('section close', solve(_vary(['%one', 'a', 'x', '', 'orphan'])), _vary(None))\ncheck('empty section', solve(_vary(['%one', '%two', 'a'])), _vary(None))\ncheck('missing eof header', solve(_vary(['%one'])), _vary(None))\ncheck('duplicate', solve(_vary(['%one', 'a', '%one', 'b'])), _vary(None))\ncheck('empty name', solve(_vary(['%', 'a'])), _vary(None))\ncheck('normal', solve(_vary(['%one', 'a', '%'])), _vary(None))\ncheck('zero', solve(_vary([])), _vary([]))\ncheck('body control', solve(_vary(['%one', 'a', 'cell', 'two'])), _vary([['one', ['a'], [['cell'], ['two']]]]))\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":"91c98c2c92c3b05585df3aef0b29296ddd37f20cba70ec5ea288fad98b73b730","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    sections, current, needs_header = [], None, False\n    for line in data:\n        if line.startswith('%'):\n            if current is not None and needs_header: return None\n            name = line[1:]\n            if not name or any(s[0] == name for s in sections): return None\n            current = [name, [], []]\n            sections.append(current)\n            needs_header = True\n        elif line == '':\n            if needs_header: return None\n            current = None\n        elif current is None: return None\n        elif needs_header:\n            current[1] = line.split('\\t')\n            needs_header = False\n        else: current[2].append(line.split('\\t'))\n    if needs_header: return None\n    return sections\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two sections', solve(_vary(['%one', 'a\\tb', '@\\tz', '%two', 'x', 'q'])), _vary([['one', ['a', 'b'], [['@', 'z']]], ['two', ['x'], [['q']]]]))\ncheck('section close', solve(_vary(['%one', 'a', 'x', '', 'orphan'])), _vary(None))\ncheck('empty section', solve(_vary(['%one', '%two', 'a'])), _vary(None))\ncheck('missing eof header', solve(_vary(['%one'])), _vary(None))\ncheck('duplicate', solve(_vary(['%one', 'a', '%one', 'b'])), _vary(None))\ncheck('empty name', solve(_vary(['%', 'a'])), _vary(None))\ncheck('normal', solve(_vary(['%one', 'a', '%'])), _vary(None))\ncheck('zero', solve(_vary([])), _vary([]))\ncheck('body control', solve(_vary(['%one', 'a', 'cell', 'two'])), _vary([['one', ['a'], [['cell'], ['two']]]]))\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-sectioned-tables-body-append","generated_at":"2026-09-29T14:44:42.545372+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: else: current[2].append(line.split('\\t'))","root_cause":"Assignment replaces previously parsed rows in a table section.","sha256":"7386b7d022bd8f653a85a48196f9ca9ad5cd2c161294e40909ee92d3510bb740","title":"A section retains only its most recent data row · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":46.295,"exit_code":1,"observations":[{"actual":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"check":"two sections","expected":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"passed":true},{"actual":null,"check":"section close","expected":null,"passed":true},{"actual":null,"check":"empty section","expected":null,"passed":true},{"actual":null,"check":"missing eof header","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty name","expected":null,"passed":true},{"actual":null,"check":"normal","expected":null,"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true},{"actual":[["one",["a"],[["two"],["cell"]]]],"check":"body control","expected":[["one",["a"],[["cell"],["two"]]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two sections\", \"actual\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"expected\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"passed\": true}, {\"check\": \"section close\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty section\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing eof header\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"body control\", \"actual\": [[\"one\", [\"a\"], [[\"two\"], [\"cell\"]]]], \"expected\": [[\"one\", [\"a\"], [[\"cell\"], [\"two\"]]]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.881,"exit_code":1,"observations":[{"actual":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"check":"two sections","expected":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"passed":true},{"actual":null,"check":"section close","expected":null,"passed":true},{"actual":null,"check":"empty section","expected":null,"passed":true},{"actual":null,"check":"missing eof header","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty name","expected":null,"passed":true},{"actual":null,"check":"normal","expected":null,"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true},{"actual":[["one",["a"],[["two"]]]],"check":"body control","expected":[["one",["a"],[["cell"],["two"]]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two sections\", \"actual\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"expected\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"passed\": true}, {\"check\": \"section close\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty section\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing eof header\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"body control\", \"actual\": [[\"one\", [\"a\"], [[\"two\"]]]], \"expected\": [[\"one\", [\"a\"], [[\"cell\"], [\"two\"]]]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":46.897,"exit_code":0,"observations":[{"actual":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"check":"two sections","expected":[["one",["a","b"],[["cell","z"]]],["two",["x"],[["q"]]]],"passed":true},{"actual":null,"check":"section close","expected":null,"passed":true},{"actual":null,"check":"empty section","expected":null,"passed":true},{"actual":null,"check":"missing eof header","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty name","expected":null,"passed":true},{"actual":null,"check":"normal","expected":null,"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true},{"actual":[["one",["a"],[["cell"],["two"]]]],"check":"body control","expected":[["one",["a"],[["cell"],["two"]]]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two sections\", \"actual\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"expected\": [[\"one\", [\"a\", \"b\"], [[\"cell\", \"z\"]]], [\"two\", [\"x\"], [[\"q\"]]]], \"passed\": true}, {\"check\": \"section close\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty section\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing eof header\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"body control\", \"actual\": [[\"one\", [\"a\"], [[\"cell\"], [\"two\"]]]], \"expected\": [[\"one\", [\"a\"], [[\"cell\"], [\"two\"]]]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}