{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":8,"contract":"Infer per-column wire types from already lexed two-column rows. Unquoted empty and NULL cells supply no evidence; quoted cells force text. Unquoted lowercase true/false are bool; canonical signed decimal integers without leading zeros are int; all other cells text. Mixed non-null kinds promote to text; a column with no evidence is unknown.","evaluation_group":"s3-delimited-text-column-inference","failed_approach":"Protecting only quoted empty strings misses quoted numbers.","family":"s3-delimited-text-column-inference-quote-evidence","id":"FA-47766","implementations":{"attempt":{"sha256":"79c8ae9dc5edf4ec8f9d22a37705d3805dcd7a19a53660fdf78993cf8e3e0555","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    evidence = [set(), set()]\n    for row in data:\n        for i, (value, quoted) in enumerate(row):\n            if not quoted and value in ('', 'NULL'): continue\n            if quoted and not value: kind = 'text'\n            elif value in ('true', 'false'): kind = 'bool'\n            elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'\n            else: kind = 'text'\n            evidence[i].add(kind)\n    return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'unknown' for kinds in evidence]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))\ncheck('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))\ncheck('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))\ncheck('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))\ncheck('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))\ncheck('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))\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":"e4e2596528255064e97f3454780540f8f80ae9139725d95352cab3582a484f73","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    evidence = [set(), set()]\n    for row in data:\n        for i, (value, quoted) in enumerate(row):\n            if not quoted and value in ('', 'NULL'): continue\n            if False: kind = 'text'\n            elif value in ('true', 'false'): kind = 'bool'\n            elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'\n            else: kind = 'text'\n            evidence[i].add(kind)\n    return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'unknown' for kinds in evidence]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))\ncheck('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))\ncheck('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))\ncheck('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))\ncheck('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))\ncheck('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))\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":"ff76d7e2cb78e5fc37c9122b58bf52c46aa8a0f466da8026d55e34fe1265ce64","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    evidence = [set(), set()]\n    for row in data:\n        for i, (value, quoted) in enumerate(row):\n            if not quoted and value in ('', 'NULL'): continue\n            if quoted: kind = 'text'\n            elif value in ('true', 'false'): kind = 'bool'\n            elif value.lstrip('-').isascii() and value.lstrip('-').isdigit() and value == str(int(value)): kind = 'int'\n            else: kind = 'text'\n            evidence[i].add(kind)\n    return [next(iter(kinds)) if len(kinds) == 1 else 'text' if kinds else 'unknown' for kinds in evidence]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('typed', solve(_vary([[['12', False], ['true', False]], [['-2', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('quoted number', solve(_vary([[['12', True], ['@', False]]])), _vary(['text', 'text']))\ncheck('null only', solve(_vary([[['NULL', False], ['', False]]])), _vary(['unknown', 'unknown']))\ncheck('quoted empty', solve(_vary([[['', True], ['NULL', True]]])), _vary(['text', 'text']))\ncheck('leading zero', solve(_vary([[['01', False], ['-0', False]]])), _vary(['text', 'text']))\ncheck('mixed', solve(_vary([[['1', False], ['true', False]], [['@', False], ['2', False]]])), _vary(['text', 'text']))\ncheck('null ignored', solve(_vary([[['NULL', False], ['', False]], [['1', False], ['false', False]]])), _vary(['int', 'bool']))\ncheck('empty table', solve(_vary([])), _vary(['unknown', 'unknown']))\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-column-inference-quote-evidence","generated_at":"2026-09-29T14:44:44.559480+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: kind = 'text'","root_cause":"Type inference forgets a lexically quoted literal is textual evidence.","sha256":"86e37f9d17071a9ef4dcf2907e1acdaf06687f1d4ae7878834d1cf034fbb285c","title":"A quoted number drives numeric schema inference · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.403,"exit_code":1,"observations":[{"actual":["int","bool"],"check":"typed","expected":["int","bool"],"passed":true},{"actual":["int","text"],"check":"quoted number","expected":["text","text"],"passed":false},{"actual":["unknown","unknown"],"check":"null only","expected":["unknown","unknown"],"passed":true},{"actual":["text","text"],"check":"quoted empty","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"leading zero","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"mixed","expected":["text","text"],"passed":true},{"actual":["int","bool"],"check":"null ignored","expected":["int","bool"],"passed":true},{"actual":["unknown","unknown"],"check":"empty table","expected":["unknown","unknown"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typed\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"quoted number\", \"actual\": [\"int\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": false}, {\"check\": \"null only\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}, {\"check\": \"quoted empty\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"leading zero\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"mixed\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"null ignored\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"empty table\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.026,"exit_code":1,"observations":[{"actual":["int","bool"],"check":"typed","expected":["int","bool"],"passed":true},{"actual":["int","text"],"check":"quoted number","expected":["text","text"],"passed":false},{"actual":["unknown","unknown"],"check":"null only","expected":["unknown","unknown"],"passed":true},{"actual":["text","text"],"check":"quoted empty","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"leading zero","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"mixed","expected":["text","text"],"passed":true},{"actual":["int","bool"],"check":"null ignored","expected":["int","bool"],"passed":true},{"actual":["unknown","unknown"],"check":"empty table","expected":["unknown","unknown"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typed\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"quoted number\", \"actual\": [\"int\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": false}, {\"check\": \"null only\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}, {\"check\": \"quoted empty\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"leading zero\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"mixed\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"null ignored\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"empty table\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.13,"exit_code":0,"observations":[{"actual":["int","bool"],"check":"typed","expected":["int","bool"],"passed":true},{"actual":["text","text"],"check":"quoted number","expected":["text","text"],"passed":true},{"actual":["unknown","unknown"],"check":"null only","expected":["unknown","unknown"],"passed":true},{"actual":["text","text"],"check":"quoted empty","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"leading zero","expected":["text","text"],"passed":true},{"actual":["text","text"],"check":"mixed","expected":["text","text"],"passed":true},{"actual":["int","bool"],"check":"null ignored","expected":["int","bool"],"passed":true},{"actual":["unknown","unknown"],"check":"empty table","expected":["unknown","unknown"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typed\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"quoted number\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"null only\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}, {\"check\": \"quoted empty\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"leading zero\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"mixed\", \"actual\": [\"text\", \"text\"], \"expected\": [\"text\", \"text\"], \"passed\": true}, {\"check\": \"null ignored\", \"actual\": [\"int\", \"bool\"], \"expected\": [\"int\", \"bool\"], \"passed\": true}, {\"check\": \"empty table\", \"actual\": [\"unknown\", \"unknown\"], \"expected\": [\"unknown\", \"unknown\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}