{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":9,"contract":"Encode already textual comma cells for a spreadsheet-facing export. Prefix a single apostrophe if the first non-space/non-tab character is =,+,-, or @. An existing leading apostrophe is preserved without duplication. Then double embedded quotes and quote every cell. Return LF-terminated row. This is a stipulated conservative transport policy, not a universal spreadsheet security guarantee.","contract_signature":"data","evaluation_group":"s3-delimited-text-spreadsheet-safe-export","failed_approach":"The alternate implementation still violates the same declared invariant: formula neutralization inserts its marker after leading whitespace.","family":"s3-delimited-text-spreadsheet-safe-export-prefix-position","id":"FA-48121","implementations":{"attempt":{"sha256":"4552d91d583458d3f2e3d0b03c198cc838fd7b86d402678fb5850ef85fcdc7de","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=[]\n    for cell in data:\n        probe = cell.lstrip(' \\t')\n        if not cell.startswith(\"'\") and probe[:1] in ('=', '+', '-', '@'):\n            cell = probe + \"'\"\n        cell = cell.replace('\"', '\"\"')\n        out.append('\"' + cell + '\"')\n    return ','.join(out) + '\\n'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('formula', solve(_vary(['=1+1'])), _vary('\"\\'=1+1\"\\n'))\ncheck('leading space', solve(_vary([' \\t+2'])), _vary('\"\\' \\t+2\"\\n'))\ncheck('existing prefix', solve(_vary([\"'=3\"])), _vary('\"\\'=3\"\\n'))\ncheck('minus', solve(_vary(['-12'])), _vary('\"\\'-12\"\\n'))\ncheck('ordinary', solve(_vary(['text', 'a\"b'])), _vary('\"text\",\"a\"\"b\"\\n'))\ncheck('empty', solve(_vary([''])), _vary('\"\"\\n'))\ncheck('interior', solve(_vary(['x=1'])), _vary('\"x=1\"\\n'))\ncheck('no cells', solve(_vary([])), _vary('\\n'))\ncheck('variant formula width', solve(['='+str(N)+'+1']), '\"\\'='+str(N)+'+1\"\\n')\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":"5c0d6b9ddd5d524040fe746084300df906d8d73573d0990be91106c008e481a0","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=[]\n    for cell in data:\n        probe = cell.lstrip(' \\t')\n        if not cell.startswith(\"'\") and probe[:1] in ('=', '+', '-', '@'):\n            cell = cell[:len(cell)-len(probe)] + \"'\" + probe\n        cell = cell.replace('\"', '\"\"')\n        out.append('\"' + cell + '\"')\n    return ','.join(out) + '\\n'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('formula', solve(_vary(['=1+1'])), _vary('\"\\'=1+1\"\\n'))\ncheck('leading space', solve(_vary([' \\t+2'])), _vary('\"\\' \\t+2\"\\n'))\ncheck('existing prefix', solve(_vary([\"'=3\"])), _vary('\"\\'=3\"\\n'))\ncheck('minus', solve(_vary(['-12'])), _vary('\"\\'-12\"\\n'))\ncheck('ordinary', solve(_vary(['text', 'a\"b'])), _vary('\"text\",\"a\"\"b\"\\n'))\ncheck('empty', solve(_vary([''])), _vary('\"\"\\n'))\ncheck('interior', solve(_vary(['x=1'])), _vary('\"x=1\"\\n'))\ncheck('no cells', solve(_vary([])), _vary('\\n'))\ncheck('variant formula width', solve(['='+str(N)+'+1']), '\"\\'='+str(N)+'+1\"\\n')\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-spreadsheet-safe-export-prefix-position","generated_at":"2026-09-29T14:44:48.065069+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":"Formula neutralization inserts its marker after leading whitespace.","sha256":"512a874a94640de8c88802058044725d056b4226416a131133aa6f835ac17bc2","title":"Formula neutralization inserts its marker after leading whitespace · 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":39.98,"exit_code":1,"observations":[{"actual":"\"=1+1'\"\n","check":"formula","expected":"\"'=1+1\"\n","passed":false},{"actual":"\"+2'\"\n","check":"leading space","expected":"\"' \t+2\"\n","passed":false},{"actual":"\"'=3\"\n","check":"existing prefix","expected":"\"'=3\"\n","passed":true},{"actual":"\"-12'\"\n","check":"minus","expected":"\"'-12\"\n","passed":false},{"actual":"\"text\",\"a\"\"b\"\n","check":"ordinary","expected":"\"text\",\"a\"\"b\"\n","passed":true},{"actual":"\"\"\n","check":"empty","expected":"\"\"\n","passed":true},{"actual":"\"x=1\"\n","check":"interior","expected":"\"x=1\"\n","passed":true},{"actual":"\n","check":"no cells","expected":"\n","passed":true},{"actual":"\"=1+1'\"\n","check":"variant formula width","expected":"\"'=1+1\"\n","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"formula\", \"actual\": \"\\\"=1+1'\\\"\\n\", \"expected\": \"\\\"'=1+1\\\"\\n\", \"passed\": false}, {\"check\": \"leading space\", \"actual\": \"\\\"+2'\\\"\\n\", \"expected\": \"\\\"' \\t+2\\\"\\n\", \"passed\": false}, {\"check\": \"existing prefix\", \"actual\": \"\\\"'=3\\\"\\n\", \"expected\": \"\\\"'=3\\\"\\n\", \"passed\": true}, {\"check\": \"minus\", \"actual\": \"\\\"-12'\\\"\\n\", \"expected\": \"\\\"'-12\\\"\\n\", \"passed\": false}, {\"check\": \"ordinary\", \"actual\": \"\\\"text\\\",\\\"a\\\"\\\"b\\\"\\n\", \"expected\": \"\\\"text\\\",\\\"a\\\"\\\"b\\\"\\n\", \"passed\": true}, {\"check\": \"empty\", \"actual\": \"\\\"\\\"\\n\", \"expected\": \"\\\"\\\"\\n\", \"passed\": true}, {\"check\": \"interior\", \"actual\": \"\\\"x=1\\\"\\n\", \"expected\": \"\\\"x=1\\\"\\n\", \"passed\": true}, {\"check\": \"no cells\", \"actual\": \"\\n\", \"expected\": \"\\n\", \"passed\": true}, {\"check\": \"variant formula width\", \"actual\": \"\\\"=1+1'\\\"\\n\", \"expected\": \"\\\"'=1+1\\\"\\n\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.6,"exit_code":1,"observations":[{"actual":"\"'=1+1\"\n","check":"formula","expected":"\"'=1+1\"\n","passed":true},{"actual":"\" \t'+2\"\n","check":"leading space","expected":"\"' \t+2\"\n","passed":false},{"actual":"\"'=3\"\n","check":"existing prefix","expected":"\"'=3\"\n","passed":true},{"actual":"\"'-12\"\n","check":"minus","expected":"\"'-12\"\n","passed":true},{"actual":"\"text\",\"a\"\"b\"\n","check":"ordinary","expected":"\"text\",\"a\"\"b\"\n","passed":true},{"actual":"\"\"\n","check":"empty","expected":"\"\"\n","passed":true},{"actual":"\"x=1\"\n","check":"interior","expected":"\"x=1\"\n","passed":true},{"actual":"\n","check":"no cells","expected":"\n","passed":true},{"actual":"\"'=1+1\"\n","check":"variant formula width","expected":"\"'=1+1\"\n","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"formula\", \"actual\": \"\\\"'=1+1\\\"\\n\", \"expected\": \"\\\"'=1+1\\\"\\n\", \"passed\": true}, {\"check\": \"leading space\", \"actual\": \"\\\" \\t'+2\\\"\\n\", \"expected\": \"\\\"' \\t+2\\\"\\n\", \"passed\": false}, {\"check\": \"existing prefix\", \"actual\": \"\\\"'=3\\\"\\n\", \"expected\": \"\\\"'=3\\\"\\n\", \"passed\": true}, {\"check\": \"minus\", \"actual\": \"\\\"'-12\\\"\\n\", \"expected\": \"\\\"'-12\\\"\\n\", \"passed\": true}, {\"check\": \"ordinary\", \"actual\": \"\\\"text\\\",\\\"a\\\"\\\"b\\\"\\n\", \"expected\": \"\\\"text\\\",\\\"a\\\"\\\"b\\\"\\n\", \"passed\": true}, {\"check\": \"empty\", \"actual\": \"\\\"\\\"\\n\", \"expected\": \"\\\"\\\"\\n\", \"passed\": true}, {\"check\": \"interior\", \"actual\": \"\\\"x=1\\\"\\n\", \"expected\": \"\\\"x=1\\\"\\n\", \"passed\": true}, {\"check\": \"no cells\", \"actual\": \"\\n\", \"expected\": \"\\n\", \"passed\": true}, {\"check\": \"variant formula width\", \"actual\": \"\\\"'=1+1\\\"\\n\", \"expected\": \"\\\"'=1+1\\\"\\n\", \"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."}}