feat(local-llm): P-0 classifier opt-in + §10 ブランチ分離運用 (ADR-038 Phase 5)#123
feat(local-llm): P-0 classifier opt-in + §10 ブランチ分離運用 (ADR-038 Phase 5)#123
Conversation
§A-2 Phase 5 dogfood の前提セットアップ。pr-monitor-config.toml に
[classifier] section を追加し enabled=true でローカル LLM (mistral:7b) による
CodeRabbit findings classification を master 上で有効化。
§10 ブランチ分離運用を以下のように修正 (本セッション 2 ターン目のユーザー
directive 「P-1〜P-5 は PR を個別に実装する想定」に従い、過剰隔離を解消):
- §10.3: P-0 / P-1〜P-5 はすべて master ベース個別 PR (元案では feature 枝のみ
だったが、master の classifier は smoke test 動作確認済 + revert PR が即時
fallback として機能するため、過剰隔離だった)
- §10.4: dogfood は master 上で classifier 自動起動。枝切替不要
- §10.7: 再開チェックリストを A (P-N PR 着手) / B (§8.D/E/F 追加実装) に分割
- 隔離スコープを §8.D / §8.E / §8.F (新規実装) に限定
- §10.6 C/D の参照誤りを修正 (kill-switch は C、6 ヶ月経過は D)
§A-2 計測ログに P-0 完了状態を記録 (smoke test 結果含む)。Setup 手順から
枝 checkout step を削除 (master 上で完結する dogfood に対応)。
P-0 smoke test:
- Ollama: mistral:7b (4.0GB) + llama2:13b (6.9GB) 起動確認
- classifier exe (.claude/cli-finding-classifier.exe, 2.2MB) 配備確認
- finding {Major / unused import} → action=auto_fix / confidence=1.0 (妥当)
- cli-pr-monitor は新 [classifier] section を読み込み可、compile 通過
本 PR は feature/local-llm-dogfood → master の squash merge を想定。
📝 Walkthrough概要ローカルLLM分類器(Ollama)の段階的検証と統合のための構成スキーマを追加し、フェーズ5計測計画、マスター/フィーチャーブランチ間の分離戦略、実行ガイダンス、および環境チェックリストを定義します。 変更内容ローカルLLM検証統合ワークフロー
推定レビュー工数🎯 2 (Simple) | ⏱️ ~12 分 関連の可能性があるプルリクエスト
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/local-llm-offload-analysis.md (1)
354-356:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winjq フィルタに余分な
)があり、コンパイルエラーになります。
test("[a-zA-Z]{8,}")の後の)が対応する(なしに現れており、実行するとjq: error: compile errorで失敗します。🐛 修正案
-jq '[.classified_findings[] | select(.normalized_issue) | .normalized_issue | test("[a-zA-Z]{8,}"))]' .claude/pr-monitor-state.json +jq '[.classified_findings[] | select(.normalized_issue) | .normalized_issue | test("[a-zA-Z]{8,}")]' .claude/pr-monitor-state.jsonなお、このコマンドは
true/falseのブール値配列を返します。違反件数を直接カウントする場合は末尾に| lengthを追加するか、select(test(...))形式に変更するとより直接的です。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/local-llm-offload-analysis.md` around lines 354 - 356, The jq expression contains an extra closing parenthesis after test("[a-zA-Z]{8,}") causing a compile error; remove the stray ')' so the expression becomes valid and, if you want a count rather than a boolean array, append | length or rewrite the pipeline to use select(test(...)) to return matching objects directly; target the jq command line shown (the expression using .classified_findings[], .normalized_issue, and test("[a-zA-Z]{8,}")) and fix the unmatched parenthesis and optionally add | length or change to select(test(...)) as described.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/local-llm-offload-analysis.md`:
- Around line 354-356: The jq expression contains an extra closing parenthesis
after test("[a-zA-Z]{8,}") causing a compile error; remove the stray ')' so the
expression becomes valid and, if you want a count rather than a boolean array,
append | length or rewrite the pipeline to use select(test(...)) to return
matching objects directly; target the jq command line shown (the expression
using .classified_findings[], .normalized_issue, and test("[a-zA-Z]{8,}")) and
fix the unmatched parenthesis and optionally add | length or change to
select(test(...)) as described.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2f97307c-a4da-4cb9-8e38-0e8122710b05
📒 Files selected for processing (2)
docs/local-llm-offload-analysis.mdpr-monitor-config.toml
Summary
docs/local-llm-offload-analysis.mdに §10「ブランチ分離運用」を追加し、P-0 (config opt-in) としてpr-monitor-config.tomlに[classifier] enabled=trueを landfeature/local-llm-dogfood枝に残置 — 検証完了まで master に流さないChanges
docs/local-llm-offload-analysis.md__backup-claude-config/手動運用、強制 hook 化なし)pr-monitor-config.toml[classifier]section 追加 (enabled=true/model=mistral:7b/endpoint=http://localhost:11434/timeout_secs=30)enabled=falseに戻す)P-0 動作確認
mistral:7b(4.0GB) +llama2:13b(6.9GB) 起動確認.claude/cli-finding-classifier.exe, 2.2MB) 配備確認{Major / unused import / remove statement}→action=auto_fix/action_confidence=1.0(妥当な分類)cli-pr-monitorは新[classifier]section を読み込み可、compile 通過背景 — モデル簡素化の経緯
本セッション 1 ターン目で「ローカル LLM の検証作業を feature ブランチに分離したい」というユーザー要望に応じ、§10 で Option B (隔離ベース) を策定。当初は P-0 / P-1〜P-5 も feature 枝のみとしていたが、2 ターン目で「P-1〜P-5 は PR を個別に実装する想定」というユーザー directive を受け、隔離スコープを §8.D / §8.E / §8.F (新規実装) に限定 する model に整理。
判断根拠:
kill-switch
classifier 起動が予期せぬ問題を起こした場合は revert PR で
[classifier] enabled = falseに戻す のが kill-switch (§10.6 C 簡易版)。crate 削除等の物理削除は dogfood 失敗判定後にまとめて実施 (§10.6 C 完全版)。Test plan
curl -s http://localhost:11434/api/tags)ls -la .claude/cli-finding-classifier.exe)echo '[...]' | .claude/cli-finding-classifier.exe --timeout-secs 60→ JSON 妥当)cargo run --bin cli-pr-monitorで no parse error)関連
Summary by CodeRabbit
リリースノート
ドキュメント
新機能