{"abstract":"A structured table violates the declared record or column contract.","category":"Delimited text","checks":8,"contract":"Read pipe records DEF|id|literal and ROW|comma-separated IDs. Definitions are immutable; rows may reference only preceding IDs, and preserve repeated references. Literal definition payloads may contain pipes. Return expanded text rows. An empty ROW payload is a zero-cell row.","evaluation_group":"s3-delimited-text-dictionary-cells","failed_approach":"The alternate implementation still violates the same declared invariant: dictionary-coded row references are sorted before expansion.","family":"s3-delimited-text-dictionary-cells-reference-order","id":"FA-48341","implementations":{"attempt":{"sha256":"a245feefc1bf37c9c9e9556220d91bbcca2a8bae01253ea32cca13f61d367697","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    dictionary,rows={},[]\n    for line in data:\n        parts=line.split('|',2)\n        if parts[0]=='DEF' and len(parts)==3:\n            if parts[1] in dictionary: return None\n            dictionary[parts[1]]=parts[2]\n        elif parts[0]=='ROW' and len(parts)==2:\n            ids=parts[1].split(',') if parts[1] else []\n            if any(key not in dictionary for key in ids): return None\n            rows.append([dictionary[key] for key in reversed(ids)])\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('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))\ncheck('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))\ncheck('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))\ncheck('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))\ncheck('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))\ncheck('empty row', solve(_vary(['ROW|'])), _vary([[]]))\ncheck('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))\ncheck('zero', solve(_vary([])), _vary([]))\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":"44da55ac1e7869b451d421b5783c2af49447f391e59c17b0d24b38fdd21fe3d8","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    dictionary,rows={},[]\n    for line in data:\n        parts=line.split('|',2)\n        if parts[0]=='DEF' and len(parts)==3:\n            if parts[1] in dictionary: return None\n            dictionary[parts[1]]=parts[2]\n        elif parts[0]=='ROW' and len(parts)==2:\n            ids=parts[1].split(',') if parts[1] else []\n            if any(key not in dictionary for key in ids): return None\n            rows.append([dictionary[key] for key in sorted(ids)])\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('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))\ncheck('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))\ncheck('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))\ncheck('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))\ncheck('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))\ncheck('empty row', solve(_vary(['ROW|'])), _vary([[]]))\ncheck('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))\ncheck('zero', solve(_vary([])), _vary([]))\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":"72515b60f3c4e11bbf7561051385163a19a02b94ca3739cc371eef9dcf98a085","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    dictionary,rows={},[]\n    for line in data:\n        parts=line.split('|',2)\n        if parts[0]=='DEF' and len(parts)==3:\n            if parts[1] in dictionary: return None\n            dictionary[parts[1]]=parts[2]\n        elif parts[0]=='ROW' and len(parts)==2:\n            ids=parts[1].split(',') if parts[1] else []\n            if any(key not in dictionary for key in ids): return None\n            rows.append([dictionary[key] for key in ids])\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('repeat refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b,a'])), _vary([['@', 'z', '@']]))\ncheck('ordered refs', solve(_vary(['DEF|a|@', 'DEF|b|z', 'ROW|a,b'])), _vary([['@', 'z']]))\ncheck('literal pipes', solve(_vary(['DEF|a|x|y', 'ROW|a'])), _vary([['x|y']]))\ncheck('unknown', solve(_vary(['ROW|a', 'DEF|a|x'])), _vary(None))\ncheck('redefine', solve(_vary(['DEF|a|x', 'DEF|a|y'])), _vary(None))\ncheck('empty row', solve(_vary(['ROW|'])), _vary([[]]))\ncheck('empty literal', solve(_vary(['DEF|a|', 'ROW|a'])), _vary([['']]))\ncheck('zero', solve(_vary([])), _vary([]))\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-dictionary-cells-reference-order","generated_at":"2026-09-29T14:44:49.890206+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: rows.append([dictionary[key] for key in ids])","root_cause":"Dictionary-coded row references are sorted before expansion.","sha256":"c090761b5c83b281eb8e26fb509c6217458742244533e34de122dc9570af62c4","title":"Dictionary-coded row references are sorted before expansion · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.664,"exit_code":1,"observations":[{"actual":[["cell","z","cell"]],"check":"repeat refs","expected":[["cell","z","cell"]],"passed":true},{"actual":[["z","cell"]],"check":"ordered refs","expected":[["cell","z"]],"passed":false},{"actual":[["x|y"]],"check":"literal pipes","expected":[["x|y"]],"passed":true},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"redefine","expected":null,"passed":true},{"actual":[[]],"check":"empty row","expected":[[]],"passed":true},{"actual":[[""]],"check":"empty literal","expected":[[""]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeat refs\", \"actual\": [[\"cell\", \"z\", \"cell\"]], \"expected\": [[\"cell\", \"z\", \"cell\"]], \"passed\": true}, {\"check\": \"ordered refs\", \"actual\": [[\"z\", \"cell\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": false}, {\"check\": \"literal pipes\", \"actual\": [[\"x|y\"]], \"expected\": [[\"x|y\"]], \"passed\": true}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"redefine\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty row\", \"actual\": [[]], \"expected\": [[]], \"passed\": true}, {\"check\": \"empty literal\", \"actual\": [[\"\"]], \"expected\": [[\"\"]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.725,"exit_code":1,"observations":[{"actual":[["cell","cell","z"]],"check":"repeat refs","expected":[["cell","z","cell"]],"passed":false},{"actual":[["cell","z"]],"check":"ordered refs","expected":[["cell","z"]],"passed":true},{"actual":[["x|y"]],"check":"literal pipes","expected":[["x|y"]],"passed":true},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"redefine","expected":null,"passed":true},{"actual":[[]],"check":"empty row","expected":[[]],"passed":true},{"actual":[[""]],"check":"empty literal","expected":[[""]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeat refs\", \"actual\": [[\"cell\", \"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\", \"cell\"]], \"passed\": false}, {\"check\": \"ordered refs\", \"actual\": [[\"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"literal pipes\", \"actual\": [[\"x|y\"]], \"expected\": [[\"x|y\"]], \"passed\": true}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"redefine\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty row\", \"actual\": [[]], \"expected\": [[]], \"passed\": true}, {\"check\": \"empty literal\", \"actual\": [[\"\"]], \"expected\": [[\"\"]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.377,"exit_code":0,"observations":[{"actual":[["cell","z","cell"]],"check":"repeat refs","expected":[["cell","z","cell"]],"passed":true},{"actual":[["cell","z"]],"check":"ordered refs","expected":[["cell","z"]],"passed":true},{"actual":[["x|y"]],"check":"literal pipes","expected":[["x|y"]],"passed":true},{"actual":null,"check":"unknown","expected":null,"passed":true},{"actual":null,"check":"redefine","expected":null,"passed":true},{"actual":[[]],"check":"empty row","expected":[[]],"passed":true},{"actual":[[""]],"check":"empty literal","expected":[[""]],"passed":true},{"actual":[],"check":"zero","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"repeat refs\", \"actual\": [[\"cell\", \"z\", \"cell\"]], \"expected\": [[\"cell\", \"z\", \"cell\"]], \"passed\": true}, {\"check\": \"ordered refs\", \"actual\": [[\"cell\", \"z\"]], \"expected\": [[\"cell\", \"z\"]], \"passed\": true}, {\"check\": \"literal pipes\", \"actual\": [[\"x|y\"]], \"expected\": [[\"x|y\"]], \"passed\": true}, {\"check\": \"unknown\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"redefine\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty row\", \"actual\": [[]], \"expected\": [[]], \"passed\": true}, {\"check\": \"empty literal\", \"actual\": [[\"\"]], \"expected\": [[\"\"]], \"passed\": true}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}