docs(phase29ao): add coreloop exitmap composition ssot (p20)

This commit is contained in:
2025-12-30 09:20:24 +09:00
parent 538061abe9
commit 6a2a0061ec
6 changed files with 104 additions and 9 deletions

View File

@ -2,12 +2,16 @@
## Current Focus: Phase 29aoCorePlan composition
Next: Phase 29ao P20CoreLoop ExitMap composition docs-first
指示書: `docs/development/current/main/phases/phase-29ao/P20-CORELOOP-EXITMAP-COMPOSITION-SSOT-INSTRUCTIONS.md`
Next: Phase 29ao P21TBD
指示書: TBD
運用ルール: integration filter で phase143_* は回さないJoinIR 回帰は phase29ae pack のみ)
運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う
移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
**2025-12-30: Phase 29ao P20 完了**
- 目的: CoreLoop の ExitMap/Cleanup/ValueJoin 合成規約を SSOT 化docs-only
- 変更: `docs/development/current/main/design/coreloop-exitmap-composition-ssot.md` / `docs/development/current/main/design/planfrag-ssot-registry.md` / `docs/development/current/main/phases/phase-29ao/README.md` / `docs/development/current/main/10-Now.md` / `docs/development/current/main/30-Backlog.md` / `CURRENT_TASK.md`
**2025-12-30: Phase 29ao P19 完了**
- 目的: regression gate に Pattern1 strict/dev shadow adopt を含め、回帰で必ず踏むSSOT化
- 変更: `tools/smokes/v2/profiles/integration/joinir/phase29ao_pattern1_strict_shadow_vm.sh` / `tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh` / `docs/development/current/main/phases/phase-29ae/README.md`

View File

@ -15,8 +15,8 @@ Related:
- **Phase 29aoactive: CorePlan composition from Skeleton/Feature**
- 入口: `docs/development/current/main/phases/phase-29ao/README.md`
- 状況: P0P19 ✅ 完了 / Next: P20CoreLoop ExitMap composition docs-first
- Next 指示書: `docs/development/current/main/phases/phase-29ao/P20-CORELOOP-EXITMAP-COMPOSITION-SSOT-INSTRUCTIONS.md`
- 状況: P0P20 ✅ 完了 / Next: P21TBD
- Next 指示書: TBD
- **Phase 29af✅ COMPLETE: Boundary hygiene / regression entrypoint / carrier layout SSOT**
- 入口: `docs/development/current/main/phases/phase-29af/README.md`

View File

@ -0,0 +1,83 @@
---
Status: SSOT
Scope: CoreLoopLoop skeletonに対する ExitMap/Cleanup/ValueJoin の合成規約
Related:
- docs/development/current/main/design/coreplan-skeleton-feature-model.md
- docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md
- docs/development/current/main/design/post-phi-final-form-ssot.md
- docs/development/current/main/design/edgecfg-fragments.md
- docs/development/current/main/design/planfrag-freeze-taxonomy.md
- docs/development/current/main/design/coreplan-migration-roadmap-ssot.md
---
# CoreLoop ExitMap Composition (SSOT)
目的: Loop skeleton に ExitMap/Cleanup/ValueJoin を合成する規約を 1 枚に固定し、Normalizer/Composer/Emit の責務境界を揺らさない。
## 1. Vocabulary語彙
- **ExitKind**: `Return` / `Break(loop_id)` / `Continue(loop_id)`(将来 `Unwind`
- **ExitMap presence**:
- `exit_kinds_present` は “存在集合” の SSOTFacts/Canonical の投影)
- `Frag.exits` は “出口エッジ” の SSOTpresence と実エッジを同じ語彙で扱う)
- **Cleanup presence**:
- `cleanup_kinds_present` は ExitKind 語彙として扱う
- cleanup の意味論は `exitkind-cleanup-effect-contract-ssot.md` に従う
- **ValueJoin**:
- join 値は `Frag.block_params``EdgeArgs(values)` で表現する
- `EdgeArgs.layout``post-phi-final-form-ssot.md` の SSOT に従う
## 2. Composition Rules合成規約
### 2.1 ExitMap presence の投影
- `exit_kinds_present``Frag.exits` に投影するpresence を SSOT 化)
- presence は “実エッジの有無” を保証しない(後段で edge を作る責務は Normalizer/Composer
- emit/merge が CFG/AST を再解析して exit を推測するのは禁止
### 2.2 Exit edges実エッジの責務
- `Continue(loop_id)` は header へ、`Break(loop_id)` は after へ配線する
- `Return`/`Unwind` は外側へ伝搬するLoop 内で勝手に消費しない)
- ループ内で “exit edge を増やす” ことはせず、`Frag.exits` を入口 SSOT として扱う
### 2.3 Cleanup
- cleanup は ExitKind の語彙に属するpattern 固有の挿入は禁止)
- 合成は `compose::cleanup` を唯一の入口にする
- cleanup の前後関係は `exitkind-cleanup-effect-contract-ssot.md` に従う
### 2.4 ValueJoin
- join 値が必要な場合、`Frag.block_params` を必ず使うPHI の暗黙推論は禁止)
- `EdgeArgs.layout` は join 入力の順序SSOTで固定する
- `emit_frag()` が PHI 挿入の唯一の接続点(他の層で PHI を作らない)
### 2.5 責務境界Fail-Fast を前提にする)
- Facts: presence までedge/PHI を作らない)
- Normalizer/Composer: `Frag``block_params` を作る
- Emit: `Frag` の情報をそのまま PHI/terminator に落とす(再推論禁止)
## 3. Fail-Fast / VerifySSOT
- **Ok(None)**:
- Skeleton が Loop でない / 対象外StraightLine 等)
- **Freeze(unstructured)**:
- Loop skeleton が一意に決まらないirreducible / multi-entry
- **Freeze(unsupported)**:
- `Unwind` 等、ExitKind 語彙はあるが現実装が扱えない
- **Freeze(contract)**:
- `exit_kinds_present``Frag.exits` が矛盾する
- `Frag.block_params``EdgeArgs.layout/values` が整合しない
検証の入口:
- `planfrag-freeze-taxonomy.md` のタグを使用strict/dev で Fail-Fast
- `edgecfg-fragments.md``verify_*` を通すrelease は挙動不変)
## 4. References入口
- CorePlan Skeleton/Feature model: `docs/development/current/main/design/coreplan-skeleton-feature-model.md`
- ExitKind/Cleanup contract: `docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md`
- Post-PHI final form: `docs/development/current/main/design/post-phi-final-form-ssot.md`
- EdgeCFG/Frag SSOT: `docs/development/current/main/design/edgecfg-fragments.md`

View File

@ -30,3 +30,4 @@ Scope: JoinIR plan/frag 導線(仕様不変)
- Post-PHI final form SSOT: `docs/development/current/main/design/post-phi-final-form-ssot.md`
- Effect classification SSOT: `docs/development/current/main/design/effect-classification-ssot.md`
- ExitKind/Cleanup/Effect contract SSOT: `docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md`
- CoreLoop ExitMap composition SSOT: `docs/development/current/main/design/coreloop-exitmap-composition-ssot.md`

View File

@ -122,7 +122,11 @@ GateSSOT:
- `docs/development/current/main/phases/phase-29ae/README.md` の回帰セットに追記
- ねらい: P17/P18 の strict/dev shadow adopt が回帰ゲートで必ず踏まれる状態を SSOT 化
## P20: CoreLoop ExitMap compositiondocs-first
- 指示書: `docs/development/current/main/phases/phase-29ao/P20-CORELOOP-EXITMAP-COMPOSITION-SSOT-INSTRUCTIONS.md`
- ねらい: Loop skeleton に対する ExitMap/Cleanup/ValueJoin の合成規約を SSOT として固定
## Nextplanned
- P20: CoreLoop ExitMap compositiondocs-first
- 指示書: `docs/development/current/main/phases/phase-29ao/P20-CORELOOP-EXITMAP-COMPOSITION-SSOT-INSTRUCTIONS.md`
- P21: TBD