nyash-codex
903ab8ef4c
refactor(mir): Extract MetadataContext from MirBuilder (Phase 136 follow-up 6/7)
## Summary
Extracted metadata and debug information management into dedicated
MetadataContext struct, completing step 6 of 7 in the Context Box
refactoring plan.
## Changes
- NEW: src/mir/builder/metadata_context.rs (MetadataContext struct + helpers)
- Modified: src/mir/builder.rs (added metadata_ctx field + sync helpers)
- Modified: src/mir/hints.rs (added Clone + Debug derives to HintSink)
- Updated: phase-136-context-box-progress.md (6/7 progress)
## Extracted Fields
- current_span: Span → metadata_ctx.current_span
- source_file: Option<String> → metadata_ctx.source_file
- hint_sink: HintSink → metadata_ctx.hint_sink
- current_region_stack: Vec<RegionId> → metadata_ctx.current_region_stack
## Key Features
- Zero-cost type inference hints (HintSink)
- Source position tracking for error messages
- Region observation stack for debug builds
- Phase 135 contract_checks integration
## Tests
- cargo test --release --lib: 1019/1023 passed (4 pre-existing failures)
- phase135_trim_mir_verify.sh: PASS
- Backward compatibility: 100% maintained (deprecated fields synced)
## Progress
Phase 136 Context Extraction: 6/7 complete (86%)
- ✅ Step 1: TypeContext
- ✅ Step 2: CoreContext
- ✅ Step 3: ScopeContext
- ✅ Step 4: BindingContext
- ✅ Step 5: VariableContext
- ✅ Step 6: MetadataContext (this commit)
- ⏳ Step 7: CompilationContext
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 22:03:34 +09:00
..
2025-09-17 10:58:12 +09:00
2025-12-15 22:03:34 +09:00
2025-11-06 15:41:52 +09:00
2025-11-06 15:41:52 +09:00
2025-08-26 01:42:18 +09:00
2025-09-05 13:29:17 +09:00
2025-12-04 14:19:48 +09:00
2025-12-04 14:19:48 +09:00