From 7eeeb588e4166ed8be0764fb91f43539ba3b0b74 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Thu, 18 Dec 2025 06:28:39 +0900 Subject: [PATCH] docs: add Phase 125 entry (planned) --- .../current/main/01-JoinIR-Selfhost-INDEX.md | 16 +++++---- docs/development/current/main/10-Now.md | 1 + docs/development/current/main/30-Backlog.md | 4 +-- .../current/main/design/joinir-design-map.md | 1 + .../current/main/phases/phase-125/README.md | 33 +++++++++++++++++++ 5 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 docs/development/current/main/phases/phase-125/README.md diff --git a/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md b/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md index 126250a7..2f8b9d21 100644 --- a/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md +++ b/docs/development/current/main/01-JoinIR-Selfhost-INDEX.md @@ -84,17 +84,21 @@ JoinIR の箱構造と責務、ループ/if の lowering パターンを把握 - `docs/development/current/main/phases/phase-122/README.md` 25. Phase 123: Normalized semantics(Return literal + If minimal compare, dev-only) - `docs/development/current/main/phases/phase-123/README.md` -26. Phase 104: loop(true) break-only digits(VM + LLVM EXE) +26. Phase 124: Reads facts + Return(Variable from env)(dev-only) + - `docs/development/current/main/phases/phase-124/README.md` +27. Phase 125: Reads-only inputs → Normalized env(planned) + - `docs/development/current/main/phases/phase-125/README.md` +28. Phase 104: loop(true) break-only digits(VM + LLVM EXE) - `docs/development/current/main/phases/phase-104/README.md` -26. Phase 107: json_cur find_balanced_* depth scan(VM + LLVM EXE) +29. Phase 107: json_cur find_balanced_* depth scan(VM + LLVM EXE) - `docs/development/current/main/phases/phase-107/README.md` -27. Phase 108: Pattern2 policy router SSOT(入口の薄さを固定) +30. Phase 108: Pattern2 policy router SSOT(入口の薄さを固定) - `docs/development/current/main/phases/phase-108/README.md` -28. Phase 109: error_tags hints SSOT(Fail-Fast + hint の語彙固定) +31. Phase 109: error_tags hints SSOT(Fail-Fast + hint の語彙固定) - `docs/development/current/main/phases/phase-109/README.md` -29. MIR Builder(Context 分割の入口) +32. MIR Builder(Context 分割の入口) - `src/mir/builder/README.md` -30. Scope/BindingId(shadowing・束縛同一性の段階移行) +33. Scope/BindingId(shadowing・束縛同一性の段階移行) - `docs/development/current/main/phase73-scope-manager-design.md` - `docs/development/current/main/PHASE_74_SUMMARY.md` - `docs/development/current/main/PHASE_75_SUMMARY.md` diff --git a/docs/development/current/main/10-Now.md b/docs/development/current/main/10-Now.md index f9bb8369..cb7fd38e 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -8,6 +8,7 @@ - unknown-read capability 導入 - reads に基づく環境拡張(env に無い変数を reads から補完) - 既定挙動は不変(`joinir_dev_enabled()` のときだけ生成・検証) +- 入口(計画): `docs/development/current/main/phases/phase-125/README.md` ## 2025-12-18:Phase 124 完了 ✅ diff --git a/docs/development/current/main/30-Backlog.md b/docs/development/current/main/30-Backlog.md index 6aa391f2..a6328d64 100644 --- a/docs/development/current/main/30-Backlog.md +++ b/docs/development/current/main/30-Backlog.md @@ -20,8 +20,8 @@ Related: - **制御の再帰合成(docs-only → dev-only段階投入)** - ねらい: `loop/if` ネストの "構造" を SSOT(ControlTree/StepTree)で表せるようにする - 注意: canonicalizer は観測/構造SSOTまで(ValueId/PHI配線は Normalized 側へ) - - 現状: Phase 119–122(StepTree cond SSOT / facts→contract / shadow parity / JoinModule生成)まで完了 - - 次候補(Phase 123): if-only を Normalized semantics で実装(Return literal, If+Compare lowering) + - 現状: Phase 119–124(cond SSOT / facts→contract / shadow parity / JoinModule生成 / semantics / reads+return-var)まで完了 + - 次候補(Phase 125): reads-only inputs を Normalized env に載せる(return var from inputs / unknown-read capability) - 入口: `docs/development/current/main/design/control-tree.md` ## 中期(ループ在庫の残り) diff --git a/docs/development/current/main/design/joinir-design-map.md b/docs/development/current/main/design/joinir-design-map.md index 27ebf2b3..744edf2d 100644 --- a/docs/development/current/main/design/joinir-design-map.md +++ b/docs/development/current/main/design/joinir-design-map.md @@ -38,6 +38,7 @@ Related: 最近の改善(完了): - policy Reject の "hint" を `error_tags` に集約して、修正方針を 1 行で出せるようにした(Phase 109) - 構造SSOT(LoopSkeleton + StepTree)へ寄せて、policy/step箱の増殖先を “構造” に集約する足場を追加した(Phase 110–112) +- StepTree 側を “変換可能なSSOT” へ段階的に拡張(cond AST handle / facts→contract / shadow parity / if-only emit / reads facts / return var)(Phase 119–124) ## Error Tags with Hints (Phase 109) diff --git a/docs/development/current/main/phases/phase-125/README.md b/docs/development/current/main/phases/phase-125/README.md new file mode 100644 index 00000000..8ab55162 --- /dev/null +++ b/docs/development/current/main/phases/phase-125/README.md @@ -0,0 +1,33 @@ +# Phase 125: Reads-only inputs → Normalized env(planned) + +## 目的 + +- Phase 124 で `Return(Variable)` を “writes由来の env” だけで解決できるようになった。 +- Phase 125 では reads-only(外側スコープの読み取り専用入力)も Normalized env に載せ、`return x` が “writesではないが読み取り可能” な場合に自然に解決できるようにする。 +- 既定挙動は不変:`joinir_dev_enabled()` のときだけ生成・検証し、本番経路の出力/動作は変えない。 + +## Scope + +- 対象: if-only(loopなし)の Normalized(dev-only) +- 目的の追加機能: + - reads-only inputs を env に追加(return/compare で参照可能) + - “unknown-read” を capability(または structured error tags)として扱い、strict では Fail-Fast + +## SSOT 方針 + +- StepTreeFacts/Contract の `reads` は “何を読むか” の SSOT +- “どこから読むか(host ValueId の供給)” は builder 側で SSOT 化し、ScopeManager / CapturedEnv / function params を入力として受け取る +- AST から “勝手に capture する” のは禁止(Phase 100 の pinned/captured と混同しない) + +## 受け入れ基準 + +- `cargo test --lib` が PASS +- Phase 121–124 の smokes が退行しない +- Phase 125 の新規 fixture/smoke で `return` が reads-only inputs から解決できる + +## 関連 + +- Phase 121–124: StepTree→Normalized dev-only の段階投入 + - `docs/development/current/main/design/control-tree.md` + - `docs/development/current/main/phases/phase-121/README.md` + - `docs/development/current/main/phases/phase-124/README.md`