From a7dbc158789f8698e66e4564701fc60c8385e875 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Thu, 11 Dec 2025 00:33:04 +0900 Subject: [PATCH] feat(joinir): Phase 240-EX - Pattern2 header condition ExprLowerer integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implementation: - Add make_pattern2_scope_manager() helper for DRY - Header conditions use ExprLowerer for supported patterns - Legacy fallback for unsupported patterns - Fail-Fast on supported patterns that fail Tests: - 4 new tests (all pass) - test_expr_lowerer_supports_simple_header_condition_i_less_literal - test_expr_lowerer_supports_header_condition_var_less_var - test_expr_lowerer_header_condition_generates_expected_instructions - test_pattern2_header_condition_via_exprlowerer Also: Archive old phase documentation (34k lines removed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../cleanup/CLEANUP_PLAN_2025-11-04.md | 2 + .../cleanup/CLEANUP_REPORT_2025-11-04.md | 2 + .../cleanup/CLEANUP_SUMMARY_2025-11-06.md | 0 .../cleanup/CLEANUP_SWEEP.md | 0 .../cleanup/DUPLICATION_ANALYSIS_REPORT.md | 2 + .../cleanup/DUPLICATION_INDEX.md | 0 .../cleanup/EXECUTIVE_SUMMARY.md | 0 .../cleanup/INSTRUCTION_DEDUP_2025-11.md | 0 .../LEGACY_CODE_INVESTIGATION_REPORT.md | 3 +- .../cleanup/LEGACY_FILES_DETAILED_LIST.md | 0 .../cleanup/PHASE1_IMPLEMENTATION_GUIDE.md | 0 .../cleanup/PHASE2_REPORT_2025-11-04.md | 2 + .../cleanup/QUICK_CLEANUP_GUIDE.md | 0 .../cleanup/QUICK_REFERENCE.md | 0 .../cleanup/README.md | 0 .../cleanup/docs-reorg/PLAN.md | 4 +- .../cleanup/docs-reorg/REPORT.md | 2 + .../cleanup/legacy-byname-removal.md | 0 .../cleanup/mir-legacy-cleanup-phase1-2.md | 0 .../call-replacement-report-2025-11-01.md | 2 + docs/archive/phases/phase-170-197/README.md | 8 + .../phase170-c2-update-summary-design.md | 1 + .../phase-170-197}/phase170-d-fix-summary.md | 1 + .../phase170-d-fix-verification.md | 1 + .../phase-170-197}/phase170-d-impl-design.md | 1 + .../phase170-loop-condition-scope.md | 1 + .../phase170-valueid-boundary-analysis.md | 1 + .../phase170_hako_json_library_design.md | 1 + .../phase171-1-boundary-analysis.md | 1 + .../phase171-2-condition-inputs-design.md | 1 + .../phase171-2_hako_check_integration.md | 1 + .../phase171-3-implementation-report.md | 1 + .../phase171-pattern5-loop-inventory.md | 1 + .../phase171_jsonparserbox_implementation.md | 1 + .../phase172-trim-lowering-impl.md | 1 + .../phase172_implementation_results.md | 1 + .../phase172_jsonparserbox_expansion.md | 1 + .../phase173-2_completion_summary.md | 1 + .../phase173-2_implementation_complete.md | 1 + .../phase173-2_investigation_findings.md | 1 + .../phase173-2_using_resolver_mir_lowering.md | 1 + .../phase173-jsonparser-loop-recheck.md | 1 + .../phase173-jsonparser-p5-design.md | 1 + .../phase173-jsonparser-p5-impl.md | 1 + .../phase173_implementation_summary.md | 1 + .../phase173_task1-2_completion_report.md | 1 + .../phase173_task1_investigation.md | 1 + .../phase173_using_static_box_resolution.md | 1 + .../phase173b-boxification-assessment.md | 1 + .../phase174-jsonparser-loop-inventory-2.md | 1 + .../phase174-jsonparser-p5b-design.md | 1 + .../phase175-multicarrier-design.md | 1 + .../phase176-pattern2-limitations.md | 1 + .../phase177-carrier-evolution.md | 1 + .../phase177-parse-string-design.md | 1 + .../phase178-string-detection.md | 1 + .../phase179-generic-pattern-framework.md | 1 + .../phase180-trim-module-design.md | 1 + ...phase182-char-comparison-generalization.md | 1 + .../phase182-simple-loops-design.md | 1 + .../phase183-loopbodylocal-role-separation.md | 1 + .../phase184-body-local-mir-lowering.md | 1 + .../phase185-body-local-integration.md | 1 + .../phase186-body-local-init-lowering.md | 1 + .../phase187-string-update-design.md | 1 + .../phase189-jsonparser-mini-verification.md | 1 + .../phase189-select-instruction-inquiry.md | 1 + .../phase190-number-update-design.md | 1 + .../phase191-body-local-integration.md | 1 + .../phase192-complex-addend-design.md | 1 + ...ase192_loop_pattern_structure_detection.md | 1 + .../phase193-init-methodcall-design.md | 1 + .../phase193_5_multi_carrier_testing.md | 1 + .../phase193_exit_binding_builder.md | 1 + .../phase194-jsonparser-deployment.md | 1 + .../phase-170-197}/phase194-loop-inventory.md | 1 + .../phase-170-197}/phase194_joinlooptrace.md | 1 + .../phase195-impl-pattern3-multicarrier.md | 1 + .../phase195-pattern3-extension-design.md | 1 + .../phase196-select-bug-analysis.md | 1 + .../phase-170-197}/phase196-select-bug-fix.md | 1 + .../phase196_loop_continue_multi_carrier.md | 1 + .../phase197-lightweight-loops-deployment.md | 1 + .../phase197_pattern4_update_semantics.md | 1 + docs/archive/phases/phase-33/README.md | 9 ++ ...hase33-10-implementation-recommendation.md | 1 + ...ase33-10-joinir-merge-phi-loss-analysis.md | 1 + .../phase33-10-local-pattern-mir-analysis.md | 1 + .../phase33-11-exit-phi-bug-analysis.md | 1 + .../phase33-13-trim-pattern-observation.md | 1 + .../phase33-16-implementation-plan.md | 1 + .../phase33-16-loop-header-phi-design.md | 1 + .../phases/phase-33}/phase33-16-qa.md | 1 + .../phase33-16-refactoring-summary.md | 1 + .../phase-33}/phase33-16-visual-guide.md | 1 + .../phase33-17-implementation-complete.md | 1 + .../phase33-18-continue-pattern-inventory.md | 1 + .../phase33-20-loop-exit-semantics.md | 1 + .../phase33-22-common-pattern-initializer.md | 1 + .../phase33-23-refactoring-complete.md | 1 + .../phase-33}/phase33-duplication-map.md | 1 + .../phase-33}/phase33-optimization-guide.md | 1 + .../phases/phase-33}/phase33-post-analysis.md | 1 + .../reports/CLEANUP_REPORT_2025-11-04.md | 6 + .../reports/DUPLICATION_ANALYSIS_REPORT.md | 6 + .../LEGACY_CODE_INVESTIGATION_REPORT.md | 6 + .../reports/PHASE2_REPORT_2025-11-04.md | 6 + .../reports}/env-var-reduction-report.md | 2 + .../phi-generation-box-refactoring-plan.md | 2 + .../current/main/phase33-16-INDEX.md | 3 + ...ase33-17-joinir-modularization-analysis.md | 3 + docs/development/runtime/01-Runtime-INDEX.md | 41 +++++ docs/development/selfhosting/quickstart.md | 2 + .../selfhost_exe_stageb_quick_guide.md | 4 + src/mir/join_ir/lowering/expr_lowerer.rs | 68 +++++++- .../lowering/loop_with_break_minimal.rs | 153 ++++++++++++++++-- 116 files changed, 401 insertions(+), 18 deletions(-) rename docs/{development => archive}/cleanup/CLEANUP_PLAN_2025-11-04.md (99%) rename docs/{development => archive}/cleanup/CLEANUP_REPORT_2025-11-04.md (99%) rename docs/{development => archive}/cleanup/CLEANUP_SUMMARY_2025-11-06.md (100%) rename docs/{development => archive}/cleanup/CLEANUP_SWEEP.md (100%) rename docs/{development => archive}/cleanup/DUPLICATION_ANALYSIS_REPORT.md (99%) rename docs/{development => archive}/cleanup/DUPLICATION_INDEX.md (100%) rename docs/{development => archive}/cleanup/EXECUTIVE_SUMMARY.md (100%) rename docs/{development => archive}/cleanup/INSTRUCTION_DEDUP_2025-11.md (100%) rename docs/{development => archive}/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md (99%) rename docs/{development => archive}/cleanup/LEGACY_FILES_DETAILED_LIST.md (100%) rename docs/{development => archive}/cleanup/PHASE1_IMPLEMENTATION_GUIDE.md (100%) rename docs/{development => archive}/cleanup/PHASE2_REPORT_2025-11-04.md (99%) rename docs/{development => archive}/cleanup/QUICK_CLEANUP_GUIDE.md (100%) rename docs/{development => archive}/cleanup/QUICK_REFERENCE.md (100%) rename docs/{development => archive}/cleanup/README.md (100%) rename docs/{development => archive}/cleanup/docs-reorg/PLAN.md (99%) rename docs/{development => archive}/cleanup/docs-reorg/REPORT.md (99%) rename docs/{development => archive}/cleanup/legacy-byname-removal.md (100%) rename docs/{development => archive}/cleanup/mir-legacy-cleanup-phase1-2.md (100%) rename docs/{development => archive}/migration/call-replacement-report-2025-11-01.md (99%) create mode 100644 docs/archive/phases/phase-170-197/README.md rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-c2-update-summary-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-d-fix-summary.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-d-fix-verification.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-d-impl-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-loop-condition-scope.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170-valueid-boundary-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase170_hako_json_library_design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171-1-boundary-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171-2-condition-inputs-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171-2_hako_check_integration.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171-3-implementation-report.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171-pattern5-loop-inventory.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase171_jsonparserbox_implementation.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase172-trim-lowering-impl.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase172_implementation_results.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase172_jsonparserbox_expansion.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-2_completion_summary.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-2_implementation_complete.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-2_investigation_findings.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-2_using_resolver_mir_lowering.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-jsonparser-loop-recheck.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-jsonparser-p5-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173-jsonparser-p5-impl.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173_implementation_summary.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173_task1-2_completion_report.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173_task1_investigation.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173_using_static_box_resolution.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase173b-boxification-assessment.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase174-jsonparser-loop-inventory-2.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase174-jsonparser-p5b-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase175-multicarrier-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase176-pattern2-limitations.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase177-carrier-evolution.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase177-parse-string-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase178-string-detection.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase179-generic-pattern-framework.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase180-trim-module-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase182-char-comparison-generalization.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase182-simple-loops-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase183-loopbodylocal-role-separation.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase184-body-local-mir-lowering.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase185-body-local-integration.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase186-body-local-init-lowering.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase187-string-update-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase189-jsonparser-mini-verification.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase189-select-instruction-inquiry.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase190-number-update-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase191-body-local-integration.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase192-complex-addend-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase192_loop_pattern_structure_detection.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase193-init-methodcall-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase193_5_multi_carrier_testing.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase193_exit_binding_builder.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase194-jsonparser-deployment.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase194-loop-inventory.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase194_joinlooptrace.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase195-impl-pattern3-multicarrier.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase195-pattern3-extension-design.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase196-select-bug-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase196-select-bug-fix.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase196_loop_continue_multi_carrier.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase197-lightweight-loops-deployment.md (99%) rename docs/{development/current/main => archive/phases/phase-170-197}/phase197_pattern4_update_semantics.md (99%) create mode 100644 docs/archive/phases/phase-33/README.md rename docs/{development/current/main => archive/phases/phase-33}/phase33-10-implementation-recommendation.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-10-joinir-merge-phi-loss-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-10-local-pattern-mir-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-11-exit-phi-bug-analysis.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-13-trim-pattern-observation.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-16-implementation-plan.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-16-loop-header-phi-design.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-16-qa.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-16-refactoring-summary.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-16-visual-guide.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-17-implementation-complete.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-18-continue-pattern-inventory.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-20-loop-exit-semantics.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-22-common-pattern-initializer.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-23-refactoring-complete.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-duplication-map.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-optimization-guide.md (99%) rename docs/{development/current/main => archive/phases/phase-33}/phase33-post-analysis.md (99%) create mode 100644 docs/archive/reports/CLEANUP_REPORT_2025-11-04.md create mode 100644 docs/archive/reports/DUPLICATION_ANALYSIS_REPORT.md create mode 100644 docs/archive/reports/LEGACY_CODE_INVESTIGATION_REPORT.md create mode 100644 docs/archive/reports/PHASE2_REPORT_2025-11-04.md rename docs/{development/proposals => archive/reports}/env-var-reduction-report.md (99%) rename docs/{development/proposals => archive/reports}/phi-generation-box-refactoring-plan.md (99%) create mode 100644 docs/development/runtime/01-Runtime-INDEX.md diff --git a/docs/development/cleanup/CLEANUP_PLAN_2025-11-04.md b/docs/archive/cleanup/CLEANUP_PLAN_2025-11-04.md similarity index 99% rename from docs/development/cleanup/CLEANUP_PLAN_2025-11-04.md rename to docs/archive/cleanup/CLEANUP_PLAN_2025-11-04.md index 7628f832..7aebe0bf 100644 --- a/docs/development/cleanup/CLEANUP_PLAN_2025-11-04.md +++ b/docs/archive/cleanup/CLEANUP_PLAN_2025-11-04.md @@ -1,3 +1,5 @@ +Status: Historical + # 🧹 プロジェクト大掃除計画 2025-11-04 **作成日**: 2025-11-04 diff --git a/docs/development/cleanup/CLEANUP_REPORT_2025-11-04.md b/docs/archive/cleanup/CLEANUP_REPORT_2025-11-04.md similarity index 99% rename from docs/development/cleanup/CLEANUP_REPORT_2025-11-04.md rename to docs/archive/cleanup/CLEANUP_REPORT_2025-11-04.md index 39929c86..e1f0643f 100644 --- a/docs/development/cleanup/CLEANUP_REPORT_2025-11-04.md +++ b/docs/archive/cleanup/CLEANUP_REPORT_2025-11-04.md @@ -1,3 +1,5 @@ +Status: Historical + # 🧹 プロジェクト大掃除実行レポート 2025-11-04 **実行日時**: 2025-11-04 16:25 diff --git a/docs/development/cleanup/CLEANUP_SUMMARY_2025-11-06.md b/docs/archive/cleanup/CLEANUP_SUMMARY_2025-11-06.md similarity index 100% rename from docs/development/cleanup/CLEANUP_SUMMARY_2025-11-06.md rename to docs/archive/cleanup/CLEANUP_SUMMARY_2025-11-06.md diff --git a/docs/development/cleanup/CLEANUP_SWEEP.md b/docs/archive/cleanup/CLEANUP_SWEEP.md similarity index 100% rename from docs/development/cleanup/CLEANUP_SWEEP.md rename to docs/archive/cleanup/CLEANUP_SWEEP.md diff --git a/docs/development/cleanup/DUPLICATION_ANALYSIS_REPORT.md b/docs/archive/cleanup/DUPLICATION_ANALYSIS_REPORT.md similarity index 99% rename from docs/development/cleanup/DUPLICATION_ANALYSIS_REPORT.md rename to docs/archive/cleanup/DUPLICATION_ANALYSIS_REPORT.md index ce829b97..2ea3138c 100644 --- a/docs/development/cleanup/DUPLICATION_ANALYSIS_REPORT.md +++ b/docs/archive/cleanup/DUPLICATION_ANALYSIS_REPORT.md @@ -1,3 +1,5 @@ +Status: Historical + # Hakorune Rustコードベース 重複コード・共通化調査レポート ## 概要 diff --git a/docs/development/cleanup/DUPLICATION_INDEX.md b/docs/archive/cleanup/DUPLICATION_INDEX.md similarity index 100% rename from docs/development/cleanup/DUPLICATION_INDEX.md rename to docs/archive/cleanup/DUPLICATION_INDEX.md diff --git a/docs/development/cleanup/EXECUTIVE_SUMMARY.md b/docs/archive/cleanup/EXECUTIVE_SUMMARY.md similarity index 100% rename from docs/development/cleanup/EXECUTIVE_SUMMARY.md rename to docs/archive/cleanup/EXECUTIVE_SUMMARY.md diff --git a/docs/development/cleanup/INSTRUCTION_DEDUP_2025-11.md b/docs/archive/cleanup/INSTRUCTION_DEDUP_2025-11.md similarity index 100% rename from docs/development/cleanup/INSTRUCTION_DEDUP_2025-11.md rename to docs/archive/cleanup/INSTRUCTION_DEDUP_2025-11.md diff --git a/docs/development/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md b/docs/archive/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md similarity index 99% rename from docs/development/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md rename to docs/archive/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md index 2ccf4734..e9430c6c 100644 --- a/docs/development/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md +++ b/docs/archive/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md @@ -1,3 +1,5 @@ +Status: Historical + # Hakorune Legacy Code Investigation Report **調査日**: 2025-11-06 @@ -489,4 +491,3 @@ cargo test **調査担当**: Claude Code **次のアクション**: Phase A (Safe削除) の実行 - diff --git a/docs/development/cleanup/LEGACY_FILES_DETAILED_LIST.md b/docs/archive/cleanup/LEGACY_FILES_DETAILED_LIST.md similarity index 100% rename from docs/development/cleanup/LEGACY_FILES_DETAILED_LIST.md rename to docs/archive/cleanup/LEGACY_FILES_DETAILED_LIST.md diff --git a/docs/development/cleanup/PHASE1_IMPLEMENTATION_GUIDE.md b/docs/archive/cleanup/PHASE1_IMPLEMENTATION_GUIDE.md similarity index 100% rename from docs/development/cleanup/PHASE1_IMPLEMENTATION_GUIDE.md rename to docs/archive/cleanup/PHASE1_IMPLEMENTATION_GUIDE.md diff --git a/docs/development/cleanup/PHASE2_REPORT_2025-11-04.md b/docs/archive/cleanup/PHASE2_REPORT_2025-11-04.md similarity index 99% rename from docs/development/cleanup/PHASE2_REPORT_2025-11-04.md rename to docs/archive/cleanup/PHASE2_REPORT_2025-11-04.md index afadd58a..2b903519 100644 --- a/docs/development/cleanup/PHASE2_REPORT_2025-11-04.md +++ b/docs/archive/cleanup/PHASE2_REPORT_2025-11-04.md @@ -1,3 +1,5 @@ +Status: Historical + # 🧹 Phase 2 実行レポート 2025-11-04 **実行日時**: 2025-11-04 16:45 diff --git a/docs/development/cleanup/QUICK_CLEANUP_GUIDE.md b/docs/archive/cleanup/QUICK_CLEANUP_GUIDE.md similarity index 100% rename from docs/development/cleanup/QUICK_CLEANUP_GUIDE.md rename to docs/archive/cleanup/QUICK_CLEANUP_GUIDE.md diff --git a/docs/development/cleanup/QUICK_REFERENCE.md b/docs/archive/cleanup/QUICK_REFERENCE.md similarity index 100% rename from docs/development/cleanup/QUICK_REFERENCE.md rename to docs/archive/cleanup/QUICK_REFERENCE.md diff --git a/docs/development/cleanup/README.md b/docs/archive/cleanup/README.md similarity index 100% rename from docs/development/cleanup/README.md rename to docs/archive/cleanup/README.md diff --git a/docs/development/cleanup/docs-reorg/PLAN.md b/docs/archive/cleanup/docs-reorg/PLAN.md similarity index 99% rename from docs/development/cleanup/docs-reorg/PLAN.md rename to docs/archive/cleanup/docs-reorg/PLAN.md index 1aaf458b..37e06846 100644 --- a/docs/development/cleanup/docs-reorg/PLAN.md +++ b/docs/archive/cleanup/docs-reorg/PLAN.md @@ -1,3 +1,5 @@ +Status: Historical + # Nyash ドキュメント再編成計画 📚 ## 📊 現状の分析結果 @@ -273,4 +275,4 @@ archive/ - **検索時間短縮**: 必要な情報への到達が3クリック以内に - **メンテナンス性向上**: 新規ドキュメントの追加場所が明確 - **重複削減**: 18個のREADME → 5個程度に集約 -- **整理度**: 283ファイル → 適切に分類された構造 \ No newline at end of file +- **整理度**: 283ファイル → 適切に分類された構造 diff --git a/docs/development/cleanup/docs-reorg/REPORT.md b/docs/archive/cleanup/docs-reorg/REPORT.md similarity index 99% rename from docs/development/cleanup/docs-reorg/REPORT.md rename to docs/archive/cleanup/docs-reorg/REPORT.md index ac43c02a..33886b24 100644 --- a/docs/development/cleanup/docs-reorg/REPORT.md +++ b/docs/archive/cleanup/docs-reorg/REPORT.md @@ -1,3 +1,5 @@ +Status: Historical + # Nyash ドキュメント再編成報告書 📋 ## 実行日時 diff --git a/docs/development/cleanup/legacy-byname-removal.md b/docs/archive/cleanup/legacy-byname-removal.md similarity index 100% rename from docs/development/cleanup/legacy-byname-removal.md rename to docs/archive/cleanup/legacy-byname-removal.md diff --git a/docs/development/cleanup/mir-legacy-cleanup-phase1-2.md b/docs/archive/cleanup/mir-legacy-cleanup-phase1-2.md similarity index 100% rename from docs/development/cleanup/mir-legacy-cleanup-phase1-2.md rename to docs/archive/cleanup/mir-legacy-cleanup-phase1-2.md diff --git a/docs/development/migration/call-replacement-report-2025-11-01.md b/docs/archive/migration/call-replacement-report-2025-11-01.md similarity index 99% rename from docs/development/migration/call-replacement-report-2025-11-01.md rename to docs/archive/migration/call-replacement-report-2025-11-01.md index 40f81602..e432c597 100644 --- a/docs/development/migration/call-replacement-report-2025-11-01.md +++ b/docs/archive/migration/call-replacement-report-2025-11-01.md @@ -1,3 +1,5 @@ +Status: Historical + # call() Replacement Report - lang/src **Date:** 2025-11-01 diff --git a/docs/archive/phases/phase-170-197/README.md b/docs/archive/phases/phase-170-197/README.md new file mode 100644 index 00000000..6513b300 --- /dev/null +++ b/docs/archive/phases/phase-170-197/README.md @@ -0,0 +1,8 @@ +# Phase 170–197 Archive + +Status: Historical +Scope: JsonParser / JoinIR 実戦フェーズ(Phase 170〜197)の詳細メモ・設計・調査ログのアーカイブ。 + +Phase 170〜197 に関する設計や調査の詳細ドキュメントは、このディレクトリに集約しているよ。 +現行ラインからは、必要なものだけを `docs/development/current/main` 側で参照する前提だよ。 + diff --git a/docs/development/current/main/phase170-c2-update-summary-design.md b/docs/archive/phases/phase-170-197/phase170-c2-update-summary-design.md similarity index 99% rename from docs/development/current/main/phase170-c2-update-summary-design.md rename to docs/archive/phases/phase-170-197/phase170-c2-update-summary-design.md index ffabc5ac..155e25d1 100644 --- a/docs/development/current/main/phase170-c2-update-summary-design.md +++ b/docs/archive/phases/phase-170-197/phase170-c2-update-summary-design.md @@ -184,3 +184,4 @@ src/mir/join_ir/lowering/ 2. **差し替え容易**: 名前 → AST → MIR と段階的に精度向上可能 3. **テスト容易**: LoopUpdateSummary を直接テスト可能 4. **後方互換**: LoopFeatures.update_summary は Option なので影響最小 +Status: Historical diff --git a/docs/development/current/main/phase170-d-fix-summary.md b/docs/archive/phases/phase-170-197/phase170-d-fix-summary.md similarity index 99% rename from docs/development/current/main/phase170-d-fix-summary.md rename to docs/archive/phases/phase-170-197/phase170-d-fix-summary.md index 35fa86a3..a2fa5460 100644 --- a/docs/development/current/main/phase170-d-fix-summary.md +++ b/docs/archive/phases/phase-170-197/phase170-d-fix-summary.md @@ -224,3 +224,4 @@ NYASH_JOINIR_STRUCTURE_ONLY=1 \ --- **End of Report** +Status: Historical diff --git a/docs/development/current/main/phase170-d-fix-verification.md b/docs/archive/phases/phase-170-197/phase170-d-fix-verification.md similarity index 99% rename from docs/development/current/main/phase170-d-fix-verification.md rename to docs/archive/phases/phase-170-197/phase170-d-fix-verification.md index b429bcab..b061f3d8 100644 --- a/docs/development/current/main/phase170-d-fix-verification.md +++ b/docs/archive/phases/phase-170-197/phase170-d-fix-verification.md @@ -253,3 +253,4 @@ loop(pos < len) { ⚠️ **Next Blockers**: Method calls in loops (Pattern 5+ features, not bugs) **Overall Impact**: Significant progress - variable scope classification is now correct. Remaining errors are legitimate feature gaps, not misclassification bugs. +Status: Historical diff --git a/docs/development/current/main/phase170-d-impl-design.md b/docs/archive/phases/phase-170-197/phase170-d-impl-design.md similarity index 99% rename from docs/development/current/main/phase170-d-impl-design.md rename to docs/archive/phases/phase-170-197/phase170-d-impl-design.md index 2654ac97..d1146421 100644 --- a/docs/development/current/main/phase170-d-impl-design.md +++ b/docs/archive/phases/phase-170-197/phase170-d-impl-design.md @@ -458,3 +458,4 @@ true // ✅ FIX: Default to OuterLocal for function parameters - Extended scope heuristics - Condition simplification analysis - Method call support in loop conditions +Status: Historical diff --git a/docs/development/current/main/phase170-loop-condition-scope.md b/docs/archive/phases/phase-170-197/phase170-loop-condition-scope.md similarity index 99% rename from docs/development/current/main/phase170-loop-condition-scope.md rename to docs/archive/phases/phase-170-197/phase170-loop-condition-scope.md index 3479255f..1562166a 100644 --- a/docs/development/current/main/phase170-loop-condition-scope.md +++ b/docs/archive/phases/phase-170-197/phase170-loop-condition-scope.md @@ -108,3 +108,4 @@ LoopBodyLocal を含む条件式を扱いたくなった場合は: - それを新しい Pattern5 として設計すれば、既存 Pattern2/4 の仕様を崩さずに拡張できる。 このドキュメントは設計メモのみであり、実装は別フェーズ(Phase 170‑D‑impl など)で行う。 +Status: Historical diff --git a/docs/development/current/main/phase170-valueid-boundary-analysis.md b/docs/archive/phases/phase-170-197/phase170-valueid-boundary-analysis.md similarity index 99% rename from docs/development/current/main/phase170-valueid-boundary-analysis.md rename to docs/archive/phases/phase-170-197/phase170-valueid-boundary-analysis.md index 166605f0..afd081fb 100644 --- a/docs/development/current/main/phase170-valueid-boundary-analysis.md +++ b/docs/archive/phases/phase-170-197/phase170-valueid-boundary-analysis.md @@ -250,3 +250,4 @@ JoinInlineBoundary::new_inputs_only( 2. Update all 4 patterns 3. Re-run Phase 170 validation tests 4. Document the "always include condition variables in boundary" pattern +Status: Historical diff --git a/docs/development/current/main/phase170_hako_json_library_design.md b/docs/archive/phases/phase-170-197/phase170_hako_json_library_design.md similarity index 99% rename from docs/development/current/main/phase170_hako_json_library_design.md rename to docs/archive/phases/phase-170-197/phase170_hako_json_library_design.md index 34728ca2..c972ddfc 100644 --- a/docs/development/current/main/phase170_hako_json_library_design.md +++ b/docs/archive/phases/phase-170-197/phase170_hako_json_library_design.md @@ -316,3 +316,4 @@ CURRENT_TASK.md に Phase 170 セクションを追加(1-2 段落): **Phase**: 170(.hako JSON ライブラリ設計) **予定工数**: 2-3 時間 **難易度**: 低(調査 + ドキュメント化) +Status: Historical diff --git a/docs/development/current/main/phase171-1-boundary-analysis.md b/docs/archive/phases/phase-170-197/phase171-1-boundary-analysis.md similarity index 99% rename from docs/development/current/main/phase171-1-boundary-analysis.md rename to docs/archive/phases/phase-170-197/phase171-1-boundary-analysis.md index bcdb5988..ce7792af 100644 --- a/docs/development/current/main/phase171-1-boundary-analysis.md +++ b/docs/archive/phases/phase-170-197/phase171-1-boundary-analysis.md @@ -207,3 +207,4 @@ Proceed to Phase 171-2 for design decision. - Phase 170 Analysis: `phase170-valueid-boundary-analysis.md` - Phase 170 Completion: `phase170-completion-report.md` - JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md` +Status: Historical diff --git a/docs/development/current/main/phase171-2-condition-inputs-design.md b/docs/archive/phases/phase-170-197/phase171-2-condition-inputs-design.md similarity index 99% rename from docs/development/current/main/phase171-2-condition-inputs-design.md rename to docs/archive/phases/phase-170-197/phase171-2-condition-inputs-design.md index 2cc5cf98..e4a55c84 100644 --- a/docs/development/current/main/phase171-2-condition-inputs-design.md +++ b/docs/archive/phases/phase-170-197/phase171-2-condition-inputs-design.md @@ -416,3 +416,4 @@ This follows the "Fail-Fast" principle from CLAUDE.md. - Phase 171-1 Analysis: `phase171-1-boundary-analysis.md` - JoinInlineBoundary: `src/mir/join_ir/lowering/inline_boundary.rs` - Merge Logic: `src/mir/builder/control_flow/joinir/merge/mod.rs` +Status: Historical diff --git a/docs/development/current/main/phase171-2_hako_check_integration.md b/docs/archive/phases/phase-170-197/phase171-2_hako_check_integration.md similarity index 99% rename from docs/development/current/main/phase171-2_hako_check_integration.md rename to docs/archive/phases/phase-170-197/phase171-2_hako_check_integration.md index 4d4d513a..5c0c695b 100644 --- a/docs/development/current/main/phase171-2_hako_check_integration.md +++ b/docs/archive/phases/phase-170-197/phase171-2_hako_check_integration.md @@ -447,3 +447,4 @@ Phase 171-2 完了後: **実工数**: 2 時間(実装完了、using 制限発見) **難易度**: 中(統合 + テスト確認) **状態**: 実装完了(using 制限により Phase 173 で動作確認予定) +Status: Historical diff --git a/docs/development/current/main/phase171-3-implementation-report.md b/docs/archive/phases/phase-170-197/phase171-3-implementation-report.md similarity index 99% rename from docs/development/current/main/phase171-3-implementation-report.md rename to docs/archive/phases/phase-170-197/phase171-3-implementation-report.md index bf689a5a..0910b7cc 100644 --- a/docs/development/current/main/phase171-3-implementation-report.md +++ b/docs/archive/phases/phase-170-197/phase171-3-implementation-report.md @@ -276,3 +276,4 @@ Finished `release` profile [optimized] target(s) in 0.07s - Phase 171-1 Analysis: `phase171-1-boundary-analysis.md` - Phase 171-2 Design: `phase171-2-condition-inputs-design.md` - JoinIR Design: `docs/development/current/main/phase33-10-if-joinir-design.md` +Status: Historical diff --git a/docs/development/current/main/phase171-pattern5-loop-inventory.md b/docs/archive/phases/phase-170-197/phase171-pattern5-loop-inventory.md similarity index 99% rename from docs/development/current/main/phase171-pattern5-loop-inventory.md rename to docs/archive/phases/phase-170-197/phase171-pattern5-loop-inventory.md index 8c8801fd..d3acaff4 100644 --- a/docs/development/current/main/phase171-pattern5-loop-inventory.md +++ b/docs/archive/phases/phase-170-197/phase171-pattern5-loop-inventory.md @@ -422,3 +422,4 @@ LoopBodyCarrierPromoter::try_promote() - [ ] Phase 172-2: JsonParser loops への展開 - Similar pattern recognition - Generalized carrier promotion +Status: Historical diff --git a/docs/development/current/main/phase171_jsonparserbox_implementation.md b/docs/archive/phases/phase-170-197/phase171_jsonparserbox_implementation.md similarity index 99% rename from docs/development/current/main/phase171_jsonparserbox_implementation.md rename to docs/archive/phases/phase-170-197/phase171_jsonparserbox_implementation.md index b75322c3..8631f17b 100644 --- a/docs/development/current/main/phase171_jsonparserbox_implementation.md +++ b/docs/archive/phases/phase-170-197/phase171_jsonparserbox_implementation.md @@ -491,3 +491,4 @@ Phase 171 MVP は正確性 > 速度を優先。最適化は Phase 173+ へ。 **予定工数**: 3-4 時間 **難易度**: 中(JSON パーサ実装 + .hako での Box 設計) **期待削減**: hako_check 行数 60%、コード共通化 100% +Status: Historical diff --git a/docs/development/current/main/phase172-trim-lowering-impl.md b/docs/archive/phases/phase-170-197/phase172-trim-lowering-impl.md similarity index 99% rename from docs/development/current/main/phase172-trim-lowering-impl.md rename to docs/archive/phases/phase-170-197/phase172-trim-lowering-impl.md index d3b16a61..fae2573e 100644 --- a/docs/development/current/main/phase172-trim-lowering-impl.md +++ b/docs/archive/phases/phase-170-197/phase172-trim-lowering-impl.md @@ -343,3 +343,4 @@ Phase 172 will **replace this early return** with actual lowering logic. - **Phase 171-C-5**: TrimLoopHelper design - **Pattern2 Lowerer**: `src/mir/builder/control_flow/joinir/patterns/pattern2_with_break.rs` - **Test File**: `local_tests/test_trim_main_pattern.hako` +Status: Historical diff --git a/docs/development/current/main/phase172_implementation_results.md b/docs/archive/phases/phase-170-197/phase172_implementation_results.md similarity index 99% rename from docs/development/current/main/phase172_implementation_results.md rename to docs/archive/phases/phase-170-197/phase172_implementation_results.md index 8534568d..9935772c 100644 --- a/docs/development/current/main/phase172_implementation_results.md +++ b/docs/archive/phases/phase-170-197/phase172_implementation_results.md @@ -292,3 +292,4 @@ box ProgramJSONBox { **実装者**: Claude Code (AI 協働開発) **レビュー日**: 2025-12-04 **Phase 状態**: 172 実装完了 ✅、173+ 提案あり +Status: Historical diff --git a/docs/development/current/main/phase172_jsonparserbox_expansion.md b/docs/archive/phases/phase-170-197/phase172_jsonparserbox_expansion.md similarity index 99% rename from docs/development/current/main/phase172_jsonparserbox_expansion.md rename to docs/archive/phases/phase-170-197/phase172_jsonparserbox_expansion.md index 5a651a70..5b6209e1 100644 --- a/docs/development/current/main/phase172_jsonparserbox_expansion.md +++ b/docs/archive/phases/phase-170-197/phase172_jsonparserbox_expansion.md @@ -489,3 +489,4 @@ for def in defs { **予定工数**: 2-3 時間 **難易度**: 低-中(既存実装の適用 + 薄いラッパー追加) **期待効果**: JSON 処理 SSOT 確立、selfhost depth-2 基盤完成 +Status: Historical diff --git a/docs/development/current/main/phase173-2_completion_summary.md b/docs/archive/phases/phase-170-197/phase173-2_completion_summary.md similarity index 99% rename from docs/development/current/main/phase173-2_completion_summary.md rename to docs/archive/phases/phase-170-197/phase173-2_completion_summary.md index 8fdb03c8..0da120af 100644 --- a/docs/development/current/main/phase173-2_completion_summary.md +++ b/docs/archive/phases/phase-170-197/phase173-2_completion_summary.md @@ -178,3 +178,4 @@ User/stakeholder should decide: **Outcome**: Investigation complete, two implementation options proposed **Recommendation**: Option 1 (minimal parser fix) **Estimated Completion**: 2-3 hours (Option 1) or 30 minutes (Option 2) +Status: Historical diff --git a/docs/development/current/main/phase173-2_implementation_complete.md b/docs/archive/phases/phase-170-197/phase173-2_implementation_complete.md similarity index 99% rename from docs/development/current/main/phase173-2_implementation_complete.md rename to docs/archive/phases/phase-170-197/phase173-2_implementation_complete.md index e99f5fe5..5f8b074f 100644 --- a/docs/development/current/main/phase173-2_implementation_complete.md +++ b/docs/archive/phases/phase-170-197/phase173-2_implementation_complete.md @@ -209,3 +209,4 @@ The core using resolver + MIR lowering integration is **functionally complete** **Investigation Time**: 2 hours **Complexity**: Medium (Runtime debugging required) **Blocking**: No (workarounds available) +Status: Historical diff --git a/docs/development/current/main/phase173-2_investigation_findings.md b/docs/archive/phases/phase-170-197/phase173-2_investigation_findings.md similarity index 99% rename from docs/development/current/main/phase173-2_investigation_findings.md rename to docs/archive/phases/phase-170-197/phase173-2_investigation_findings.md index e84a4eef..86be3cb1 100644 --- a/docs/development/current/main/phase173-2_investigation_findings.md +++ b/docs/archive/phases/phase-170-197/phase173-2_investigation_findings.md @@ -198,3 +198,4 @@ JsonParserBox.parse/1("{}") **Phase**: 173-2 Investigation **Outcome**: Strategy revision required **Recommendation**: Minimal parser fix (Option 1) +Status: Historical diff --git a/docs/development/current/main/phase173-2_using_resolver_mir_lowering.md b/docs/archive/phases/phase-170-197/phase173-2_using_resolver_mir_lowering.md similarity index 99% rename from docs/development/current/main/phase173-2_using_resolver_mir_lowering.md rename to docs/archive/phases/phase-170-197/phase173-2_using_resolver_mir_lowering.md index c996c723..91d252dd 100644 --- a/docs/development/current/main/phase173-2_using_resolver_mir_lowering.md +++ b/docs/archive/phases/phase-170-197/phase173-2_using_resolver_mir_lowering.md @@ -444,3 +444,4 @@ JsonParserBox が「正式な標準ライブラリ」として完全に機能す **予定工数**: 4-6 時間 **難易度**: 高(名前解決・MIR lowering の統合) **前提**: Phase 173 前半(Task 1-3)完了 +Status: Historical diff --git a/docs/development/current/main/phase173-jsonparser-loop-recheck.md b/docs/archive/phases/phase-170-197/phase173-jsonparser-loop-recheck.md similarity index 99% rename from docs/development/current/main/phase173-jsonparser-loop-recheck.md rename to docs/archive/phases/phase-170-197/phase173-jsonparser-loop-recheck.md index 9a263f2d..a7fbf602 100644 --- a/docs/development/current/main/phase173-jsonparser-loop-recheck.md +++ b/docs/archive/phases/phase-170-197/phase173-jsonparser-loop-recheck.md @@ -381,3 +381,4 @@ Phase 171 で実装した Trim パイプラインが、JsonParser の `_trim` - `_unescape_string` - Pattern1、LoopBodyLocal 問題なし(対象外) **Phase 173-3 での設計方針**: 既存の Trim パイプラインをそのまま活用 +Status: Historical diff --git a/docs/development/current/main/phase173-jsonparser-p5-design.md b/docs/archive/phases/phase-170-197/phase173-jsonparser-p5-design.md similarity index 99% rename from docs/development/current/main/phase173-jsonparser-p5-design.md rename to docs/archive/phases/phase-170-197/phase173-jsonparser-p5-design.md index 2a466899..3e0b9041 100644 --- a/docs/development/current/main/phase173-jsonparser-p5-design.md +++ b/docs/archive/phases/phase-170-197/phase173-jsonparser-p5-design.md @@ -308,3 +308,4 @@ loop(p < s.length()) { **ドキュメント成果物**: - `phase173-jsonparser-p5-impl.md` - 実装結果レポート - `CURRENT_TASK.md` - Phase 173 成果記録 +Status: Historical diff --git a/docs/development/current/main/phase173-jsonparser-p5-impl.md b/docs/archive/phases/phase-170-197/phase173-jsonparser-p5-impl.md similarity index 99% rename from docs/development/current/main/phase173-jsonparser-p5-impl.md rename to docs/archive/phases/phase-170-197/phase173-jsonparser-p5-impl.md index dd9a4505..3e2cdd38 100644 --- a/docs/development/current/main/phase173-jsonparser-p5-impl.md +++ b/docs/archive/phases/phase-170-197/phase173-jsonparser-p5-impl.md @@ -329,3 +329,4 @@ NYASH_JOINIR_CORE=1 NYASH_LEGACY_LOOPBUILDER=0 \ - 複雑なループへの拡張 - MethodCall 対応 - Execution 問題の解決 +Status: Historical diff --git a/docs/development/current/main/phase173_implementation_summary.md b/docs/archive/phases/phase-170-197/phase173_implementation_summary.md similarity index 99% rename from docs/development/current/main/phase173_implementation_summary.md rename to docs/archive/phases/phase-170-197/phase173_implementation_summary.md index 7503754f..b0b22b9b 100644 --- a/docs/development/current/main/phase173_implementation_summary.md +++ b/docs/archive/phases/phase-170-197/phase173_implementation_summary.md @@ -228,3 +228,4 @@ NYASH_CLI_VERBOSE=1 **更新日**: 2025-12-04 **Phase**: 173(using + 静的 Box メソッド解決) **進捗**: Task 1-2 完了(25%)/ Task 3-8 残り(75%) +Status: Historical diff --git a/docs/development/current/main/phase173_task1-2_completion_report.md b/docs/archive/phases/phase-170-197/phase173_task1-2_completion_report.md similarity index 99% rename from docs/development/current/main/phase173_task1-2_completion_report.md rename to docs/archive/phases/phase-170-197/phase173_task1-2_completion_report.md index af4851cd..0d017a6b 100644 --- a/docs/development/current/main/phase173_task1-2_completion_report.md +++ b/docs/archive/phases/phase-170-197/phase173_task1-2_completion_report.md @@ -330,3 +330,4 @@ local parser = new JsonLib.JsonParserBox() **Phase**: 173(using + 静的 Box メソッド解決) **進捗**: Task 1-2 完了(25%) **次タスク**: Task 3(JsonParserBox バグ修正)または Task 4(using resolver 修正) +Status: Historical diff --git a/docs/development/current/main/phase173_task1_investigation.md b/docs/archive/phases/phase-170-197/phase173_task1_investigation.md similarity index 99% rename from docs/development/current/main/phase173_task1_investigation.md rename to docs/archive/phases/phase-170-197/phase173_task1_investigation.md index 7e14426b..f1aa2c91 100644 --- a/docs/development/current/main/phase173_task1_investigation.md +++ b/docs/archive/phases/phase-170-197/phase173_task1_investigation.md @@ -262,3 +262,4 @@ local parser = new JsonLib.JsonParserBox() **作成日**: 2025-12-04 **調査時間**: 約2時間 **次のタスク**: Task 3(JsonParserBox バグ修正)または Task 2(仕様固定) +Status: Historical diff --git a/docs/development/current/main/phase173_using_static_box_resolution.md b/docs/archive/phases/phase-170-197/phase173_using_static_box_resolution.md similarity index 99% rename from docs/development/current/main/phase173_using_static_box_resolution.md rename to docs/archive/phases/phase-170-197/phase173_using_static_box_resolution.md index a2705cd4..62b795ed 100644 --- a/docs/development/current/main/phase173_using_static_box_resolution.md +++ b/docs/archive/phases/phase-170-197/phase173_using_static_box_resolution.md @@ -385,3 +385,4 @@ Phase 173 完了後: **予定工数**: 4-6 時間 **難易度**: 高(名前解決・MIR lowering の修正) **Rust VM 変更**: なし(.hako/using 側のみ) +Status: Historical diff --git a/docs/development/current/main/phase173b-boxification-assessment.md b/docs/archive/phases/phase-170-197/phase173b-boxification-assessment.md similarity index 99% rename from docs/development/current/main/phase173b-boxification-assessment.md rename to docs/archive/phases/phase-170-197/phase173b-boxification-assessment.md index 55bbce25..c45ba002 100644 --- a/docs/development/current/main/phase173b-boxification-assessment.md +++ b/docs/archive/phases/phase-170-197/phase173b-boxification-assessment.md @@ -115,3 +115,4 @@ - **Ready for Phase 34+**: No technical debt from this refactoring **Answer to user's question**: "It's simpler now, not complex!" ✨ +Status: Historical diff --git a/docs/development/current/main/phase174-jsonparser-loop-inventory-2.md b/docs/archive/phases/phase-170-197/phase174-jsonparser-loop-inventory-2.md similarity index 99% rename from docs/development/current/main/phase174-jsonparser-loop-inventory-2.md rename to docs/archive/phases/phase-170-197/phase174-jsonparser-loop-inventory-2.md index f8f418ff..08dd3812 100644 --- a/docs/development/current/main/phase174-jsonparser-loop-inventory-2.md +++ b/docs/archive/phases/phase-170-197/phase174-jsonparser-loop-inventory-2.md @@ -343,3 +343,4 @@ loop(pos < len) { 3. Phase 176: エスケープ処理追加(continue 対応) 4. Phase 177: _parse_number 対応(indexOf パターン) 5. Phase 178+: _parse_array/_parse_object(複雑ループ) +Status: Historical diff --git a/docs/development/current/main/phase174-jsonparser-p5b-design.md b/docs/archive/phases/phase-170-197/phase174-jsonparser-p5b-design.md similarity index 99% rename from docs/development/current/main/phase174-jsonparser-p5b-design.md rename to docs/archive/phases/phase-170-197/phase174-jsonparser-p5b-design.md index d4d174d1..798c0a2a 100644 --- a/docs/development/current/main/phase174-jsonparser-p5b-design.md +++ b/docs/archive/phases/phase-170-197/phase174-jsonparser-p5b-design.md @@ -360,3 +360,4 @@ NYASH_JOINIR_CORE=1 NYASH_LEGACY_LOOPBUILDER=0 \ **成功すれば**: - Trim P5 パイプラインが「Trim 専用」ではなく「文字比較ループ汎用」であることが証明される - Phase 175+ での拡張(複数キャリア・continue 等)の基盤が確立される +Status: Historical diff --git a/docs/development/current/main/phase175-multicarrier-design.md b/docs/archive/phases/phase-170-197/phase175-multicarrier-design.md similarity index 99% rename from docs/development/current/main/phase175-multicarrier-design.md rename to docs/archive/phases/phase-170-197/phase175-multicarrier-design.md index 6bf933da..58e14199 100644 --- a/docs/development/current/main/phase175-multicarrier-design.md +++ b/docs/archive/phases/phase-170-197/phase175-multicarrier-design.md @@ -278,3 +278,4 @@ bb12: // Exit block - **Phase 174**: P5 minimal PoC (quote detection only) - **Phase 176**: Pattern2 multi-carrier implementation ([phase176-completion-report.md](phase176-completion-report.md)) - **Pattern Space**: [docs/development/current/main/loop_pattern_space.md](loop_pattern_space.md) +Status: Historical diff --git a/docs/development/current/main/phase176-pattern2-limitations.md b/docs/archive/phases/phase-170-197/phase176-pattern2-limitations.md similarity index 99% rename from docs/development/current/main/phase176-pattern2-limitations.md rename to docs/archive/phases/phase-170-197/phase176-pattern2-limitations.md index 85a16b72..e6ce7c4f 100644 --- a/docs/development/current/main/phase176-pattern2-limitations.md +++ b/docs/archive/phases/phase-170-197/phase176-pattern2-limitations.md @@ -234,3 +234,4 @@ The problem is that `lower_loop_with_break_minimal()` completely ignores `Carrie 3. **Integration Test**: Pattern 3 (trim) with Pattern 2 shape - Test case: `loop(pos < len) { if ch == ' ' { break } pos = pos + 1 }` - Verify sum/count carriers survive through break exits +Status: Historical diff --git a/docs/development/current/main/phase177-carrier-evolution.md b/docs/archive/phases/phase-170-197/phase177-carrier-evolution.md similarity index 99% rename from docs/development/current/main/phase177-carrier-evolution.md rename to docs/archive/phases/phase-170-197/phase177-carrier-evolution.md index 77a49567..cfa50db1 100644 --- a/docs/development/current/main/phase177-carrier-evolution.md +++ b/docs/archive/phases/phase-170-197/phase177-carrier-evolution.md @@ -163,3 +163,4 @@ _parse_string の制御フロー: - **Production 適用**: 構造は変えず、制御フローのみ追加(Phase 177+) → **「Carrier 数を固定して制御フローを段階的に複雑化」が正解** +Status: Historical diff --git a/docs/development/current/main/phase177-parse-string-design.md b/docs/archive/phases/phase-170-197/phase177-parse-string-design.md similarity index 99% rename from docs/development/current/main/phase177-parse-string-design.md rename to docs/archive/phases/phase-170-197/phase177-parse-string-design.md index ae7a3ce3..cb0d6460 100644 --- a/docs/development/current/main/phase177-parse-string-design.md +++ b/docs/archive/phases/phase-170-197/phase177-parse-string-design.md @@ -176,3 +176,4 @@ static box JsonParserStringTest3 { ## まとめ **Phase 177-A では、min2 と同型の Simple Case を Production 環境に適用する。** エスケープ処理は Phase 178 以降に回し、まず「2-carrier + break」の動作確認を優先する。 +Status: Historical diff --git a/docs/development/current/main/phase178-string-detection.md b/docs/archive/phases/phase-170-197/phase178-string-detection.md similarity index 99% rename from docs/development/current/main/phase178-string-detection.md rename to docs/archive/phases/phase-170-197/phase178-string-detection.md index 1bd41f3e..2d353e3e 100644 --- a/docs/development/current/main/phase178-string-detection.md +++ b/docs/archive/phases/phase-170-197/phase178-string-detection.md @@ -69,3 +69,4 @@ To support string loops, either: 2. Process loop body statements in MIR alongside JoinIR control flow (Option B) Phase 178 provides the detection foundation for future string support. +Status: Historical diff --git a/docs/development/current/main/phase179-generic-pattern-framework.md b/docs/archive/phases/phase-170-197/phase179-generic-pattern-framework.md similarity index 99% rename from docs/development/current/main/phase179-generic-pattern-framework.md rename to docs/archive/phases/phase-170-197/phase179-generic-pattern-framework.md index 826d3cda..2c935fb6 100644 --- a/docs/development/current/main/phase179-generic-pattern-framework.md +++ b/docs/archive/phases/phase-170-197/phase179-generic-pattern-framework.md @@ -372,3 +372,4 @@ Pattern 2 has complex Trim pattern logic (~100 lines) that: - **LoopScopeShapeBuilder**: `src/mir/builder/control_flow/joinir/patterns/loop_scope_shape_builder.rs` - **ConditionEnvBuilder**: `src/mir/builder/control_flow/joinir/patterns/condition_env_builder.rs` - **JoinIRConversionPipeline**: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs` +Status: Historical diff --git a/docs/development/current/main/phase180-trim-module-design.md b/docs/archive/phases/phase-170-197/phase180-trim-module-design.md similarity index 99% rename from docs/development/current/main/phase180-trim-module-design.md rename to docs/archive/phases/phase-170-197/phase180-trim-module-design.md index b90fb50e..ccab86b8 100644 --- a/docs/development/current/main/phase180-trim-module-design.md +++ b/docs/archive/phases/phase-170-197/phase180-trim-module-design.md @@ -321,3 +321,4 @@ return Err(format!( - Focus is on code organization and maintainability - Trim pattern logic remains identical, just relocated - Future Phase 181+ can build on this clean foundation +Status: Historical diff --git a/docs/development/current/main/phase182-char-comparison-generalization.md b/docs/archive/phases/phase-170-197/phase182-char-comparison-generalization.md similarity index 99% rename from docs/development/current/main/phase182-char-comparison-generalization.md rename to docs/archive/phases/phase-170-197/phase182-char-comparison-generalization.md index 3ab76c8a..236a29f5 100644 --- a/docs/development/current/main/phase182-char-comparison-generalization.md +++ b/docs/archive/phases/phase-170-197/phase182-char-comparison-generalization.md @@ -415,3 +415,4 @@ cargo test --release --lib pattern4 **Phase**: 182(CharComparison 汎用化の準備・設計) **ステータス**: ドキュメント・計画のみ(コード変更なし) **次フェーズ**: Phase 183(実装・リネーム) +Status: Historical diff --git a/docs/development/current/main/phase182-simple-loops-design.md b/docs/archive/phases/phase-170-197/phase182-simple-loops-design.md similarity index 99% rename from docs/development/current/main/phase182-simple-loops-design.md rename to docs/archive/phases/phase-170-197/phase182-simple-loops-design.md index eefea298..780c13d8 100644 --- a/docs/development/current/main/phase182-simple-loops-design.md +++ b/docs/archive/phases/phase-170-197/phase182-simple-loops-design.md @@ -126,3 +126,4 @@ Success criteria: - Phase 181: JsonParser loop analysis - Pattern detection: `src/mir/builder/control_flow/joinir/patterns/detection.rs` - P1/P2 lowerers: `src/mir/builder/control_flow/joinir/patterns/pattern{1,2}_*.rs` +Status: Historical diff --git a/docs/development/current/main/phase183-loopbodylocal-role-separation.md b/docs/archive/phases/phase-170-197/phase183-loopbodylocal-role-separation.md similarity index 99% rename from docs/development/current/main/phase183-loopbodylocal-role-separation.md rename to docs/archive/phases/phase-170-197/phase183-loopbodylocal-role-separation.md index 05ae08c5..04e9ff0e 100644 --- a/docs/development/current/main/phase183-loopbodylocal-role-separation.md +++ b/docs/archive/phases/phase-170-197/phase183-loopbodylocal-role-separation.md @@ -238,3 +238,4 @@ To support `_parse_number` and `_atoi` fully, we need: - Phase 181: JsonParser loop inventory - Phase 171-C: LoopBodyCarrierPromoter original design - Phase 170-D: LoopConditionScopeBox implementation +Status: Historical diff --git a/docs/development/current/main/phase184-body-local-mir-lowering.md b/docs/archive/phases/phase-170-197/phase184-body-local-mir-lowering.md similarity index 99% rename from docs/development/current/main/phase184-body-local-mir-lowering.md rename to docs/archive/phases/phase-170-197/phase184-body-local-mir-lowering.md index 2aeec103..2363a319 100644 --- a/docs/development/current/main/phase184-body-local-mir-lowering.md +++ b/docs/archive/phases/phase-170-197/phase184-body-local-mir-lowering.md @@ -372,3 +372,4 @@ loop(i < 5) { - **Phase 171-C**: LoopBodyCarrierPromoter original design - **carrier_update_emitter.rs**: Current update emission logic - **condition_env.rs**: Condition variable environment design +Status: Historical diff --git a/docs/development/current/main/phase185-body-local-integration.md b/docs/archive/phases/phase-170-197/phase185-body-local-integration.md similarity index 99% rename from docs/development/current/main/phase185-body-local-integration.md rename to docs/archive/phases/phase-170-197/phase185-body-local-integration.md index d9b2b001..f160fcd7 100644 --- a/docs/development/current/main/phase185-body-local-integration.md +++ b/docs/archive/phases/phase-170-197/phase185-body-local-integration.md @@ -674,3 +674,4 @@ If full expression lowering is too complex, **Phase 186-simple** could: 2. **Testing earlier would have caught this**: Phase 184 should have had E2E test 3. **Phase 185 assumption was wrong**: Assumed init lowering was done, it wasn't 4. **Clear scope boundaries needed**: "Infrastructure" vs "Full implementation" +Status: Historical diff --git a/docs/development/current/main/phase186-body-local-init-lowering.md b/docs/archive/phases/phase-170-197/phase186-body-local-init-lowering.md similarity index 99% rename from docs/development/current/main/phase186-body-local-init-lowering.md rename to docs/archive/phases/phase-170-197/phase186-body-local-init-lowering.md index b94f4cd2..9b7323b0 100644 --- a/docs/development/current/main/phase186-body-local-init-lowering.md +++ b/docs/archive/phases/phase-170-197/phase186-body-local-init-lowering.md @@ -529,3 +529,4 @@ loop(...) { ## Changelog - **2025-12-09**: Initial design document created +Status: Historical diff --git a/docs/development/current/main/phase187-string-update-design.md b/docs/archive/phases/phase-170-197/phase187-string-update-design.md similarity index 99% rename from docs/development/current/main/phase187-string-update-design.md rename to docs/archive/phases/phase-170-197/phase187-string-update-design.md index ef47f22f..00eff09b 100644 --- a/docs/development/current/main/phase187-string-update-design.md +++ b/docs/archive/phases/phase-170-197/phase187-string-update-design.md @@ -410,3 +410,4 @@ Phase 187 establishes a clear design for string update handling in JoinIR: **No code changes in Phase 187**—all design decisions documented for Phase 188+ implementation. **Next Phase**: Phase 188 - Implement StringAppendChar/Literal lowering (3-4 hours estimate). +Status: Historical diff --git a/docs/development/current/main/phase189-jsonparser-mini-verification.md b/docs/archive/phases/phase-170-197/phase189-jsonparser-mini-verification.md similarity index 99% rename from docs/development/current/main/phase189-jsonparser-mini-verification.md rename to docs/archive/phases/phase-170-197/phase189-jsonparser-mini-verification.md index b172bee1..d02190e1 100644 --- a/docs/development/current/main/phase189-jsonparser-mini-verification.md +++ b/docs/archive/phases/phase-170-197/phase189-jsonparser-mini-verification.md @@ -412,3 +412,4 @@ Three minimal test files created for verification: **Report Status**: ✅ Complete **Next Action**: Update CURRENT_TASK.md and roadmap documents +Status: Historical diff --git a/docs/development/current/main/phase189-select-instruction-inquiry.md b/docs/archive/phases/phase-170-197/phase189-select-instruction-inquiry.md similarity index 99% rename from docs/development/current/main/phase189-select-instruction-inquiry.md rename to docs/archive/phases/phase-170-197/phase189-select-instruction-inquiry.md index 82d0f016..a9dda89f 100644 --- a/docs/development/current/main/phase189-select-instruction-inquiry.md +++ b/docs/archive/phases/phase-170-197/phase189-select-instruction-inquiry.md @@ -350,3 +350,4 @@ static box Main { 🤖 **Created by**: Claude Code 📅 **Date**: 2025-12-05 🎯 **Target**: Phase 189 - Select Instruction MIR Bridge Implementation +Status: Historical diff --git a/docs/development/current/main/phase190-number-update-design.md b/docs/archive/phases/phase-170-197/phase190-number-update-design.md similarity index 99% rename from docs/development/current/main/phase190-number-update-design.md rename to docs/archive/phases/phase-170-197/phase190-number-update-design.md index afc721e0..8a99ac97 100644 --- a/docs/development/current/main/phase190-number-update-design.md +++ b/docs/archive/phases/phase-170-197/phase190-number-update-design.md @@ -980,3 +980,4 @@ Assignment { - **E2E 結果**: `phase190_atoi_impl.hako` → 12 ✅、`phase190_parse_number_impl.hako` → 123 ✅ - **制約**: body-local 変数 assignment は JoinIR 未対応(Phase 186 残タスク) - ExitLine contract Verifier 追加(`#[cfg(debug_assertions)]`) +Status: Historical diff --git a/docs/development/current/main/phase191-body-local-integration.md b/docs/archive/phases/phase-170-197/phase191-body-local-integration.md similarity index 99% rename from docs/development/current/main/phase191-body-local-integration.md rename to docs/archive/phases/phase-170-197/phase191-body-local-integration.md index e624bae5..4f8f23ce 100644 --- a/docs/development/current/main/phase191-body-local-integration.md +++ b/docs/archive/phases/phase-170-197/phase191-body-local-integration.md @@ -289,3 +289,4 @@ Phase 191 で以下が達成されました: - `apps/tests/phase191_body_local_atoi.hako`(新規作成) - `apps/tests/phase190_atoi_impl.hako`(退行確認) - `apps/tests/phase190_parse_number_impl.hako`(退行確認) +Status: Historical diff --git a/docs/development/current/main/phase192-complex-addend-design.md b/docs/archive/phases/phase-170-197/phase192-complex-addend-design.md similarity index 99% rename from docs/development/current/main/phase192-complex-addend-design.md rename to docs/archive/phases/phase-170-197/phase192-complex-addend-design.md index 86d29950..7324aef7 100644 --- a/docs/development/current/main/phase192-complex-addend-design.md +++ b/docs/archive/phases/phase-170-197/phase192-complex-addend-design.md @@ -598,3 +598,4 @@ When running a test with complex addend pattern: - **2025-12-09**: Initial design document (Section 1-8) - **2025-12-09**: Implementation complete (Section 9) +Status: Historical diff --git a/docs/development/current/main/phase192_loop_pattern_structure_detection.md b/docs/archive/phases/phase-170-197/phase192_loop_pattern_structure_detection.md similarity index 99% rename from docs/development/current/main/phase192_loop_pattern_structure_detection.md rename to docs/archive/phases/phase-170-197/phase192_loop_pattern_structure_detection.md index f2807692..3e4ab854 100644 --- a/docs/development/current/main/phase192_loop_pattern_structure_detection.md +++ b/docs/archive/phases/phase-170-197/phase192_loop_pattern_structure_detection.md @@ -105,4 +105,5 @@ No pattern depends on function names (e.g. `"main"`) or specific variable names - Multiple carrier variables - More complex continue/break combinations - Align LoopForm/LoopScopeShape-based detection with this AST-based pipeline so both views are consistent. +Status: Historical diff --git a/docs/development/current/main/phase193-init-methodcall-design.md b/docs/archive/phases/phase-170-197/phase193-init-methodcall-design.md similarity index 99% rename from docs/development/current/main/phase193-init-methodcall-design.md rename to docs/archive/phases/phase-170-197/phase193-init-methodcall-design.md index 82e7d028..94fc5301 100644 --- a/docs/development/current/main/phase193-init-methodcall-design.md +++ b/docs/archive/phases/phase-170-197/phase193-init-methodcall-design.md @@ -665,3 +665,4 @@ Phase 193 では **ConditionEnv を「ループパラメータ専用 view」と > 「テーブル+メソッド呼び出し」のような複合パターンは、次の箱(または .hako 側のリライト)案件にする。 → **Phase 194+ は Option C(実戦投入優先)を推奨** +Status: Historical diff --git a/docs/development/current/main/phase193_5_multi_carrier_testing.md b/docs/archive/phases/phase-170-197/phase193_5_multi_carrier_testing.md similarity index 99% rename from docs/development/current/main/phase193_5_multi_carrier_testing.md rename to docs/archive/phases/phase-170-197/phase193_5_multi_carrier_testing.md index c078cfa8..73675fc8 100644 --- a/docs/development/current/main/phase193_5_multi_carrier_testing.md +++ b/docs/archive/phases/phase-170-197/phase193_5_multi_carrier_testing.md @@ -201,3 +201,4 @@ Phase 193 achieves complete modularization and enhancement of JoinIR loop loweri - **ValueId Allocation**: Currently uses `max(variable_map) + 1` strategy. Future: delegate to builder's proper ValueId allocator. - **Debugging**: Environment variable `NYASH_TRACE_EXIT_BINDING=1` will be useful for debugging Phase 193-5 integration. - **Next Phase**: Phase 194 can now focus on advanced pattern detection without carrier handling complexity. +Status: Historical diff --git a/docs/development/current/main/phase193_exit_binding_builder.md b/docs/archive/phases/phase-170-197/phase193_exit_binding_builder.md similarity index 99% rename from docs/development/current/main/phase193_exit_binding_builder.md rename to docs/archive/phases/phase-170-197/phase193_exit_binding_builder.md index dc76ef08..4deb968a 100644 --- a/docs/development/current/main/phase193_exit_binding_builder.md +++ b/docs/archive/phases/phase-170-197/phase193_exit_binding_builder.md @@ -362,3 +362,4 @@ Output example: - [ ] loop_continue_multi_carrier.hako test passes with correct output - [ ] Variable map correctly reflects post-loop carrier state - [ ] Debugging environment variable works as expected +Status: Historical diff --git a/docs/development/current/main/phase194-jsonparser-deployment.md b/docs/archive/phases/phase-170-197/phase194-jsonparser-deployment.md similarity index 99% rename from docs/development/current/main/phase194-jsonparser-deployment.md rename to docs/archive/phases/phase-170-197/phase194-jsonparser-deployment.md index 16486ecf..1f3fbc34 100644 --- a/docs/development/current/main/phase194-jsonparser-deployment.md +++ b/docs/archive/phases/phase-170-197/phase194-jsonparser-deployment.md @@ -572,3 +572,4 @@ let structure_only = match std::env::var("NYASH_JOINIR_STRUCTURE_ONLY") { 3. Multiple MethodCalls 未対応 **全体評価**: Phase 194 は「検証フェーズ」として大成功。次の Phase への明確な道筋を示した。 +Status: Historical diff --git a/docs/development/current/main/phase194-loop-inventory.md b/docs/archive/phases/phase-170-197/phase194-loop-inventory.md similarity index 99% rename from docs/development/current/main/phase194-loop-inventory.md rename to docs/archive/phases/phase-170-197/phase194-loop-inventory.md index 45e01887..9a41d2b8 100644 --- a/docs/development/current/main/phase194-loop-inventory.md +++ b/docs/archive/phases/phase-170-197/phase194-loop-inventory.md @@ -319,3 +319,4 @@ Phase 194 is about **validating existing infrastructure**, not adding new functi - **Multiple MethodCalls**: Needs Phase 195+ design This inventory provides a clear roadmap for future JoinIR expansion based on real-world loop patterns. +Status: Historical diff --git a/docs/development/current/main/phase194_joinlooptrace.md b/docs/archive/phases/phase-170-197/phase194_joinlooptrace.md similarity index 99% rename from docs/development/current/main/phase194_joinlooptrace.md rename to docs/archive/phases/phase-170-197/phase194_joinlooptrace.md index 63572b44..d57eaabc 100644 --- a/docs/development/current/main/phase194_joinlooptrace.md +++ b/docs/archive/phases/phase-170-197/phase194_joinlooptrace.md @@ -86,4 +86,5 @@ pub fn trace() -> &'static JoinLoopTrace - Phase 194 は **挙動を変えない** リファクタフェーズ(観測レイヤーの整形)として扱う。 - Loop パターンや ExitBinding まわりは Phase 193/196/197 で安定しているので、それを壊さない形でログだけを寄せることが目的。 +Status: Historical diff --git a/docs/development/current/main/phase195-impl-pattern3-multicarrier.md b/docs/archive/phases/phase-170-197/phase195-impl-pattern3-multicarrier.md similarity index 99% rename from docs/development/current/main/phase195-impl-pattern3-multicarrier.md rename to docs/archive/phases/phase-170-197/phase195-impl-pattern3-multicarrier.md index f6c56253..2b7d599b 100644 --- a/docs/development/current/main/phase195-impl-pattern3-multicarrier.md +++ b/docs/archive/phases/phase-170-197/phase195-impl-pattern3-multicarrier.md @@ -625,3 +625,4 @@ Section 7.2 の Phase 195 を完了マークに更新: - 設計書に基づく実装 - 単一責任の原則維持 - ドキュメント駆動開発 +Status: Historical diff --git a/docs/development/current/main/phase195-pattern3-extension-design.md b/docs/archive/phases/phase-170-197/phase195-pattern3-extension-design.md similarity index 99% rename from docs/development/current/main/phase195-pattern3-extension-design.md rename to docs/archive/phases/phase-170-197/phase195-pattern3-extension-design.md index eca39009..b846a8b7 100644 --- a/docs/development/current/main/phase195-pattern3-extension-design.md +++ b/docs/archive/phases/phase-170-197/phase195-pattern3-extension-design.md @@ -692,3 +692,4 @@ MIR (壊れている): - P3 Lowerer は複数キャリア対応完了 ✅ - ExitLine/CarrierVar は既に対応済み(変更不要)✅ - JoinIR→MIR bridge の Select バグは別 Issue として分離 ✅ +Status: Historical diff --git a/docs/development/current/main/phase196-select-bug-analysis.md b/docs/archive/phases/phase-170-197/phase196-select-bug-analysis.md similarity index 99% rename from docs/development/current/main/phase196-select-bug-analysis.md rename to docs/archive/phases/phase-170-197/phase196-select-bug-analysis.md index 36ac24a1..04f860cc 100644 --- a/docs/development/current/main/phase196-select-bug-analysis.md +++ b/docs/archive/phases/phase-170-197/phase196-select-bug-analysis.md @@ -219,3 +219,4 @@ RC: 0 ### 成果 - Phase 195 の Multi-carrier Pattern 3 が完全動作 - 既存 Pattern 1/2/3 に退行なし +Status: Historical diff --git a/docs/development/current/main/phase196-select-bug-fix.md b/docs/archive/phases/phase-170-197/phase196-select-bug-fix.md similarity index 99% rename from docs/development/current/main/phase196-select-bug-fix.md rename to docs/archive/phases/phase-170-197/phase196-select-bug-fix.md index 7cea0dbb..dc25503b 100644 --- a/docs/development/current/main/phase196-select-bug-fix.md +++ b/docs/archive/phases/phase-170-197/phase196-select-bug-fix.md @@ -597,3 +597,4 @@ bb10: ### コミット - **[996925eb]** fix(joinir): Phase 196 Select double-remap bug in instruction_rewriter +Status: Historical diff --git a/docs/development/current/main/phase196_loop_continue_multi_carrier.md b/docs/archive/phases/phase-170-197/phase196_loop_continue_multi_carrier.md similarity index 99% rename from docs/development/current/main/phase196_loop_continue_multi_carrier.md rename to docs/archive/phases/phase-170-197/phase196_loop_continue_multi_carrier.md index 825e319a..fd5c6da6 100644 --- a/docs/development/current/main/phase196_loop_continue_multi_carrier.md +++ b/docs/archive/phases/phase-170-197/phase196_loop_continue_multi_carrier.md @@ -213,3 +213,4 @@ for idx in 1..=carrier_info.carriers.len() { - Created Phase 196 documentation (Task 196-1) - Identified root cause: hardcoded ExitMeta::single() and join_inputs - Task investigation completed by Agent +Status: Historical diff --git a/docs/development/current/main/phase197-lightweight-loops-deployment.md b/docs/archive/phases/phase-170-197/phase197-lightweight-loops-deployment.md similarity index 99% rename from docs/development/current/main/phase197-lightweight-loops-deployment.md rename to docs/archive/phases/phase-170-197/phase197-lightweight-loops-deployment.md index d9d1945e..ae69c43d 100644 --- a/docs/development/current/main/phase197-lightweight-loops-deployment.md +++ b/docs/archive/phases/phase-170-197/phase197-lightweight-loops-deployment.md @@ -443,3 +443,4 @@ NYASH_JOINIR_CORE=1 ./target/release/hakorune apps/tests/phase182_p1_match_liter - `docs/development/current/main/phase194-loop-inventory.md`(ループ一覧) - `docs/development/current/main/joinir-architecture-overview.md`(実戦適用状況表) - `CURRENT_TASK.md`(Phase 197 セクション) +Status: Historical diff --git a/docs/development/current/main/phase197_pattern4_update_semantics.md b/docs/archive/phases/phase-170-197/phase197_pattern4_update_semantics.md similarity index 99% rename from docs/development/current/main/phase197_pattern4_update_semantics.md rename to docs/archive/phases/phase-170-197/phase197_pattern4_update_semantics.md index 893c3a4c..38d17852 100644 --- a/docs/development/current/main/phase197_pattern4_update_semantics.md +++ b/docs/archive/phases/phase-170-197/phase197_pattern4_update_semantics.md @@ -141,3 +141,4 @@ After implementation: - Test case: `apps/tests/loop_continue_multi_carrier.hako` - Lowerer: `src/mir/join_ir/lowering/loop_with_continue_minimal.rs` - Pattern detection: `src/mir/builder/control_flow/joinir/patterns/pattern4_with_continue.rs` +Status: Historical diff --git a/docs/archive/phases/phase-33/README.md b/docs/archive/phases/phase-33/README.md new file mode 100644 index 00000000..8e712e92 --- /dev/null +++ b/docs/archive/phases/phase-33/README.md @@ -0,0 +1,9 @@ +# Phase 33 Archive (JoinIR 初期フェーズ) + +Status: Historical +Scope: Phase 33 の JoinIR 初期フェーズに関する設計/分析/実装メモを集約。 + +Phase 33 で書かれた JoinIR の初期ドキュメントはこのフォルダに集めたよ。 +現行設計は `docs/development/current/main/joinir-architecture-overview.md`(SSOT)と +`docs/development/current/main/01-JoinIR-Selfhost-INDEX.md`(入口)を参照してね。 + diff --git a/docs/development/current/main/phase33-10-implementation-recommendation.md b/docs/archive/phases/phase-33/phase33-10-implementation-recommendation.md similarity index 99% rename from docs/development/current/main/phase33-10-implementation-recommendation.md rename to docs/archive/phases/phase-33/phase33-10-implementation-recommendation.md index 3bbf7a23..f57ae8d0 100644 --- a/docs/development/current/main/phase33-10-implementation-recommendation.md +++ b/docs/archive/phases/phase-33/phase33-10-implementation-recommendation.md @@ -253,3 +253,4 @@ bb10: **Created**: 2025-12-06 **Status**: Analysis Complete, Ready for Implementation **Priority**: HIGH (Correctness Issue) +Status: Historical diff --git a/docs/development/current/main/phase33-10-joinir-merge-phi-loss-analysis.md b/docs/archive/phases/phase-33/phase33-10-joinir-merge-phi-loss-analysis.md similarity index 99% rename from docs/development/current/main/phase33-10-joinir-merge-phi-loss-analysis.md rename to docs/archive/phases/phase-33/phase33-10-joinir-merge-phi-loss-analysis.md index 11836f13..53f48fbd 100644 --- a/docs/development/current/main/phase33-10-joinir-merge-phi-loss-analysis.md +++ b/docs/archive/phases/phase-33/phase33-10-joinir-merge-phi-loss-analysis.md @@ -164,3 +164,4 @@ bb10: ``` The PHI instruction for `sum_merged = Select(continue_cond, sum_param, sum_next)` (line 304 in loop_with_continue_minimal.rs) is being lost during merge. +Status: Historical diff --git a/docs/development/current/main/phase33-10-local-pattern-mir-analysis.md b/docs/archive/phases/phase-33/phase33-10-local-pattern-mir-analysis.md similarity index 99% rename from docs/development/current/main/phase33-10-local-pattern-mir-analysis.md rename to docs/archive/phases/phase-33/phase33-10-local-pattern-mir-analysis.md index 81b09bf8..b1db68ec 100644 --- a/docs/development/current/main/phase33-10-local-pattern-mir-analysis.md +++ b/docs/archive/phases/phase-33/phase33-10-local-pattern-mir-analysis.md @@ -628,3 +628,4 @@ if merge_block.instructions.iter().any(|inst| { **Phase 33-10完了判定**: PHIチェック追加のみで完了とする **次のフェーズ**: Phase 33-11(IfMerge実装、またはPhase 34へ移行) +Status: Historical diff --git a/docs/development/current/main/phase33-11-exit-phi-bug-analysis.md b/docs/archive/phases/phase-33/phase33-11-exit-phi-bug-analysis.md similarity index 99% rename from docs/development/current/main/phase33-11-exit-phi-bug-analysis.md rename to docs/archive/phases/phase-33/phase33-11-exit-phi-bug-analysis.md index 567bef33..f83c8b84 100644 --- a/docs/development/current/main/phase33-11-exit-phi-bug-analysis.md +++ b/docs/archive/phases/phase-33/phase33-11-exit-phi-bug-analysis.md @@ -139,3 +139,4 @@ Expected output: 1 2 ``` +Status: Historical diff --git a/docs/development/current/main/phase33-13-trim-pattern-observation.md b/docs/archive/phases/phase-33/phase33-13-trim-pattern-observation.md similarity index 99% rename from docs/development/current/main/phase33-13-trim-pattern-observation.md rename to docs/archive/phases/phase-33/phase33-13-trim-pattern-observation.md index 28bc163c..10e51f27 100644 --- a/docs/development/current/main/phase33-13-trim-pattern-observation.md +++ b/docs/archive/phases/phase-33/phase33-13-trim-pattern-observation.md @@ -397,3 +397,4 @@ if let Some(phi_dst) = carrier_phis.get(&binding.carrier_name) { ## Date: 2025-12-07 ## Status: In Progress - Design Phase Complete! +Status: Historical diff --git a/docs/development/current/main/phase33-16-implementation-plan.md b/docs/archive/phases/phase-33/phase33-16-implementation-plan.md similarity index 99% rename from docs/development/current/main/phase33-16-implementation-plan.md rename to docs/archive/phases/phase-33/phase33-16-implementation-plan.md index 06f243bf..bf9a41cf 100644 --- a/docs/development/current/main/phase33-16-implementation-plan.md +++ b/docs/archive/phases/phase-33/phase33-16-implementation-plan.md @@ -502,3 +502,4 @@ Phase 33-16 transforms exit value handling from "skip and hope" to "SSA-correct 5. Passing correct values to ExitLineOrchestrator (Phase 6) This eliminates SSA-undef errors while maintaining clear separation of concerns and backward compatibility. +Status: Historical diff --git a/docs/development/current/main/phase33-16-loop-header-phi-design.md b/docs/archive/phases/phase-33/phase33-16-loop-header-phi-design.md similarity index 99% rename from docs/development/current/main/phase33-16-loop-header-phi-design.md rename to docs/archive/phases/phase-33/phase33-16-loop-header-phi-design.md index 97304954..ba9f44d2 100644 --- a/docs/development/current/main/phase33-16-loop-header-phi-design.md +++ b/docs/archive/phases/phase-33/phase33-16-loop-header-phi-design.md @@ -242,4 +242,5 @@ Boundary 構造体自体には新フィールドを足さず、 4. 上記テスト戦略に沿って回帰テスト・SSA 検証を行う。 実装時に設計が変わった場合は、このファイルと `joinir-architecture-overview.md` を SSOT として必ず更新すること。 +Status: Historical diff --git a/docs/development/current/main/phase33-16-qa.md b/docs/archive/phases/phase-33/phase33-16-qa.md similarity index 99% rename from docs/development/current/main/phase33-16-qa.md rename to docs/archive/phases/phase-33/phase33-16-qa.md index 8cd3bf98..6ab3f575 100644 --- a/docs/development/current/main/phase33-16-qa.md +++ b/docs/archive/phases/phase-33/phase33-16-qa.md @@ -299,3 +299,4 @@ merge_joinir_mir_blocks() { **Replace skip logic**: Yes, with fallback mechanism for backward compatibility **The magic**: Loop header PHI dst (allocated in Phase 3.5, finalized in Phase 4.5) is SSA-defined and can be safely used in exit values instead of parameters! +Status: Historical diff --git a/docs/development/current/main/phase33-16-refactoring-summary.md b/docs/archive/phases/phase-33/phase33-16-refactoring-summary.md similarity index 99% rename from docs/development/current/main/phase33-16-refactoring-summary.md rename to docs/archive/phases/phase-33/phase33-16-refactoring-summary.md index ce41adc1..ed159d37 100644 --- a/docs/development/current/main/phase33-16-refactoring-summary.md +++ b/docs/archive/phases/phase-33/phase33-16-refactoring-summary.md @@ -137,3 +137,4 @@ The original code worked but required deep knowledge to maintain. The refactorin **Related Files**: - `src/mir/builder/control_flow/joinir/merge/instruction_rewriter.rs` (refactored) - `docs/development/current/main/phase33-16-self-loop-fix.md` (original bug fix) +Status: Historical diff --git a/docs/development/current/main/phase33-16-visual-guide.md b/docs/archive/phases/phase-33/phase33-16-visual-guide.md similarity index 99% rename from docs/development/current/main/phase33-16-visual-guide.md rename to docs/archive/phases/phase-33/phase33-16-visual-guide.md index ebfa1add..4514f775 100644 --- a/docs/development/current/main/phase33-16-visual-guide.md +++ b/docs/archive/phases/phase-33/phase33-16-visual-guide.md @@ -465,3 +465,4 @@ jq '.functions[0].blocks[0].instructions[0:3]' mir.json # First 3 instructions | 6 | ExitLineOrchestrator | carrier_phis | var_map updated | existing | **Total changes**: ~6 locations, ~100 lines added/modified, 0 lines removed (backward compat) +Status: Historical diff --git a/docs/development/current/main/phase33-17-implementation-complete.md b/docs/archive/phases/phase-33/phase33-17-implementation-complete.md similarity index 99% rename from docs/development/current/main/phase33-17-implementation-complete.md rename to docs/archive/phases/phase-33/phase33-17-implementation-complete.md index a96dde34..4613f0b2 100644 --- a/docs/development/current/main/phase33-17-implementation-complete.md +++ b/docs/archive/phases/phase-33/phase33-17-implementation-complete.md @@ -207,3 +207,4 @@ instruction_rewriter.rs (589行) **Build**: Success(1m 03s) **Tests**: All Pass **Next**: Phase 33-17-B 実施検討 +Status: Historical diff --git a/docs/development/current/main/phase33-18-continue-pattern-inventory.md b/docs/archive/phases/phase-33/phase33-18-continue-pattern-inventory.md similarity index 99% rename from docs/development/current/main/phase33-18-continue-pattern-inventory.md rename to docs/archive/phases/phase-33/phase33-18-continue-pattern-inventory.md index 903df8ca..8f3eddb5 100644 --- a/docs/development/current/main/phase33-18-continue-pattern-inventory.md +++ b/docs/archive/phases/phase-33/phase33-18-continue-pattern-inventory.md @@ -207,3 +207,4 @@ pub fn classify(features: &LoopFeatures) -> LoopPatternKind { **作成日**: 2025-12-07 **Phase**: 33-18 (Design Only) +Status: Historical diff --git a/docs/development/current/main/phase33-20-loop-exit-semantics.md b/docs/archive/phases/phase-33/phase33-20-loop-exit-semantics.md similarity index 99% rename from docs/development/current/main/phase33-20-loop-exit-semantics.md rename to docs/archive/phases/phase-33/phase33-20-loop-exit-semantics.md index b96d1c15..43d16ed1 100644 --- a/docs/development/current/main/phase33-20-loop-exit-semantics.md +++ b/docs/archive/phases/phase-33/phase33-20-loop-exit-semantics.md @@ -140,4 +140,5 @@ LoopBuilder 完全削除後の JoinIR ループラインにおいて、 このフェーズで「LoopBuilder 無しの JoinIR ループ出口ラインの基礎」は固まったので、 今後は continue 系と JsonParserBox のような実アプリ側ロジックを順番に乗せていく段階に入る。** +Status: Historical diff --git a/docs/development/current/main/phase33-22-common-pattern-initializer.md b/docs/archive/phases/phase-33/phase33-22-common-pattern-initializer.md similarity index 99% rename from docs/development/current/main/phase33-22-common-pattern-initializer.md rename to docs/archive/phases/phase-33/phase33-22-common-pattern-initializer.md index a3e70f5b..416a38d7 100644 --- a/docs/development/current/main/phase33-22-common-pattern-initializer.md +++ b/docs/archive/phases/phase-33/phase33-22-common-pattern-initializer.md @@ -384,3 +384,4 @@ sum=9, RC: 0 ✅ - JoinIRConversionPipeline: `src/mir/builder/control_flow/joinir/patterns/conversion_pipeline.rs` - Phase 33-23 fix: boundary.loop_var_name setting - Pattern 1-4: `src/mir/builder/control_flow/joinir/patterns/pattern*.rs` +Status: Historical diff --git a/docs/development/current/main/phase33-23-refactoring-complete.md b/docs/archive/phases/phase-33/phase33-23-refactoring-complete.md similarity index 99% rename from docs/development/current/main/phase33-23-refactoring-complete.md rename to docs/archive/phases/phase-33/phase33-23-refactoring-complete.md index 55c025c7..c3d7ad69 100644 --- a/docs/development/current/main/phase33-23-refactoring-complete.md +++ b/docs/archive/phases/phase-33/phase33-23-refactoring-complete.md @@ -222,3 +222,4 @@ Co-Authored-By: Claude Haiku 4.5 **作成者**: Claude Code (Sonnet 4.5) **承認**: 要ユーザーレビュー +Status: Historical diff --git a/docs/development/current/main/phase33-duplication-map.md b/docs/archive/phases/phase-33/phase33-duplication-map.md similarity index 99% rename from docs/development/current/main/phase33-duplication-map.md rename to docs/archive/phases/phase-33/phase33-duplication-map.md index 91fa760e..52f16bcc 100644 --- a/docs/development/current/main/phase33-duplication-map.md +++ b/docs/archive/phases/phase-33/phase33-duplication-map.md @@ -283,3 +283,4 @@ cargo test --release ## 📝 変更履歴 - 2025-12-07: 初版作成(Phase 33-21完了後の調査結果) +Status: Historical diff --git a/docs/development/current/main/phase33-optimization-guide.md b/docs/archive/phases/phase-33/phase33-optimization-guide.md similarity index 99% rename from docs/development/current/main/phase33-optimization-guide.md rename to docs/archive/phases/phase-33/phase33-optimization-guide.md index cc292955..e0c8c72e 100644 --- a/docs/development/current/main/phase33-optimization-guide.md +++ b/docs/archive/phases/phase-33/phase33-optimization-guide.md @@ -529,3 +529,4 @@ git diff --stat HEAD~1 ``` ✅ Phase 33-22最適化完了! +Status: Historical diff --git a/docs/development/current/main/phase33-post-analysis.md b/docs/archive/phases/phase-33/phase33-post-analysis.md similarity index 99% rename from docs/development/current/main/phase33-post-analysis.md rename to docs/archive/phases/phase-33/phase33-post-analysis.md index 58d7a254..bab94e88 100644 --- a/docs/development/current/main/phase33-post-analysis.md +++ b/docs/archive/phases/phase-33/phase33-post-analysis.md @@ -370,3 +370,4 @@ Phase 33-19/33-21完了時点で、**351行削減可能な改善機会**を発 Legacy Fallback削除は**テスト検証必須**(削除して問題ないか確認)。 condition_to_joinirとBoolExprLowererの統合は**不要**(設計上正しい分離)。 +Status: Historical diff --git a/docs/archive/reports/CLEANUP_REPORT_2025-11-04.md b/docs/archive/reports/CLEANUP_REPORT_2025-11-04.md new file mode 100644 index 00000000..d89f151d --- /dev/null +++ b/docs/archive/reports/CLEANUP_REPORT_2025-11-04.md @@ -0,0 +1,6 @@ +# 🧹 プロジェクト大掃除実行レポート 2025-11-04 + +Status: Historical + +(内容は `docs/development/cleanup/CLEANUP_REPORT_2025-11-04.md` から移動) + diff --git a/docs/archive/reports/DUPLICATION_ANALYSIS_REPORT.md b/docs/archive/reports/DUPLICATION_ANALYSIS_REPORT.md new file mode 100644 index 00000000..b79834a5 --- /dev/null +++ b/docs/archive/reports/DUPLICATION_ANALYSIS_REPORT.md @@ -0,0 +1,6 @@ +# Hakorune Rustコードベース 重複コード・共通化調査レポート + +Status: Historical + +(内容は `docs/development/cleanup/DUPLICATION_ANALYSIS_REPORT.md` から移動) + diff --git a/docs/archive/reports/LEGACY_CODE_INVESTIGATION_REPORT.md b/docs/archive/reports/LEGACY_CODE_INVESTIGATION_REPORT.md new file mode 100644 index 00000000..095cedf1 --- /dev/null +++ b/docs/archive/reports/LEGACY_CODE_INVESTIGATION_REPORT.md @@ -0,0 +1,6 @@ +# Hakorune Legacy Code Investigation Report + +Status: Historical + +(内容は `docs/development/cleanup/LEGACY_CODE_INVESTIGATION_REPORT.md` から移動) + diff --git a/docs/archive/reports/PHASE2_REPORT_2025-11-04.md b/docs/archive/reports/PHASE2_REPORT_2025-11-04.md new file mode 100644 index 00000000..5731499d --- /dev/null +++ b/docs/archive/reports/PHASE2_REPORT_2025-11-04.md @@ -0,0 +1,6 @@ +# 🧹 Phase 2 実行レポート 2025-11-04 + +Status: Historical + +(内容は `docs/development/cleanup/PHASE2_REPORT_2025-11-04.md` から移動) + diff --git a/docs/development/proposals/env-var-reduction-report.md b/docs/archive/reports/env-var-reduction-report.md similarity index 99% rename from docs/development/proposals/env-var-reduction-report.md rename to docs/archive/reports/env-var-reduction-report.md index 0f5088e7..aaf2c64f 100644 --- a/docs/development/proposals/env-var-reduction-report.md +++ b/docs/archive/reports/env-var-reduction-report.md @@ -1,3 +1,5 @@ +Status: Historical + # 環境変数徹底調査レポート - 25個から5個への削減計画 **作成日**: 2025-11-21 diff --git a/docs/development/proposals/phi-generation-box-refactoring-plan.md b/docs/archive/reports/phi-generation-box-refactoring-plan.md similarity index 99% rename from docs/development/proposals/phi-generation-box-refactoring-plan.md rename to docs/archive/reports/phi-generation-box-refactoring-plan.md index 2f41a83d..55a2c3c4 100644 --- a/docs/development/proposals/phi-generation-box-refactoring-plan.md +++ b/docs/archive/reports/phi-generation-box-refactoring-plan.md @@ -1,3 +1,5 @@ +Status: Historical + # PHI生成コードの箱理論リファクタリング計画 **作成日**: 2025-11-20 diff --git a/docs/development/current/main/phase33-16-INDEX.md b/docs/development/current/main/phase33-16-INDEX.md index f74b3ac0..15831ab7 100644 --- a/docs/development/current/main/phase33-16-INDEX.md +++ b/docs/development/current/main/phase33-16-INDEX.md @@ -1,3 +1,6 @@ +Status: Active +Scope: Phase 33-16(Loop Header PHI SSOT)に関する現役目次。歴史詳細は archive 側を参照。 + # Phase 33-16: Loop Header PHI SSOT - Documentation Index **Last Updated**: 2025-12-07 diff --git a/docs/development/current/main/phase33-17-joinir-modularization-analysis.md b/docs/development/current/main/phase33-17-joinir-modularization-analysis.md index fac96424..461839c7 100644 --- a/docs/development/current/main/phase33-17-joinir-modularization-analysis.md +++ b/docs/development/current/main/phase33-17-joinir-modularization-analysis.md @@ -1,3 +1,6 @@ +Status: Active +Scope: Phase 33-17 の JoinIR モジュール化分析の要約(現行参照用)。詳細メモは archive 側へ移行。 + # Phase 33-17: JoinIR モジュール化分析 ## 実行日: 2025-12-07 diff --git a/docs/development/runtime/01-Runtime-INDEX.md b/docs/development/runtime/01-Runtime-INDEX.md new file mode 100644 index 00000000..6dc33caf --- /dev/null +++ b/docs/development/runtime/01-Runtime-INDEX.md @@ -0,0 +1,41 @@ +# Runtime / Ring0 / CLI INDEX(読み始めガイド) + +Status: Active +Scope: Runtime / Ring0 / Stage1 CLI に関する現役設計・提案ドキュメントの入口。 + +このファイルは、ランタイムと CLI まわりの設計ドキュメントが増えてきたときに +「まずどれを読めばいまの前提が分かるか」を示すための簡単なインデックスだよ。 + +--- + +## 1. Runtime / File I/O / ABI ライン + +- File I/O Provider(FileBox / コア + プラグイン) + - `docs/development/runtime/FILEBOX_PROVIDER.md` +- C Core ABI / Numeric ABI(設計段階の仕様) + - `docs/development/runtime/C_CORE_ABI.md` + - `docs/development/runtime/NUMERIC_ABI.md` +- System Hakorune Subset(Runtime / Numeric Core のサブセット定義) + - `docs/development/runtime/system-hakorune-subset.md` + +これらは主に設計・提案レベルのドキュメントとして扱うよ(Status: design-stage 等)。 + +--- + +## 2. 環境変数と運用ガイド + +- Nyash 環境変数の整理と最小セット + - `docs/development/runtime/ENV_VARS.md` + +環境変数が増えすぎないようにするポリシーや、`nyash.toml` での上書き方の現役ガイドとして参照してね。 + +--- + +## 3. Stage1 CLI / selfhost 実行ライン + +- Stage1 Hakorune CLI Design(設計 + stub 実装) + - `docs/development/runtime/cli-hakorune-stage1.md` + +Selfhost / Stage1 CLI の詳細なフローについては、JoinIR / Selfhost INDEX から +`docs/development/current/main/selfhost_stage3_expected_flow.md` もあわせて読むと全体像が掴みやすいよ。 + diff --git a/docs/development/selfhosting/quickstart.md b/docs/development/selfhosting/quickstart.md index d62840db..4fc952f8 100644 --- a/docs/development/selfhosting/quickstart.md +++ b/docs/development/selfhosting/quickstart.md @@ -1,3 +1,5 @@ +Status: SSOT, Active + # Self‑Hosting Quickstart (Phase 15 — Resume) This note shows how to run the Nyash self‑host compiler MVP to emit MIR(JSON v0) and execute it with the current VM line. The flow keeps defaults unchanged and uses small, opt‑in flags for development. diff --git a/docs/development/testing/selfhost_exe_stageb_quick_guide.md b/docs/development/testing/selfhost_exe_stageb_quick_guide.md index ee76a093..0f865f6d 100644 --- a/docs/development/testing/selfhost_exe_stageb_quick_guide.md +++ b/docs/development/testing/selfhost_exe_stageb_quick_guide.md @@ -1,3 +1,7 @@ +Status: Active +Scope: `tools/selfhost_exe_stageb.sh` の具体的な使い方と代表パターン(EXE ビルド/VM とのパリティ検証)をまとめたガイド。 +See also: `docs/development/selfhosting/quickstart.md`(Self‑Host 全体フローの SSOT)。 + # selfhost_exe_stageb.sh - Quick Usage Guide ## TL;DR diff --git a/src/mir/join_ir/lowering/expr_lowerer.rs b/src/mir/join_ir/lowering/expr_lowerer.rs index 78177f6b..1d79ad05 100644 --- a/src/mir/join_ir/lowering/expr_lowerer.rs +++ b/src/mir/join_ir/lowering/expr_lowerer.rs @@ -268,7 +268,8 @@ impl<'env, 'builder, S: ScopeManager> ExprLowerer<'env, 'builder, S> { /// Check if an AST node is supported in condition context /// /// Phase 231: Conservative whitelist. We only support patterns we know work. - fn is_supported_condition(ast: &ASTNode) -> bool { + /// Phase 240-EX: Made public to allow callers to check before attempting lowering. + pub fn is_supported_condition(ast: &ASTNode) -> bool { match ast { // Literals: Integer, Bool ASTNode::Literal { .. } => true, @@ -727,4 +728,69 @@ mod tests { "MethodCall should fail-fast with UnsupportedNode" ); } + + // Phase 240-EX: Header condition patterns + + #[test] + fn test_expr_lowerer_supports_simple_header_condition_i_less_literal() { + // header pattern: i < 10 + let ast = bin(BinaryOperator::Less, var("i"), lit_i(10)); + assert!( + ExprLowerer::::is_supported_condition(&ast), + "i < 10 should be supported for Pattern2 header condition" + ); + + // lower and verify success + let scope = make_basic_scope(); + let mut builder = create_test_builder(); + let mut lowerer = ExprLowerer::new(&scope, ExprContext::Condition, &mut builder); + + let result = lowerer.lower(&ast); + assert!(result.is_ok(), "i < 10 should lower successfully"); + + // Compare instruction should be present + let instructions = lowerer.take_last_instructions(); + assert_has_compare(&instructions); + } + + #[test] + fn test_expr_lowerer_supports_header_condition_var_less_var() { + // header pattern: i < n (variable vs variable) + let ast = bin(BinaryOperator::Less, var("i"), var("j")); + assert!( + ExprLowerer::::is_supported_condition(&ast), + "i < n should be supported for Pattern2 header condition" + ); + + // lower and verify success + let scope = make_basic_scope(); + let mut builder = create_test_builder(); + let mut lowerer = ExprLowerer::new(&scope, ExprContext::Condition, &mut builder); + + let result = lowerer.lower(&ast); + assert!(result.is_ok(), "i < n should lower successfully"); + + // Compare instruction should be present + let instructions = lowerer.take_last_instructions(); + assert_has_compare(&instructions); + } + + #[test] + fn test_expr_lowerer_header_condition_generates_expected_instructions() { + // Test that header condition i < 10 generates proper Compare instruction + let scope = make_basic_scope(); + let mut builder = create_test_builder(); + + let ast = bin(BinaryOperator::Less, var("i"), lit_i(10)); + let mut lowerer = ExprLowerer::new(&scope, ExprContext::Condition, &mut builder); + + let result = lowerer.lower(&ast); + assert!(result.is_ok()); + + let instructions = lowerer.take_last_instructions(); + assert!(!instructions.is_empty(), "Should generate instructions"); + + // Should have Compare instruction + assert_has_compare(&instructions); + } } diff --git a/src/mir/join_ir/lowering/loop_with_break_minimal.rs b/src/mir/join_ir/lowering/loop_with_break_minimal.rs index f9775c43..09c1f9e3 100644 --- a/src/mir/join_ir/lowering/loop_with_break_minimal.rs +++ b/src/mir/join_ir/lowering/loop_with_break_minimal.rs @@ -72,9 +72,29 @@ use crate::mir::loop_pattern_detection::loop_condition_scope::LoopConditionScope use crate::mir::loop_pattern_detection::error_messages::{ format_unsupported_condition_error, extract_body_local_names, }; +use crate::mir::loop_pattern_detection::function_scope_capture::CapturedEnv; +use crate::mir::join_ir::lowering::scope_manager::Pattern2ScopeManager; use crate::mir::ValueId; use std::collections::BTreeMap; // Phase 222.5-D: HashMap → BTreeMap for determinism +/// Phase 240-EX: Helper to build Pattern2ScopeManager with minimal dependencies +/// +/// This helper creates a Pattern2ScopeManager for use in ExprLowerer, providing +/// a clean way to reuse scope management setup for both header and break conditions. +fn make_pattern2_scope_manager<'a>( + condition_env: &'a ConditionEnv, + body_local_env: Option<&'a LoopBodyLocalEnv>, + captured_env: Option<&'a CapturedEnv>, + carrier_info: &'a CarrierInfo, +) -> Pattern2ScopeManager<'a> { + Pattern2ScopeManager { + condition_env, + loop_body_local_env: body_local_env, + captured_env, + carrier_info, + } +} + /// Lower Pattern 2 (Loop with Conditional Break) to JoinIR /// /// # Phase 188-Impl-2: Pure JoinIR Fragment Generation @@ -240,13 +260,49 @@ pub(crate) fn lower_loop_with_break_minimal( i_param, carrier_param_ids ); - // Phase 169 / Phase 171-fix: Lower condition using condition_to_joinir helper with ConditionEnv - // This will allocate ValueIds dynamically based on condition complexity - let (cond_value, mut cond_instructions) = lower_condition_to_joinir( - condition, - &mut alloc_value, - env, - )?; + // Phase 169 / Phase 171-fix / Phase 240-EX: Lower condition + // + // Phase 240-EX: Try ExprLowerer first for supported patterns, fall back to legacy path + let (cond_value, mut cond_instructions) = { + use crate::mir::join_ir::lowering::expr_lowerer::{ExprContext, ExprLowerer}; + use crate::mir::builder::MirBuilder; + + // Build minimal ScopeManager for header condition + let empty_body_env = LoopBodyLocalEnv::new(); + let empty_captured_env = CapturedEnv::new(); + + let scope_manager = make_pattern2_scope_manager( + env, + Some(&empty_body_env), + Some(&empty_captured_env), + carrier_info, + ); + + if ExprLowerer::::is_supported_condition(condition) { + // Phase 240-EX: ExprLowerer path (for simple conditions) + let mut dummy_builder = MirBuilder::new(); + let mut expr_lowerer = ExprLowerer::new(&scope_manager, ExprContext::Condition, &mut dummy_builder); + + match expr_lowerer.lower(condition) { + Ok(value_id) => { + let instructions = expr_lowerer.take_last_instructions(); + eprintln!("[joinir/pattern2/phase240] Header condition via ExprLowerer: {} instructions", instructions.len()); + (value_id, instructions) + } + Err(e) => { + // Fail-Fast: If ExprLowerer says it's supported but fails, this is a bug + return Err(format!( + "[joinir/pattern2/phase240] ExprLowerer failed on supported condition: {:?}", + e + )); + } + } + } else { + // Legacy path: condition_to_joinir (for complex conditions not yet supported) + eprintln!("[joinir/pattern2/phase240] Header condition via legacy path (not yet supported by ExprLowerer)"); + lower_condition_to_joinir(condition, &mut alloc_value, env)? + } + }; // After condition lowering, allocate remaining ValueIds let exit_cond = alloc_value(); // Exit condition (negated loop condition) @@ -260,9 +316,6 @@ pub(crate) fn lower_loop_with_break_minimal( // 従来経路と構造的に同等になることを期待している。 let (break_cond_value, mut break_cond_instructions) = { use crate::mir::join_ir::lowering::expr_lowerer::{ExprContext, ExprLowerer, ExprLoweringError}; - use crate::mir::join_ir::lowering::scope_manager::Pattern2ScopeManager; - use crate::mir::loop_pattern_detection::function_scope_capture::CapturedEnv; - use crate::mir::join_ir::lowering::loop_body_local_env::LoopBodyLocalEnv; use crate::mir::builder::MirBuilder; // Phase 236-EX: ExprLowerer は MirBuilder 参照を要求するが、 @@ -275,12 +328,12 @@ pub(crate) fn lower_loop_with_break_minimal( let empty_body_env = LoopBodyLocalEnv::new(); let empty_captured_env = CapturedEnv::new(); - let scope_manager = Pattern2ScopeManager { - condition_env: env, - loop_body_local_env: Some(&empty_body_env), - captured_env: Some(&empty_captured_env), + let scope_manager = make_pattern2_scope_manager( + env, + Some(&empty_body_env), + Some(&empty_captured_env), carrier_info, - }; + ); let mut expr_lowerer = ExprLowerer::new(&scope_manager, ExprContext::Condition, &mut dummy_builder); let value_id = match expr_lowerer.lower(break_condition) { @@ -742,4 +795,74 @@ mod tests { assert!(vars.contains("ch")); // The problematic body-local variable } + // Phase 240-EX: Integration test for ExprLowerer header path + + #[test] + fn test_pattern2_header_condition_via_exprlowerer() { + use crate::mir::join_ir::lowering::carrier_info::{CarrierInfo, CarrierVar, CarrierRole, CarrierInit}; + use crate::mir::join_ir::lowering::condition_env::ConditionEnv; + use crate::mir::join_ir::lowering::join_value_space::JoinValueSpace; + + // Simple header condition: i < 10 + let loop_cond = binop_node(var_node("i"), int_literal_node(10)); + // Simple break condition: i >= 5 + let break_cond = binop_node(var_node("i"), int_literal_node(5)); + + let scope = minimal_scope(); + + // Setup ConditionEnv + let mut condition_env = ConditionEnv::new(); + condition_env.insert("i".to_string(), ValueId(100)); + + // Setup CarrierInfo + let carrier_info = CarrierInfo { + loop_var_name: "i".to_string(), + loop_var_id: ValueId(1), + carriers: vec![], + trim_helper: None, + promoted_loopbodylocals: vec![], + }; + + // Setup carrier_updates (empty for simple loop) + let carrier_updates = BTreeMap::new(); + + // Setup JoinValueSpace + let mut join_value_space = JoinValueSpace::new(); + + // Call lower_loop_with_break_minimal + let result = lower_loop_with_break_minimal( + scope, + &loop_cond, + &break_cond, + &condition_env, + &carrier_info, + &carrier_updates, + &[], // Empty body AST + None, // No body-local env + &mut join_value_space, + ); + + assert!(result.is_ok(), "Should lower successfully with ExprLowerer for header condition"); + + let (join_module, _fragment_meta) = result.unwrap(); + + // Verify JoinModule structure + assert_eq!(join_module.functions.len(), 3, "Should have 3 functions: main, loop_step, k_exit"); + + // Verify that loop_step has Compare instructions for both header and break conditions + let loop_step_func = join_module.functions.values() + .find(|f| f.name == "loop_step") + .expect("Should have loop_step function"); + + let compare_count = loop_step_func.body.iter() + .filter(|inst| matches!(inst, JoinInst::Compute(MirLikeInst::Compare { .. }))) + .count(); + + assert!( + compare_count >= 2, + "Should have at least 2 Compare instructions (header + break), got {}", + compare_count + ); + } + }