{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":9,"contract":"Decode a table with an integer preamble giving the number of following physical header rows. Each header row is comma cells; combine corresponding column labels with /, omitting empty components. At least one header row is required, widths must agree, final names must be nonempty and unique. Remaining rows are body and must match width. Return header and body.","evaluation_group":"s3-delimited-text-header-count-preamble","failed_approach":"The alternate implementation still violates the same declared invariant: the body begins at the last header row instead of after it.","family":"s3-delimited-text-header-count-preamble-body-start","id":"FA-48821","implementations":{"attempt":{"sha256":"055eeab2d0b83668cb8917cc6308f944cfaade87939f8d622ee3d7649cafeaaa","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 or not data[0].isascii() or not data[0].isdecimal(): return None\n    count=int(data[0])\n    if count<1 or len(data)<count+1: return None\n    levels=[line.split(',') for line in data[1:count+1]]\n    width=len(levels[0])\n    if any(len(level)!=width for level in levels): return None\n    header=['/'.join(level[i] for level in levels if level[i]) for i in range(width)]\n    if any(not name for name in header) or len(set(header))!=width: return None\n    rows=[line.split(',') for line in data[count+2:]]\n    if any(len(row)!=width for row in rows): return None\n    return {'header':header,'rows':rows}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('levels', solve(_vary(['2', 'group,group', 'a,b', '@,z'])), _vary({'header': ['group/a', 'group/b'], 'rows': [['@', 'z']]}))\ncheck('empty components', solve(_vary(['2', 'group,', 'a,b', '@,z'])), _vary({'header': ['group/a', 'b'], 'rows': [['@', 'z']]}))\ncheck('header only', solve(_vary(['1', '@'])), _vary({'header': ['@'], 'rows': []}))\ncheck('bad count', solve(_vary(['0', 'a'])), _vary(None))\ncheck('too few headers', solve(_vary(['2', 'a'])), _vary(None))\ncheck('width mismatch', solve(_vary(['2', 'a,b', 'c'])), _vary(None))\ncheck('duplicate', solve(_vary(['1', 'a,a'])), _vary(None))\ncheck('empty final name', solve(_vary(['2', ',a', ',b'])), _vary(None))\ncheck('body width', solve(_vary(['1', 'a,b', '@'])), _vary(None))\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":"b63c867c2e839774165ef9eb43632a61eff7aac4c12a98755069c9642b5960d7","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 or not data[0].isascii() or not data[0].isdecimal(): return None\n    count=int(data[0])\n    if count<1 or len(data)<count+1: return None\n    levels=[line.split(',') for line in data[1:count+1]]\n    width=len(levels[0])\n    if any(len(level)!=width for level in levels): return None\n    header=['/'.join(level[i] for level in levels if level[i]) for i in range(width)]\n    if any(not name for name in header) or len(set(header))!=width: return None\n    rows=[line.split(',') for line in data[count:]]\n    if any(len(row)!=width for row in rows): return None\n    return {'header':header,'rows':rows}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('levels', solve(_vary(['2', 'group,group', 'a,b', '@,z'])), _vary({'header': ['group/a', 'group/b'], 'rows': [['@', 'z']]}))\ncheck('empty components', solve(_vary(['2', 'group,', 'a,b', '@,z'])), _vary({'header': ['group/a', 'b'], 'rows': [['@', 'z']]}))\ncheck('header only', solve(_vary(['1', '@'])), _vary({'header': ['@'], 'rows': []}))\ncheck('bad count', solve(_vary(['0', 'a'])), _vary(None))\ncheck('too few headers', solve(_vary(['2', 'a'])), _vary(None))\ncheck('width mismatch', solve(_vary(['2', 'a,b', 'c'])), _vary(None))\ncheck('duplicate', solve(_vary(['1', 'a,a'])), _vary(None))\ncheck('empty final name', solve(_vary(['2', ',a', ',b'])), _vary(None))\ncheck('body width', solve(_vary(['1', 'a,b', '@'])), _vary(None))\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":"f721d3361c09056295254294e2c13be31b3d9cbb04627a75e3fc27a1ad41db41","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 or not data[0].isascii() or not data[0].isdecimal(): return None\n    count=int(data[0])\n    if count<1 or len(data)<count+1: return None\n    levels=[line.split(',') for line in data[1:count+1]]\n    width=len(levels[0])\n    if any(len(level)!=width for level in levels): return None\n    header=['/'.join(level[i] for level in levels if level[i]) for i in range(width)]\n    if any(not name for name in header) or len(set(header))!=width: return None\n    rows=[line.split(',') for line in data[count+1:]]\n    if any(len(row)!=width for row in rows): return None\n    return {'header':header,'rows':rows}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('levels', solve(_vary(['2', 'group,group', 'a,b', '@,z'])), _vary({'header': ['group/a', 'group/b'], 'rows': [['@', 'z']]}))\ncheck('empty components', solve(_vary(['2', 'group,', 'a,b', '@,z'])), _vary({'header': ['group/a', 'b'], 'rows': [['@', 'z']]}))\ncheck('header only', solve(_vary(['1', '@'])), _vary({'header': ['@'], 'rows': []}))\ncheck('bad count', solve(_vary(['0', 'a'])), _vary(None))\ncheck('too few headers', solve(_vary(['2', 'a'])), _vary(None))\ncheck('width mismatch', solve(_vary(['2', 'a,b', 'c'])), _vary(None))\ncheck('duplicate', solve(_vary(['1', 'a,a'])), _vary(None))\ncheck('empty final name', solve(_vary(['2', ',a', ',b'])), _vary(None))\ncheck('body width', solve(_vary(['1', 'a,b', '@'])), _vary(None))\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-header-count-preamble-body-start","generated_at":"2026-09-29T14:44:54.315791+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: data[count+1:]","root_cause":"The body begins at the last header row instead of after it.","sha256":"104e9320d343b6d58b1b225a3e23439a6cc16372619d8cd9888674ea7db6b7ec","title":"The body begins at the last header row instead of after it · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.016,"exit_code":1,"observations":[{"actual":{"header":["group/a","group/b"],"rows":[]},"check":"levels","expected":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["group/a","b"],"rows":[]},"check":"empty components","expected":{"header":["group/a","b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["cell"],"rows":[]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":true},{"actual":null,"check":"bad count","expected":null,"passed":true},{"actual":null,"check":"too few headers","expected":null,"passed":true},{"actual":null,"check":"width mismatch","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty final name","expected":null,"passed":true},{"actual":{"header":["a","b"],"rows":[]},"check":"body width","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"levels\", \"actual\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": []}, \"expected\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"empty components\", \"actual\": {\"header\": [\"group/a\", \"b\"], \"rows\": []}, \"expected\": {\"header\": [\"group/a\", \"b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": []}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": true}, {\"check\": \"bad count\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"too few headers\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width mismatch\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty final name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"body width\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": []}, \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.562,"exit_code":1,"observations":[{"actual":{"header":["group/a","group/b"],"rows":[["a","b"],["cell","z"]]},"check":"levels","expected":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["group/a","b"],"rows":[["a","b"],["cell","z"]]},"check":"empty components","expected":{"header":["group/a","b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["cell"],"rows":[["cell"]]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":false},{"actual":null,"check":"bad count","expected":null,"passed":true},{"actual":null,"check":"too few headers","expected":null,"passed":true},{"actual":null,"check":"width mismatch","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty final name","expected":null,"passed":true},{"actual":null,"check":"body width","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"levels\", \"actual\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"a\", \"b\"], [\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"empty components\", \"actual\": {\"header\": [\"group/a\", \"b\"], \"rows\": [[\"a\", \"b\"], [\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": [[\"cell\"]]}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": false}, {\"check\": \"bad count\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"too few headers\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width mismatch\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty final name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"body width\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.76,"exit_code":0,"observations":[{"actual":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"check":"levels","expected":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"passed":true},{"actual":{"header":["group/a","b"],"rows":[["cell","z"]]},"check":"empty components","expected":{"header":["group/a","b"],"rows":[["cell","z"]]},"passed":true},{"actual":{"header":["cell"],"rows":[]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":true},{"actual":null,"check":"bad count","expected":null,"passed":true},{"actual":null,"check":"too few headers","expected":null,"passed":true},{"actual":null,"check":"width mismatch","expected":null,"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"empty final name","expected":null,"passed":true},{"actual":null,"check":"body width","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"levels\", \"actual\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": true}, {\"check\": \"empty components\", \"actual\": {\"header\": [\"group/a\", \"b\"], \"rows\": [[\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": true}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": []}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": true}, {\"check\": \"bad count\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"too few headers\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"width mismatch\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty final name\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"body width\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}