Files
hakorune/docs/development/current/main/design/planfrag-ssot-registry.md

33 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Plan/Frag SSOT Registry (SSOT)
Status: Draft (Phase 29ai P2)
Scope: JoinIR plan/frag 導線(仕様不変)
目的: “真実の所在SSOT” を表で固定し、層が勝手に再解析/再推論して SSOT が崩れるのを防ぐ。
## SSOT Table
| Layer | SSOT (Truth) | Forbidden (Must Not) | Verification (Fail-Fast) |
|---|---|---|---|
| Facts | CFG/Terminator/境界情報から抽出した “観測” と “導出” を分離した Facts | planner が CFG を再走査する前提の不足した Facts を作る / emit が CFG を覗いて “穴埋め” | Facts 収集時: 契約違反は `Freeze(contract)`strict/dev は即Fail |
| Normalize | Facts の表現ゆれ除去(純変換) | 追加の解析CFG/AST を見に行く) / 値の意味を変える変形 | normalize 後の不変条件を `verify_*` で検証strict/dev |
| Planner | Canonical Facts → Plan候補集合→一意化 | pattern 名で入口分岐を公開APIに漏らす / emit の都合で再解析 | 0候補=Ok(None), 1候補=Ok(Some), 2+=Freeze(ambiguous) |
| Plan | DomainPlanpattern固有のSSOT語彙 | CFG 再解析が必要な “情報欠落” Plan / 二重Plan語彙 | emit 前に Plan の構造不変条件を検証strict/dev |
| Emit | Plan → Frag生成のみ | Facts/CFG に戻って再推論 / silent fallback | emit は入力不足を Freeze(bug/contract) で落とすstrict/dev |
| Frag | 生成結果EdgeCFG/JoinIR lowering の出力) | Frag が “真実” として再利用されること(派生物) | 既存の frag verifier / contract_checks を入口で実行 |
## Notes
- “Forbidden” は将来の if 地獄 / hidden fallback を防ぐための境界ガード。
- Verification は既存の `contract_checks` と整合する形で増やす(既定挙動は変えない)。
## References
- Entry: `docs/development/current/main/phases/phase-29ai/README.md`
- Plan/Frag overview: `docs/development/current/main/design/edgecfg-fragments.md`
- Pattern6/7 contracts: `docs/development/current/main/design/pattern6-7-contracts.md`
- CorePlan Skeleton/Feature model: `docs/development/current/main/design/coreplan-skeleton-feature-model.md`
- 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`