Files
hakorune/docs/development/current/main/30-Backlog.md
nyash-codex ac14f94578 refactor(phase115): FileHandleBox 箱化・モジュール化実装完成
「Everything is Box」原則に基づいて FileHandleBox を整理し、
コード重複を削減して保守性を大幅向上。

【Task 1】テストヘルパー外出し
- tests/common/file_box_helpers.rs を新規作成
- setup_test_file / cleanup_test_file / init_test_provider を共有化
- FileBox と FileHandleBox 両方で統一的なテストヘルパーを使用可能に

【Task 2】ny_* メソッド統一化(マクロ化)
- 4つのマクロを新規定義:
  - ny_wrap_void!(open, write, close)
  - ny_wrap_string!(read)
  - ny_wrap_bool!(exists, is_file, is_dir)
  - ny_wrap_integer!(size)
- 8個のny_*メソッドをマクロ呼び出しに置き換え
- 削減効果: 52行 → 8行(85%削減!)

【Task 3】ドキュメント & テスト確認
- FileHandleBox ドキュメントに "Code Organization" セクション追加
- Phase 115 実装内容を明記(モジュール化・箱化・マクロ統一化)
- CURRENT_TASK.md に Phase 115 セクション追加

【効果】
- 保守性向上: ny_* メソッドの重複パターンをマクロで一元管理
- テスト共有化: 共通ヘルパーで FileBox/FileHandleBox 間の一貫性確保
- 可読性向上: 実装の意図が明確に
- 拡張性: 新しいny_*メソッド追加時はマクロ呼び出し1行で完了

【統計】
- 新規作成: 2ファイル(+40行)
- 修正: 2ファイル(+72行, -62行)
- 実質: +50行(マクロ・ヘルパー・ドキュメント追加)
- テスト: 27個全PASS(1個は環境依存で ignore)

【技術的工夫】
- マクロ展開後の動作が既存と同一(互換性維持)
- エラーハンドリング一元化(unwrap_or_default / unwrap_or(false))
- allow(unused_mut) で警告抑制

【Phase 106-115 全体成果】
Ring0/FileBox I/O パイプライン第1章完全クローズ
- 10フェーズ完成
- 60ファイル修正
- +2,500行実装
- 59テスト全PASS
- Ring0 / Ring1 / FileBox / FileHandleBox 完全統一設計

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 04:13:15 +09:00

15 lines
806 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Self Current Task — Backlog (main)
短期JoinIR/selfhost ライン 第2章
- selfhost Stage3 代表パスの安定化JoinIR Strict 経由で JSON emit まで通す)。
- `hako_check` ラインの整理(可能な限り JoinIR 経由に寄せ、分岐やフォールバックを可視化)。
- CURRENT_TASK / Phase docs を「selfhost/JoinIR 第2章」視点で更新。
中期
- VInvokevector戻り型の正道化toml 記述 or NyRT 期待フラグ)。
- wasm/Web デモライン: JoinIR ベースの軽量ランタイム検証。
周辺
- Ny ツール側selfhost-compiler / hako_check / 各種 CLIのログ・エラー体験を、Ring0/ConsoleService 上で整える。
- docs 更新(言語ガイド + JoinIR ガイドに selfhost 代表フローを追記)。