{"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: a union appends physical input rows without remapping names.","family":"s3-delimited-text-table-union-row-remap","id":"FA-48596","implementations":{"attempt":{"sha256":"a6c592f9d9163a7252edb447ba5b1275fdde257b48d8c616e7bf671c5256a1e9","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([None]*(len(header)-len(row))+row)\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":"387dda0ef37799275101a5b215e1725a2fb53c964a9da02dd04a0fdd950d96f6","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(row+[None]*(len(header)-len(row)))\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-row-remap","generated_at":"2026-09-29T14:44:52.152761+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: out.append([mapping.get(name) for name in header])","root_cause":"A union appends physical input rows without remapping names.","sha256":"b88ddb0a289e9d1899c4d2e1ff92246846cbc35aee2d06951a0c6319f580a0f3","title":"A union appends physical input rows without remapping names · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.476,"exit_code":1,"observations":[{"actual":{"header":["b","a","c"],"rows":[[null,"cell","x"],[null,"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"],["z","y"]]},"check":"reordered","expected":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"passed":false},{"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":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\": [[null, \"cell\", \"x\"], [null, \"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\"], [\"z\", \"y\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"passed\": false}, {\"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\": 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":41.41,"exit_code":1,"observations":[{"actual":{"header":["b","a","c"],"rows":[["cell","x",null],["y","z",null]]},"check":"union","expected":{"header":["b","a","c"],"rows":[["cell","x",null],[null,"y","z"]]},"passed":false},{"actual":{"header":["a","b"],"rows":[["cell","x"],["z","y"]]},"check":"reordered","expected":{"header":["a","b"],"rows":[["cell","x"],["y","z"]]},"passed":false},{"actual":null,"check":"duplicate","expected":null,"passed":true},{"actual":null,"check":"ragged","expected":null,"passed":true},{"actual":{"header":["a","b"],"rows":[["",null],["cell",null]]},"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\", null], [\"y\", \"z\", null]]}, \"expected\": {\"header\": [\"b\", \"a\", \"c\"], \"rows\": [[\"cell\", \"x\", null], [null, \"y\", \"z\"]]}, \"passed\": false}, {\"check\": \"reordered\", \"actual\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"z\", \"y\"]]}, \"expected\": {\"header\": [\"a\", \"b\"], \"rows\": [[\"cell\", \"x\"], [\"y\", \"z\"]]}, \"passed\": false}, {\"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], [\"cell\", null]]}, \"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":43.08,"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"}