f5ab4910e4
fix(plugins): Fix FileBox plugin I/O operations and add TLV debugging
...
## FileBox Plugin Fixes
### Issue Resolution
- Fixed file write operations not persisting to disk
- Fixed TLV tag mismatch preventing read operations
- Added comprehensive TLV debugging capability
### Changes Made
#### plugins/nyash-filebox-plugin/src/lib.rs
- Added file.flush() after write operations to ensure data persistence
- Modified tlv_parse_bytes to accept both String(6) and Bytes(7) tags
- Resolves compatibility issue with plugin-tester String encoding
#### tools/plugin-tester/src/main.rs
- Added `tlv-debug` subcommand with detailed TLV analysis
- Provides hex dumps, encoding/decoding verification
- Full plugin round-trip testing with file I/O validation
- Detailed error analysis for debugging TLV protocol issues
## Test Results
### Before Fix
```
INFO: WRITE 8 bytes
INFO: READ 0 bytes ← Problem: no data read
✗: Plugin round-trip failed\!
```
### After Fix
```
INFO: WRITE 8 bytes
INFO: READ 8 bytes ← Fixed: data successfully read
✓: Plugin round-trip successful\!
```
## Technical Details
- Root cause: Missing file.flush() + TLV tag type mismatch
- Plugin-tester sends String(6), plugin expected Bytes(7) only
- File buffer not flushed to disk before close/reopen
- Solution: Added flush() + dual tag support for compatibility
This completes the core BID-FFI plugin I/O functionality validation.
Nyash integration still needs method dispatch optimization.
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-18 11:21:04 +09:00
0441608db3
BID-FFI integration:\n- Add plugin-tester io subcommand and TLV helpers; E2E open/write/read/close\n- Implement FileBox plugin invoke (birth/open/read/write/close) with BID-1 two-pass\n- Add BID loader/registry/plugin_box modules; prefer plugin-backed FileBox in interpreter\n- Introduce PluginFileBox with minimal read/write/close dispatch\n- Update runner debug paths; add local simple tests\n- Docs: plugin-tester guide and FileBox Nyash↔BID mapping; CURRENT_TASK updated
2025-08-18 11:07:03 +09:00
2efdd0ac0c
feat: BID-FFIプラグインシステム基盤実装(Step 1-3完了)
...
- FileBoxプラグイン単体実装
- birth/finiライフサイクル対応
- 6つのメソッド定義(birth/open/read/write/close/fini)
- プラグインが自らBox名「FileBox」を宣言
- nyash.toml設定ファイル作成
- FileBox = "nyash-filebox-plugin" マッピング定義
- プラグイン検索パス設定
- プラグインテスター作成(tools/plugin-tester)
- Box名を決め打ちしない汎用設計
- プラグインから型情報を動的取得
- メソッド一覧表示機能
- 診断機能付きチェックコマンド
重要な設計原則:
- プラグインが自分のBox名を宣言(ローダーは知らない)
- 汎用的で拡張可能な設計
- メモリ管理の明確な責任分担
次のステップ:Nyashとの統合(Step 4)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-18 09:32:54 +09:00
bec0e9bc92
revert: 古いプラグインシステム実装前の状態に巻き戻し
...
- ソースコードをcommit 3f7d71fの状態に復元(古いプラグインシステム実装前)
- docsフォルダは最新の状態を維持(BID-FFI設計ドキュメント含む)
- nyashバイナリの基本動作確認済み
- BID-FFIシステムをクリーンに再実装する準備完了
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-08-18 08:34:19 +09:00
75868a5a96
feat(phase-9.75g-0): Implement BID-FFI Day 5 - FileBox plugin library and transparent switching (90% complete)
...
Day 5 achievements:
- Created independent FileBox plugin crate with C FFI exports
- Integrated plugin loading into Nyash interpreter startup
- Implemented transparent builtin/plugin Box switching via nyash.toml
- Successfully loaded plugin library (385KB .so) at runtime
- Confirmed PluginBox proxy creation for FileBox instances
Architecture changes:
- Added plugins/ directory with .gitignore for build artifacts
- Modified runner.rs to load plugins from nyash.toml on startup
- Updated objects.rs to use BoxFactoryRegistry for FileBox creation
- Fixed bid module visibility between lib.rs and main.rs
Remaining work (10%):
- Complete PluginBox proxy method implementations (toString, etc.)
- Test actual file operations through plugin interface
- Finalize error handling and edge cases
Build status: All tests passing, plugin loading confirmed
2025-08-18 00:33:01 +09:00