feat(phase109): RuntimeProfile設計で FileBox を条件付き optional に
Phase 109 完全実装完了: - RuntimeProfile enum (Default, NoFs) で profile 制御 - CoreBoxId.is_required_in(profile) で条件付き required/optional - initialize_runtime() で env 読み込み責務を一元化(修正1) - NoFsFileIo スタブで no-fs プロファイルでの FileBox 無効化(修正2) - Logger/ConsoleService は no-fs でも有効と明示(修正2) - Profile 拡張予定(TestMock/Sandbox/ReadOnly/Embedded)を予約(修正3) 実装ファイル: - src/runtime/runtime_profile.rs (新規) - src/providers/ring1/file/nofs_fileio.rs (新規) - src/runtime/core_box_ids.rs (修正) - src/runtime/plugin_host.rs (修正) - src/runtime/provider_lock.rs (修正) - docs 更新 テスト: Phase 109 11/11 PASS ✅ ビルド: cargo build --release SUCCESS ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -557,13 +557,37 @@ rg 'impl.*LogApi' --type rust
|
||||
|
||||
## Summary
|
||||
|
||||
Phase 99 establishes a **clear inventory** of logging infrastructure and println! call sites:
|
||||
Phase 85–108 で、Ring0 / CoreServices / FileBox / Logging の基礎はほぼ出揃った:
|
||||
|
||||
1. **Ring0.log**: Underutilized, ready for expansion
|
||||
2. **println!/eprintln!**: 1477 production call sites categorized into 4 groups
|
||||
3. **Migration strategy**: Phased approach starting with user-facing messages
|
||||
4. **Success criteria**: Clear metrics for each phase
|
||||
- Ring0Context: Mem/Io/Time/Log/Fs/Thread の抽象化が確立
|
||||
- CoreBoxId/CoreMethodId: Box 名・メソッド名の SSOT 化
|
||||
- CoreServices/PluginHost: ring1-core (String/Integer/Bool/Array/Map/Console) の service 化
|
||||
- ConsoleService/Logging: 3層設計(Ring0.log / ConsoleService / test println!)が定着
|
||||
- FileBox: CoreRequired 扱い + Ring0FsFileIo 経由で read/write 両対応
|
||||
|
||||
**Phase 102**: StdMem implementation complete, preparing for hakmem integration.
|
||||
Phase 99 は logging infrastructure と println! call site の在庫を整理し:
|
||||
|
||||
**Next Steps**: Phase 100+ will implement gradual migrations based on this inventory.
|
||||
1. **Ring0.log**: dev/debug ログの受け皿として拡張準備済み
|
||||
2. **println!/eprintln!**: ~1400 箇所を 4 カテゴリに分類(user-facing/dev/test/internal)
|
||||
3. **Migration strategy**: user-facing → Ring0.log/internal の順で段階的移行
|
||||
|
||||
Phase 102 では StdMem 実装により hakmem 統合の足場を用意し、
|
||||
Phase 106–108 では FileBox provider_lock / Ring0FsFileIo / write/write_all 実装により、
|
||||
`FileBox → FileIo → Ring0.FsApi → std::fs` のパイプラインが完成した。
|
||||
|
||||
### Next Phases(計画)
|
||||
|
||||
今後の候補フェーズ(優先度の高い順):
|
||||
|
||||
- **Phase 109: runtime profiles(default/no-fs)**
|
||||
- `NYASH_PROFILE={default|no-fs}` などのプロファイル導入
|
||||
- default では FileBox 必須、no-fs では FileBox provider 未登録(エラー文字列で通知)
|
||||
- **Phase 110: FileHandleBox**
|
||||
- FileBox を「1ファイル専用」に保ちつつ、複数ファイル同時アクセスは FileHandleBox 側に切り出す
|
||||
- Ring0FsFileIo を再利用してハンドル単位の管理を行う
|
||||
- **Phase 111: Fs metadata 拡張**
|
||||
- `exists/metadata/canonicalize` を FileIo / FileBox 側にきちんとエクスポート
|
||||
- Ring0.FsApi の stat 情報を Nyash 側から扱えるようにする
|
||||
|
||||
さらに長期的には、Ring0 全体を「統一サービスレジストリ」として扱うフェーズ(Mem/Io/Time/Log/Fs/Thread の trait 統合)を
|
||||
Phase 11x 以降で検討する予定だよ。
|
||||
|
||||
Reference in New Issue
Block a user