{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":7,"contract":"Process an initial comma header plus ORDER|comma-indexes and DATA|comma-values records. ORDER is a zero-based permutation describing each incoming position original column index. Each new order replaces the previous order. DATA is rearranged into original header order. Reject invalid permutations and row widths.","evaluation_group":"s3-delimited-text-column-order-records","failed_approach":"The alternate implementation still violates the same declared invariant: a repeated physical column is admitted as a permutation.","family":"s3-delimited-text-column-order-records-order-validation","id":"FA-48406","implementations":{"attempt":{"sha256":"5d244f63528d7aca36c66491dd1df50a04deec6f6ec3acc89225bb2b2fe92fad","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    width=len(data[0].split(',')); order=list(range(width)); rows=[]\n    for line in data[1:]:\n        tag,payload=(line.split('|',1)+[''])[:2]\n        fields=payload.split(',')\n        if tag=='ORDER':\n            if any(not x.isascii() or not x.isdecimal() for x in fields): return None\n            proposal=[int(x) for x in fields]\n            if any(x>=width for x in proposal): return None\n            order=proposal\n        elif tag=='DATA':\n            if len(fields)!=width: return None\n            row=[None]*width\n            for position,original in enumerate(order): row[original]=fields[position]\n            rows.append(row)\n        else: return None\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))\ncheck('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))\ncheck('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))\ncheck('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))\ncheck('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))\ncheck('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))\ncheck('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))\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":"0071e13ceb0fefe7e2c4b86ac5acb0cf23dd9eb4f78f52cdf937d674d1bd854f","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    width=len(data[0].split(',')); order=list(range(width)); rows=[]\n    for line in data[1:]:\n        tag,payload=(line.split('|',1)+[''])[:2]\n        fields=payload.split(',')\n        if tag=='ORDER':\n            if any(not x.isascii() or not x.isdecimal() for x in fields): return None\n            proposal=[int(x) for x in fields]\n            if len(proposal)!=width: return None\n            order=proposal\n        elif tag=='DATA':\n            if len(fields)!=width: return None\n            row=[None]*width\n            for position,original in enumerate(order): row[original]=fields[position]\n            rows.append(row)\n        else: return None\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))\ncheck('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))\ncheck('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))\ncheck('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))\ncheck('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))\ncheck('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))\ncheck('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))\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":"5c76e57712bb68f17e8aa38ae7a2e03b9248b2b0214b458169b8d131ecd72d4d","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    width=len(data[0].split(',')); order=list(range(width)); rows=[]\n    for line in data[1:]:\n        tag,payload=(line.split('|',1)+[''])[:2]\n        fields=payload.split(',')\n        if tag=='ORDER':\n            if any(not x.isascii() or not x.isdecimal() for x in fields): return None\n            proposal=[int(x) for x in fields]\n            if sorted(proposal)!=list(range(width)): return None\n            order=proposal\n        elif tag=='DATA':\n            if len(fields)!=width: return None\n            row=[None]*width\n            for position,original in enumerate(order): row[original]=fields[position]\n            rows.append(row)\n        else: return None\n    return rows\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cyclic', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'DATA|z,@,y'])), _vary([['@', 'y', 'z']]))\ncheck('replace', solve(_vary(['a,b,c', 'ORDER|2,0,1', 'ORDER|1,2,0', 'DATA|y,z,@'])), _vary([['@', 'y', 'z']]))\ncheck('duplicate order', solve(_vary(['a,b', 'ORDER|0,0'])), _vary(None))\ncheck('out of range', solve(_vary(['a,b', 'ORDER|0,2'])), _vary(None))\ncheck('wrong width', solve(_vary(['a,b', 'DATA|@'])), _vary(None))\ncheck('identity', solve(_vary(['a,b', 'DATA|@,z'])), _vary([['@', 'z']]))\ncheck('reset', solve(_vary(['a,b', 'ORDER|1,0', 'DATA|x,@', 'ORDER|0,1', 'DATA|@,y'])), _vary([['@', 'x'], ['@', 'y']]))\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-order-records-order-validation","generated_at":"2026-09-29T14:44:50.523902+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 sorted(proposal)!=list(range(width)): return None","root_cause":"A repeated physical column is admitted as a permutation.","sha256":"8c6bc764b45498fac723083656e8440bc7c3231c03cffe6dc25664b37fb4e730","title":"A repeated physical column is admitted as a permutation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.739,"exit_code":1,"observations":[{"actual":[["cell","y","z"]],"check":"cyclic","expected":[["cell","y","z"]],"passed":true},{"actual":[["cell","y","z"]],"check":"replace","expected":[["cell","y","z"]],"passed":true},{"actual":[],"check":"duplicate order","expected":null,"passed":false},{"actual":null,"check":"out of range","expected":null,"passed":true},{"actual":null,"check":"wrong width","expected":null,"passed":true},{"actual":[["cell","z"]],"check":"identity","expected":[["cell","z"]],"passed":true},{"actual":[["cell","x"],["cell","y"]],"check":"reset","expected":[["cell","x"],["cell","y"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cyclic\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"replace\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"duplicate order\", \"actual\": [], \"expected\": null, \"passed\": false}, {\"check\": \"out of range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"wrong width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"identity\", \"actual\": [[\"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"expected\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.742,"exit_code":1,"observations":[{"actual":[["cell","y","z"]],"check":"cyclic","expected":[["cell","y","z"]],"passed":true},{"actual":[["cell","y","z"]],"check":"replace","expected":[["cell","y","z"]],"passed":true},{"actual":[],"check":"duplicate order","expected":null,"passed":false},{"actual":[],"check":"out of range","expected":null,"passed":false},{"actual":null,"check":"wrong width","expected":null,"passed":true},{"actual":[["cell","z"]],"check":"identity","expected":[["cell","z"]],"passed":true},{"actual":[["cell","x"],["cell","y"]],"check":"reset","expected":[["cell","x"],["cell","y"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cyclic\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"replace\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"duplicate order\", \"actual\": [], \"expected\": null, \"passed\": false}, {\"check\": \"out of range\", \"actual\": [], \"expected\": null, \"passed\": false}, {\"check\": \"wrong width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"identity\", \"actual\": [[\"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"expected\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.854,"exit_code":0,"observations":[{"actual":[["cell","y","z"]],"check":"cyclic","expected":[["cell","y","z"]],"passed":true},{"actual":[["cell","y","z"]],"check":"replace","expected":[["cell","y","z"]],"passed":true},{"actual":null,"check":"duplicate order","expected":null,"passed":true},{"actual":null,"check":"out of range","expected":null,"passed":true},{"actual":null,"check":"wrong width","expected":null,"passed":true},{"actual":[["cell","z"]],"check":"identity","expected":[["cell","z"]],"passed":true},{"actual":[["cell","x"],["cell","y"]],"check":"reset","expected":[["cell","x"],["cell","y"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cyclic\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"replace\", \"actual\": [[\"cell\", \"y\", \"z\"]], \"expected\": [[\"cell\", \"y\", \"z\"]], \"passed\": true}, {\"check\": \"duplicate order\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"out of range\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"wrong width\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"identity\", \"actual\": [[\"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"reset\", \"actual\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"expected\": [[\"cell\", \"x\"], [\"cell\", \"y\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}