feat(joinir): Phase 231 - ExprLowerer/ScopeManager pilot implementation

Pilot implementation of unified expression lowering for Pattern2 break conditions:

New files:
- scope_manager.rs (280 lines) - ScopeManager trait + Pattern2ScopeManager
- expr_lowerer.rs (455 lines) - ExprLowerer with Condition context support

Features:
- Unified variable lookup across ConditionEnv/LoopBodyLocalEnv/CapturedEnv/CarrierInfo
- Pre-validation of condition AST before lowering
- Fail-safe design with fallback to legacy path
- 8 new unit tests (all pass)

Integration:
- Pattern2 break condition uses ExprLowerer for pre-validation
- Existing proven lowering path preserved
- Zero impact on existing functionality (890/897 tests pass)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-10 22:48:45 +09:00
parent b07329b37f
commit 13a676d406
10 changed files with 1427 additions and 75 deletions

View File

@ -128,6 +128,7 @@ ConditionPromotionResult::Promoted {
### E2E Test
**Test File**: `apps/tests/phase2235_p2_digit_pos_min.hako`
このテストは digit_pos 昇格と型整合性・SSA 安定性を確認するインフラ用途で、数値としての戻り値の意味論は今後の JsonParser 本体フェーズで定義する予定だよ。
**Success Criteria**:
- No type error ("unsupported compare Lt on Bool and Integer")