feat(joinir): Phase 77 - BindingId expansion implementation (dev-only)

Phase 77 implements promoted_bindings population in DigitPos/Trim promoters
and deprecates legacy name-based resolution paths.

Changes:
- DigitPosPromoter: Added binding_map field and record_promoted_binding() calls
- TrimLoopHelper: Added binding_map field for ch → is_ch_match tracking
- Pattern2/4: Wired binding_map from builder.binding_map to promoters
- Legacy deprecation: Added #[deprecated] to resolve_promoted_join_id()
- Dual-path design: BindingId priority + name fallback maintained

Files modified (8):
- pattern2_with_break.rs, pattern4_with_continue.rs: binding_map wiring
- trim_loop_lowering.rs: Trim promoter integration
- carrier_info.rs: Deprecation warnings
- scope_manager.rs: Deprecated fallback paths
- loop_body_carrier_promoter.rs: Trim binding_map support
- loop_body_cond_promoter.rs: Orchestrator updates
- loop_body_digitpos_promoter.rs: DigitPos binding_map support

Tests: 958/958 PASS (zero regressions)
Design: Type-safe BindingId mapping replaces string-based promoted variable resolution

Phase 78+ will delete deprecated code (~50 lines) and make binding_map required.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-13 05:58:57 +09:00
parent 65ecd75529
commit 72173c1ac8
8 changed files with 153 additions and 2 deletions

View File

@ -250,6 +250,8 @@ fn promote_and_prepare_carriers(
break_cond: Some(&inputs.break_condition_node),
continue_cond: None,
loop_body: body,
#[cfg(feature = "normalized_dev")]
binding_map: Some(&builder.binding_map),
};
match LoopBodyCondPromoter::try_promote_for_condition(promotion_req) {

View File

@ -239,6 +239,8 @@ fn prepare_pattern4_context(
break_cond: None, // Pattern 4 has no break
continue_cond,
loop_body: &normalized_body,
#[cfg(feature = "normalized_dev")]
binding_map: Some(&builder.binding_map),
};
match LoopBodyCondPromoter::try_promote_for_condition(promotion_req) {

View File

@ -226,6 +226,8 @@ impl TrimLoopLowerer {
cond_scope: &cond_scope,
break_cond: Some(break_cond),
loop_body: body,
#[cfg(feature = "normalized_dev")]
binding_map: Some(&builder.binding_map),
};
match LoopBodyCarrierPromoter::try_promote(&request) {
@ -236,6 +238,9 @@ impl TrimLoopLowerer {
);
// Step 3: Convert to CarrierInfo and merge
#[cfg(feature = "normalized_dev")]
let promoted_carrier = trim_info.to_carrier_info(Some(&builder.binding_map));
#[cfg(not(feature = "normalized_dev"))]
let promoted_carrier = trim_info.to_carrier_info();
carrier_info.merge_from(&promoted_carrier);