docs(phase287): Mark P4 complete, add P5 instructions
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
# Self Current Task — Now (main)
|
||||
|
||||
## Current Focus: Phase 287 P4(Plan stage modularization)
|
||||
## Current Focus: Phase 287 P5(Stages visibility facade)
|
||||
|
||||
**2025-12-27: Phase 188.3 完了** ✅
|
||||
- Pattern6(NestedLoopMinimal): `apps/tests/phase1883_nested_minimal.hako` が RC=9
|
||||
@ -32,7 +32,13 @@
|
||||
- `instruction_rewriter.rs` を stage 単位へ物理分割(Scan/Plan/Apply)し、facade(orchestrator)へ縮退(意味論不変)
|
||||
- 検証: 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 287(P4)**: `rewriter/stages/plan.rs` の責務分割(意味論不変)
|
||||
- 指示書: `docs/development/current/main/phases/phase-287/P4-PLAN_STAGE-MODULARIZATION-INSTRUCTIONS.md`
|
||||
1. **Phase 287(P5)**: `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 freeze(RC/weak/ABI)
|
||||
- 相談パケット: `docs/development/current/main/investigations/phase-29y-mir-lifecycle-vocab-consult.md`
|
||||
3. (future design, separate phase)Plan 生成の正規化(相談パケット)
|
||||
|
||||
@ -14,10 +14,10 @@ Related:
|
||||
- 次: Phase 288.2+(任意): REPL UX improvements(history / multiline / load 等)
|
||||
|
||||
- **Phase 287(active): 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 SSOT(patternに散らさない)**
|
||||
- 目的: `return` を “pattern最適化の個別実装” にせず、`ExitKind` と `compose::*` / `emit_frag()` に収束させる
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Phase 287 P4: `rewriter/stages/plan.rs` 分割指示書(意味論不変)
|
||||
|
||||
**Date**: 2025-12-27
|
||||
**Status**: Ready(next)
|
||||
**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` の再分割
|
||||
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
# Phase 287 P5: `rewriter/stages` 可視性引き締め指示書(意味論不変)
|
||||
|
||||
**Date**: 2025-12-27
|
||||
**Status**: Ready(next)
|
||||
**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 # facade(re-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 維持
|
||||
- 恒常ログ増加なし
|
||||
@ -1,6 +1,6 @@
|
||||
# Phase 287: Developer Hygiene(big 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 modularization(P4)✅
|
||||
|
||||
- `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` を facade(re-export)にする(意味論不変)。
|
||||
- 指示書: `docs/development/current/main/phases/phase-287/P5-STAGES-VISIBILITY-FACADE-INSTRUCTIONS.md`
|
||||
|
||||
---
|
||||
|
||||
## Legacy / Historical (2025-12-26 plan)
|
||||
|
||||
以下は「Phase 287 を hygiene として計画していた時期のログ」。今後の候補として残すが、P0/P1(big files)とは別系統。
|
||||
|
||||
Reference in New Issue
Block a user