From e52547f17d3b95ba3ddfc3cfea6bfc2d0ce8eca1 Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:19:41 +0900 Subject: [PATCH] docs: apply sixth review feedback K-1, remove FEEDBACK section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - K-1: add currentPhase inline (rePhase.FindStringSubmatch) to FormatPlanDisplay() snippet — was missing, leaving an extra ReadLongTerm() call Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3e969f467..cd90a119a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -581,6 +581,8 @@ content := ms.ReadLongTerm() if !reActivePlan.MatchString(content) { return "No active plan." } var status string if m := reStatus.FindStringSubmatch(content); len(m) >= 2 { status = strings.TrimSpace(m[1]) } +var currentPhase int +if m := rePhase.FindStringSubmatch(content); len(m) >= 2 { currentPhase, _ = strconv.Atoi(m[1]) } phases := getPlanPhasesFrom(content) // private 関数 (1つだけ新設) ``` @@ -676,31 +678,3 @@ Phase 0 ──→ Phase 1 ──→ Phase 2 ──→ Phase 3 ──→ Phase 4 - Phase 4: **ディスク書き込み削減** (microSD 寿命保護) - Phase 5: 必要に応じて個別判断 ---- - -## FEEDBACK — 第6回レビュー (K) - -> レビュー日: 2026-02-24。`pkg/agent/memory.go` と Phase 3-1 スニペットを照合。 - -### K-1. Phase 3-1: `FormatPlanDisplay()` スニペットが `GetCurrentPhase()` のインライン化を省略している - -**指摘内容**: `FormatPlanDisplay()` の Phase 3-1 修正スニペットは `HasActivePlan` (L658)・`GetPlanStatus` (L666)・`GetPlanPhases` (L668) を修正しているが、**L667 の `GetCurrentPhase()`** が漏れている。 - -```go -// FormatPlanDisplay() — 現在の呼び出し -status := ms.GetPlanStatus() // L666 — スニペットで修正済み -currentPhase := ms.GetCurrentPhase() // L667 — スニペットに出てこない → ReadLongTerm() が残る -phases := ms.GetPlanPhases() // L668 — getPlanPhasesFrom(content) で修正済み -``` - -`currentPhase` は L672 (`Phase %d/%d`) と L676-680 (フェーズ絵文字判定) で使われており、省略できない値。`rePhase` はパッケージ変数として存在するのでインライン化は1行: - -```go -var currentPhase int -if m := rePhase.FindStringSubmatch(content); len(m) >= 2 { - currentPhase, _ = strconv.Atoi(m[1]) -} -``` - -**影響**: この漏れがあると Phase 3-1 適用後も `FormatPlanDisplay()` に `ReadLongTerm()` が2回残る (L657 + `GetCurrentPhase()` 内部)。スニペットに上記を追加して1回に統一する。 -