docs: Phase 100 P1 pinned receiver integration tests complete

- Update docs/development/current/main/phases/phase-100/README.md
  * Document P1 implementation and pinned receiver example
- Update docs/development/current/main/10-Now.md
  * Add Phase 100 P1 completion short report

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

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-17 05:43:54 +09:00
parent 82806f8f90
commit 682fc11f7c
2 changed files with 47 additions and 0 deletions

View File

@ -1,5 +1,13 @@
# Self Current Task — Now (main)
## 2025-12-17Phase 100 P1 完了 ✅
**Phase 100 P1: Pinned Local Captures**
- CapturedEnv に CapturedKind (Explicit/Pinned) 拡張
- PinnedLocalAnalyzer で loop-outer read-only locals を識別
- Pinned receiver (例: s.substring()) が loop 内で使用可能に
- Fixture/smoke で動作確認済み
## 20251217Phase 99 完了 ✅
**Phase 99: Trim/escape 実コード寄り強化VM+LLVM EXE**

View File

@ -42,3 +42,42 @@ loop(i < n) {
- **P2mutable**: loop body 内で再代入される外側変数は `Pinned` では扱わず、LoopStatecarrier/envに昇格して運ぶ。
- 初期は “更新形を限定” して shape guard を作り、未対応は FailFast曖昧に通さない
- **P3hoist**: ループ内の不変式の巻き上げは Loop Canonicalizer 側で扱う(別ユースケースとして分離)
## P1: Pinned Local Captures (Explicit/Pinned) - 完了 ✅
Implemented CapturedKind enum to distinguish:
- **Explicit**: Traditional captures (condition variables, carriers)
- **Pinned**: Phase 100 read-only loop-outer locals used as method receivers
**Status**: P1-1 through P1-5 complete - pinned receiver functionality validated with fixture+smoke tests.
Example (now works):
```hako
local s = "a" + "b" + "c" # Dynamic construction (loop-outer)
loop(i < 1) {
local ch = s.substring(i, i+1) # Pinned receiver works!
print(i)
i = i + 1
}
```
**Smoke test**: phase100_pinned_local_receiver_vm.sh
### Implementation Details
**Search Order (SSOT)**:
1. ConditionEnv (loop-outer scope)
2. LoopBodyLocalEnv (body-local variables - Phase 226 cascading)
3. CapturedEnv (pinned loop-outer locals)
4. CarrierInfo (mutable carriers)
**Key Components**:
- `CapturedKind` enum: Distinguishes Explicit vs Pinned captures
- `PinnedLocalAnalyzer`: Identifies loop-outer read-only locals
- `loop_body_local_init.rs`: Updated receiver resolution with full search order
### Test Coverage
- **Fixture**: `apps/tests/phase100_pinned_local_receiver_min.hako`
- **Smoke Test**: `tools/smokes/v2/profiles/integration/apps/phase100_pinned_local_receiver_vm.sh`
- **Regression**: Phase 96 and Phase 94 smoke tests pass