{"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":"Checking only after several sections misses the first abandoned header.","family":"s3-delimited-text-sectioned-tables-missing-intermediate-header","id":"FA-47536","implementations":{"attempt":{"sha256":"8003b908f9c10b20caaf38c60610d133fc21f3160c48fa1a0e390171a6ccafb3","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 and len(sections) > 1: 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"},"broken":{"sha256":"17e01a27d8b1a6f04b9657ce498ace7b443ebbd3d43f56a9a7d632204cb1974a","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 False: 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"},"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-missing-intermediate-header","generated_at":"2026-09-29T14:44:42.464264+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: if current is not None and needs_header: return None","root_cause":"Opening a section does not resolve the prior pending header requirement.","sha256":"8e22ce5ca8fab32ec5cf782a2db314e0daa1a177dd83e041f9349d5f026ae048","title":"A new table directive abandons an unbound section · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.411,"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":[["one",[],[]],["two",["a"],[]]],"check":"empty section","expected":null,"passed":false},{"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":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\": [[\"one\", [], []], [\"two\", [\"a\"], []]], \"expected\": null, \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":55.595,"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":[["one",[],[]],["two",["a"],[]]],"check":"empty section","expected":null,"passed":false},{"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":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\": [[\"one\", [], []], [\"two\", [\"a\"], []]], \"expected\": null, \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":44.386,"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"}