- Fixed deadlock in FileBox plugin copyFrom implementation (single lock)
- Added TLV Handle (tag=8) parsing in calls.rs for returned BoxRefs
- Improved plugin loader with config path consistency and detailed logging
- Fixed loader routing for proper Handle type_id/fini_method_id resolution
- Added detailed logging for TLV encoding/decoding in plugin_loader_v2
Test docs/examples/plugin_boxref_return.nyash now works correctly:
- cloneSelf() returns FileBox Handle properly
- copyFrom(Box) accepts plugin Box arguments
- Both FileBox instances close and fini correctly
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename legacy plugin files to *_legacy.rs for protection
- Comment out old plugin loader and Host VTable dependencies
- Add temporary stub for create_plugin_box during migration
- Fix doc comment placement in io_methods.rs
- Prepare for v2 plugin system with single FFI entry point
- Extend plugin-tester to support multi-box plugins with v2 API
- Add nyash_plugin_get_box_count/get_box_info/get_type_id functions
- Create test multi-box plugin providing TestBoxA and TestBoxB
- Update plugin-system.md documentation for v2 format
- Add nyash.toml v2 specification for multi-box support
- Successfully tested multi-box plugin lifecycle and type resolution
This enables one plugin to provide multiple Box types, solving the
dependency issue where HTTPServerBox needs SocketBox.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🎊 Phase 9.75g-0 COMPLETE - Revolutionary Plugin System Achievement\!
✅ Major Completions:
- plugin-tester type validation: nyash.toml integration & method signature verification
- Duplicate method name detection: Enforces Nyash no-overloading policy
- Comprehensive developer guide: 200+ line technical documentation
- Memory safety: HostVtable lifetime issues resolved with LazyLock
- Type information system: External nyash.toml configuration eliminates hardcoded conversions
🚀 Revolutionary Impact:
Nyash now supports dynamic Box type extension via plugins:
```nyash
local file = new FileBox() // Plugin-provided
local db = new PostgreSQLBox() // Future: Plugin-provided
local gpu = new CudaBox() // Future: Plugin-provided
```
📊 Technical Achievements:
- plugin-tester: 4 comprehensive validation modes (check/lifecycle/io/typecheck)
- BID-FFI Protocol: Production-ready with valgrind-verified memory safety
- Type conversion: Automatic string→bytes mapping via nyash.toml
- Method validation: Prevents overloading conflicts in plugin development
🎯 Next Priority: Phase 8.6 VM Performance Improvement
Current issue: VM is 0.9x slower than interpreter (regression\!)
Target: 2x+ speedup for practical VM execution
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
🚨 Critical memory safety fix:
- HostVtable was created on stack and destroyed after init
- Plugin stored reference to destroyed memory → NULL pointer access
- Changed to static LazyLock storage for lifetime safety
✅ Results:
- Segfault completely eliminated
- Plugin logging now works properly
- Type info system confirmed working
- Full E2E FileBox plugin operation successful
🔧 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>