feat(joinir): Phase 76 - promoted_bindings map (dev-only)

Phase 76 introduces type-safe promotion tracking via promoted_bindings
(BindingId→BindingId map). Replaces fragile string matching hacks with
compiler-checked identity mapping.

Changes:
- carrier_info.rs: Added promoted_bindings field and resolution methods
- pattern4_carrier_analyzer.rs: Updated for BindingId integration
- pattern_pipeline.rs: Carrier resolution via promoted_bindings
- loop_with_break_minimal/tests.rs: Added promoted_bindings tests
- normalized/fixtures.rs: Extended with Phase 76 fixtures

Tests: 5/5 new unit tests PASS (record/resolve/merge/default/overwrite)
Tests: lib 958/958 PASS, normalized_dev 54/54 PASS (no regressions)

Design: Dual-path (BindingId OR name) enables gradual Phase 77+ transition.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-13 05:35:14 +09:00
parent c18dde238a
commit 11e68203c8
6 changed files with 588 additions and 0 deletions

View File

@ -71,6 +71,8 @@ impl Pattern4CarrierAnalyzer {
carriers: updated_carriers,
trim_helper: all_carriers.trim_helper.clone(),
promoted_loopbodylocals: all_carriers.promoted_loopbodylocals.clone(), // Phase 224
#[cfg(feature = "normalized_dev")]
promoted_bindings: all_carriers.promoted_bindings.clone(), // Phase 76
})
}
@ -294,6 +296,8 @@ mod tests {
],
trim_helper: None,
promoted_loopbodylocals: Vec::new(), // Phase 224
#[cfg(feature = "normalized_dev")]
promoted_bindings: std::collections::BTreeMap::new(), // Phase 76
};
// Analyze carriers

View File

@ -414,6 +414,8 @@ mod tests {
],
trim_helper: None,
promoted_loopbodylocals: Vec::new(), // Phase 224
#[cfg(feature = "normalized_dev")]
promoted_bindings: std::collections::BTreeMap::new(), // Phase 76
},
loop_scope: LoopScopeShapeBuilder::empty_body_locals(
BasicBlockId(0),
@ -453,6 +455,8 @@ mod tests {
whitespace_chars: vec![" ".to_string(), "\t".to_string()],
}),
promoted_loopbodylocals: Vec::new(), // Phase 224
#[cfg(feature = "normalized_dev")]
promoted_bindings: std::collections::BTreeMap::new(), // Phase 76
},
loop_scope: LoopScopeShapeBuilder::empty_body_locals(
BasicBlockId(0),