{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":9,"contract":"Apply cell text edits to an unquoted comma row without changing unedited spelling. Edits are [zero-based cell index,replacement text], unique indexes only; replacements cannot contain comma or newline. Compute all source spans before editing and apply from right to left. Out-of-range indexes reject.","contract_signature":"data","evaluation_group":"s3-delimited-text-raw-cell-patches","failed_approach":"The alternate implementation still violates the same declared invariant: a cell edit consumes its following comma.","family":"s3-delimited-text-raw-cell-patches-patch-end","id":"FA-48746","implementations":{"attempt":{"sha256":"2c8c54177344cc2308dc044d8e719a92e5d48fb4233873a649b0085f542e204e","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    text=data['row']; starts=[0]+[i+1 for i,ch in enumerate(text) if ch==',']\n    ends=[i for i,ch in enumerate(text) if ch==',']+[len(text)]\n    seen=set(); patches=[]\n    for index,value in data['edits']:\n        if not 0<=index<len(starts) or index in seen: return None\n        if any(ch in value for ch in ',\\r\\n'): return None\n        seen.add(index); patches.append((starts[index],ends[index],value))\n    for start,end,value in sorted(patches,reverse=True):\n        text=text[:start]+value+text[min(end+2,len(text)):]\n    return text\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('vary lengths', solve(_vary({'row': 'a,bbb,c', 'edits': [[0, '@long'], [2, 'z']]})), _vary('@long,bbb,z'))\ncheck('empty field', solve(_vary({'row': 'a,,b', 'edits': [[1, '@']]})), _vary('a,@,b'))\ncheck('empty replacement', solve(_vary({'row': 'a,b,c', 'edits': [[1, '']]})), _vary('a,,c'))\ncheck('duplicate index', solve(_vary({'row': 'a,b', 'edits': [[0, 'x'], [0, 'y']]})), _vary(None))\ncheck('invalid replacement', solve(_vary({'row': 'a,b', 'edits': [[1, 'x,y']]})), _vary(None))\ncheck('out of range', solve(_vary({'row': 'a,b', 'edits': [[2, 'x']]})), _vary(None))\ncheck('preserve spaces', solve(_vary({'row': ' a , b ', 'edits': [[1, '@']]})), _vary(' a ,@'))\ncheck('unicode', solve(_vary({'row': 'é,😀,x', 'edits': [[1, '@']]})), _vary('é,@,x'))\ncheck('no edits', solve(_vary({'row': '@,x', 'edits': []})), _vary('@,x'))\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":"44e1ca794373362cc82710d55e29b6c3ccab39a78751cc471ad4f645ce49e1d7","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    text=data['row']; starts=[0]+[i+1 for i,ch in enumerate(text) if ch==',']\n    ends=[i for i,ch in enumerate(text) if ch==',']+[len(text)]\n    seen=set(); patches=[]\n    for index,value in data['edits']:\n        if not 0<=index<len(starts) or index in seen: return None\n        if any(ch in value for ch in ',\\r\\n'): return None\n        seen.add(index); patches.append((starts[index],ends[index],value))\n    for start,end,value in sorted(patches,reverse=True):\n        text=text[:start]+value+text[end+1:]\n    return text\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('vary lengths', solve(_vary({'row': 'a,bbb,c', 'edits': [[0, '@long'], [2, 'z']]})), _vary('@long,bbb,z'))\ncheck('empty field', solve(_vary({'row': 'a,,b', 'edits': [[1, '@']]})), _vary('a,@,b'))\ncheck('empty replacement', solve(_vary({'row': 'a,b,c', 'edits': [[1, '']]})), _vary('a,,c'))\ncheck('duplicate index', solve(_vary({'row': 'a,b', 'edits': [[0, 'x'], [0, 'y']]})), _vary(None))\ncheck('invalid replacement', solve(_vary({'row': 'a,b', 'edits': [[1, 'x,y']]})), _vary(None))\ncheck('out of range', solve(_vary({'row': 'a,b', 'edits': [[2, 'x']]})), _vary(None))\ncheck('preserve spaces', solve(_vary({'row': ' a , b ', 'edits': [[1, '@']]})), _vary(' a ,@'))\ncheck('unicode', solve(_vary({'row': 'é,😀,x', 'edits': [[1, '@']]})), _vary('é,@,x'))\ncheck('no edits', solve(_vary({'row': '@,x', 'edits': []})), _vary('@,x'))\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-raw-cell-patches-patch-end","generated_at":"2026-09-29T14:44:53.730529+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":"A cell edit consumes its following comma.","sha256":"22c0c852f8baba94936471b2845d2e32149470c2aeb71d606ca820b8285549db","title":"A cell edit consumes its following comma · 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":40.754,"exit_code":1,"observations":[{"actual":"celllongbb,z","check":"vary lengths","expected":"celllong,bbb,z","passed":false},{"actual":"a,cell","check":"empty field","expected":"a,cell,b","passed":false},{"actual":"a,","check":"empty replacement","expected":"a,,c","passed":false},{"actual":null,"check":"duplicate index","expected":null,"passed":true},{"actual":null,"check":"invalid replacement","expected":null,"passed":true},{"actual":null,"check":"out of range","expected":null,"passed":true},{"actual":" a ,cell","check":"preserve spaces","expected":" a ,cell","passed":true},{"actual":"é,cell","check":"unicode","expected":"é,cell,x","passed":false},{"actual":"cell,x","check":"no edits","expected":"cell,x","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"vary lengths\", \"actual\": \"celllongbb,z\", \"expected\": \"celllong,bbb,z\", \"passed\": false}, {\"check\": \"empty field\", \"actual\": \"a,cell\", \"expected\": \"a,cell,b\", \"passed\": false}, {\"check\": \"empty replacement\", \"actual\": \"a,\", \"expected\": \"a,,c\", \"passed\": false}, {\"check\": \"duplicate index\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"invalid replacement\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"out of range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"preserve spaces\", \"actual\": \" a ,cell\", \"expected\": \" a ,cell\", \"passed\": true}, {\"check\": \"unicode\", \"actual\": \"é,cell\", \"expected\": \"é,cell,x\", \"passed\": false}, {\"check\": \"no edits\", \"actual\": \"cell,x\", \"expected\": \"cell,x\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.747,"exit_code":1,"observations":[{"actual":"celllongbbb,z","check":"vary lengths","expected":"celllong,bbb,z","passed":false},{"actual":"a,cellb","check":"empty field","expected":"a,cell,b","passed":false},{"actual":"a,c","check":"empty replacement","expected":"a,,c","passed":false},{"actual":null,"check":"duplicate index","expected":null,"passed":true},{"actual":null,"check":"invalid replacement","expected":null,"passed":true},{"actual":null,"check":"out of range","expected":null,"passed":true},{"actual":" a ,cell","check":"preserve spaces","expected":" a ,cell","passed":true},{"actual":"é,cellx","check":"unicode","expected":"é,cell,x","passed":false},{"actual":"cell,x","check":"no edits","expected":"cell,x","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"vary lengths\", \"actual\": \"celllongbbb,z\", \"expected\": \"celllong,bbb,z\", \"passed\": false}, {\"check\": \"empty field\", \"actual\": \"a,cellb\", \"expected\": \"a,cell,b\", \"passed\": false}, {\"check\": \"empty replacement\", \"actual\": \"a,c\", \"expected\": \"a,,c\", \"passed\": false}, {\"check\": \"duplicate index\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"invalid replacement\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"out of range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"preserve spaces\", \"actual\": \" a ,cell\", \"expected\": \" a ,cell\", \"passed\": true}, {\"check\": \"unicode\", \"actual\": \"é,cellx\", \"expected\": \"é,cell,x\", \"passed\": false}, {\"check\": \"no edits\", \"actual\": \"cell,x\", \"expected\": \"cell,x\", \"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."}}