{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":7,"contract":"Combine a list of tables, each {header:[names], rows:[[cells]]}. Output header is the first-seen union of names, preserving first-seen order. Duplicate names within one input header and row-width mismatches reject. Missing columns in a table become null; explicit empty values remain empty. Return {header,rows}.","evaluation_group":"s3-delimited-text-table-union","failed_approach":"The alternate implementation still violates the same declared invariant: missing union columns are filled with empty strings.","family":"s3-delimited-text-table-union-missing-union","id":"FA-48601","implementations":{"attempt":{"sha256":"8e6c396291addaa93d386313313dde0ada2654e4ab65a1ec9f86ff862fde6adf","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    header=[]\n    for table in data:\n        if len(set(table['header']))!=len(table['header']): return None\n        for name in table['header']:\n            if name not in header: header.append(name)\n    out=[]\n    for table in data:\n        for row in table['rows']:\n            if len(row)!=len(table['header']): return None\n            mapping=dict(zip(table['header'],row))\n            out.append([mapping.get(name,0) for name in header])\n    return {'header':header,'rows':out}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('union', solve(_vary([{'header': ['b', 'a'], 'rows': [['@', 'x']]}, {'header': ['a', 'c'], 'rows': [['y', 'z']]}])), _vary({'header': ['b', 'a', 'c'], 'rows': [['@', 'x', None], [None, 'y', 'z']]}))\ncheck('reordered', solve(_vary([{'header': ['a', 'b'], 'rows': [['@', 'x']]}, {'header': ['b', 'a'], 'rows': [['z', 'y']]}])), _vary({'header': ['a', 'b'], 'rows': [['@', 'x'], ['y', 'z']]}))\ncheck('duplicate', solve(_vary([{'header': ['a', 'a'], 'rows': []}])), _vary(None))\ncheck('ragged', solve(_vary([{'header': ['a', 'b'], 'rows': [['@']]}])), _vary(None))\ncheck('explicit empty', solve(_vary([{'header': ['a'], 'rows': [['']]}, {'header': ['b'], 'rows': [['@']]}])), _vary({'header': ['a', 'b'], 'rows': [['', None], [None, '@']]}))\ncheck('empty', solve(_vary([])), _vary({'header': [], 'rows': []}))\ncheck('header only', solve(_vary([{'header': ['@'], 'rows': []}])), _vary({'header': ['@'], 'rows': []}))\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":"b6ae099599133da80ba8db8d7e1179e5d8084b50d97ea4a587ecda751bd52b71","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    header=[]\n    for table in data:\n        if len(set(table['header']))!=len(table['header']): return None\n        for name in table['header']:\n            if name not in header: header.append(name)\n    out=[]\n    for table in data:\n        for row in table['rows']:\n            if len(row)!=len(table['header']): return None\n            mapping=dict(zip(table['header'],row))\n            out.append([mapping.get(name,'') for name in header])\n    return {'header':header,'rows':out}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('union', solve(_vary([{'header': ['b', 'a'], 'rows': [['@', 'x']]}, {'header': ['a', 'c'], 'rows': [['y', 'z']]}])), _vary({'header': ['b', 'a', 'c'], 'rows': [['@', 'x', None], [None, 'y', 'z']]}))\ncheck('reordered', solve(_vary([{'header': ['a', 'b'], 'rows': [['@', 'x']]}, {'header': ['b', 'a'], 'rows': [['z', 'y']]}])), _vary({'header': ['a', 'b'], 'rows': [['@', 'x'], ['y', 'z']]}))\ncheck('duplicate', solve(_vary([{'header': ['a', 'a'], 'rows': []}])), _vary(None))\ncheck('ragged', solve(_vary([{'header': ['a', 'b'], 'rows': [['@']]}])), _vary(None))\ncheck('explicit empty', solve(_vary([{'header': ['a'], 'rows': [['']]}, {'header': ['b'], 'rows': [['@']]}])), _vary({'header': ['a', 'b'], 'rows': [['', None], [None, '@']]}))\ncheck('empty', solve(_vary([])), _vary({'header': [], 'rows': []}))\ncheck('header only', solve(_vary([{'header': ['@'], 'rows': []}])), _vary({'header': ['@'], 'rows': []}))\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":"e4872d3961c87210a1ee583e451be27d5b2d67f57f854db1139e988716afa70f","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    header=[]\n    for table in data:\n        if len(set(table['header']))!=len(table['header']): return None\n        for name in table['header']:\n            if name not in header: header.append(name)\n    out=[]\n    for table in data:\n        for row in table['rows']:\n            if len(row)!=len(table['header']): return None\n            mapping=dict(zip(table['header'],row))\n            out.append([mapping.get(name) for name in header])\n    return {'header':header,'rows':out}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('union', solve(_vary([{'header': ['b', 'a'], 'rows': [['@', 'x']]}, {'header': ['a', 'c'], 'rows': [['y', 'z']]}])), _vary({'header': ['b', 'a', 'c'], 'rows': [['@', 'x', None], [None, 'y', 'z']]}))\ncheck('reordered', solve(_vary([{'header': ['a', 'b'], 'rows': [['@', 'x']]}, {'header': ['b', 'a'], 'rows': [['z', 'y']]}])), _vary({'header': ['a', 'b'], 'rows': [['@', 'x'], ['y', 'z']]}))\ncheck('duplicate', solve(_vary([{'header': ['a', 'a'], 'rows': []}])), _vary(None))\ncheck('ragged', solve(_vary([{'header': ['a', 'b'], 'rows': [['@']]}])), _vary(None))\ncheck('explicit empty', solve(_vary([{'header': ['a'], 'rows': [['']]}, {'header': ['b'], 'rows': [['@']]}])), _vary({'header': ['a', 'b'], 'rows': [['', None], [None, '@']]}))\ncheck('empty', solve(_vary([])), _vary({'header': [], 'rows': []}))\ncheck('header only', solve(_vary([{'header': ['@'], 'rows': []}])), _vary({'header': ['@'], 'rows': []}))\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-table-union-missing-union","generated_at":"2026-09-29T14:44:52.151131+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: mapping.get(name)","root_cause":"Missing union columns are filled with empty strings.","sha256":"fc2d7a9848d1a69ecf9e4af7e60f280519871915a05bbade691c139f89aa23f5","title":"Missing union columns are filled with empty strings · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.127,"exit_code":1,"observations":[{"actual":{"header":["b","a","c"],"rows":[["cell","x",0],[0,"y","z"]]},"check":"union","expected":{"header":["b","a","c"],"rows":[["cell","x",null],[null,"y","z"]]},"passed":false},{"actual":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"check":"reordered","expected":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"ragged","expected":null,"passed":true},{"actual":{"header":["a","b"],"rows":[["",0],[0,"cell"]]},"check":"explicit empty","expected":{"header":["a","b"],"rows":[["",null],[null,"cell"]]},"passed":false},{"actual":{"header":[],"rows":[]},"check":"empty","expected":{"header":[],"rows":[]},"passed":true},{"actual":{"header":["cell"],"rows":[]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"union\", \"actual\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", 0], [0, \"y\", \"z\"]]}, \"expected\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", null], [null, \"y\", \"z\"]]}, \"passed\": false}, {\"check\": \"reordered\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ragged\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit empty\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", 0], [0, \"cell\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", null], [null, \"cell\"]]}, \"passed\": false}, {\"check\": \"empty\", \"actual\": {\"header\": [], \"rows\": []}, \"expected\": {\"header\": [], \"rows\": []}, \"passed\": true}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": []}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.629,"exit_code":1,"observations":[{"actual":{"header":["b","a","c"],"rows":[["cell","x",""],["","y","z"]]},"check":"union","expected":{"header":["b","a","c"],"rows":[["cell","x",null],[null,"y","z"]]},"passed":false},{"actual":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"check":"reordered","expected":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"ragged","expected":null,"passed":true},{"actual":{"header":["a","b"],"rows":[["",""],["","cell"]]},"check":"explicit empty","expected":{"header":["a","b"],"rows":[["",null],[null,"cell"]]},"passed":false},{"actual":{"header":[],"rows":[]},"check":"empty","expected":{"header":[],"rows":[]},"passed":true},{"actual":{"header":["cell"],"rows":[]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"union\", \"actual\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", \"\"], [\"\", \"y\", \"z\"]]}, \"expected\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", null], [null, \"y\", \"z\"]]}, \"passed\": false}, {\"check\": \"reordered\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ragged\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit empty\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", \"\"], [\"\", \"cell\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", null], [null, \"cell\"]]}, \"passed\": false}, {\"check\": \"empty\", \"actual\": {\"header\": [], \"rows\": []}, \"expected\": {\"header\": [], \"rows\": []}, \"passed\": true}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": []}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.87,"exit_code":0,"observations":[{"actual":{"header":["b","a","c"],"rows":[["cell","x",null],[null,"y","z"]]},"check":"union","expected":{"header":["b","a","c"],"rows":[["cell","x",null],[null,"y","z"]]},"passed":true},{"actual":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"check":"reordered","expected":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"passed":true},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"ragged","expected":null,"passed":true},{"actual":{"header":["a","b"],"rows":[["",null],[null,"cell"]]},"check":"explicit empty","expected":{"header":["a","b"],"rows":[["",null],[null,"cell"]]},"passed":true},{"actual":{"header":[],"rows":[]},"check":"empty","expected":{"header":[],"rows":[]},"passed":true},{"actual":{"header":["cell"],"rows":[]},"check":"header only","expected":{"header":["cell"],"rows":[]},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"union\", \"actual\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", null], [null, \"y\", \"z\"]]}, \"expected\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", null], [null, \"y\", \"z\"]]}, \"passed\": true}, {\"check\": \"reordered\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"passed\": true}, {\"check\": \"duplicate\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"ragged\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit empty\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", null], [null, \"cell\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"\", null], [null, \"cell\"]]}, \"passed\": true}, {\"check\": \"empty\", \"actual\": {\"header\": [], \"rows\": []}, \"expected\": {\"header\": [], \"rows\": []}, \"passed\": true}, {\"check\": \"header only\", \"actual\": {\"header\": [\"cell\"], \"rows\": []}, \"expected\": {\"header\": [\"cell\"], \"rows\": []}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}