Commit Graph

5 Commits

Author SHA1 Message Date
65763c1ed6 feat(llvm): Phase 97 - Call/PHI/Plugin強化 + リファクタリング準備
## 概要
LLVM backend のCall処理、PHI wiring、Plugin loader を強化。
次のリファクタリング(箱化モジュール化)のための準備も含む。

## 変更内容

### LLVM Call処理強化
- `mir_call/__init__.py`: Call ルーティングロジック改善
- `mir_call/global_call.py`: print処理の marshal強化
- `mir_call/method_call.py`: メソッド呼び出し処理改善
- `boxcall.py`: BoxCall処理改善

### PHI処理強化
- `phi_manager.py`: PHI管理改善
- `phi_wiring/wiring.py`: PHI配線ロジック強化(+17行)
- `phi_wiring/tagging.py`: Type tagging改善
- `resolver.py`: Value解決ロジック強化(+34行)

### Copy伝播
- `copy.py`: Copy命令のType tag伝播追加(+10行)

### Plugin loader強化
- `library.rs`: エラー出力改善、[plugin/missing]ログ追加(+34行)
- fail-fast強化

### テスト
- `phase97_json_loader_escape_llvm_exe.sh`: Phase 97 E2Eテスト追加
- `phase97_next_non_ws_llvm_exe.sh`: Phase 97 E2Eテスト追加

### その他
- `nyash_kernel/lib.rs`: Kernel側の改善(+23行)

## 統計
- 14ファイル変更
- +256行 / -53行 = +203 net

## 次のリファクタリング準備
以下の箇所がリファクタリング対象として識別済み:
1. Call ルーティング箱の明文化
2. print の marshal 箱
3. TypeFacts/Tagging 箱の一本化
4. PHI Snapshot 契約のSSOT
5. Plugin loader のエラー出力統合

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-17 03:51:03 +09:00
ccd2342376 feat(plugin_loader): Phase 134 P0 - Best-effort plugin loading (continue on failures) 2025-12-15 17:00:51 +09:00
6ecd8f7f52 feat(runtime): Phase 103 CoreServices Optional化 - Memory Constraints対応
- 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)
2025-12-03 13:59:06 +09:00
8633224061 JoinIR/SSA/Stage-3: sync CURRENT_TASK and dev env 2025-12-01 11:10:46 +09:00
8fbbe2b3a0 refactor: 大規模リファクタリングPhase完了 - SRP原則による品質向上
🎯 実行内容:
• box_operators.rs: 639行 → 26%構造改善 (Phase 1-2完了)
  - マクロ抽出: macros.rs (演算子実装統一)
  - ヘルパー分離: helpers.rs (共通ユーティリティ)
  - 静的実装分離: static_ops.rs (静的演算子)
• arithmetic boxes: 完全モジュール分割
  - 6種類の演算Box (add/subtract/multiply/divide/modulo/compare)
• plugin_loader_v2: 7モジュール完全分割
  - config/library/metadata/singletons/specs/util分離
• nyash-net-plugin: 緊急修正完了 (27エラー→0)
  - import解決問題・マクロスコープ問題・関数構造問題修正
• nyash-filebox-plugin: モジュール統合・冗長削除

📊 成果:
• SRP原則適用による保守性向上
• 大規模ファイル分割による可読性改善
• プラグインビルドエラー完全解決
• モジュール境界明確化・再利用性向上

🔧 検証済み: 全スモークテスト正常動作確認

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 05:03:59 +09:00