From 02368edd148b4173800aab527cca05a87dbc2015 Mon Sep 17 00:00:00 2001 From: tomoaki Date: Mon, 29 Dec 2025 18:43:29 +0900 Subject: [PATCH] docs(phase29an): add p6 planner skeleton gate --- CURRENT_TASK.md | 2 +- docs/development/current/main/10-Now.md | 7 ++- .../P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md | 61 +++++++++++++++++++ .../current/main/phases/phase-29an/README.md | 8 ++- 4 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 docs/development/current/main/phases/phase-29an/P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md diff --git a/CURRENT_TASK.md b/CURRENT_TASK.md index 1dc9620c..f2b33a1d 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/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md` +`docs/development/current/main/phases/phase-29an/P6-PLANNER-SKELETON-GATE-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 06de58c9..5057e665 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -2,7 +2,7 @@ ## Current Focus: Phase 29an(Skeleton/Feature Facts) -Next: Phase 29an P5(SkeletonFacts: if without else) +Next: Phase 29an P6(Planner skeleton gate) 運用ルール: integration filter で phase143_* は回さない(JoinIR 回帰は phase29ae pack のみ) 運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う 移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md` @@ -12,6 +12,11 @@ Next: Phase 29an P5(SkeletonFacts: if without else) - 変更: `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 P5 完了** ✅ +- 目的: SkeletonFacts の If2 判定を else 有無に依存しない形へ修正(未接続・仕様不変) +- 変更: `src/mir/builder/control_flow/plan/facts/skeleton_facts.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/P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md b/docs/development/current/main/phases/phase-29an/P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md new file mode 100644 index 00000000..0851f4ab --- /dev/null +++ b/docs/development/current/main/phases/phase-29an/P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md @@ -0,0 +1,61 @@ +--- +Status: Active +Scope: code(仕様不変、Plannerの骨格前提を明文化) +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/planfrag-freeze-taxonomy.md +- docs/development/current/main/phases/phase-29ae/README.md +--- + +# Phase 29an P6: Planner に Skeleton gate を追加(Loop 以外は Ok(None)、仕様不変) + +Date: 2025-12-29 +Status: Ready for execution +Scope: Planner の前提(LoopFacts は LoopSkeleton)をコードで明文化して、将来の Region plan へ繋ぐ + +## Objective + +- `build_plan_from_facts_ctx()` の入口で `skeleton.kind` を確認し、Loop 以外は **`Ok(None)`** へ倒す(fallback を維持) +- 現状は `LoopFacts` が loop 起点なので実質的に到達しないが、**SSOT としての境界**をコードに固定する + +## Non-goals + +- 候補の集合/順序/ログ/エラー文字列の変更 +- 新しい Freeze を追加して gate を壊す +- Skeleton の “一意化” を実装する(P7 以降) + +## Implementation + +Update: +- `src/mir/builder/control_flow/plan/planner/build.rs` + +### Step 1: skeleton gate を追加 + +`build_plan_from_facts_ctx()` 冒頭で: + +- `use crate::mir::builder::control_flow::plan::facts::skeleton_facts::SkeletonKind;` を追加 +- `match facts.facts.skeleton.kind { SkeletonKind::Loop => {}, _ => return Ok(None) }` + +注意: +- `Ok(None)` に倒す理由: 既定挙動を変えず legacy fallback を維持するため +- 将来 “対象っぽい” を Freeze にしたくなった場合は P7(Skeleton一意化)で taxonomy に従って実装する + +### Step 2: unit test を 1 本追加(SSOT固定) + +`build.rs` の `#[cfg(test)]` 内で、手動で `LoopFacts` を構築して `skeleton.kind=If2` を入れたケースを作り、 +`build_plan_from_facts_ctx(...)=Ok(None)` を確認する。 + +注意: +- ここは “仕様不変” のためのガードテスト。実行導線では発火しない想定。 + +## 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(p6): gate planner by skeleton kind"` + diff --git a/docs/development/current/main/phases/phase-29an/README.md b/docs/development/current/main/phases/phase-29an/README.md index ffcd4339..c1d90d22 100644 --- a/docs/development/current/main/phases/phase-29an/README.md +++ b/docs/development/current/main/phases/phase-29an/README.md @@ -62,7 +62,11 @@ Status: ✅ COMPLETE(実装コミット: `5ea120ca1`) - 指示書: `docs/development/current/main/phases/phase-29an/P5-SKELETON-IF-WITHOUT-ELSE-INSTRUCTIONS.md` - ねらい: SkeletonFacts の If2 判定を “else有無に依存しない” 形に修正し、SSOTとしての正しさを上げる(未接続・仕様不変) +Status: ✅ COMPLETE(実装コミット: `1319cbfb2`) + ## Next(planned) -- P6: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化 -- P7: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ +- P6: Planner に skeleton gate を追加(Loop 以外は Ok(None)、仕様不変) + - 指示書: `docs/development/current/main/phases/phase-29an/P6-PLANNER-SKELETON-GATE-INSTRUCTIONS.md` +- P7: Skeleton 一意化(0/1/2+ → None/Some/Freeze)を “骨格推論” に限定して SSOT 化 +- P8: Feature 合成(ExitMap / ValueJoin / Cleanup)を CorePlan 合成へ繋ぐ