Files
hakorune/docs/development/current
nyash-codex 9ea15e8417 feat(mir): Loop Canonicalizer Phase 4 - router parity verification
## Summary
既存 Router と Canonicalizer の選択が一致することを dev-only で検証。
不一致は理由付き Fail-Fast(strict mode)。

## Changes
- src/mir/builder/control_flow/joinir/routing.rs:
  - verify_router_parity() 実装
  - cf_loop_joinir_impl でパリティチェック呼び出し
  - 2つのユニットテスト追加
    - test_parity_check_mismatch_detected
    - test_parity_check_match_simple_while
- docs/development/current/main/phases/phase-137/phase-137-4-parity-verification.md:
  - Phase 4 完全ドキュメント

## Verification Modes
- Debug mode (HAKO_JOINIR_DEBUG=1): ログのみ
- Strict mode (HAKO_JOINIR_STRICT=1): 不一致でエラー

## Known Mismatch
- skip_whitespace pattern:
  - Canonicalizer: Pattern3IfPhi (構造認識)
  - Router: Pattern2Break (has_break優先)
  - Phase 5+ で分類ルール改善予定

## Tests
- Unit tests: 2 tests PASS
- Integration: skip_whitespace parity mismatch 検出確認
- cargo test --release --lib: 1046/1046 PASS

Phase 137-4 complete

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 05:51:57 +09:00
..