docs(plan): Phase 273 P4 - Plan Line SSOT Documentation Finalization

Phase 273 P4 では、Plan ライン(Extractor → Normalizer → Verifier → Lowerer)を
"current operational SSOT" として文書化し、アーキテクチャの収束を明文化した。

## Changes

### router.rs docstring 更新
- "Phase 273 P3: Plan Line is Current SSOT for Pattern6/7" セクション追加
- ルーティング戦略を明示(Plan entry points → legacy table)
- SSOT Entry Points を列挙(Pattern6/7 Normalizer, Pattern1-5 各 Lowerer)

### phase-273/README.md 更新
- P3 completion section 追加(generalized CoreLoopPlan 移行完了)
- P3+ Legacy Removal section 追加(~174 lines 削除記録)
- P4 Proposal section 追加(Documentation Finalization チェックリスト)
- SSOT Documentation Entry Points リスト追加(5 つの SSOT 入口)

### joinir-architecture-overview.md 更新
- Section 2.1.2 "Plan-Based Patterns (Pattern6-7, Phase 273 P3)" 追加
- Plan Extractor, Normalizer, Verifier, Lowerer の Box 構造を文書化
- Plan line vs JoinIR line 比較表追加(収束性・SSOT 特性の対比)
- SSOT characteristics リスト追加(Normalizer SSOT, emit_frag SSOT 等)

## SSOT Entry Points(Phase 273 P3 完了時点)

1. **ルーティング**: `router.rs::route_loop_pattern()` - Pattern6/7 Plan entry points
2. **型定義**: `plan/mod.rs` - DomainPlan/CorePlan 固定語彙
3. **正規化**: `plan/normalizer.rs` - Pattern 固有知識一元管理
4. **検証**: `plan/verifier.rs` - fail-fast 不変条件(V2-V9)
5. **降格**: `plan/lowerer.rs` - Pattern-agnostic MIR emission

## Test

-  VM regression: phase254_p0_index_of_vm.sh (PASS)
-  LLVM regression: phase258_p0_index_of_string_llvm_exe.sh (PASS)

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-23 00:34:38 +09:00
parent 1b7fd7a0ff
commit 6f1d0df187
3 changed files with 168 additions and 12 deletions

View File

@ -278,13 +278,27 @@ pub(crate) static LOOP_PATTERNS: &[LoopPatternEntry] = &[
/// - No redundant pattern detection in detect functions
/// - All patterns use structure-based classification
///
/// # Phase 273 P1: DomainPlan → Normalizer → Verifier → Lowerer
/// # Phase 273 P3: Plan Line is Current SSOT for Pattern6/7
///
/// Pattern6 uses the new two-layer Plan architecture:
/// - extract_scan_with_init_plan() → DomainPlan (pure extraction)
/// - PlanNormalizer::normalize() → CorePlan (pattern knowledge expansion)
/// This function implements the following routing strategy:
/// 1. Try Plan-based Pattern6 (extract_scan_with_init_plan) → DomainPlan
/// 2. Try Plan-based Pattern7 (extract_split_scan_plan) → DomainPlan
/// 3. Fall through to legacy Pattern1-5 table for other patterns
///
/// The Plan line (Extractor → Normalizer → Verifier → Lowerer) is the
/// current operational SSOT for Pattern6/7. Legacy patterns (1-5) use
/// the traditional LoopPatternContext-based routing.
///
/// Plan-based architecture (Phase 273 P1-P3):
/// - extract_*_plan() → DomainPlan (pure extraction, no builder)
/// - PlanNormalizer::normalize() → CorePlan (pattern knowledge expansion, SSOT)
/// - PlanVerifier::verify() → fail-fast validation
/// - PlanLowerer::lower() → MIR emission (pattern-agnostic)
/// - PlanLowerer::lower() → MIR emission (pattern-agnostic, emit_frag SSOT)
///
/// SSOT Entry Points:
/// - Pattern6: src/mir/builder/control_flow/plan/normalizer.rs (ScanWithInit normalization)
/// - Pattern7: src/mir/builder/control_flow/plan/normalizer.rs (SplitScan normalization)
/// - Pattern1-5: src/mir/builder/control_flow/joinir/patterns/pattern*.rs (direct lowering)
pub(crate) fn route_loop_pattern(
builder: &mut MirBuilder,
ctx: &LoopPatternContext,