docs(phase29am): coreplan step-a if/exit implementation instructions

This commit is contained in:
2025-12-29 16:31:29 +09:00
parent ab49325f56
commit fd7e3fee35
5 changed files with 113 additions and 2 deletions

View File

@ -1,8 +1,8 @@
# Self Current Task — Now (main)
## Current Focus: Phase 29alCorePlan composition hardening / docs-first
## Current Focus: Phase 29amCorePlan Step-A implementation
Next: Phase 29al P4unwind を含む ExitKind 拡張: design only
Next: Phase 29am P0CorePlan::If/CorePlan::Exit lowerer/verifier
運用ルール: integration filter で phase143_* は回さないJoinIR 回帰は phase29ae pack のみ)
運用ルール: phase286_pattern9_* は legacy pack (SKIP) を使う
移行道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`

View File

@ -35,6 +35,11 @@ Related:
- Next: P4unwind を含む ExitKind 拡張: design only
- 道筋 SSOT: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
- **Phase 29amcandidate: CorePlan Step-A implementation (lowerer/verifier)**
- 入口: `docs/development/current/main/phases/phase-29am/README.md`
- Next: P0CorePlan::If/CorePlan::Exit lowerer/verifier
- Gate: `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
- **Phase 29aicandidate: Plan/Frag single-plannerFacts SSOT**
- 入口: `docs/development/current/main/phases/phase-29ai/README.md`
- Next: Phase 29ai P16TBD: promotion hint を JoinIR 側の orchestrator へ配線、挙動不変)

View File

@ -0,0 +1,81 @@
---
Status: Active
Scope: code仕様不変、ルーティング変更なし
Related:
- docs/development/current/main/phases/phase-29am/README.md
- docs/development/current/main/design/coreplan-migration-roadmap-ssot.md
- docs/development/current/main/design/effect-classification-ssot.md
- docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md
- docs/development/current/main/phases/phase-29ae/README.md
---
# Phase 29am P0: CorePlan lowerer/verifier “穴埋め” (If/Exit)
Date: 2025-12-29
Status: Ready for execution
Scope: `CorePlan::If` / `CorePlan::Exit` の lowerer/verifier を最小実装(仕様不変)
## Objective
- `CorePlan` を “構造SSOT” として使っていくために、lowerer が `CorePlan::If` / `CorePlan::Exit` を処理できる状態にする
- 既存の JoinIR/PlanFrag のルーティング順序・観測・エラー文字列(実行経路)は変えない
- CorePlan 単体テストで仕様を固定し、将来の合成Skeleton+Featureに備える
## Non-goals
- Facts/Planner/Normalizer の挙動変更(どのプランを採用するかは変えない)
- 既存プログラムの意味論変更quick / joinir regression gate は不変)
- 新 env var 追加
- 大規模リファクタ(最小差分)
## Implementation (critical order)
### Step 1: lowerer の未対応分岐を削るIf/Exit
Target:
- `src/mir/builder/control_flow/plan/lowerer.rs`
Work:
- `CorePlan::If(CoreIfPlan)` を lower できるようにする
- `CorePlan::Exit(CoreExitPlan)` を lower できるようにする
Rules (SSOT):
- effect/再順序は `docs/development/current/main/design/effect-classification-ssot.md` に従う
- cleanup/exit 境界は `docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md` に従う
- 既存の emit/merge は再解析しないCorePlan 入力だけで完結)
Notes:
- まず “standalone” 実装でよいLoop の内部に入る複合ケースは P1+ に回す)
- 可能なら `PlanVerifier` が落ちる条件(不変条件違反)を先に追加して fail-fast に寄せる
### Step 2: verifier の不変条件を最小追加
Target:
- `src/mir/builder/control_flow/plan/verifier.rs`
Work:
- `CoreIfPlan` の最小不変条件then/else の空、Exit の位置、など)を追加
- `CoreExitPlan` の最小不変条件loop 外の Break/Continue 禁止、など)を追加
### Step 3: 単体テストで仕様固定
Target (例):
- `src/mir/builder/control_flow/plan/verifier.rs` の tests
- または `src/mir/builder/control_flow/plan/lowerer.rs` の tests既存の流儀に合わせる
Tests (minimum):
- `CorePlan::Exit(Return)` が lower/verify できる
- `CorePlan::If` が lower/verify できるthen/else の片側だけ、両側、など)
- 不変条件違反は fail-fastErrになる
## 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 "phase29am(p0): implement coreplan if/exit lowering"`

View File

@ -0,0 +1,22 @@
---
Status: Active
Scope: CorePlan 実装準備lowerer/verifier の穴埋め、仕様不変で段階導入)
Related:
- docs/development/current/main/design/coreplan-migration-roadmap-ssot.md
- docs/development/current/main/design/effect-classification-ssot.md
- docs/development/current/main/design/exitkind-cleanup-effect-contract-ssot.md
- docs/development/current/main/phases/phase-29ae/README.md
---
# Phase 29am: CorePlan Step-A implementation (lowerer/verifier)
Goal: CorePlan で“組み立てる”移行を進める前に、`CorePlan` の語彙が単独でも lower/verify できる状態へ近づける。
SSOT 道筋: `docs/development/current/main/design/coreplan-migration-roadmap-ssot.md`
## P0: Implement CorePlan::If / CorePlan::Exit lowering (minimal)
- 指示書: `docs/development/current/main/phases/phase-29am/P0-COREPLAN-LOWERER-IF-EXIT-INSTRUCTIONS.md`
- ねらい: 既存のルーティング/観測を変えずに、CorePlan 側の “未対応エラー” を減らす(仕様不変)
- Gate: `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`