{"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.","contract_signature":"data","evaluation_group":"s3-delimited-text-header-count-preamble","failed_approach":"The alternate implementation still violates the same declared invariant: header assembly combines each level row instead of each physical column.","family":"s3-delimited-text-header-count-preamble-column-level","id":"FA-48836","implementations":{"attempt":{"sha256":"ac95d0b6672c8ca73c8349c14cbd35ad23c9759cf04909649bbba1e94d70a552","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) for level in levels][: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"},"broken":{"sha256":"2af0ef44a410640bbb1c407a2a09c8efabb6804873e133ddf43e895873f67408","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) for level in levels]\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-column-level","generated_at":"2026-09-29T14:44:54.439835+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":"Header assembly combines each level row instead of each physical column.","sha256":"7d87a4de3775fbe155bbce345dc9019bb4f88b5f3fd52ca081e62275f6e18b51","title":"Header assembly combines each level row instead of each physical column · 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":40.635,"exit_code":1,"observations":[{"actual":{"header":["group/group","a/b"],"rows":[["cell","z"]]},"check":"levels","expected":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["group/","a/b"],"rows":[["cell","z"]]},"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":{"header":["/a","/b"],"rows":[]},"check":"empty final name","expected":null,"passed":false},{"actual":null,"check":"body width","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"levels\", \"actual\": {\"header\": [\"group/group\", \"a/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"empty components\", \"actual\": {\"header\": [\"group/\", \"a/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"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\": {\"header\": [\"/a\", \"/b\"], \"rows\": []}, \"expected\": null, \"passed\": false}, {\"check\": \"body width\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.373,"exit_code":1,"observations":[{"actual":{"header":["group/group","a/b"],"rows":[["cell","z"]]},"check":"levels","expected":{"header":["group/a","group/b"],"rows":[["cell","z"]]},"passed":false},{"actual":{"header":["group/","a/b"],"rows":[["cell","z"]]},"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":{"header":["/a","/b"],"rows":[]},"check":"empty final name","expected":null,"passed":false},{"actual":null,"check":"body width","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"levels\", \"actual\": {\"header\": [\"group/group\", \"a/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"expected\": {\"header\": [\"group/a\", \"group/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"passed\": false}, {\"check\": \"empty components\", \"actual\": {\"header\": [\"group/\", \"a/b\"], \"rows\": [[\"cell\", \"z\"]]}, \"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\": {\"header\": [\"/a\", \"/b\"], \"rows\": []}, \"expected\": null, \"passed\": false}, {\"check\": \"body width\", \"actual\": null, \"expected\": null, \"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."}}