feat(runtime): Phase 100 user-facing 出力の ConsoleService 完全統一 - 29箇所完了

## Phase 100 完了項目
-  selfhost.rs: 6箇所 → console_println!
-  llvm.rs: 23箇所(主要メッセージ) → console_println!
-  全テストPASS(core_services: 11, plugin_host: 7)
-  ドキュメント更新完了

## 置き換え箇所(29箇所)

**selfhost.rs**(6箇所):
- Line 57: CoreInitError 出力
- Lines 194/363/418/519/570: Result 出力

**llvm.rs**(23箇所、ユーザー向けメッセージのみ):
- エラーメッセージ(): ファイル読み込み、using/parse エラー
- 成功メッセージ(📊): MIR コンパイル成功
- LLVM/harness 関連エラー
- 実行結果出力
- Mock LLVM メッセージ

## 意図的に除外(Phase 101 対象)
- llvm.rs の `[joinir/llvm]`, `[parse/context]` デバッグログ
- hack_check: .hako アプリ(Nyash言語の ConsoleBox 経由)
- bench.rs: テスト・性能表示(dev-debug)
- mir.rs: 内部 MIR ダンプ(dev-debug)

## 技術的成果
- selfhost/LLVM runner のユーザー向けメッセージを ConsoleService に統一
- Phase 99 で確立したログ/出力ポリシーを実装レベルで実現
- デバッグログとユーザー向け出力の明確な分離
- Graceful Degradation パターンの実用確認

## 統計
- Phase 98: 7箇所
- Phase 100: 29箇所
- **合計**: 36箇所で ConsoleService 経由に移行完了
- 残り user-facing: ~330箇所(Phase 101-102 で段階的拡張)

## ドキュメント更新
- logging_policy.md: Section 7 追加(Phase 100 実装完了記録)
- ring0-inventory.md: Category 1 更新(Phase 100 進捗反映)
- CURRENT_TASK.md: Phase 85 セクション追記

## Phase 85-100 総括
- Phase 95.5-97: CoreServices 6個完全実装(String/Integer/Bool/Array/Map/Console)
- Phase 98-98.5: ConsoleService 代表パス拡張(7箇所)
- Phase 99: ログ/出力ポリシー確定(3層設計文書化)
- Phase 100: user-facing 出力の ConsoleService 化(29箇所) 

次: Phase 101(dev-debug/test/internal 出力の整理、Ring0.log 活用)

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-03 11:55:14 +09:00
parent c181aeac4d
commit 7cf11fbc5c
5 changed files with 99 additions and 39 deletions

View File

@ -310,3 +310,48 @@ Phase 99 establishes the **documentation foundation** for future logging/output
4. **Migration strategy**: Phased approach with clear priorities
**Next Steps**: Phase 100+ will implement gradual migrations based on this policy framework.
---
## Section 7: Phase 100 Implementation Complete (2025-12-03)
### user-facing 出力の CoreServices 化完了
**実装概要**: selfhost と LLVM runner の主要なユーザー向け出力を ConsoleService (console_println!) 経由に統一
**完了箇所**:
- **selfhost.rs**: 6箇所 → console_println!
- Line 57: CoreInitError 出力
- Line 194, 363, 418, 519, 570: Result 出力
- **llvm.rs**: 23箇所ユーザー向けメッセージ → console_println!
- Line 26, 44, 53, 60, 116: エラーメッセージ(❌)
- Line 121-122: 成功メッセージ(📊)
- Line 215, 230, 239, 275, 287, 295: LLVM/harness エラー
- Line 324, 328, 334-335, 353-354, 357-358, 362: 実行結果
- Line 369-370, 379, 383, 391: Mock LLVM メッセージ
- **vm.rs**: 1箇所Phase 98 で完了済み)
- **core_bridge.rs**: 2箇所Phase 98 で完了済み)
- **selfhost 関連**: 5箇所Phase 98 で完了済み)
**合計**: Phase 98 (7箇所) + Phase 100 (29箇所) = **36箇所完了**
**除外箇所**(意図的に残した):
- llvm.rs の `[joinir/llvm]`, `[parse/context]` デバッグログPhase 101 対象)
- hack_check: .hako アプリNyash言語の ConsoleBox 経由、別フェーズ)
**テスト結果**:
- ✅ cargo build --release 成功
- ✅ core_services テスト: 11 passed
- ✅ plugin_host テスト: 7 passed
- ✅ 代表ケース動作確認:
- loop_min_while.hako: "📊 MIR Module compiled successfully!" 等が console_println! 経由で出力
- エラーケース: "❌ Error reading file..." が console_println! 経由で出力
**残りの user-facing 出力**:
- 推定: ~330箇所その他の runner/modes/*
- 優先度: HIGH → Phase 101-102 で段階的拡張
**技術的成果**:
- selfhost/LLVM runner のユーザー向けメッセージが ConsoleService に統一
- Phase 99 で確立したログ/出力ポリシーが実装レベルで実現
- デバッグログとユーザー向け出力の明確な分離