## Purpose Stop pattern number enumeration proliferation by establishing Frag composition API as the Single Source of Truth (SSOT) for structured control flow → CFG lowering. Pattern numbers (1-9+) are **symptom labels** for regression tests, NOT architectural concepts. The architectural SSOT is **Frag composition rules** (seq/if/loop/cleanup). ## Changes Summary **Phase A (Docs-only, no code)**: SSOT Positioning - edgecfg-fragments.md: Status Draft → Active SSOT (+243 lines) - Added 5 sections: Composition SSOT, Rules, Laws, Fail-Fast, Ownership - Documented 3-tier ownership model (Normalizer/Composition/Lowerer) - Established composition as pattern absorption destination - joinir-architecture-overview.md: Pattern absorption documentation (+90 lines) - Added Section 0.2: Pattern Number Absorption Destination - JoinIR vs Plan comparison (different extraction, same SSOT) - Pattern absorption status table (Pattern6/7 as Phase 280 targets) - phase-280/README.md: Full roadmap (new) **Phase B (API solidification)**: Contract Verification - compose.rs: Module-level + function-level Phase 280 docs (+149 lines) - Documented composition SSOT, ownership model, usage example - Added constraint/composition law sections to seq/if/loop/cleanup - Contract verification: All seq/if/loop contracts verified (no gaps) - Test gap analysis: No missing tests (wires/exits separation explicitly tested) **Phase C (Pattern preparation)**: Documentation-only - normalizer.rs: Pattern6/7 TODO comments (+10 lines) - Pattern6: Early exit doesn't fit compose::if_() → cleanup() target - Pattern7: 挙動不変保証難 → compose::if_() migration deferred to Phase 281 ## Impact - **Net +460 lines** (docs-heavy, minimal code) - **4 files modified**, 1 directory created - **SSOT established**: Frag composition is now THE absorption destination - **導線固定**: Clear migration path for Pattern6/7 (Phase 281+) - **No behavior change**: Documentation-only for Phase C (tests not run) ## Phase 280 Goal Achieved ✅ SSOT positioning + 導線固定 (NOT full migration - that's Phase 281) ✅ Phase A complete: Docs updated to "Active SSOT" ✅ Phase B complete: API contract verified and documented ✅ Phase C complete: Pattern6/7 hand-rolled locations documented ## Next Phase (Phase 281+) - Phase 281: Full Pattern6/7 absorption (replace hand-rolled with compose_*) - Phase 282: Router shrinkage (pattern numbers → test labels) - Phase 283+: Pattern8 and beyond 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Phase ドキュメント
このフォルダは、実装フェーズ(Phase 131, Phase 33 等)ごとの詳細記録を保管します。
現在の Phase
- Phase 139(DONE): post-if
post_kの return lowering をReturnValueLowererBoxに統一(出口 SSOT 完成) - Phase 140(DONE):
NormalizedExprLowererBox初版(pure expression のみ) - Phase 141 P0(DONE): impure 拡張点(contract)を SSOT 化(Call/MethodCall はまだ out-of-scope)
- Phase 141 P1(DONE): “既知 intrinsic だけ” を許可して段階投入(length0)
- Phase 141 P1.5(DONE): known intrinsic registry + available_inputs 3-source merge + diagnostics
- Phase 141 P2+(planned): Call/MethodCall 対応(effects + typing の段階投入)
- Phase 142-loopstmt P0(DONE): 正規化単位を statement(loop 1個)へ寄せる(パターン爆発を止める)
- Phase 142-loopstmt P1(DONE): LLVM EXE smoke(同 fixture)を追加
- Phase 143-loopvocab(planned): StepTree の語彙拡張(loop 内 if/break/continue を「語彙追加」で吸収)
- Phase 91–92: Selfhost depth‑2 coverage(P5b escape recognition → lowering)
- Phase 94–100: P5b escape E2E / Trim policy / pinned + accumulator(VM/LLVM EXE parity)
- Phase 102: real-app read_quoted loop regression(VM + LLVM EXE)
- Phase 103: if-only regression baseline(VM + LLVM EXE / plan)
- Phase 113: if-only partial assign parity(片側代入の保持 merge)
- Phase 107–109: real-app depth-scan / policy router SSOT / error hint SSOT
- Phase 110–112: ControlTree / StepTree(構造SSOT, dev-only)※設計SSOTは
../design/control-tree.md
Phase フォルダ構成(推奨)
phases/phase-131/
├── README.md (Phase 全体概要)
├── 131-03-llvm-lowering-inventory.md (LLVM 部分のテスト・検証)
├── 131-11-case-c-summary.md (Case C 実装サマリー)
└── phase131-11-case-c-root-cause-analysis.md (根本原因分析)
参照方法
- 現在の Phase を知りたい → ../10-Now.md
- 該当 Phase を詳しく知りたい → フォルダを開く
- 設計背景を知りたい → ../design/
- 調査ログを見たい → ../investigations/
Phase 命名規則
- ファイル名:
phase-<N>-<title>/(例:phase-131/) - 文書名:
<N>-<NN>-<topic>.md(例:131-11-case-c-summary.md)- Phase 番号で自然にソート可能
- 同一 Phase 内で段階的に追跡可能
作成ルール(SSOT)
詳しくは ../DOCS_LAYOUT.md を参照。
- ✅ 置き場所:
phases/phase-<N>/配下のみ - ✅ 内容: Phase の実装記録・進捗・チェックリスト・検証結果
- ❌ 避けるべき: 複数 Phase で参照される設計・アーキテクチャ(→ design/ へ)
最終更新: 2025-12-19