{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":8,"contract":"Split a comma record with trailing comments. A # outside double quotes ends the record; inside quotes it is data. Quotes toggle quoted state and are removed; doubled quotes inside quotes emit one quote. Whitespace before a trailing comment is data. Unterminated quoting rejects.","evaluation_group":"s3-delimited-text-trailing-comments","failed_approach":"The alternate implementation still violates the same declared invariant: an open quoted comment-looking field is accepted at eof.","family":"s3-delimited-text-trailing-comments-comment-eof","id":"FA-48161","implementations":{"attempt":{"sha256":"14a23d2c2cf7c070f517089c10df29ba43fcc026752fe34a8dbbdd40161e9cda","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    out, buf, quoted, i = [], [], False, 0\n    while i < len(data):\n        ch=data[i]\n        if ch == '\"':\n            if quoted and i+1 < len(data) and data[i+1] == '\"':\n                buf.append('\"'); i += 2; continue\n            quoted = not quoted\n        elif ch == '#' and not quoted: break\n        elif ch == ',' and not quoted:\n            out.append(''.join(buf)); buf=[]\n        else: buf.append(ch)\n        i += 1\n    if quoted and '#' not in data: return None\n    out.append(''.join(buf))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('comment', solve(_vary('@,x#note')), _vary(['@', 'x']))\ncheck('quoted marker', solve(_vary('\"#@\",x')), _vary(['#@', 'x']))\ncheck('escaped quote', solve(_vary('\"a\"\"#b\",z')), _vary(['a\"#b', 'z']))\ncheck('spaces', solve(_vary('@  #x')), _vary(['@  ']))\ncheck('only comment', solve(_vary('#note')), _vary(['']))\ncheck('unclosed', solve(_vary('\"@#note')), _vary(None))\ncheck('normal', solve(_vary('@,x')), _vary(['@', 'x']))\ncheck('comment commas', solve(_vary('@#x,y')), _vary(['@']))\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":"cf89db8b7bdfb0a0caed5027b5dae1ffec259e77497079cf8ce0ca2eebf42e03","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    out, buf, quoted, i = [], [], False, 0\n    while i < len(data):\n        ch=data[i]\n        if ch == '\"':\n            if quoted and i+1 < len(data) and data[i+1] == '\"':\n                buf.append('\"'); i += 2; continue\n            quoted = not quoted\n        elif ch == '#' and not quoted: break\n        elif ch == ',' and not quoted:\n            out.append(''.join(buf)); buf=[]\n        else: buf.append(ch)\n        i += 1\n    if quoted: quoted=False\n    out.append(''.join(buf))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('comment', solve(_vary('@,x#note')), _vary(['@', 'x']))\ncheck('quoted marker', solve(_vary('\"#@\",x')), _vary(['#@', 'x']))\ncheck('escaped quote', solve(_vary('\"a\"\"#b\",z')), _vary(['a\"#b', 'z']))\ncheck('spaces', solve(_vary('@  #x')), _vary(['@  ']))\ncheck('only comment', solve(_vary('#note')), _vary(['']))\ncheck('unclosed', solve(_vary('\"@#note')), _vary(None))\ncheck('normal', solve(_vary('@,x')), _vary(['@', 'x']))\ncheck('comment commas', solve(_vary('@#x,y')), _vary(['@']))\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":"015bbb11965f644930fe00f62300281bc9d252e6724a34460de3f6edbc924bcb","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    out, buf, quoted, i = [], [], False, 0\n    while i < len(data):\n        ch=data[i]\n        if ch == '\"':\n            if quoted and i+1 < len(data) and data[i+1] == '\"':\n                buf.append('\"'); i += 2; continue\n            quoted = not quoted\n        elif ch == '#' and not quoted: break\n        elif ch == ',' and not quoted:\n            out.append(''.join(buf)); buf=[]\n        else: buf.append(ch)\n        i += 1\n    if quoted: return None\n    out.append(''.join(buf))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('comment', solve(_vary('@,x#note')), _vary(['@', 'x']))\ncheck('quoted marker', solve(_vary('\"#@\",x')), _vary(['#@', 'x']))\ncheck('escaped quote', solve(_vary('\"a\"\"#b\",z')), _vary(['a\"#b', 'z']))\ncheck('spaces', solve(_vary('@  #x')), _vary(['@  ']))\ncheck('only comment', solve(_vary('#note')), _vary(['']))\ncheck('unclosed', solve(_vary('\"@#note')), _vary(None))\ncheck('normal', solve(_vary('@,x')), _vary(['@', 'x']))\ncheck('comment commas', solve(_vary('@#x,y')), _vary(['@']))\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-trailing-comments-comment-eof","generated_at":"2026-09-29T14:44:48.280209+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: if quoted: return None","root_cause":"An open quoted comment-looking field is accepted at EOF.","sha256":"f0eebe23b32ce4a4e4d99bc075b747f67b90782e4c9fc8a12836bf4628d19331","title":"An open quoted comment-looking field is accepted at EOF · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.538,"exit_code":1,"observations":[{"actual":["cell","x"],"check":"comment","expected":["cell","x"],"passed":true},{"actual":["#cell","x"],"check":"quoted marker","expected":["#cell","x"],"passed":true},{"actual":["a\"#b","z"],"check":"escaped quote","expected":["a\"#b","z"],"passed":true},{"actual":["cell  "],"check":"spaces","expected":["cell  "],"passed":true},{"actual":[""],"check":"only comment","expected":[""],"passed":true},{"actual":["cell#note"],"check":"unclosed","expected":null,"passed":false},{"actual":["cell","x"],"check":"normal","expected":["cell","x"],"passed":true},{"actual":["cell"],"check":"comment commas","expected":["cell"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"comment\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"quoted marker\", \"actual\": [\"#cell\", \"x\"], \"expected\": [\"#cell\", \"x\"], \"passed\": true}, {\"check\": \"escaped quote\", \"actual\": [\"a\\\"#b\", \"z\"], \"expected\": [\"a\\\"#b\", \"z\"], \"passed\": true}, {\"check\": \"spaces\", \"actual\": [\"cell  \"], \"expected\": [\"cell  \"], \"passed\": true}, {\"check\": \"only comment\", \"actual\": [\"\"], \"expected\": [\"\"], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": [\"cell#note\"], \"expected\": null, \"passed\": false}, {\"check\": \"normal\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"comment commas\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.044,"exit_code":1,"observations":[{"actual":["cell","x"],"check":"comment","expected":["cell","x"],"passed":true},{"actual":["#cell","x"],"check":"quoted marker","expected":["#cell","x"],"passed":true},{"actual":["a\"#b","z"],"check":"escaped quote","expected":["a\"#b","z"],"passed":true},{"actual":["cell  "],"check":"spaces","expected":["cell  "],"passed":true},{"actual":[""],"check":"only comment","expected":[""],"passed":true},{"actual":["cell#note"],"check":"unclosed","expected":null,"passed":false},{"actual":["cell","x"],"check":"normal","expected":["cell","x"],"passed":true},{"actual":["cell"],"check":"comment commas","expected":["cell"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"comment\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"quoted marker\", \"actual\": [\"#cell\", \"x\"], \"expected\": [\"#cell\", \"x\"], \"passed\": true}, {\"check\": \"escaped quote\", \"actual\": [\"a\\\"#b\", \"z\"], \"expected\": [\"a\\\"#b\", \"z\"], \"passed\": true}, {\"check\": \"spaces\", \"actual\": [\"cell  \"], \"expected\": [\"cell  \"], \"passed\": true}, {\"check\": \"only comment\", \"actual\": [\"\"], \"expected\": [\"\"], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": [\"cell#note\"], \"expected\": null, \"passed\": false}, {\"check\": \"normal\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"comment commas\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.008,"exit_code":0,"observations":[{"actual":["cell","x"],"check":"comment","expected":["cell","x"],"passed":true},{"actual":["#cell","x"],"check":"quoted marker","expected":["#cell","x"],"passed":true},{"actual":["a\"#b","z"],"check":"escaped quote","expected":["a\"#b","z"],"passed":true},{"actual":["cell  "],"check":"spaces","expected":["cell  "],"passed":true},{"actual":[""],"check":"only comment","expected":[""],"passed":true},{"actual":null,"check":"unclosed","expected":null,"passed":true},{"actual":["cell","x"],"check":"normal","expected":["cell","x"],"passed":true},{"actual":["cell"],"check":"comment commas","expected":["cell"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"comment\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"quoted marker\", \"actual\": [\"#cell\", \"x\"], \"expected\": [\"#cell\", \"x\"], \"passed\": true}, {\"check\": \"escaped quote\", \"actual\": [\"a\\\"#b\", \"z\"], \"expected\": [\"a\\\"#b\", \"z\"], \"passed\": true}, {\"check\": \"spaces\", \"actual\": [\"cell  \"], \"expected\": [\"cell  \"], \"passed\": true}, {\"check\": \"only comment\", \"actual\": [\"\"], \"expected\": [\"\"], \"passed\": true}, {\"check\": \"unclosed\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal\", \"actual\": [\"cell\", \"x\"], \"expected\": [\"cell\", \"x\"], \"passed\": true}, {\"check\": \"comment commas\", \"actual\": [\"cell\"], \"expected\": [\"cell\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}