Type Strategy Registry
14 sections
Overview
Eliminate cross-phase drift permanently by creating a single, pure-data crate (ori_registry) that declares the complete behavioral specification of every builtin type — methods, operators, ownership, memory strategy — as const data that all compiler phases consume. No phase hard-codes type knowledge independently. One declaration per fact, one source of truth, structural enforcement via Rust's type system.
Completed
14 sections
Core Data Model Design
Design all Rust types for the pure-data type strategy registry
Crate Scaffolding & Purity Enforcement
Create ori_registry crate with zero dependencies, correct module structure, workspace integration, and compile/test-time purity enforcement
Primitive Type Definitions (int, float, bool, byte, char)
Define complete TypeDef constants for all primitive types (int, float, bool, byte, char)
String Type Definition
Define complete TypeDef constant for str including all methods, operators, and ownership annotations
Compound Type Definitions
Define complete TypeDef specifications for Duration, Size, Ordering, Error, and format spec types in ori_registry
Collection & Wrapper Type Definitions
Define complete TypeDef constants for all generic collection and wrapper types: List, Map, Set, Range, Tuple, Option, Result, Channel
Iterator & DoubleEndedIterator Type Definitions
Complete pure-data TypeDef declarations for Iterator<T> and DoubleEndedIterator<T>, including all adapter/consumer methods, DEI-only gating, and CollectionMethod enum mapping
Query API & Lookup Functions
Define the public interface layer between ori_registry data and all consuming compiler phases
Wire Type Checker (ori_types)
Replace all inline resolve_*_method dispatchers in ori_types with registry-driven lookups
Wire Evaluator (ori_eval)
Replace all hardcoded method enumerations in ori_eval with registry-derived data, while preserving existing dispatch performance (O(1) Name comparison) and the resolver chain architecture
Wire ARC & Borrow Pass (ori_arc)
Replace BORROWING_METHOD_NAMES and BuiltinOwnershipSets construction with ori_registry as the single source of truth, and preserve iterator/COW exclusion semantics
Wire LLVM Backend (ori_llvm) — OpStrategy Dispatch & Builtin Simplification
Replace emit_binary_op/emit_unary_op type guards with registry-driven OpStrategy dispatch; simplify declare_builtins! macro
Migrate ori_ir & Legacy Consolidation
Delete ori_ir::builtin_methods (now superseded by ori_registry), update all consumers to use ori_registry, confirm DerivedTrait and format spec stay in ori_ir — without breaking any tests
Enforcement Tests, Testing Matrix & Exit Criteria
Make cross-phase drift structurally impossible via enforcement tests, eliminate all allowlists, remove all legacy code, and define exhaustive exit criteria for the entire plan