{"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: an existing literal-prefix marker is duplicated.","family":"s3-delimited-text-spreadsheet-safe-export-prefix-duplication","id":"FA-48126","implementations":{"attempt":{"sha256":"f765b2b0bb6064470bcd33f4134ee0cc9081dc67368b5eda4ebb7b4bdd6f62a3","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 cell.startswith(\"'\") or any(x in cell for x in '=+-@'):\n            cell = \"'\" + cell\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":"6f6a8f9cb498e6e8deda616ac6f36df7560fdbfd72493283eacfafa5c4355eb0","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 cell.startswith(\"'\") or probe[:1] in ('=', '+', '-', '@'):\n            cell = \"'\" + cell\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-duplication","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":"An existing literal-prefix marker is duplicated.","sha256":"25e5bc3d0095ce2614f28b78520ae588495093c58a0c19ac43f60b4da49bef1f","title":"An existing literal-prefix marker is duplicated · 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":38.924,"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":true},{"actual":"\"''=3\"\n","check":"existing prefix","expected":"\"'=3\"\n","passed":false},{"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":false},{"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\": true}, {\"check\": \"existing prefix\", \"actual\": \"\\\"''=3\\\"\\n\", \"expected\": \"\\\"'=3\\\"\\n\", \"passed\": false}, {\"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\": false}, {\"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"},"broken":{"elapsed_ms":40.126,"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":true},{"actual":"\"''=3\"\n","check":"existing prefix","expected":"\"'=3\"\n","passed":false},{"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\": true}, {\"check\": \"existing prefix\", \"actual\": \"\\\"''=3\\\"\\n\", \"expected\": \"\\\"'=3\\\"\\n\", \"passed\": false}, {\"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."}}