- Add CoreServicesConfig struct (from_env, minimal, all_enabled) - Implement with_core_from_registry_optional() for selective initialization - Update CoreBoxesImpl fields to Option<Arc<dyn XyzService>> - Maintain backward compatibility (with_core_from_registry calls all_enabled) - Add NYASH_CORE_DISABLE_* environment variable support - ConsoleBox remains mandatory (Graceful Degradation principle) - Add unit tests for optional initialization - Update console_println! macro to handle Option type - Fix direct console.println() calls in vm.rs and selfhost.rs - Create core_optional_design.md documentation Note: Phase 104 will extend ConsoleService to be optional as well with graceful fallback in console_println! macro. Files modified: - src/runtime/plugin_host.rs (CoreServicesConfig, with_core_from_registry_optional, tests) - src/runtime/core_services.rs (CoreBoxesImpl fields → Option type) - src/runtime/mod.rs (console_println! macro updated) - src/runner/modes/vm.rs (handle Option console) - src/runner/selfhost.rs (handle Option console) - docs/development/current/main/core_optional_design.md (new) - docs/development/current/main/ring0-inventory.md (Phase 103 entry) Test results: - Build: ✅ Success (0 errors, 7 warnings) - Unit tests: ✅ 3/3 passed (optional_core_tests) - Runtime tests: ✅ 63/63 passed - Smoke tests: ✅ 30/31 passed (1 pre-existing timeout)
observe — Builder 観測(dev‑only/既定OFF)
目的
- Builder 内部の決定(resolve.try/choose, ssa.phi など)を JSONL で観測する。
- 環境変数で明示有効化された時のみ動作(既定OFF)。言語仕様・実行結果は不変。
責務
- ssa.rs:
emit_phi— PHI の決定(pred の type/origin、dst の決定)を DebugHub へ emit。 - resolve.rs:
emit_try/emit_choose— メソッド解決の候補/最終選択を emit。
非責務(禁止)
- MIR 命令の生成/変更は行わない(副作用なし)。
- 起源付与や型推論は origin 層に限定。
トグル(DebugHub 側でガード)
NYASH_DEBUG_ENABLE=1NYASH_DEBUG_KINDS=resolve,ssaNYASH_DEBUG_SINK=/path/to/file.jsonl
レイヤールール
- Allowed: DebugHub emit、Builder の読み取り(関数名/region_id/メタ)。
- Forbidden: rewrite/origin の機能をここに持ち込まない。