Enum Layout SSOT & Take-Project Hardening
4 sections
Overview
Centralize ALL enum layout knowledge into a single source of truth in ori_repr, migrate every codegen consumer to use that SSOT instead of hardcoded layout assumptions, harden the AIMS take-project ownership model against lineage gaps and iterator-only scope limitations, and replace weak source-text-only niche tests with emitter-driven IR verification — resolving 10 confirmed dual-source TPR findings from the repr-opt §07 architectural review and making the enum representation architecture sound for all current AND future layout optimizations (niche filling, payload compression, §08-§12 work).
Planned
4 sections
EnumLayoutInfo API
Create a canonical EnumLayoutInfo query surface in ori_repr that answers ALL enum layout questions — tag encoding, payload sizing, field offsets, ABI size — eliminating 8+ scattered packing computations
TagAccess Full Migration + Derive Fix
Migrate ALL 88 codegen consumer sites to use TagAccess + EnumLayoutInfo, eliminating every hardcoded enum field index — fixing the active tagged-pointer miscompile in derive enum bodies
Take-Project Hardening
Enforce the in_class ⊆ var_to_lineage invariant via lineage reconciliation and generalize is_take_project from iterator-only tag whitelist to MachineRepr-driven ownership classification
Verification & Testing
Replace source-text niche-helper tests with emitter-driven IR verification, add codegen gate audit ensuring no TagAccess bypass, and run full integration verification