{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":11,"contract":"Read a comma table with header H,<column names>, body D,<values>, and final F,<body count>. Reject missing or misplaced footer, count mismatch, malformed tags, unequal body width, and missing header. Count only body records. Return body arrays.","contract_signature":"data","evaluation_group":"s3-delimited-text-record-footer","failed_approach":"Checking only undercounts accepts a footer claiming absent rows.","family":"s3-delimited-text-record-footer-footer-count","id":"FA-47871","implementations":{"attempt":{"sha256":"1a6f2ab1d5b17047491b0dcc9be5fafc4b16eff886987325974b590696ab967d","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].startswith('H,'): return None\n    width = len(data[0].split(',')) - 1\n    rows, closed = [], False\n    for line in data[1:]:\n        if closed: return None\n        cells = line.split(',')\n        if cells[0] == 'D':\n            if len(cells) - 1 != width: return None\n            rows.append(cells[1:])\n        elif cells[0] == 'F':\n            if len(cells) != 2 or not cells[1].isascii() or not cells[1].isdecimal(): return None\n            if int(cells[1]) < len(rows): return None\n            closed = True\n        else: return None\n    if not closed: return None\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('table', solve(_vary(['H,a,b', 'D,@,x', 'D,y,z', 'F,2'])), _vary([['@', 'x'], ['y', 'z']]))\ncheck('count mismatch', solve(_vary(['H,a', 'D,@', 'F,2'])), _vary(None))\ncheck('after footer', solve(_vary(['H,a', 'F,0', 'D,@'])), _vary(None))\ncheck('missing footer', solve(_vary(['H,a', 'D,@'])), _vary(None))\ncheck('empty body', solve(_vary(['H,a', 'F,0'])), _vary([]))\ncheck('bad tag', solve(_vary(['H,a', 'X,@', 'F,1'])), _vary(None))\ncheck('bad width', solve(_vary(['H,a,b', 'D,@', 'F,1'])), _vary(None))\ncheck('missing header', solve(_vary(['D,@', 'F,1'])), _vary(None))\ncheck('second footer', solve(_vary(['H,a', 'F,0', 'F,0'])), _vary(None))\ncheck('bad count', solve(_vary(['H,a', 'F,-1'])), _vary(None))\ncheck('unknown not counted', solve(_vary(['H,a', 'X,@', 'F,0'])), _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":"dcce55ff67e4a66e4aea91e523a3bb6dff412dd42f258764f06b1a7962d90498","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].startswith('H,'): return None\n    width = len(data[0].split(',')) - 1\n    rows, closed = [], False\n    for line in data[1:]:\n        if closed: return None\n        cells = line.split(',')\n        if cells[0] == 'D':\n            if len(cells) - 1 != width: return None\n            rows.append(cells[1:])\n        elif cells[0] == 'F':\n            if len(cells) != 2 or not cells[1].isascii() or not cells[1].isdecimal(): return None\n            if int(cells[1]) != len(rows) + 1: return None\n            closed = True\n        else: return None\n    if not closed: return None\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('table', solve(_vary(['H,a,b', 'D,@,x', 'D,y,z', 'F,2'])), _vary([['@', 'x'], ['y', 'z']]))\ncheck('count mismatch', solve(_vary(['H,a', 'D,@', 'F,2'])), _vary(None))\ncheck('after footer', solve(_vary(['H,a', 'F,0', 'D,@'])), _vary(None))\ncheck('missing footer', solve(_vary(['H,a', 'D,@'])), _vary(None))\ncheck('empty body', solve(_vary(['H,a', 'F,0'])), _vary([]))\ncheck('bad tag', solve(_vary(['H,a', 'X,@', 'F,1'])), _vary(None))\ncheck('bad width', solve(_vary(['H,a,b', 'D,@', 'F,1'])), _vary(None))\ncheck('missing header', solve(_vary(['D,@', 'F,1'])), _vary(None))\ncheck('second footer', solve(_vary(['H,a', 'F,0', 'F,0'])), _vary(None))\ncheck('bad count', solve(_vary(['H,a', 'F,-1'])), _vary(None))\ncheck('unknown not counted', solve(_vary(['H,a', 'X,@', 'F,0'])), _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-record-footer-footer-count","generated_at":"2026-09-29T14:44:45.722580+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":"The declared count is compared with a header-inclusive tally.","sha256":"cb87faee42abf6d557dc10102eead2c485d6b3b32872fc4a097f612cb2b19d06","title":"Footer verification counts the header as a body record · 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":43.726,"exit_code":1,"observations":[{"actual":[["cell","x"],["y","z"]],"check":"table","expected":[["cell","x"],["y","z"]],"passed":true},{"actual":[["cell"]],"check":"count mismatch","expected":null,"passed":false},{"actual":null,"check":"after footer","expected":null,"passed":true},{"actual":null,"check":"missing footer","expected":null,"passed":true},{"actual":[],"check":"empty body","expected":[],"passed":true},{"actual":null,"check":"bad tag","expected":null,"passed":true},{"actual":null,"check":"bad width","expected":null,"passed":true},{"actual":null,"check":"missing header","expected":null,"passed":true},{"actual":null,"check":"second footer","expected":null,"passed":true},{"actual":null,"check":"bad count","expected":null,"passed":true},{"actual":null,"check":"unknown not counted","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"table\", \"actual\": [[\"cell\", \"x\"], [\"y\", \"z\"]], \"expected\": [[\"cell\", \"x\"], [\"y\", \"z\"]], \"passed\": true}, {\"check\": \"count mismatch\", \"actual\": [[\"cell\"]], \"expected\": null, \"passed\": false}, {\"check\": \"after footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty body\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"bad tag\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing header\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"second footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad count\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"unknown not counted\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.917,"exit_code":1,"observations":[{"actual":null,"check":"table","expected":[["cell","x"],["y","z"]],"passed":false},{"actual":[["cell"]],"check":"count mismatch","expected":null,"passed":false},{"actual":null,"check":"after footer","expected":null,"passed":true},{"actual":null,"check":"missing footer","expected":null,"passed":true},{"actual":null,"check":"empty body","expected":[],"passed":false},{"actual":null,"check":"bad tag","expected":null,"passed":true},{"actual":null,"check":"bad width","expected":null,"passed":true},{"actual":null,"check":"missing header","expected":null,"passed":true},{"actual":null,"check":"second footer","expected":null,"passed":true},{"actual":null,"check":"bad count","expected":null,"passed":true},{"actual":null,"check":"unknown not counted","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"table\", \"actual\": null, \"expected\": [[\"cell\", \"x\"], [\"y\", \"z\"]], \"passed\": false}, {\"check\": \"count mismatch\", \"actual\": [[\"cell\"]], \"expected\": null, \"passed\": false}, {\"check\": \"after footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty body\", \"actual\": null, \"expected\": [], \"passed\": false}, {\"check\": \"bad tag\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"missing header\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"second footer\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad count\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"unknown not counted\", \"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."}}