docs(joinir): Phase 63 - AST ownership analyzer (dev-only)
ASTNode → OwnershipPlan の解析器を追加(analysis-only, normalized_dev)。 Key changes: - New ast_analyzer.rs (~370 lines): - AstOwnershipAnalyzer: AST → Vec<OwnershipPlan> - ScopeKind: Function/Loop/If/Block - Invariants: owned_vars/relay_writes/captures/condition_captures Design: - JSON v0 "Local=rebind" を使わず、AST の Statement::Local を正しく扱う - "読むのは自由、管理は直下だけ" アーキテクチャ維持 Tests: 3 unit tests + 47/47 normalized_dev PASS - loop_local_carrier_is_owned_and_written - condition_capture_is_reported_for_loop - relay_write_detected_for_outer_owned_var Next: Phase 64 - P3(if-sum) 本番ルートへ dev-only で接続 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
28
docs/development/current/main/PHASE_63_SUMMARY.md
Normal file
28
docs/development/current/main/PHASE_63_SUMMARY.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Phase 63 Summary: Ownership AST Analyzer (dev-only)
|
||||
|
||||
## Goal
|
||||
|
||||
本番ルート(MIR builder)の入力である `crate::ast::ASTNode` から、Ownership-Relay の解析結果(`OwnershipPlan`)を生成できるようにする。
|
||||
|
||||
- JSON v0 専用の「Local=rebind」扱いは使わない
|
||||
- `normalized_dev` feature 下でのみ有効(analysis-only)
|
||||
|
||||
## Changes
|
||||
|
||||
- 追加: `src/mir/join_ir/ownership/ast_analyzer.rs`
|
||||
- `AstOwnershipAnalyzer` を実装(AST → `Vec<OwnershipPlan>`)
|
||||
- ScopeKind: Function / Loop / If / Block
|
||||
- 不変条件: `owned_vars / relay_writes / captures / condition_captures` を `OwnershipPlan` として出力
|
||||
- 導線: `src/mir/join_ir/ownership/mod.rs`
|
||||
- `#[cfg(feature = "normalized_dev")] pub use ast_analyzer::*;` を追加
|
||||
|
||||
## Tests
|
||||
|
||||
- `src/mir/join_ir/ownership/ast_analyzer.rs` 内にユニットテストを追加:
|
||||
- loop-local owned + write(carrier 相当)
|
||||
- condition capture(condition_captures ⊆ captures)
|
||||
- relay write(外側 owned への更新)
|
||||
|
||||
## Notes
|
||||
|
||||
- Phase 64 で、本番 P3(if-sum) ルート(`pattern3_with_if_phi.rs`)へ dev-only で接続し、carrier order / boundary inputs の SSOT 化を開始する。
|
||||
Reference in New Issue
Block a user