feat(phase94): Box→Service conversion with actual registry integration

Phase 94完全達成 - UnifiedBoxRegistryから実際のBoxを取得してServiceに変換

### 実装成果
-  6個のAdapter実装(StringBox/Integer/Bool/Array/Map/Console)
-  Dummy実装完全削除(38行削減)
-  Fail-Fast原則徹底(フォールバック削除)
-  テスト7/7 PASS(100%)

### 変更ファイル
- src/runtime/core_services.rs: 6個のAdapter実装(+93行)
- src/runtime/plugin_host.rs: 実際のBox取得ロジック(+54行)、Dummy削除(-17行)
- src/runtime/mod.rs: フォールバック削除(-8行)

### 技術的成果
- Box<dyn NyashBox>を直接保持(型安全性確保)
- registry.create_box()で実際のBoxインスタンス取得
- BuiltinBoxFactory登録でcore_required Boxes提供

### 次のステップ
Phase 95: Service traitメソッド実装(Console/String/Array/Map)

🤖 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 09:14:49 +09:00
parent b3de4cac4b
commit f4144a22a6
4 changed files with 217 additions and 103 deletions

View File

@ -1,6 +1,6 @@
# Core Boxes 設計ドキュメントPhase 87 完了版)
# Core Boxes 設計ドキュメントPhase 8794 完了版)
Phase 87 で実装された CoreBoxId/CoreMethodId の完全仕様。
Phase 87 で実装された CoreBoxId/CoreMethodId と、Phase 9194 で統合された CoreServices/PluginHost/Adapter の仕様。
**目的**: Box名・メソッド名のハードコードを型安全な enum に箱化することで、以下を実現:
- ✅ コンパイル時検証(タイポ撲滅)
@ -8,7 +8,10 @@ Phase 87 で実装された CoreBoxId/CoreMethodId の完全仕様。
- ✅ SSOTSingle Source of Truth確立
- ✅ 保守性向上
**実装状況**: ✅ Phase 87 完了2025-12-02
**実装状況**:
- ✅ Phase 87: CoreBoxId/CoreMethodId 実装
- ✅ Phase 91: CoreServices/PluginHost skeleton
- ✅ Phase 94: Box → Service Adapter 実装と Dummy 削除
---
@ -546,4 +549,3 @@ NYASH_USE_PLUGIN_HOST=1 ./target/release/nyash apps/tests/selfhost_min.hako
2. `src/runtime/core_services.rs`: CoreServices::dummy() ヘルパー
3. `src/runtime/mod.rs`: initialize_runtime() 実装(環境変数制御)
4. `src/runner/selfhost.rs`: PluginHost 初期化追加