{"abstract":"Unpivot sorts parents by identity before expansion.","category":"Data systems","checks":7,"contract":"Unpivot selected columns of record dictionaries into [id,column,value] rows. Include explicitly present None values, skip absent columns, respect requested column order and repetitions, and retain parent row order.","contract_signature":"d","evaluation_group":"s3-data-systems-unpivot-presence","failed_approach":"Reversal also violates source order.","family":"s3-data-systems-unpivot-presence-source-order","id":"FA-44936","implementations":{"attempt":{"sha256":"fa2aae49e22bf1bc93e285caad23c6a5dee194e5799df46a19f23862f7ab1365","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,columns=d\n        result=[]\n        for row in reversed(rows):\n            ident=row['id']\n            for column in columns:\n                if column not in row: continue\n                result.append([ident,column,row.get(column)])\n        return result\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('source column order', solve([[{'id': 9, 'a': 1, 'b': 2}], ['b', 'a']]), [[9, 'b', 2], [9, 'a', 1]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 1}], ['a', 'b']]), [[9, 'a', 1]])\n    check('duplicate column', solve([[{'id': 9, 'a': 1}], ['a', 'a']]), [[9, 'a', 1], [9, 'a', 1]])\n    check('parent order', solve([[{'id': 9, 'a': 1}, {'id': 2, 'a': 2}], ['a']]), [[9, 'a', 1], [2, 'a', 2]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 1}], []]), [])\nelif N == 2:\n    check('source column order', solve([[{'id': 9, 'a': 2, 'b': 3}], ['b', 'a']]), [[9, 'b', 3], [9, 'a', 2]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 2}], ['a', 'b']]), [[9, 'a', 2]])\n    check('duplicate column', solve([[{'id': 9, 'a': 2}], ['a', 'a']]), [[9, 'a', 2], [9, 'a', 2]])\n    check('parent order', solve([[{'id': 9, 'a': 2}, {'id': 2, 'a': 3}], ['a']]), [[9, 'a', 2], [2, 'a', 3]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 2}], []]), [])\nelif N == 3:\n    check('source column order', solve([[{'id': 9, 'a': 3, 'b': 4}], ['b', 'a']]), [[9, 'b', 4], [9, 'a', 3]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 3}], ['a', 'b']]), [[9, 'a', 3]])\n    check('duplicate column', solve([[{'id': 9, 'a': 3}], ['a', 'a']]), [[9, 'a', 3], [9, 'a', 3]])\n    check('parent order', solve([[{'id': 9, 'a': 3}, {'id': 2, 'a': 4}], ['a']]), [[9, 'a', 3], [2, 'a', 4]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 3}], []]), [])\nelif N == 4:\n    check('source column order', solve([[{'id': 9, 'a': 4, 'b': 5}], ['b', 'a']]), [[9, 'b', 5], [9, 'a', 4]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 4}], ['a', 'b']]), [[9, 'a', 4]])\n    check('duplicate column', solve([[{'id': 9, 'a': 4}], ['a', 'a']]), [[9, 'a', 4], [9, 'a', 4]])\n    check('parent order', solve([[{'id': 9, 'a': 4}, {'id': 2, 'a': 5}], ['a']]), [[9, 'a', 4], [2, 'a', 5]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 4}], []]), [])\nelif N == 5:\n    check('source column order', solve([[{'id': 9, 'a': 5, 'b': 6}], ['b', 'a']]), [[9, 'b', 6], [9, 'a', 5]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 5}], ['a', 'b']]), [[9, 'a', 5]])\n    check('duplicate column', solve([[{'id': 9, 'a': 5}], ['a', 'a']]), [[9, 'a', 5], [9, 'a', 5]])\n    check('parent order', solve([[{'id': 9, 'a': 5}, {'id': 2, 'a': 6}], ['a']]), [[9, 'a', 5], [2, 'a', 6]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 5}], []]), [])\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":"5ce32d4dc65fcd9ce42ccf1b6015d96702599a4d6841252a0836465581d502fb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,columns=d\n        result=[]\n        for row in sorted(rows,key=lambda r:r[\"id\"]):\n            ident=row['id']\n            for column in columns:\n                if column not in row: continue\n                result.append([ident,column,row.get(column)])\n        return result\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('source column order', solve([[{'id': 9, 'a': 1, 'b': 2}], ['b', 'a']]), [[9, 'b', 2], [9, 'a', 1]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 1}], ['a', 'b']]), [[9, 'a', 1]])\n    check('duplicate column', solve([[{'id': 9, 'a': 1}], ['a', 'a']]), [[9, 'a', 1], [9, 'a', 1]])\n    check('parent order', solve([[{'id': 9, 'a': 1}, {'id': 2, 'a': 2}], ['a']]), [[9, 'a', 1], [2, 'a', 2]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 1}], []]), [])\nelif N == 2:\n    check('source column order', solve([[{'id': 9, 'a': 2, 'b': 3}], ['b', 'a']]), [[9, 'b', 3], [9, 'a', 2]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 2}], ['a', 'b']]), [[9, 'a', 2]])\n    check('duplicate column', solve([[{'id': 9, 'a': 2}], ['a', 'a']]), [[9, 'a', 2], [9, 'a', 2]])\n    check('parent order', solve([[{'id': 9, 'a': 2}, {'id': 2, 'a': 3}], ['a']]), [[9, 'a', 2], [2, 'a', 3]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 2}], []]), [])\nelif N == 3:\n    check('source column order', solve([[{'id': 9, 'a': 3, 'b': 4}], ['b', 'a']]), [[9, 'b', 4], [9, 'a', 3]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 3}], ['a', 'b']]), [[9, 'a', 3]])\n    check('duplicate column', solve([[{'id': 9, 'a': 3}], ['a', 'a']]), [[9, 'a', 3], [9, 'a', 3]])\n    check('parent order', solve([[{'id': 9, 'a': 3}, {'id': 2, 'a': 4}], ['a']]), [[9, 'a', 3], [2, 'a', 4]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 3}], []]), [])\nelif N == 4:\n    check('source column order', solve([[{'id': 9, 'a': 4, 'b': 5}], ['b', 'a']]), [[9, 'b', 5], [9, 'a', 4]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 4}], ['a', 'b']]), [[9, 'a', 4]])\n    check('duplicate column', solve([[{'id': 9, 'a': 4}], ['a', 'a']]), [[9, 'a', 4], [9, 'a', 4]])\n    check('parent order', solve([[{'id': 9, 'a': 4}, {'id': 2, 'a': 5}], ['a']]), [[9, 'a', 4], [2, 'a', 5]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 4}], []]), [])\nelif N == 5:\n    check('source column order', solve([[{'id': 9, 'a': 5, 'b': 6}], ['b', 'a']]), [[9, 'b', 6], [9, 'a', 5]])\n    check('explicit null', solve([[{'id': 9, 'a': None}], ['a']]), [[9, 'a', None]])\n    check('missing field', solve([[{'id': 9, 'a': 5}], ['a', 'b']]), [[9, 'a', 5]])\n    check('duplicate column', solve([[{'id': 9, 'a': 5}], ['a', 'a']]), [[9, 'a', 5], [9, 'a', 5]])\n    check('parent order', solve([[{'id': 9, 'a': 5}, {'id': 2, 'a': 6}], ['a']]), [[9, 'a', 5], [2, 'a', 6]])\n    check('zero value', solve([[{'id': 9, 'a': 0}], ['a']]), [[9, 'a', 0]])\n    check('empty projection', solve([[{'id': 9, 'a': 5}], []]), [])\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":"Offline stipulated semantics over valid small inputs; no performance, concurrency, or production-engine conformance claim. 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-data-systems-unpivot-presence-source-order","generated_at":"2026-09-29T14:44:17.183537+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A bounded deterministic data engine model makes representation and changelog faults reproducible.","root_cause":"unpivot-presence: Unpivot sorts parents by identity before expansion.","sha256":"1e77c105f1e9f291bdfc37be5a5aa92263409790854630e78f819c5af5d3f2f7","title":"Unpivot sorts parents by identity before expansion · 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":43.69,"exit_code":1,"observations":[{"actual":[[9,"b",2],[9,"a",1]],"check":"source column order","expected":[[9,"b",2],[9,"a",1]],"passed":true},{"actual":[[9,"a",null]],"check":"explicit null","expected":[[9,"a",null]],"passed":true},{"actual":[[9,"a",1]],"check":"missing field","expected":[[9,"a",1]],"passed":true},{"actual":[[9,"a",1],[9,"a",1]],"check":"duplicate column","expected":[[9,"a",1],[9,"a",1]],"passed":true},{"actual":[[2,"a",2],[9,"a",1]],"check":"parent order","expected":[[9,"a",1],[2,"a",2]],"passed":false},{"actual":[[9,"a",0]],"check":"zero value","expected":[[9,"a",0]],"passed":true},{"actual":[],"check":"empty projection","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"source column order\", \"actual\": [[9, \"b\", 2], [9, \"a\", 1]], \"expected\": [[9, \"b\", 2], [9, \"a\", 1]], \"passed\": true}, {\"check\": \"explicit null\", \"actual\": [[9, \"a\", null]], \"expected\": [[9, \"a\", null]], \"passed\": true}, {\"check\": \"missing field\", \"actual\": [[9, \"a\", 1]], \"expected\": [[9, \"a\", 1]], \"passed\": true}, {\"check\": \"duplicate column\", \"actual\": [[9, \"a\", 1], [9, \"a\", 1]], \"expected\": [[9, \"a\", 1], [9, \"a\", 1]], \"passed\": true}, {\"check\": \"parent order\", \"actual\": [[2, \"a\", 2], [9, \"a\", 1]], \"expected\": [[9, \"a\", 1], [2, \"a\", 2]], \"passed\": false}, {\"check\": \"zero value\", \"actual\": [[9, \"a\", 0]], \"expected\": [[9, \"a\", 0]], \"passed\": true}, {\"check\": \"empty projection\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.18,"exit_code":1,"observations":[{"actual":[[9,"b",2],[9,"a",1]],"check":"source column order","expected":[[9,"b",2],[9,"a",1]],"passed":true},{"actual":[[9,"a",null]],"check":"explicit null","expected":[[9,"a",null]],"passed":true},{"actual":[[9,"a",1]],"check":"missing field","expected":[[9,"a",1]],"passed":true},{"actual":[[9,"a",1],[9,"a",1]],"check":"duplicate column","expected":[[9,"a",1],[9,"a",1]],"passed":true},{"actual":[[2,"a",2],[9,"a",1]],"check":"parent order","expected":[[9,"a",1],[2,"a",2]],"passed":false},{"actual":[[9,"a",0]],"check":"zero value","expected":[[9,"a",0]],"passed":true},{"actual":[],"check":"empty projection","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"source column order\", \"actual\": [[9, \"b\", 2], [9, \"a\", 1]], \"expected\": [[9, \"b\", 2], [9, \"a\", 1]], \"passed\": true}, {\"check\": \"explicit null\", \"actual\": [[9, \"a\", null]], \"expected\": [[9, \"a\", null]], \"passed\": true}, {\"check\": \"missing field\", \"actual\": [[9, \"a\", 1]], \"expected\": [[9, \"a\", 1]], \"passed\": true}, {\"check\": \"duplicate column\", \"actual\": [[9, \"a\", 1], [9, \"a\", 1]], \"expected\": [[9, \"a\", 1], [9, \"a\", 1]], \"passed\": true}, {\"check\": \"parent order\", \"actual\": [[2, \"a\", 2], [9, \"a\", 1]], \"expected\": [[9, \"a\", 1], [2, \"a\", 2]], \"passed\": false}, {\"check\": \"zero value\", \"actual\": [[9, \"a\", 0]], \"expected\": [[9, \"a\", 0]], \"passed\": true}, {\"check\": \"empty projection\", \"actual\": [], \"expected\": [], \"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."}}