diff --git a/CURRENT_TASK.md b/CURRENT_TASK.md index 4c0f45aa..1dc9620c 100644 --- a/CURRENT_TASK.md +++ b/CURRENT_TASK.md @@ -19,7 +19,7 @@ Scope: Repo root の旧リンク互換。現行の入口は `docs/development/cu `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` が移行タスクの Done 判定の入口。 **Next implementation (CorePlan Step-B / Facts SSOT)** -`docs/development/current/main/phases/phase-29an/P4-LOOPFACTS-REQUIRE-SKELETON-FEATURES-INSTRUCTIONS.md` +`docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md` **2025-12-29: Phase 29am P0 COMPLETE (CorePlan If/Exit lowerer/verifier)** CorePlan の If/Exit を lowerer/verifier で扱えるようにして、CorePlan 移行の土台を作った。 diff --git a/docs/development/current/main/10-Now.md b/docs/development/current/main/10-Now.md index a164211a..06de58c9 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -2,11 +2,16 @@ ## Current Focus: Phase 29an(Skeleton/Feature Facts) -Next: Phase 29an P4(LoopFacts require skeleton/features) +Next: Phase 29an P5(SkeletonFacts: if without else) 運用ルール: integration filter で phase143_* は回さない(JoinIR 回帰は phase29ae pack のみ) 運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う 移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` +**2025-12-29: Phase 29an P4 完了** ✅ +- 目的: LoopFacts が Some のとき skeleton/features が必ず揃うように型を引き締め(SSOT引き締め、仕様不変) +- 変更: `src/mir/builder/control_flow/plan/facts/loop_facts.rs` / `src/mir/builder/control_flow/plan/planner/build.rs` +- 検証: `cargo build --release` / `./tools/smokes/v2/run.sh --profile quick` / `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh` + **2025-12-29: Phase 29an P3 完了** ✅ - 目的: Freeze taxonomy の `unstructured` タグをコード語彙へ追加(未使用のまま、仕様不変) - 変更: `src/mir/builder/control_flow/plan/planner/freeze.rs` diff --git a/docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md b/docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md new file mode 100644 index 00000000..4c8c86f6 --- /dev/null +++ b/docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md @@ -0,0 +1,57 @@ +--- +Status: Active +Scope: code(仕様不変、SkeletonFacts のSSOT正しさ修正) +Related: +- docs/development/current/main/phases/phase-29an/README.md +- docs/development/current/main/design/coreplan-skeleton-feature-model.md +- docs/development/current/main/phases/phase-29ae/README.md +--- + +# Phase 29an P5: SkeletonFacts — `if` without `else` is still If2(SSOT correctness) + +Date: 2025-12-29 +Status: Ready for execution +Scope: SkeletonFacts の分類だけを正しくする(未接続、仕様不変) + +## Objective + +- `SkeletonFacts` が `ASTNode::If { else_body: None }` を **If2Skeleton** として分類できるようにする + - else が無くても CFG 上は “then / fallthrough” の 2 分岐 + join を持てるため、骨格としては If2 に含めるのが自然 +- 既存の JoinIR / Plan / Frag の挙動は一切触らない(未接続) + +## Non-goals + +- ルーティング順序・観測・エラー文字列の変更 +- Facts の `Ok(None)` gate の変更 +- SkeletonFacts の利用箇所を増やす(P5 は分類の正しさだけ) + +## Implementation + +Update: +- `src/mir/builder/control_flow/plan/facts/skeleton_facts.rs` + +### Step 1: If2 判定を else 有無に依存しない形へ + +Before(概念): +- `ASTNode::If { else_body: Some(_) } => If2` + +After: +- `ASTNode::If { .. } => If2` + +### Step 2: unit tests 追加/更新 + +`#[cfg(test)]` に以下を追加: +- `if` + `else_body: None` が `SkeletonKind::If2` になる +- (既存があるなら)`if` + `else_body: Some(_)` も `SkeletonKind::If2` のまま +- `match` が `SkeletonKind::BranchN` になる(最小) + +## Verification(required) + +- `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(p5): classify if-without-else as if2 skeleton"` + diff --git a/docs/development/current/main/phases/phase-29an/README.md b/docs/development/current/main/phases/phase-29an/README.md index 6dfedbde..ffcd4339 100644 --- a/docs/development/current/main/phases/phase-29an/README.md +++ b/docs/development/current/main/phases/phase-29an/README.md @@ -55,7 +55,14 @@ Status: ✅ COMPLETE(実装コミット: `aa8c12bcf`) - ねらい: LoopFacts が Some のとき、Skeleton/Feature は必ず揃っている(Option剥がしの散在を止める) - 重要: `Ok(None)` gate は不変 +Status: ✅ COMPLETE(実装コミット: `5ea120ca1`) + +## P5: SkeletonFacts — classify `if` without `else` as If2 (SSOT correctness, unused) + +- 指示書: `docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md` +- ねらい: SkeletonFacts の If2 判定を “else有無に依存しない” 形に修正し、SSOTとしての正しさを上げる(未接続・仕様不変) + ## Next(planned) -- P5: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化 -- P6: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ +- P6: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化 +- P7: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ