{"abstract":"Pivot drops identities seen only in unrequested categories.","category":"Data systems","checks":7,"contract":"Pivot [row-id,category,value] into [row-id,list-for-category...] using the caller category order. Each cell is an ordered bag list. Unknown categories do not populate cells but retain their row identity; absent cells are empty lists and null values remain elements.","contract_signature":"d","evaluation_group":"s3-data-systems-categorical-pivot-lists","failed_approach":"Choosing one category as the row domain loses other identities.","family":"s3-data-systems-categorical-pivot-lists-row-domain","id":"FA-44886","implementations":{"attempt":{"sha256":"808ce79166be975f4892d20c5aa955c89943cf5c034cab8a4feec8c1b2029376","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,categories=d\n        ids=list(dict.fromkeys(i for i,c,v in rows if c==categories[0])) if categories else []\n        out=[]\n        for ident in ids:\n            record=[ident]\n            for category in categories:\n                cell=[value for i,c,value in rows if i==ident and c==category]\n                record.append(cell)\n            out.append(record)\n        return out\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('column order', solve([[[1, 'a', 1], [1, 'b', 2]], ['b', 'a']]), [[1, [2], [1]]])\n    check('unknown-only row', solve([[[1, 'z', 1]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 1], [2, 'a', 2]], ['a']]), [[1, [1]], [2, [2]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 1], [1, 'a', 1]], ['a']]), [[1, [1, 1]]])\n    check('no categories', solve([[[1, 'a', 1]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 2:\n    check('column order', solve([[[1, 'a', 2], [1, 'b', 3]], ['b', 'a']]), [[1, [3], [2]]])\n    check('unknown-only row', solve([[[1, 'z', 2]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 2], [2, 'a', 3]], ['a']]), [[1, [2]], [2, [3]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 2], [1, 'a', 2]], ['a']]), [[1, [2, 2]]])\n    check('no categories', solve([[[1, 'a', 2]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 3:\n    check('column order', solve([[[1, 'a', 3], [1, 'b', 4]], ['b', 'a']]), [[1, [4], [3]]])\n    check('unknown-only row', solve([[[1, 'z', 3]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 3], [2, 'a', 4]], ['a']]), [[1, [3]], [2, [4]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 3], [1, 'a', 3]], ['a']]), [[1, [3, 3]]])\n    check('no categories', solve([[[1, 'a', 3]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 4:\n    check('column order', solve([[[1, 'a', 4], [1, 'b', 5]], ['b', 'a']]), [[1, [5], [4]]])\n    check('unknown-only row', solve([[[1, 'z', 4]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 4], [2, 'a', 5]], ['a']]), [[1, [4]], [2, [5]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 4], [1, 'a', 4]], ['a']]), [[1, [4, 4]]])\n    check('no categories', solve([[[1, 'a', 4]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 5:\n    check('column order', solve([[[1, 'a', 5], [1, 'b', 6]], ['b', 'a']]), [[1, [6], [5]]])\n    check('unknown-only row', solve([[[1, 'z', 5]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 5], [2, 'a', 6]], ['a']]), [[1, [5]], [2, [6]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 5], [1, 'a', 5]], ['a']]), [[1, [5, 5]]])\n    check('no categories', solve([[[1, 'a', 5]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\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":"0479a3b13bb6d13d48bae8d43dfde6fff86f90b799a59da854df83702418adf9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,categories=d\n        ids=list(dict.fromkeys(i for i,c,v in rows if c in categories))\n        out=[]\n        for ident in ids:\n            record=[ident]\n            for category in categories:\n                cell=[value for i,c,value in rows if i==ident and c==category]\n                record.append(cell)\n            out.append(record)\n        return out\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('column order', solve([[[1, 'a', 1], [1, 'b', 2]], ['b', 'a']]), [[1, [2], [1]]])\n    check('unknown-only row', solve([[[1, 'z', 1]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 1], [2, 'a', 2]], ['a']]), [[1, [1]], [2, [2]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 1], [1, 'a', 1]], ['a']]), [[1, [1, 1]]])\n    check('no categories', solve([[[1, 'a', 1]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 2:\n    check('column order', solve([[[1, 'a', 2], [1, 'b', 3]], ['b', 'a']]), [[1, [3], [2]]])\n    check('unknown-only row', solve([[[1, 'z', 2]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 2], [2, 'a', 3]], ['a']]), [[1, [2]], [2, [3]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 2], [1, 'a', 2]], ['a']]), [[1, [2, 2]]])\n    check('no categories', solve([[[1, 'a', 2]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 3:\n    check('column order', solve([[[1, 'a', 3], [1, 'b', 4]], ['b', 'a']]), [[1, [4], [3]]])\n    check('unknown-only row', solve([[[1, 'z', 3]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 3], [2, 'a', 4]], ['a']]), [[1, [3]], [2, [4]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 3], [1, 'a', 3]], ['a']]), [[1, [3, 3]]])\n    check('no categories', solve([[[1, 'a', 3]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 4:\n    check('column order', solve([[[1, 'a', 4], [1, 'b', 5]], ['b', 'a']]), [[1, [5], [4]]])\n    check('unknown-only row', solve([[[1, 'z', 4]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 4], [2, 'a', 5]], ['a']]), [[1, [4]], [2, [5]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 4], [1, 'a', 4]], ['a']]), [[1, [4, 4]]])\n    check('no categories', solve([[[1, 'a', 4]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\nelif N == 5:\n    check('column order', solve([[[1, 'a', 5], [1, 'b', 6]], ['b', 'a']]), [[1, [6], [5]]])\n    check('unknown-only row', solve([[[1, 'z', 5]], ['a']]), [[1, []]])\n    check('two row groups', solve([[[1, 'a', 5], [2, 'a', 6]], ['a']]), [[1, [5]], [2, [6]]])\n    check('null fact', solve([[[1, 'a', None]], ['a']]), [[1, [None]]])\n    check('duplicate fact', solve([[[1, 'a', 5], [1, 'a', 5]], ['a']]), [[1, [5, 5]]])\n    check('no categories', solve([[[1, 'a', 5]], []]), [[1]])\n    check('no facts', solve([[], ['a']]), [])\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-categorical-pivot-lists-row-domain","generated_at":"2026-09-29T14:44:16.836450+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":"categorical-pivot-lists: Pivot drops identities seen only in unrequested categories.","sha256":"b3b551684e999cc92521ac720c8cc08d82b4c8178f46c1f8b27932a685e6fa1a","title":"Pivot drops identities seen only in unrequested categories · 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":44.383,"exit_code":1,"observations":[{"actual":[[1,[2],[1]]],"check":"column order","expected":[[1,[2],[1]]],"passed":true},{"actual":[],"check":"unknown-only row","expected":[[1,[]]],"passed":false},{"actual":[[1,[1]],[2,[2]]],"check":"two row groups","expected":[[1,[1]],[2,[2]]],"passed":true},{"actual":[[1,[null]]],"check":"null fact","expected":[[1,[null]]],"passed":true},{"actual":[[1,[1,1]]],"check":"duplicate fact","expected":[[1,[1,1]]],"passed":true},{"actual":[],"check":"no categories","expected":[[1]],"passed":false},{"actual":[],"check":"no facts","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"column order\", \"actual\": [[1, [2], [1]]], \"expected\": [[1, [2], [1]]], \"passed\": true}, {\"check\": \"unknown-only row\", \"actual\": [], \"expected\": [[1, []]], \"passed\": false}, {\"check\": \"two row groups\", \"actual\": [[1, [1]], [2, [2]]], \"expected\": [[1, [1]], [2, [2]]], \"passed\": true}, {\"check\": \"null fact\", \"actual\": [[1, [null]]], \"expected\": [[1, [null]]], \"passed\": true}, {\"check\": \"duplicate fact\", \"actual\": [[1, [1, 1]]], \"expected\": [[1, [1, 1]]], \"passed\": true}, {\"check\": \"no categories\", \"actual\": [], \"expected\": [[1]], \"passed\": false}, {\"check\": \"no facts\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.204,"exit_code":1,"observations":[{"actual":[[1,[2],[1]]],"check":"column order","expected":[[1,[2],[1]]],"passed":true},{"actual":[],"check":"unknown-only row","expected":[[1,[]]],"passed":false},{"actual":[[1,[1]],[2,[2]]],"check":"two row groups","expected":[[1,[1]],[2,[2]]],"passed":true},{"actual":[[1,[null]]],"check":"null fact","expected":[[1,[null]]],"passed":true},{"actual":[[1,[1,1]]],"check":"duplicate fact","expected":[[1,[1,1]]],"passed":true},{"actual":[],"check":"no categories","expected":[[1]],"passed":false},{"actual":[],"check":"no facts","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"column order\", \"actual\": [[1, [2], [1]]], \"expected\": [[1, [2], [1]]], \"passed\": true}, {\"check\": \"unknown-only row\", \"actual\": [], \"expected\": [[1, []]], \"passed\": false}, {\"check\": \"two row groups\", \"actual\": [[1, [1]], [2, [2]]], \"expected\": [[1, [1]], [2, [2]]], \"passed\": true}, {\"check\": \"null fact\", \"actual\": [[1, [null]]], \"expected\": [[1, [null]]], \"passed\": true}, {\"check\": \"duplicate fact\", \"actual\": [[1, [1, 1]]], \"expected\": [[1, [1, 1]]], \"passed\": true}, {\"check\": \"no categories\", \"actual\": [], \"expected\": [[1]], \"passed\": false}, {\"check\": \"no facts\", \"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."}}