feat(joinir): Phase 45 - JoinIR mode unification

Unified JoinIR routing logic through centralized JoinIrMode enum:

Key changes:
- Added JoinIrMode enum (StructuredOnly / NormalizedDev / NormalizedCanonical)
- Added current_joinir_mode() for centralized mode determination
- Refactored normalized_dev_enabled() as thin wrapper over mode enum
- Updated bridge.rs: mode-based routing with canonical P2-Core special handling
- Updated runner.rs: mode pattern matching for dev roundtrip path

Files modified:
- joinir_dev.rs: JoinIrMode enum + current_joinir_mode() (+49 lines)
- bridge.rs: Replaced boolean checks with mode pattern matching (+29 lines)
- runner.rs: Mode-based routing logic (+9 lines)
- CURRENT_TASK.md: Phase 45 implementation summary

Documentation:
- phase45-norm-mode-design.md: Complete design spec and implementation guide

Behavior preservation:
- Canonical P2-Core shapes: always Normalized→MIR(direct) (mode-independent)
- NormalizedDev mode: Structured→Normalized→MIR for supported shapes
- StructuredOnly mode: Structured→MIR direct (default)

Tests: 937/937 PASS (no regression, pure refactor)

🤖 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-12 03:31:58 +09:00
parent ed8e2d3142
commit 879d3ee08e
5 changed files with 254 additions and 16 deletions

View File

@ -61,6 +61,11 @@
- JsonParser `_atoi` 本体の Program(JSON) フィクスチャを normalized_dev に追加し、Structured→Normalized→MIR(direct) と Structured→MIR の VM 出力を比較するテストで一致を固定(符号あり/なしの簡易パス対応。canonical 切替は後続フェーズ)。
- Phase 43-Cdev-only:
- JsonParser `_parse_number` 本体の Program(JSON) フィクスチャを normalized_dev に追加し、Structured→Normalized→MIR(direct) と Structured→MIR の VM 出力を比較するテストで一致を固定num_str は現状仕様のまま据え置き、P2-Mid の足慣らし)。
- **Phase 45-NORM-MODE実装済み✅ 2025-12-12**:
- JoinIR モード一本化: バラバラだったフラグ/feature を `JoinIrMode` enum に集約StructuredOnly / NormalizedDev / NormalizedCanonical
- `current_joinir_mode()` でモード取得、bridge/runner で `normalized_dev_enabled()` → mode pattern matching に移行。
- Canonical P2-Core は mode 無視で常に Normalized→MIR(direct)、それ以外は mode に従う統一ルーティング。
- 937/937 tests PASS既存挙動完全保持のリファクタ
### 1. いまコード側で意識しておきたいフォーカス