{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":11,"contract":"Resolve an ordered comma column selector against width. Decimal selectors are one based, ranges a-b include both endpoints, and * adds every column not selected earlier. Explicit duplicate selections are retained. Reject malformed, reversed or out-of-bound numeric ranges. Return zero-based physical indexes.","evaluation_group":"s3-delimited-text-column-selector","failed_approach":"Sorting the deduplicated set also destroys user-specified order.","family":"s3-delimited-text-column-selector-explicit-duplicates","id":"FA-47931","implementations":{"attempt":{"sha256":"865429da65dc9815438dfedd2e4247420d4d3a053d0f54c3455f91e20aee5f0f","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 token in data['selector'].split(','):\n        if token == '*':\n            out.extend(i for i in range(data['width']) if i not in out)\n            continue\n        parts = token.split('-')\n        if len(parts) not in (1,2) or any(not p.isascii() or not p.isdecimal() for p in parts): return None\n        start, end = int(parts[0]), int(parts[-1])\n        if not 1 <= start <= end <= data['width']: return None\n        out.extend(range(start-1, end))\n    return sorted(set(out))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ordered', solve(_vary({'selector': '3,1', 'width': 3})), _vary([2, 0]))\ncheck('range', solve(_vary({'selector': '2-4', 'width': 4})), _vary([1, 2, 3]))\ncheck('wildcard', solve(_vary({'selector': '2,*', 'width': 3})), _vary([1, 0, 2]))\ncheck('duplicate', solve(_vary({'selector': '2,2', 'width': 3})), _vary([1, 1]))\ncheck('reversed', solve(_vary({'selector': '3-1', 'width': 3})), _vary(None))\ncheck('zero', solve(_vary({'selector': '0', 'width': 3})), _vary(None))\ncheck('outside', solve(_vary({'selector': '4', 'width': 3})), _vary(None))\ncheck('bad range', solve(_vary({'selector': '1-2-3', 'width': 3})), _vary(None))\ncheck('empty', solve(_vary({'selector': '', 'width': 3})), _vary(None))\ncheck('variable width', solve(_vary({'selector': '1,*', 'width': 4})), _vary([0, 1, 2, 3]))\ncheck('variant selector width', solve({'selector':'1,*','width':N+2}), list(range(N+2)))\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":"8703d4316a65dff7cdd7c6d332d47d3a243225cb4373f432160e623ba0c0b844","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 token in data['selector'].split(','):\n        if token == '*':\n            out.extend(i for i in range(data['width']) if i not in out)\n            continue\n        parts = token.split('-')\n        if len(parts) not in (1,2) or any(not p.isascii() or not p.isdecimal() for p in parts): return None\n        start, end = int(parts[0]), int(parts[-1])\n        if not 1 <= start <= end <= data['width']: return None\n        out.extend(range(start-1, end))\n    return list(dict.fromkeys(out))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ordered', solve(_vary({'selector': '3,1', 'width': 3})), _vary([2, 0]))\ncheck('range', solve(_vary({'selector': '2-4', 'width': 4})), _vary([1, 2, 3]))\ncheck('wildcard', solve(_vary({'selector': '2,*', 'width': 3})), _vary([1, 0, 2]))\ncheck('duplicate', solve(_vary({'selector': '2,2', 'width': 3})), _vary([1, 1]))\ncheck('reversed', solve(_vary({'selector': '3-1', 'width': 3})), _vary(None))\ncheck('zero', solve(_vary({'selector': '0', 'width': 3})), _vary(None))\ncheck('outside', solve(_vary({'selector': '4', 'width': 3})), _vary(None))\ncheck('bad range', solve(_vary({'selector': '1-2-3', 'width': 3})), _vary(None))\ncheck('empty', solve(_vary({'selector': '', 'width': 3})), _vary(None))\ncheck('variable width', solve(_vary({'selector': '1,*', 'width': 4})), _vary([0, 1, 2, 3]))\ncheck('variant selector width', solve({'selector':'1,*','width':N+2}), list(range(N+2)))\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":"74afbb7e06e63c43d3bbd867097175cfafa89b4a57bf8a1323f72da59acdf1c5","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 token in data['selector'].split(','):\n        if token == '*':\n            out.extend(i for i in range(data['width']) if i not in out)\n            continue\n        parts = token.split('-')\n        if len(parts) not in (1,2) or any(not p.isascii() or not p.isdecimal() for p in parts): return None\n        start, end = int(parts[0]), int(parts[-1])\n        if not 1 <= start <= end <= data['width']: return None\n        out.extend(range(start-1, end))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ordered', solve(_vary({'selector': '3,1', 'width': 3})), _vary([2, 0]))\ncheck('range', solve(_vary({'selector': '2-4', 'width': 4})), _vary([1, 2, 3]))\ncheck('wildcard', solve(_vary({'selector': '2,*', 'width': 3})), _vary([1, 0, 2]))\ncheck('duplicate', solve(_vary({'selector': '2,2', 'width': 3})), _vary([1, 1]))\ncheck('reversed', solve(_vary({'selector': '3-1', 'width': 3})), _vary(None))\ncheck('zero', solve(_vary({'selector': '0', 'width': 3})), _vary(None))\ncheck('outside', solve(_vary({'selector': '4', 'width': 3})), _vary(None))\ncheck('bad range', solve(_vary({'selector': '1-2-3', 'width': 3})), _vary(None))\ncheck('empty', solve(_vary({'selector': '', 'width': 3})), _vary(None))\ncheck('variable width', solve(_vary({'selector': '1,*', 'width': 4})), _vary([0, 1, 2, 3]))\ncheck('variant selector width', solve({'selector':'1,*','width':N+2}), list(range(N+2)))\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-selector-explicit-duplicates","generated_at":"2026-09-29T14:44:46.155781+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: return out","root_cause":"A set-like selector result removes intentionally repeated output columns.","sha256":"e507edcd9ee47d6e0cc94f3e52f1391f556f4f9c31c1e01b252e71207537bf9c","title":"Explicit repeated column selectors are deduplicated · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.422,"exit_code":1,"observations":[{"actual":[0,2],"check":"ordered","expected":[2,0],"passed":false},{"actual":[1,2,3],"check":"range","expected":[1,2,3],"passed":true},{"actual":[0,1,2],"check":"wildcard","expected":[1,0,2],"passed":false},{"actual":[1],"check":"duplicate","expected":[1,1],"passed":false},{"actual":null,"check":"reversed","expected":null,"passed":true},{"actual":null,"check":"zero","expected":null,"passed":true},{"actual":null,"check":"outside","expected":null,"passed":true},{"actual":null,"check":"bad range","expected":null,"passed":true},{"actual":null,"check":"empty","expected":null,"passed":true},{"actual":[0,1,2,3],"check":"variable width","expected":[0,1,2,3],"passed":true},{"actual":[0,1,2],"check":"variant selector width","expected":[0,1,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ordered\", \"actual\": [0, 2], \"expected\": [2, 0], \"passed\": false}, {\"check\": \"range\", \"actual\": [1, 2, 3], \"expected\": [1, 2, 3], \"passed\": true}, {\"check\": \"wildcard\", \"actual\": [0, 1, 2], \"expected\": [1, 0, 2], \"passed\": false}, {\"check\": \"duplicate\", \"actual\": [1], \"expected\": [1, 1], \"passed\": false}, {\"check\": \"reversed\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"outside\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"variable width\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"variant selector width\", \"actual\": [0, 1, 2], \"expected\": [0, 1, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.925,"exit_code":1,"observations":[{"actual":[2,0],"check":"ordered","expected":[2,0],"passed":true},{"actual":[1,2,3],"check":"range","expected":[1,2,3],"passed":true},{"actual":[1,0,2],"check":"wildcard","expected":[1,0,2],"passed":true},{"actual":[1],"check":"duplicate","expected":[1,1],"passed":false},{"actual":null,"check":"reversed","expected":null,"passed":true},{"actual":null,"check":"zero","expected":null,"passed":true},{"actual":null,"check":"outside","expected":null,"passed":true},{"actual":null,"check":"bad range","expected":null,"passed":true},{"actual":null,"check":"empty","expected":null,"passed":true},{"actual":[0,1,2,3],"check":"variable width","expected":[0,1,2,3],"passed":true},{"actual":[0,1,2],"check":"variant selector width","expected":[0,1,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ordered\", \"actual\": [2, 0], \"expected\": [2, 0], \"passed\": true}, {\"check\": \"range\", \"actual\": [1, 2, 3], \"expected\": [1, 2, 3], \"passed\": true}, {\"check\": \"wildcard\", \"actual\": [1, 0, 2], \"expected\": [1, 0, 2], \"passed\": true}, {\"check\": \"duplicate\", \"actual\": [1], \"expected\": [1, 1], \"passed\": false}, {\"check\": \"reversed\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"outside\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"variable width\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"variant selector width\", \"actual\": [0, 1, 2], \"expected\": [0, 1, 2], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":46.53,"exit_code":0,"observations":[{"actual":[2,0],"check":"ordered","expected":[2,0],"passed":true},{"actual":[1,2,3],"check":"range","expected":[1,2,3],"passed":true},{"actual":[1,0,2],"check":"wildcard","expected":[1,0,2],"passed":true},{"actual":[1,1],"check":"duplicate","expected":[1,1],"passed":true},{"actual":null,"check":"reversed","expected":null,"passed":true},{"actual":null,"check":"zero","expected":null,"passed":true},{"actual":null,"check":"outside","expected":null,"passed":true},{"actual":null,"check":"bad range","expected":null,"passed":true},{"actual":null,"check":"empty","expected":null,"passed":true},{"actual":[0,1,2,3],"check":"variable width","expected":[0,1,2,3],"passed":true},{"actual":[0,1,2],"check":"variant selector width","expected":[0,1,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ordered\", \"actual\": [2, 0], \"expected\": [2, 0], \"passed\": true}, {\"check\": \"range\", \"actual\": [1, 2, 3], \"expected\": [1, 2, 3], \"passed\": true}, {\"check\": \"wildcard\", \"actual\": [1, 0, 2], \"expected\": [1, 0, 2], \"passed\": true}, {\"check\": \"duplicate\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"reversed\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"zero\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"outside\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"bad range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"variable width\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"variant selector width\", \"actual\": [0, 1, 2], \"expected\": [0, 1, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}