docs(phase29an): add p10 exitmap facts scaffold

This commit is contained in:
2025-12-30 03:10:16 +09:00
parent 0354c17eb7
commit 0428e5942f
4 changed files with 82 additions and 3 deletions

View File

@ -0,0 +1,69 @@
---
Status: Active
Scope: code仕様不変、Feature合成の足場
Related:
- docs/development/current/main/phases/phase-29an/README.md
- 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/phases/phase-29ae/README.md
---
# Phase 29an P10: ExitMap FeatureFacts の足場(型だけ先に追加、未接続)
Date: 2025-12-29
Status: Ready for execution
Scope: FeatureFacts を “ExitMap/cleanup 合成” に繋ぐ語彙の足場を作る(未接続、仕様不変)
## Objective
- Skeleton+Feature 合成の中核である `ExitMap` を、Facts 側の語彙として先に定義する
- P10 では **型と変換導線の足場だけ**(解析は次の P11 以降)
## Non-goals
- 既存ルーティング/観測/エラー文字列の変更
- `Ok(None)` gate の変更
- exit の対応付け(どの break/continue がどこへ)を推論する
- cleanup/value_join を実装するP12+
## Implementation
### Step 1: ExitKind/ExitMapFacts を feature_facts に追加SSOT語彙
Update:
- `src/mir/builder/control_flow/plan/facts/feature_facts.rs`
Add types最小:
- `enum ExitKindFacts { Return, Break, Continue }`
- `struct ExitMapFacts { kinds_present: std::collections::BTreeSet<ExitKindFacts> }`
Add field:
- `LoopFeatureFacts { exit_map: Option<ExitMapFacts>, ... }`
PopulateP10では未接続:
- `exit_map: None` を既定
注意:
- 既存の `ExitUsageFacts` はそのまま残すExitMapFacts を使うのは P11+
- `ExitKindFacts` は将来 `Unwind` を追加できる形にするP12以降
### Step 2: unit tests型・既定値の固定
Update/add tests in `feature_facts.rs`:
- `try_extract_loop_feature_facts()``exit_map: None` を返すこと
### Step 3: LoopFacts/CanonicalLoopFacts の projection は触らない(仕様不変)
P10では `canonicalize_loop_facts` の projection は増やさない。
projection拡張は P11 でまとめてやる)
## Verificationrequired
- `cargo build --release`
- `./tools/smokes/v2/run.sh --profile quick`
- `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
## Commit
- `git add -A && git commit -m \"phase29an(p10): add exitmap feature facts scaffold\"`

View File

@ -88,6 +88,11 @@ Status: ✅ COMPLETE実装コミット: `195b424cc`
- 指示書: `docs/development/current/main/phases/phase-29an/P9-SKELETON-UNIFICATION-INFERENCE-INSTRUCTIONS.md`
- ねらい: Skeleton 一意化の境界を Facts 側で SSOT 化(未接続、仕様不変)
Status: ✅ COMPLETE実装コミット: `0354c17eb`
## Nextplanned
- P10: Feature 合成ExitMap / ValueJoin / Cleanupを CorePlan 合成へ繋ぐ
- P10: ExitMap FeatureFacts の足場(型だけ先に追加、未接続)
- 指示書: `docs/development/current/main/phases/phase-29an/P10-EXITMAP-FEATURE-FACTS-SCAFFOLD-INSTRUCTIONS.md`
- P11: ExitMapFacts の “presence” を ExitUsageFacts から埋めるstill conservative
- P12: cleanup/value_join の足場型・projection・verifier だけ)を追加