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:
nyash-codex
2025-12-12 22:51:21 +09:00
parent acb6720d9b
commit 0ff96612cf
6 changed files with 951 additions and 1 deletions

View File

@ -53,4 +53,5 @@ Phase 61 は「Break(P2) に P3 固有ロジックを混ぜない」を達成し
## Next Candidates
- Phase 62: P3(if-sum) の「本番 MIR→JoinIR ルート」へ OwnershipPlan を渡す設計AST-based ownership 解析の接続点を設計 → dev-only で段階接続)。
- Phase 63: ASTNode → OwnershipPlan の analyzer を追加analysis-only, dev-only
- Phase 63+: multi-hop / merge relay の意味論設計Fail-Fast を解除する前に SSOT と不変条件を明文化)。