feat(joinir): Phase 89 P0 - Continue + Early Return pattern detector

## Pattern4 Detector 締め
- is_pattern4_continue_minimal() を厳しく
- Select 必須 + conditional Jump exactly 1
- loop 内 return を P4 と誤認しない

## 新パターン箱
- LoopPattern::ContinueReturn enum 追加
- has_return_in_loop_body() helper 追加
- Fail-Fast: UnimplementedPattern error

## Normalized-dev 統合
- NormalizedDevShape::PatternContinueReturnMinimal
- detector: Select + conditional Jumps >= 2
- canonical には入れない(dev-only)

## Documentation
- 10-Now.md, CURRENT_TASK.md 更新

Impact:
- 987 lib tests PASS
- 60 normalized_dev tests PASS
- Pattern4 誤爆防止

🤖 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-14 00:59:58 +09:00
parent b578eb7a65
commit 4e3fc4ad49
9 changed files with 351 additions and 16 deletions

View File

@ -55,10 +55,37 @@
- Prerequisites documented: llvm-config-18, llvmlite, LLVM features
- Integration test: PASS (or SKIP if no LLVM)
**Next**: Phase 88+ (TBD - await user direction)
**Reference**: phase87-selfhost-llvm-exe-line.md
### Phase 89 P0: Continue + Early Return Pattern (2025-12-14) 🚧
**Status**: IN PROGRESS - Dev-only fixture isolation
**Goal**:
- Establish new control axis: Continue + Early Return (loop-internal return)
- Prevent Pattern4 detector false positives (canonical mismatch)
- Maintain default behavior (normalized_dev scope only)
**Step 0 COMPLETE** (2025-12-14):
- ✅ Pattern4 detector tightened (require Select + exactly 1 conditional Jump)
- ✅ Test added: `test_pattern4_detector_rejects_loop_with_return`
- ✅ All existing Pattern4 tests pass
**Next Steps**:
- P0-1: Documentation (10-Now.md, CURRENT_TASK.md)
- P0-2: Minimal fixture (continue + early return, deterministic output)
- P0-3: Frontend pattern (LoopPattern::ContinueReturn enum + lowering box)
- P0-4: Normalized-dev integration (shape + normalize function)
- P0-5: Acceptance tests (structured vs vm-bridge parity + expected output)
**Constraints**:
- ❌ No default behavior changes
- ❌ No by-name branching
- ❌ No fallback processing (Fail-Fast)
- ❌ Not added to canonical shapes initially (dev-only first)
**Reference**: (TBD - phase89-continue-return-pattern.md)
### Scope / BindingIddev-only の段階移行ライン)
- MIR builder 側で lexical scope / shadowing を実在化し、言語仕様の “local はブロック境界で分離” を SSOT に揃えた。