Files
hakorune/docs/development
nyash-codex 8fe0babf01 docs: Add comprehensive code refactoring discovery analysis
Analyze entire codebase for refactoring opportunities:
- 110 files > 400 lines (72,936 lines total)
- Identified 6 critical files blocking Pattern 4/5 implementation
- Created Phase 1-3 refactoring roadmap (95-105 hours total)

Key findings:

**Critical Path (Phase 1): 26.5 hours**
- control_flow.rs: 1,632 lines → 6 modules (12.5h)
  - Blocks: Pattern 4/5 implementation
  - 714-line function, 168 control flow branches
  - Cognitive complexity: 5/5 (EXTREME)

- loopform_builder.rs: 1,166 lines → 6 modules (8h)
  - 4-pass split (prepare/preheader/header/seal)
  - 330+ lines of tests needing organization

- Quick wins: 5 files, 14 hours total
  - mir_json_emit.rs: v0/v1 format split (3h)
  - generic_case_a.rs: EntryFunctionBuilder extract (3h)
  - config_joinir.rs: JoinIR config extract (3h)
  - join_ir_runner.rs: Pattern handlers (3h)
  - box_factory.rs: Factory policy (2h)

**High Priority (Phase 2): 29 hours**
- builder.rs: 322 commits in 2025 (highest churn)
- strip.rs: using module handling (1,081 lines)
- Other large files

**Optional (Phase 3): 40-50 hours**
- Remaining 600-800 line files
- Code health improvements

**ROI Analysis**:
- Phase 1 investment: 26.5 hours
- Time saved on Pattern 4/5: 15-20 hours
- Maintenance savings: 5h/month long-term
- Breakeven: < 2 months

**Prioritization Strategy**:
1. Unblocks future development (Pattern 4/5)
2. Reduces cognitive load (5/5 → avg 2/5)
3. Improves testability
4. Zero breaking changes (fully reversible)

Document includes:
- Detailed analysis of 110 files
- Refactoring plans for each critical file
- Before/after code examples
- Complete prioritization matrix
- Risk assessment and mitigation

Next step: Execute Phase 1 starting with control_flow.rs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 20:23:59 +09:00
..

Nyash Development Documentation 🔧

開発者向けの進行中タスクと開発計画ドキュメントです。

📂 ディレクトリ構造

current/

  • CURRENT_TASK.md - 現在進行中のタスク
  • アクティブな開発作業の詳細
  • 最新の実装状況

roadmap/

  • phases/ - フェーズ別開発計画
    • phase-8/ - AST→MIR変換
    • phase-9/ - VM/JIT実装
    • phase-10/ - AOT最適化
  • native-plan/ - ネイティブビルド計画
    • 実行バックエンド統合
    • パフォーマンス目標

proposals/

  • RFCRequest for Comments
  • 新機能提案
  • 設計ディスカッション

🎯 重要な参照先

  • 進行状況: current/CURRENT_TASK.md
  • 開発計画: roadmap/phases/
  • 技術提案: proposals/

📝 注意事項

このディレクトリの内容は開発中であり、頻繁に変更されます。 安定した仕様はreference/を参照してください。