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

This commit is contained in:
2025-12-27 12:50:17 +09:00
parent 3c52ba954e
commit ad5b6085c1
5 changed files with 99 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# Self Current Task — Now (main)
## Current Focus: Phase 287 P4Plan stage modularization
## Current Focus: Phase 287 P5Stages visibility facade
**2025-12-27: Phase 188.3 完了**
- Pattern6NestedLoopMinimal: `apps/tests/phase1883_nested_minimal.hako` が RC=9
@ -32,7 +32,13 @@
- `instruction_rewriter.rs` を stage 単位へ物理分割Scan/Plan/Applyし、facadeorchestratorへ縮退意味論不変
- 検証: Build 0 errors / quick 154 PASS / 恒常ログ増加なし
- 入口: `docs/development/current/main/phases/phase-287/P3-INSTRUCTION_REWRITER-MODULARIZATION-INSTRUCTIONS.md`
- 次の指示書P4: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
- 次の指示書P4: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`(完了)
**2025-12-27: Phase 287 P4 完了**
- `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`
**2025-12-27: Phase 188.2 完了**
- StepTreeの `max_loop_depth` を SSOT に採用Option A
@ -125,8 +131,8 @@
- quick smoke 154/154 PASS 維持、Pattern1/4 PoC 両方 PASS
**次のステップ**:
1. **Phase 287P4**: `rewriter/stages/plan.rs` の責務分割(意味論不変)
- 指示書: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
1. **Phase 287P5**: `rewriter/stages` の可視性引き締め(意味論不変)
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-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 ✅ 完了merge modularize / ast_feature_extractor facade / contract_checks facade / rewriter stages split
-P4: `rewriter/stages/plan.rs` を責務単位で分割Plan stage の見える化
- 状況: 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
- 入口: `docs/development/current/main/phases/phase-287/README.md`
- 指示書: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
- **Phase 284✅ COMPLETE: Return as ExitKind SSOTpatternに散らさない**
- 目的: `return` を “pattern最適化の個別実装” にせず、`ExitKind``compose::*` / `emit_frag()` に収束させる

View File

@ -1,7 +1,7 @@
# Phase 287 P4: `rewriter/stages/plan.rs` 分割指示書(意味論不変)
**Date**: 2025-12-27
**Status**: Readynext
**Status**: Completed ✅
**Scope**: `src/mir/builder/control_flow/joinir/merge/rewriter/stages/plan.rs`~741行を “責務単位” に分割して読みやすくし、`plan.rs` は facade入口 + 組み立て)へ縮退する。
**Non-goals**: 仕様変更、エラータグ/ヒント文の変更、検出条件の追加/緩和、silent fallback 追加、恒常ログ増加、`merge/instruction_rewriter.rs` の再分割

View File

@ -0,0 +1,75 @@
# 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)` に縮退する。
**Non-goals**: 仕様変更、エラータグ/ヒント文の変更、ログ出力変更、pipeline の順序/条件変更、ファイル分割の追加P5は “可視性と入口” のみ)
---
## 目的SSOT
- “誰が stage 関数を呼べるか” を構造で明示し、API 面を薄くする(カプセル化)。
- `instruction_rewriter.rs` 側の import を単純化し、`stages/mod.rs` を pipeline の **唯一の入口**にする。
- 将来のリファクタでも “入口を 1 箇所” に保ち、迷子を防ぐ。
---
## 現状
- `stages/{scan,plan,apply}.rs` の関数が `pub(in crate::mir::builder::control_flow::joinir::merge)` になっており、実装側が外へ露出している。
- `instruction_rewriter.rs``stages::scan::scan_blocks` のように “実装ファイル名” を知っている。
---
## 目標(構造)
```
rewriter/stages/
├── mod.rs # facadere-export のみ)
├── scan.rs # pub(super) fn scan_blocks(...)
├── plan/ # pub(super) fn plan_rewrites(...)
└── apply.rs # pub(super) fn apply_rewrites(...)
```
- `instruction_rewriter.rs``use super::rewriter::stages::{scan_blocks, plan_rewrites, apply_rewrites};` のみ。
---
## 手順(安全な順序)
### Step 1: `stages/mod.rs` に re-export を追加
- `pub(in crate::mir::builder::control_flow::joinir::merge) use ...;` で 3 関数を re-export する。
- `scan::scan_blocks`
- `plan::plan_rewrites`
- `apply::apply_rewrites`
### Step 2: stage 関数の可視性を縮退
- `scan.rs` / `apply.rs` / `plan/mod.rs` の関数を `pub(super) fn ...` に変更。
### Step 3: `instruction_rewriter.rs` の import を単純化
- `stages::scan::...` などの “ファイル名 import” を削除して、`stages::{...}` に統一。
### Step 4: compile/check
- `cargo check -p nyash-rust --lib` が通ること。
- warnings は増やさない(既存は許容)。
---
## 検証手順(受け入れ基準)
```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 complete, P4 next)
**Status**: In progress (P0/P1/P2/P3/P4 complete, P5 next)
**Date**: 2025-12-27
**Previous**: Phase 286 (Plan Line完全運用化)
@ -37,13 +37,20 @@ Phase 287 は「開発導線の整備(意味論不変)」を優先して、
---
## Next (P4)
## 2025-12-27 Update: Plan stage modularizationP4
- `rewriter/stages/plan.rs`“責務単位” に分割し、Plan stage を読みやすくする(意味論不変)。
- `rewriter/stages/plan.rs`facade 化し、`rewriter/stages/plan/` 配下へ責務単位で分割した(意味論不変)。
- 指示書: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
---
## Next (P5)
- pipeline 関数scan/plan/applyの可視性を引き締め、`stages/mod.rs` を facadere-exportにする意味論不変
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
---
## Legacy / Historical (2025-12-26 plan)
以下は「Phase 287 を hygiene として計画していた時期のログ」。今後の候補として残すが、P0/P1big filesとは別系統。