From af9e08ad7e621a19be48319ac5c64b479ee0267b Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Tue, 24 Feb 2026 14:22:05 +0900 Subject: [PATCH] docs: add 7th review feedback (L-1) to CLAUDE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L-1: Phase 3-2 incorrectly lists GetMemoryContext() as a strings.Split optimization target — it doesn't directly call any split helpers after Phase 3-1. GetPlanContext() is the correct target: it calls extractPhaseContent, extractCommandsSection, extractContextSection which all split independently on the same content. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index cd90a119a..5b337f0a9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -678,3 +678,38 @@ Phase 0 ──→ Phase 1 ──→ Phase 2 ──→ Phase 3 ──→ Phase 4 - Phase 4: **ディスク書き込み削減** (microSD 寿命保護) - Phase 5: 必要に応じて個別判断 +--- + +## FEEDBACK — 第7回レビュー (L) + +> レビュー日: 2026-02-24。`pkg/agent/memory.go` の呼び出し経路と Phase 3-2 の対象関数を照合。 + +### L-1. Phase 3-2: `GetMemoryContext()` は Split 最適化の対象外、`GetPlanContext()` が抜けている + +**指摘内容**: Phase 3-2 に「`GetMemoryContext()` / `FormatPlanDisplay()` 内で1回 `strings.Split(content, "\n")`」とあるが、`GetMemoryContext()` は `strings.Split` を呼ぶヘルパーを**直接呼ばない**。Split は呼び先の `GetPlanContext()` 等の内部で起きる。Phase 3-2 の対象は `GetMemoryContext()` ではなく `GetPlanContext()` が正しい。 + +**各関数から split ヘルパーへの直接呼び出しを確認**: + +``` +GetMemoryContext() (Phase 3-1 修正後) + ├─ reActivePlan.MatchString(content) ← regex、split なし + ├─ reStatus.FindStringSubmatch(content) ← regex、split なし + └─ GetPlanContext() / GetInterviewContext() 等 ← 内部で split するが、 + GetMemoryContext から lines を渡せない + (signature 変更が必要になる) + +FormatPlanDisplay() + ├─ getPlanPhasesFrom(content) ← 内部で extractPhaseContent → Split ✓ + ├─ extractCommandsSection(content) L699 ← extractSection → Split ✓ + └─ extractContextSection(content) L710 ← extractSection → Split ✓ + +GetPlanContext() + ├─ extractPhaseContent(content, phase) L585 ← Split ✓ + ├─ extractCommandsSection(content) L591 ← Split ✓ + └─ extractContextSection(content) L598 ← Split ✓ +``` + +`FormatPlanDisplay()` と `GetPlanContext()` はいずれも同じ `content` を受け取り、複数の split ヘルパーを呼ぶ。これらが Phase 3-2 の正しい対象。 + +**計画の修正箇所**: Phase 3-2 の対象を `GetMemoryContext()` → `GetPlanContext()` に差し替える。 +