Skip to content

Feat: Unified ir pipeline#1

Merged
seryl merged 3 commits intomainfrom
unified-ir-pipeline
Sep 15, 2025
Merged

Feat: Unified ir pipeline#1
seryl merged 3 commits intomainfrom
unified-ir-pipeline

Conversation

@seryl
Copy link
Copy Markdown
Owner

@seryl seryl commented Sep 15, 2025

[0.7.0] - 2025-09-15

Added

  • Unified IR Pipeline: Complete DAG-based compilation pipeline with symbol tables and dependency graphs
  • Two-Phase Compilation: Analysis phase builds global symbol table, synthesis phase generates code with full dependency knowledge
  • Special Case Registry: TOML-driven configuration system for edge cases, eliminating all hardcoded special logic
  • Module Registry: Centralized module resolution with lexical scoping and cross-module dependency tracking
  • Compilation Unit: Intermediate representation between analysis and synthesis phases for clean separation of concerns
  • Pattern-Based Module Aliases: Intelligent module alias generation (e.g., metav1, corev1, storagev1) to avoid naming conflicts
  • Consistent mod.ncl Structure: Every directory now includes a mod.ncl file that imports all types in that directory

Changed

  • Major Architecture Overhaul: Migrated from ad-hoc processing to structured two-phase compilation with proper symbol tables
  • Module System: Complete rewrite with hierarchical mod.ncl generation and proper import hoisting
  • Import Resolution: All imports now hoisted to module level, eliminating inline imports throughout generated code
  • Import Paths: All import paths now use consistent mod.ncl structure (e.g., ../core/v1/mod.ncl instead of ../core/v1.ncl)
  • Module Alias Generation: Replaced hardcoded if-else chains with pattern-based alias extraction from import paths
  • Special Cases: Moved all K8s and Crossplane special handling from code to declarative TOML configuration files
  • Directory Structure: Eliminated redundant subdirectories in package generation (e.g., crossplane/apiextensions.crossplane.io)
  • Test Infrastructure: Moved test package generation to system temporary directory instead of cluttering examples folder
  • Code Quality: Removed ~300 lines of legacy code, fixed all compilation warnings and clippy lints
  • Error Types: Large PipelineError variants now boxed to reduce stack allocation pressure

Fixed

  • K8s Core Type Imports: Fixed incorrect import paths for TypedLocalObjectReference, PodTemplateSpec, and other core types
  • Duplicate Module Variables: Resolved naming conflicts by using unique module aliases (metav1, corev1) instead of duplicate v1Module declarations
  • Cross-Module References: Properly resolved through two-phase compilation and dependency analysis
  • Import Path Consistency: All imports now use proper relative paths calculated via ModuleRegistry
  • Circular Dependencies: Added detection and proper error reporting via petgraph
  • Test Failures: Fixed naming convention tests, module registry tests, and snapshot tests
  • Memory Safety: Eliminated all unwrap(), expect(), and panic!() calls in favor of proper Result types
  • Memory Optimization: Reduced PipelineError stack footprint from 184 bytes to ~16 bytes by boxing large error variants
  • Clippy Warnings: Fixed all warnings including needless_borrow, manual_flatten, vec_init_then_push, and function argument count issues
  • Code Quality: Fixed all clippy warnings including result_large_err, derivable_impls, and should_implement_trait
  • Error Handling: Improved error message formatting and Display implementations for better debugging experience

Removed

  • Hardcoded Logic: Eliminated all hardcoded K8s and Crossplane special cases (now in TOML configuration)
  • Inline Imports: All imports now properly hoisted to module level
  • Hardcoded Module Aliases: Replaced with pattern-based extraction from import paths

- Comprehensive type coverage expansion (199→321 Kubernetes types)
- Fixed critical required field usability issue making types practical to use
- Added recursive type discovery replacing hardcoded namespace lists
- Support for unversioned types (RawExtension, IntOrString) in v0 directory
- Enhanced cross-package import resolution with full package IDs
- Reserved keyword escaping for JSON Schema fields
- Updated to Kubernetes v1.33.4 schema version
@seryl seryl merged commit 362165d into main Sep 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant