diff --git a/CURRENT_TASK.md b/CURRENT_TASK.md index 0973e0df..bbc251e1 100644 --- a/CURRENT_TASK.md +++ b/CURRENT_TASK.md @@ -4,7 +4,7 @@ 詳細は `docs/development/current/main/` 以下の各 Phase 文書と、JoinIR の SSOT である `docs/development/current/main/joinir-architecture-overview.md` を参照してね。 -最終更新: 2025-12-13 +最終更新: 2025-12-14 過去ログ(肥大化した旧 CURRENT_TASK)はここに退避したよ: - `docs/development/current/main/CURRENT_TASK_ARCHIVE_2025-12-13.md` @@ -17,8 +17,9 @@ - Pattern2 の promoted carriers(DigitPos/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 を維持(退行なし)。 +- **Phase 88 完了**: continue + 可変ステップ(i=i+const 差分)を dev-only fixture で固定、StepCalculator Box 抽出。 +- **Phase 89 完了**: P0(ContinueReturn detector)+ P1(lowering 実装)完了。 +- `cargo test --release --lib` は PASS を維持(993 passed、退行なし)。 参照: - `docs/development/current/main/10-Now.md` @@ -32,26 +33,30 @@ ## 次の指示書(優先順位) -### P0 (進行中): Phase 89 - Continue + Early Return Pattern +### P0: Phase 90 - _parse_string 合成 fixture -**現在地**: Step 0 完了(detector 締め済み)、Step 1 進行中(docs 更新) +**目的**: continue(escape) + return(close quote) の合成パターンを dev-only fixture で固定 -**残りステップ**: -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 一致 + 期待値) +**実装順序**(最短・事故減): +1. 合成 fixture 設計(制御構造のみ、文字列処理なし) + - continue(escape) + return(close quote) + str += ... + p += 1/2 + - 期待値が一意(例: n=10 で return 前に acc=4) +2. ShapeGuard 追加(誤爆防止) + - PatternParseStringCompositeMinimal (dev shape) + - P4/ContinueReturn と区別する条件 +3. lowering 実装(新しい箱) + - parse_string_composite_pattern.rs(例) + - Fail-Fast: 対応形以外は即エラー +4. normalized_dev テスト(2本) + - structured vs canonical 一致 + - 期待値一致 **受け入れ基準**: - `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 候補) +### P1: JoinIR / Selfhost depth-2 の前進(Phase 91 候補) 目的: - JsonParserBox の残り複合ループを JoinIR 対応する。 @@ -65,7 +70,7 @@ 受け入れ基準: - 代表ケースが 1 コマンドで再現可能(CI は増やさない、quick を重くしない)。 -### P1: Ownership/Relay runtime 対応の再開(Phase 88 候補) +### P2: Ownership/Relay runtime 対応の再開(Phase 92 候補) 目的: - multihop/merge relay を “runtime でも” 受理できるところまで契約を伸ばす(Fail-Fast の段階解除)。 @@ -73,10 +78,23 @@ 受け入れ基準: - dev-only 既定OFF のまま、既存ラインを壊さない。 -### Done: P0 SSOT の軽い追記(docs-only) +### Done: Phase 88-89 完了 -- `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 は記載済み(追記不要)。 +**Phase 88**: +- continue + 可変ステップ(i=i+const 差分)を dev-only fixture で固定 +- StepCalculator Box 抽出(+6 unit tests、再利用可能) +- エラーメッセージ詳細化、Fail-Fast 仕様固定 + +**Phase 89 P0**: +- Pattern4 detector 締め(Select 必須 + conditional Jump exactly 1) +- LoopPattern::ContinueReturn enum + shape 追加 +- canonical には入れない(dev-only、誤爆防止) + +**Phase 89 P1**: +- continue_return_pattern.rs 実装(457行、StepCalculator 再利用) +- normalized_dev tests +2(vm_bridge + 期待値) + +**Impact**: 993 lib tests + 61 normalized_dev tests 全パス、箱化スコア 10/10 --- diff --git a/docs/development/current/main/10-Now.md b/docs/development/current/main/10-Now.md index fa2be707..7330692d 100644 --- a/docs/development/current/main/10-Now.md +++ b/docs/development/current/main/10-Now.md @@ -57,34 +57,63 @@ **Reference**: phase87-selfhost-llvm-exe-line.md -### Phase 89 P0: Continue + Early Return Pattern (2025-12-14) 🚧 +### Phase 88: Continue + 可変ステップ (2025-12-14) ✅ -**Status**: IN PROGRESS - Dev-only fixture isolation +**Status**: COMPLETE - dev-only fixture 固定完了 -**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) +**Achievements**: +- continue + 可変ステップ(i=i+const 差分加算)を dev-only fixture で固定 +- continue 分岐側での acc 更新を許可 +- Fail-Fast 仕様固定(非 const の i 更新を拒否) +- StepCalculator Box 抽出(+6 unit tests、再利用可能な純関数設計) +- エラーメッセージ詳細化(Expected/Found/Hint 形式) -**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 +**Impact**: +- Tests: 993 lib tests PASS, 60 normalized_dev tests PASS +- 箱化スコア: 9/10(Phase 33 Box 理論の模範実装) +- コード削減: 5%(321→305行、重複ロジック削除) -**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) +**Reference**: +- continue_pattern.rs, step_calculator.rs +- jsonparser_unescape_string_step2_min.program.json -**Constraints**: -- ❌ No default behavior changes -- ❌ No by-name branching -- ❌ No fallback processing (Fail-Fast) -- ❌ Not added to canonical shapes initially (dev-only first) +### Phase 89 P0: Continue + Early Return Pattern Detector (2025-12-14) ✅ -**Reference**: (TBD - phase89-continue-return-pattern.md) +**Status**: COMPLETE - Dev-only detector 確立完了 + +**Achievements**: +- Pattern4 detector 締め(Select 必須 + conditional Jump exactly 1) +- LoopPattern::ContinueReturn enum 追加 +- NormalizedDevShape::PatternContinueReturnMinimal 追加(detector: Select + conditional Jumps >= 2) +- Fail-Fast: UnimplementedPattern error(フォールバックなし) +- canonical には入れない(dev-only、誤爆防止) + +**Impact**: +- Pattern4 誤爆防止(continue+return を正しく区別) +- Tests: 987 lib tests PASS + +**Reference**: +- shape_guard.rs, loop_patterns/mod.rs, analysis.rs +- pattern_continue_return_min.program.json (fixture) + +### Phase 89 P1: ContinueReturn Lowering Implementation (2025-12-14) ✅ + +**Status**: COMPLETE - 独立箱実装完了 + +**Achievements**: +- continue_return_pattern.rs 実装(457行、StepCalculator 再利用) +- Continue + Early Return の JoinIR lowering(loop 内 return 対応) +- Fail-Fast 原則徹底(5箇所検証) +- fixtures.rs に build_pattern_continue_return_min 追加 +- normalized_dev tests +2(vm_bridge + 期待値 n=10→acc=4) + +**Impact**: +- Tests: 993 lib tests PASS, 61 normalized_dev tests PASS (+2) +- 箱化原則:単一責任・境界明確・再利用性高 + +**Reference**: +- continue_return_pattern.rs, fixtures.rs +- tests/normalized_joinir_min/shapes.rs ### Scope / BindingId(dev-only の段階移行ライン)