feat(selfhost): Phase 151 - ConsoleBox Selfhost Support

- Identify ConsoleBox registration issue: plugins registered but PluginBoxFactory can't find them
- Root cause: timing/initialization order between BoxFactoryRegistry and UnifiedBoxRegistry
- Solution: Add ConsoleBox builtin fallback for selfhost Stage-3 pipeline
- Implementation: Plugin-preferred, builtin as fallback
- Test results: 2/2 PASS (esc_dirname_smoke.hako, string_ops_basic.hako)

Modified files:
- src/box_factory/builtin_impls/console_box.rs (new, 35 lines)
- src/box_factory/builtin_impls/mod.rs (add console_box module)
- src/box_factory/builtin.rs (add ConsoleBox creation and box_types)
- CURRENT_TASK.md (Phase 151 completion)
- docs/development/current/main/phase151_consolebox_selfhost_support.md (implementation summary)

🤖 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-04 13:07:12 +09:00
parent 62808f9585
commit d70329e5df
8 changed files with 150 additions and 11 deletions

View File

@ -202,6 +202,13 @@ static box Main {
}
```
📌 **Note: `Type::static_method` と宣言構文について**
- 呼び出し側では `Type::static_method(...)` のように「型にぶら下がった関数」を使うことができるが、
これはあくまで **呼び出し構文** だよ。
- 宣言側の構文としては **`static box` の中に通常のメソッドを定義する** のが Stage3 仕様の正しい形で、
`static method foo() { ... }` のようなトップレベルBox外の宣言構文は **legacy/非推奨** であり、今後の実装では使用しない。
Runner Configuration
- Enable using preprocessing: `NYASH_ENABLE_USING=1`
- CLI from-the-top registration: `--using "ns as Alias"` or `--using '"apps/foo.hako" as Foo'` (repeatable)