docs(phase287): Mark P5 complete, add P6 instructions

This commit is contained in:
2025-12-27 13:20:16 +09:00
parent ce2b4b97e5
commit 8d4472ddd3
5 changed files with 90 additions and 12 deletions

View File

@ -1,6 +1,6 @@
# Self Current Task — Now (main)
## Current Focus: Phase 287 P5Stages visibility facade
## Current Focus: Phase 287 P6Scan plan integration decision
**2025-12-27: Phase 188.3 完了**
- Pattern6NestedLoopMinimal: `apps/tests/phase1883_nested_minimal.hako` が RC=9
@ -38,7 +38,13 @@
- `rewriter/stages/plan.rs` を facade 化し、`rewriter/stages/plan/` 配下へ責務単位で分割(意味論不変)
- 検証: Build 0 errors / quick 154 PASS / 恒常ログ増加なし
- 入口: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
- 次の指示書P5: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
- 次の指示書P5: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`(完了)
**2025-12-27: Phase 287 P5 完了**
- `stages/mod.rs` を facade にして stage 関数を re-export単一入口化
- 検証: Build 0 errors / quick 154 PASS / 恒常ログ増加なし
- 入口: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
- 次の指示書P6: `docs/development/current/main/phases/phase-287/P6-SCAN_PLAN-INTEGRATION-INSTRUCTIONS.md`
**2025-12-27: Phase 188.2 完了**
- StepTreeの `max_loop_depth` を SSOT に採用Option A
@ -131,8 +137,8 @@
- quick smoke 154/154 PASS 維持、Pattern1/4 PoC 両方 PASS
**次のステップ**:
1. **Phase 287P5**: `rewriter/stages` の可視性引き締め(意味論不変
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
1. **Phase 287P6**: Scan plan 統合docs-first
- 指示書: `docs/development/current/main/phases/phase-287/P6-SCAN_PLAN-INTEGRATION-INSTRUCTIONS.md`
2. post self-host / docs-first**Phase 29y**: MIR lifecycle vocab freezeRC/weak/ABI
- 相談パケット: `docs/development/current/main/investigations/phase-29y-mir-lifecycle-vocab-consult.md`
3. future design, separate phasePlan 生成の正規化(相談パケット)

View File

@ -14,10 +14,10 @@ Related:
- 次: Phase 288.2+(任意): REPL UX improvementshistory / multiline / load 等)
- **Phase 287active: Big Files Refactoring follow-ups意味論不変**
- 状況: P0/P1/P2/P3/P4 ✅ 完了merge modularize / ast_feature_extractor facade / contract_checks facade / rewriter stages split / plan stage split
-P5: `rewriter/stages` の可視性引き締めstages/mod.rs facade
- 状況: P0/P1/P2/P3/P4/P5 ✅ 完了merge modularize / ast_feature_extractor facade / contract_checks facade / rewriter stages split / plan stage split / stages facade
-P6: Scan plan の扱いを決めて統合 or 削除docs-first
- 入口: `docs/development/current/main/phases/phase-287/README.md`
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
- 指示書: `docs/development/current/main/phases/phase-287/P6-SCAN_PLAN-INTEGRATION-INSTRUCTIONS.md`
- **Phase 284✅ COMPLETE: Return as ExitKind SSOTpatternに散らさない**
- 目的: `return` を “pattern最適化の個別実装” にせず、`ExitKind``compose::*` / `emit_frag()` に収束させる

View File

@ -1,8 +1,8 @@
# Phase 287 P5: `rewriter/stages` 可視性引き締め指示書(意味論不変)
**Date**: 2025-12-27
**Status**: Readynext
**Scope**: `src/mir/builder/control_flow/joinir/merge/rewriter/stages/` の stage 関数scan/plan/apply`stages/mod.rs` 経由の re-export に統一し、各 stage 実装ファイル側の可視性を `pub(super)` に縮退する
**Status**: Completed ✅
**Scope**: `src/mir/builder/control_flow/joinir/merge/rewriter/stages/` の stage 関数scan/plan/apply`stages/mod.rs` 経由の re-export に統一し、呼び出し側は `stages::{...}` のみを使用する(単一入口)
**Non-goals**: 仕様変更、エラータグ/ヒント文の変更、ログ出力変更、pipeline の順序/条件変更、ファイル分割の追加P5は “可視性と入口” のみ)
---

View File

@ -0,0 +1,65 @@
# Phase 287 P6: Scan plan 統合docs-first, 意味論不変の範囲で)
**Date**: 2025-12-27
**Status**: Readynext
**Scope**: `merge/instruction_rewriter.rs` の Stage 1scanで生成する `RewritePlan` を、Stage 2planへ “同じ意味” で反映するか、または Stage 1 を削除して pipeline を単純化するための判断を docs で固定する。
**Non-goals**: 挙動変更、ログ恒常増加、silent fallback 追加、テスト専用の暫定コード追加
---
## 背景(問題点)
現状の pipeline は “Scan → Plan → Apply” という構造だが、`RewritePlan` が Stage 2 で実質未使用になっており、同じ検出tail call / return など)を Stage 2 側で再走査している。
この状態は以下の問題を生む:
- “Scan の存在意義” が曖昧で、将来の保守時に二重修正が起きやすい
- Stage 境界の責務が不明瞭になりやすいread-only のはずが drift しやすい)
---
## 目的SSOT
- Scan の役割を SSOT として固定する(使うなら “何に使うか”、捨てるなら “なぜ捨てるか”)。
- 意味論不変を守ったまま、重複ロジックを解消するための “安全な最短ルート” を決める。
---
## 選択肢(決めること)
### Option A: Scan plan を Stage 2 に反映(維持)
- `RewritePlan` を Stage 2 の入力として使い、検出を 1 回に寄せる。
- 受け入れ条件:
- Stage 2 で “scan と同等の検出” を再計算しない
- out-of-scope は `Ok(None)` ではなく、現状通りの Fail-Fast 契約を維持fallback 禁止)
### Option B: Stage 1 を削除(単純化)
- Scan を消し、Stage 2 が唯一の “解析 + 変換” 入口になる。
- 受け入れ条件:
- debug/log の恒常出力差を出さない(既存 `debug` フラグに従う)
- pipeline の見通し(責務)を docs と module 構造で補強する
---
## 手順docs-first
1. `RewritePlan` の intended contract を 10 行程度で記述(何を “決めた” と見なすか)
2. Option A/B を選び、採用理由と不採用理由を 1 段落ずつ書く
3. 実装は “移動 + 入口統一” に限定するif 増殖や新条件を入れない)
---
## 検証(受け入れ基準)
```bash
cargo build --release
./tools/smokes/v2/run.sh --profile quick
./target/release/hakorune --backend vm apps/tests/phase1883_nested_minimal.hako # RC=9
```
受け入れ:
- Build: 0 errors
- quick: 154/154 PASS
- Pattern6: RC=9 維持
- 恒常ログ増加なし

View File

@ -1,6 +1,6 @@
# Phase 287: Developer Hygienebig files / smoke / normalizer
**Status**: In progress (P0/P1/P2/P3/P4 complete, P5 next)
**Status**: In progress (P0/P1/P2/P3/P4/P5 complete, P6 next)
**Date**: 2025-12-27
**Previous**: Phase 286 (Plan Line完全運用化)
@ -44,13 +44,20 @@ Phase 287 は「開発導線の整備(意味論不変)」を優先して、
---
## Next (P5)
## 2025-12-27 Update: Stages facadeP5
- pipeline 関数scan/plan/applyの可視性を引き締め、`stages/mod.rs` を facadere-exportにする(意味論不変)。
- pipeline 関数scan/plan/apply`stages/mod.rs` から re-export し、呼び出し側 import を単一入口へ統一した(意味論不変)。
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
---
## Next (P6)
- Stage-1/2/3 の “scan plan” が未使用なので、設計を固定してから統合する(または削除する)ための docs-first 指示書を作る。
- 指示書: `docs/development/current/main/phases/phase-287/P6-SCAN_PLAN-INTEGRATION-INSTRUCTIONS.md`
---
## Legacy / Historical (2025-12-26 plan)
以下は「Phase 287 を hygiene として計画していた時期のログ」。今後の候補として残すが、P0/P1big filesとは別系統。