feat: Add HTTP status tests and dynamic plugin documentation

- Add e2e_vm_http_status_404/500 tests to verify HTTP status handling
- ResultBox properly returns Ok(Response) for HTTP errors, Err for connection failures
- Create dynamic-plugin-flow.md documenting MIR→VM→Registry→Plugin flow
- Add vm-stats test files for HTTP 404/500 status codes
- Update net-plugin.md with HTTP error handling clarification
- Create E2E_TESTS.md documenting all E2E test behaviors
- Add mir-26-instruction-diet.md for MIR optimization plans
- Add vm-stats-cookbook.md for VM statistics usage guide
- Update MIR verifier to properly track self-assignment patterns

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-23 16:33:32 +09:00
parent 494a864ed2
commit 70af0fe566
15 changed files with 671 additions and 19 deletions

View File

@ -2,32 +2,43 @@
## ✅ 直近の完了
1. ドキュメント再編成の完了(構造刷新)
2. プラグインBoxFileBox基本実装とインタープリター統合
2. VM×プラグインのE2E整備FileBox/Net
- FileBox: open/write/read, copyFrom(handle)VM
- Net: GET/POSTVM、404/500Ok(Response)、unreachableErr(ErrorBox)
3. VM命令カウンタ時間計測のCLI化`--vm-stats`, `--vm-stats-json`とJSON出力対応
- サンプル/スクリプト整備tools/run_vm_stats.sh、local_tests/vm_stats_*.nyash
4. MIR if-merge 修正retがphi dstを返す Verifier強化mergeでのphi未使用検知
5. ドキュメント追加・更新
- Dynamic Plugin FlowMIR→VM→Registry→Loader→Plugin
- Netプラグインのエラーモデルunreachable=Err, 404/500=Ok
- E2Eテスト一覧整備
6. CI: plugins E2E ジョブLinuxを追加
## 🚧 次にやること(再開方針)
1) MIR→VMの健全化短期・最優先
- 現行MIR→VMのマッピング表を作成欠落/冗長/重複を可視化
- サンプル/テストをVMで実行し、差分ログ例外系・returns_resultを確認
- 成果物: `docs/reference/architecture/mir-to-vm-mapping.md`暫定
- マッピング表更新Err経路・Handle戻り・Result整合を実測で反映
- Verifierルールの拡充use-before-def across merge を強化)
- 成果物: `docs/reference/architecture/mir-to-vm-mapping.md`更新済・追補
2) VM×プラグインシステムのE2E検証短期
- `tests/e2e_plugin_filebox.rs` をVMでも通す`--features plugins`
- ケース: `new/close`, `open/read/write`, `copyFrom(handle)`、デリゲーション from Parent
- 成果物: テストグリーン+既知の制約を `VM_README.md` に明記
- FileBox/Netを中心にケース拡張大きいボディ、ヘッダー多数、タイムアウト等
- 成果物: E2E追補`VM_README.md` に既知の制約とTipsを追記
3) 命令セットのダイエット中期目標26命令
-行統計(`--vm-stats --vm-stats-json`)でホット命令を特
- 統合方針(例: TypeCheck/Castの整理、Array/Ref周りの集約、ExternCall→BoxCall移行
- 段階移行(互換エイリアス→削除)と回帰テスト整備
- 成果物: 26命令案ドラフト+移行計画
-HTTP OK/404/500/unreachable、FileBoxを反映して合意版を確
- 統合方針TypeOp/WeakRef/Barrierの統合、ExternCall最小化
- 段階移行(ビルドモードでメタ降格、互換エイリアス→削除)と回帰テスト整備
- 成果物: 26命令案(合意版)+移行計画
## ▶ 実行コマンド例
計測実行:
```bash
nyash --backend vm --vm-stats --vm-stats-json local_tests/test_hello.nyash > vm_stats.json
tools/run_vm_stats.sh local_tests/vm_stats_http_ok.nyash vm_stats_ok.json
tools/run_vm_stats.sh local_tests/vm_stats_http_err.nyash vm_stats_err.json
tools/run_vm_stats.sh local_tests/vm_stats_http_404.nyash vm_stats_404.json
tools/run_vm_stats.sh local_tests/vm_stats_http_500.nyash vm_stats_500.json
```
VM×プラグインE2E:
@ -42,10 +53,9 @@ nyash --dump-mir --mir-verbose examples/plugin_box_sample.nyash
nyash --verify examples/plugin_box_sample.nyash
```
## 🔭 26命令ターゲットドラフトの方向性
コア(候補): Const / Copy / Load / Store / BinOp / UnaryOp / Compare / Jump / Branch / Phi / Call / BoxCall / NewBox / ArrayGet / ArraySet / RefNew / RefGet / RefSet / WeakNew / WeakLoad / BarrierRead / BarrierWrite / Return / Print or ExternCall(→BoxCall集約) + 2枠例外/await系のどちらか
補助: Debug/Nop/Safepointはビルドモードで有効化命令としては非中核に降格
## 🔭 26命令ターゲット合意ドラフト)
- コア: Const / Copy / Load / Store / BinOp / UnaryOp / Compare / Jump / Branch / Phi / Return / Call / BoxCall / NewBox / ArrayGet / ArraySet / RefNew / RefGet / RefSet / Await / Print / ExternCall(最小) / TypeOp(=TypeCheck/Cast統合) / WeakRef(=WeakNew/WeakLoad統合) / Barrier(=Read/Write統合)
- メタ降格: Debug / Nop / Safepointビルドモードで制御
---
最終更新: 2025年8月23日MIR/VM再フォーカス、26命令ダイエットへ)
最終更新: 2025年8月23日VM×Plugins安定・MIR修正・26命令合意ドラフトへ)