Files
hakorune/docs/development/current/main/design/planfrag-freeze-taxonomy.md

50 lines
1.9 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 Freeze Taxonomy (SSOT)
Status: Draft (Phase 29ai P2)
Scope: Facts → Plan仕様不変
目的: `Result<Option<Plan>, Freeze>` の “None と Freeze の境界” を規約として固定し、実装者の解釈差で挙動が揺れるのを防ぐ。
## Return Contract (SSOT)
### `Ok(None)` = NotApplicable
「plan 化の対象ではない」ため、既存経路に委譲して良い。
- 例:
- region が単純直列で、Plan/Frag を挟む必然がない
- 必須の入口条件が揃っていないloop/header/exit が確定できない等)※ただし “対象っぽい” 場合は Freeze
### `Ok(Some(plan))` = Unique plan
候補が一意に確定し、emit に必要な情報が揃っている。
### `Err(Freeze)` = Fail-Fastsilent fallback 禁止)
“対象っぽい” のに plan が一意化できない、または契約違反/禁止形が観測された。
## Tags (recommended)
- `plan/freeze:contract`
- 形が契約を破っている(例: 必須 step が欠落、join 入力の整合が崩れている)
- `plan/freeze:ambiguous`
- 複数候補が成立し、一意化できない(将来のルール追加で解消される可能性がある)
- `plan/freeze:unsupported`
- 一意に判定できるが、未実装で扱えない(“未対応” を誤って None にしない)
- `plan/freeze:bug`
- 不変条件が壊れている/到達してはいけない状態(実装バグ・内部矛盾)
## Message format (SSOT)
コード側の `Display` は安定化する(例):
- `"[plan/freeze:{tag}] {message}"`
必要なら hint を別枠で付ける(ログで検知しやすくする)。
## 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`