Commit Graph

1 Commits

Author SHA1 Message Date
1adf57ec54 refactor(mir): Extract BindingContext from MirBuilder (Phase 136 follow-up 4/7)
## Summary
Extracted binding management into dedicated BindingContext struct,
completing step 4 of 7 in the Context Box refactoring plan.

## Changes
- NEW: src/mir/builder/binding_context.rs (BindingContext struct + helpers)
- Modified 7 files to use binding_ctx (SSOT pattern with legacy sync)
- Added comprehensive unit tests for BindingContext

## Extracted Fields
- binding_map: BTreeMap<String, BindingId> → binding_ctx.binding_map

## Benefits
- Clear separation: BindingId mapping isolated from MirBuilder
- Better testability: BindingContext can be tested independently
- Consistent pattern: Same SSOT + legacy sync approach as previous steps

## Tests
- cargo test --release --lib: 1008/1008 passed
- phase135_trim_mir_verify.sh: PASS
- Backward compatibility: 100% maintained (deprecated fields synced)

## Progress
Phase 136 Context Extraction: 4/7 complete (57%)
-  Step 1: TypeContext
-  Step 2: CoreContext
-  Step 3: ScopeContext
-  Step 4: BindingContext (this commit)
-  Step 5: VariableContext
-  Step 6: MetadataContext
-  Step 7: RegionContext

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 20:40:23 +09:00