Files
hakorune/CURRENT_TASK.md
nyash-codex 4e3fc4ad49 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>
2025-12-14 00:59:58 +09:00

87 lines
4.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Current Task
このファイルは「いま何に集中しているか」と「次にやり得る候補」だけを書く軽量ビューだよ。
詳細は `docs/development/current/main/` 以下の各 Phase 文書と、JoinIR の SSOT である
`docs/development/current/main/joinir-architecture-overview.md` を参照してね。
最終更新: 2025-12-13
過去ログ(肥大化した旧 CURRENT_TASKはここに退避したよ:
- `docs/development/current/main/CURRENT_TASK_ARCHIVE_2025-12-13.md`
---
## 今の状態Phase 7489 まで到達)
- Scope/BindingId の段階移行dev-onlyは Pattern2/3/4 まで配線済みdual-path 維持)。
- Pattern2 の promoted carriersDigitPos/Trimについて ExitLine 契約ConditionOnly を exit PHI から除外)を E2E で固定済み。
- debug flag SSOT / DebugOutputBox 移行 / error tags 集約 / carrier init builder まで整備済み。
- **LLVM exe line SSOT 確立**: `tools/build_llvm.sh` を使用した .hako → executable パイプライン標準化完了。
- **Phase 89 P0 進行中**: Continue + Early Return パターンの dev-only 固定Step 0 完了、detector 締め済み)。
- `cargo test --release --lib` は PASS を維持(退行なし)。
参照:
- `docs/development/current/main/10-Now.md`
- `docs/development/current/main/phase73-scope-manager-design.md`
- `docs/development/current/main/phase80-bindingid-p3p4-plan.md`
- `docs/development/current/main/phase81-pattern2-exitline-contract.md`
- `docs/development/current/main/phase78-85-boxification-feedback.md`
- `docs/development/current/main/phase87-selfhost-llvm-exe-line.md`
---
## 次の指示書(優先順位)
### P0 (進行中): Phase 89 - Continue + Early Return Pattern
**現在地**: Step 0 完了detector 締め済み、Step 1 進行中docs 更新)
**残りステップ**:
1. ✅ Step 0: detector 締め + test完了
2. 🚧 Step 1: ドキュメント10-Now.md, CURRENT_TASK.md← 現在ここ
3. Step 2: 最小 fixture 作成continue + early return、決定的出力
4. Step 3: Frontend 新パターン箱追加LoopPattern::ContinueReturn
5. Step 4: normalized-dev 統合shape + normalize 関数)
6. Step 5: 受け入れテスト(構造 vs vm-bridge 一致 + 期待値)
**受け入れ基準**:
- `NYASH_JOINIR_NORMALIZED_DEV_RUN=1 cargo test --features normalized_dev --test normalized_joinir_min` PASS
- `cargo test --release --lib` PASS退行なし
- dev-only のみcanonical には入れない)
**参照**: ユーザー提供の Phase 89 指示書
### P1: JoinIR / Selfhost depth-2 の前進Phase 90 候補)
目的:
- JsonParserBox の残り複合ループを JoinIR 対応する。
- または selfhost .hako コンパイラの他部分Lexer/ASTBuilder 等)で JoinIR 適用範囲を拡大する。
やること(設計→実装の順):
1. 候補ループの抽出JsonParserBox or Lexer/ASTBuilder
2. Pattern 判定Pattern 1-4 のいずれか、または新 Pattern 提案)
3. JoinIR lowering 実装 + E2E テスト
受け入れ基準:
- 代表ケースが 1 コマンドで再現可能CI は増やさない、quick を重くしない)。
### P1: Ownership/Relay runtime 対応の再開Phase 88 候補)
目的:
- multihop/merge relay を “runtime でも” 受理できるところまで契約を伸ばすFail-Fast の段階解除)。
受け入れ基準:
- dev-only 既定OFF のまま、既存ラインを壊さない。
### Done: P0 SSOT の軽い追記docs-only
- `docs/development/current/main/10-Now.md` の「Scope / BindingId」節に Phase 86 の到達点carrier init / error tagsを追記済み。
- `docs/development/current/main/joinir-architecture-overview.md` の Phase 86 SSOT Modules は記載済み(追記不要)。
---
## すぐ走らせる確認コマンド
- `cargo test --release --lib`
- `NYASH_JOINIR_NORMALIZED_DEV_RUN=1 cargo test --features normalized_dev --test normalized_joinir_min -- --nocapture`