feat(phase92): UnifiedBoxRegistry integration roadmap complete
Phase 92 完了: UnifiedBoxRegistry 統合の導線作り **実装内容**: - CoreServices::required_ids() 実装 - Phase 87 CoreBoxId の core_required (6個) を返す - is_core_required() との整合性を型レベルで保証 - CoreInitError enum 追加 - MissingService, RegistryEmpty, InvalidServiceType - Display + std::error::Error trait 実装 - PluginHost::with_core_from_registry() skeleton - Phase 93 で実装予定(todo!() でプレースホルダー) - initialize_runtime() 接続ポイント決定 - Ring0Context と UnifiedBoxRegistry を橋渡し **Phase 87 整合性**: - required_ids() が is_core_required() と完全一致 - テストで整合性を検証 **テスト結果**: - 3件追加(全て合格) - test_required_ids_consistency - test_core_init_error_display - test_with_core_from_registry_todo (should_panic) - ビルド成功 - 既存テストに影響なし **ドキュメント更新**: - Section 9 追加(113行) - ensure_initialized() 呼び出し場所決定(4箇所) - Phase 93 実装計画明記 **次のステップ**: Phase 93 (with_core_from_registry 実装 & 起動パス統合) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
//! Phase 87 CoreBoxId の core_required (6個) 全てをカバー。
|
||||
|
||||
use std::sync::Arc;
|
||||
use crate::runtime::CoreBoxId;
|
||||
|
||||
/// StringBox Service trait
|
||||
pub trait StringService: Send + Sync {
|
||||
@ -58,6 +59,20 @@ pub struct CoreServices {
|
||||
}
|
||||
|
||||
impl CoreServices {
|
||||
/// Phase 87 CoreBoxId の core_required (6個) を返す
|
||||
///
|
||||
/// Phase 87 CoreBoxId::is_core_required() と完全一致する。
|
||||
pub fn required_ids() -> &'static [CoreBoxId] {
|
||||
&[
|
||||
CoreBoxId::String,
|
||||
CoreBoxId::Integer,
|
||||
CoreBoxId::Bool,
|
||||
CoreBoxId::Array,
|
||||
CoreBoxId::Map,
|
||||
CoreBoxId::Console,
|
||||
]
|
||||
}
|
||||
|
||||
/// 全フィールドが初期化されているか検証
|
||||
/// Phase 92 以降で各 Service の初期化を検証
|
||||
pub fn ensure_initialized(&self) {
|
||||
@ -65,3 +80,27 @@ impl CoreServices {
|
||||
// Phase 92 以降で各 Service の初期化を検証
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_required_ids_consistency() {
|
||||
let required = CoreServices::required_ids();
|
||||
assert_eq!(required.len(), 6);
|
||||
|
||||
// Phase 87 CoreBoxId::is_core_required() と一致
|
||||
for id in required {
|
||||
assert!(id.is_core_required());
|
||||
}
|
||||
|
||||
// 全ての core_required が含まれているか確認
|
||||
assert!(required.contains(&CoreBoxId::String));
|
||||
assert!(required.contains(&CoreBoxId::Integer));
|
||||
assert!(required.contains(&CoreBoxId::Bool));
|
||||
assert!(required.contains(&CoreBoxId::Array));
|
||||
assert!(required.contains(&CoreBoxId::Map));
|
||||
assert!(required.contains(&CoreBoxId::Console));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user