Skip to content

docs(llm-offload): Phase E — ADR-038 採用昇格 + 4 ephemeral 計画書 retire#156

Merged
aloekun merged 1 commit into
masterfrom
feature/phase-e-llm-offload-adoption
May 15, 2026
Merged

docs(llm-offload): Phase E — ADR-038 採用昇格 + 4 ephemeral 計画書 retire#156
aloekun merged 1 commit into
masterfrom
feature/phase-e-llm-offload-adoption

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 15, 2026

Summary

  • ADR-038 採用昇格 (2026-05-15): Phase A〜D dogfood で採用条件を完全充足 (累積 6 PR / 9 data points、fallback 11%、verdict variance 3 経路すべて、FP は Bundle k-1 で構造的解消済 + post-fix dogfood で再現せず) のため、試験運用 → 採用へ昇格
  • Permanent value migration: Phase A〜D の知見を ADR-038 (採用判定 / 実装最終構成 / 実装層選択 cost-aware / Known failure modes 3 件 = Markdown context hallucinate + Ollama HTTP timeout + Phase b' v2 attention dilution) と ADR-040 (num_ctx trade-off、既出) に集約
  • Ephemeral 計画書 4 ファイル retire: docs/local-llm-offload-{analysis,history,phase-d-outcomes,phase-d-guide}.md (計 1431 行) を docs-governance §Retirement Workflow に従い削除
  • 2 件の open ADR codify todo をフォルドイン land: 順位 99 (cost-aware + attention dilution、PR docs: Phase d kickoff prep + 順位 98 追加 + dogfood roster 反映 (3 commits) #138 由来) / 順位 126 (hallucinate failure mode、PR feat(hooks): Phase D D-5 — comment-lint test 拡充 + MAX cap break scope test #151/152/153 5 PR 連続観測由来) を ADR-038 編集と同 PR で消化

変更ファイル

区分 ファイル 変更内容
ADR 更新 docs/adr/adr-038-local-llm-finding-classification.md ステータス採用昇格 + 採用判定 section (+92)
ADR 更新 docs/adr/adr-039-experimental-feature-standard-pattern.md bounded lifetime example を ADR-038 採用昇格に更新
ADR 更新 docs/adr/adr-040-local-llm-context-size.md analysis.md retire 反映
削除 docs/local-llm-offload-{analysis,history,phase-d-outcomes,phase-d-guide}.md 計 4 ファイル retire (-1431)
todo 更新 docs/todo6.md / todo8.md / todo-summary.md 順位 99 / 126 を land 済として削除 + 既知課題 section (PR #119 stale marker) 追加
Rust source src/lib-ollama-client/src/lib.rs / cli-finding-classifier/{tests,evals}/ / hooks-post-tool-linter/src/main.rs コメント参照を ADR-038 / 「retire 済」に更新
config pr-monitor-config.toml 旧 history.md §A-2 参照を ADR-038 に置換

Diff stats: +224 / -1541 across 15 files (net -1317)

既知課題 (本 PR scope 外、todo8.md に記録)

Test plan

  • cargo check --workspace pass
  • cargo test -p cli-finding-classifier --test lint_screen_evals 20 pass / 1 ignored
  • cargo test -p hooks-post-tool-linter md_no_docs_relative 7 pass (更新済 fixture を含む)
  • pnpm lint:md 0 error
  • pre-push-review APPROVE 1 iter / 10m 11s
  • grep -rn 'local-llm-offload-(analysis|history|phase-d-outcomes|phase-d-guide)' で残存 4 件はすべて retire-aware historical reference (broken link なし)

関連

Summary by CodeRabbit

リリースノーツ

  • Documentation
    • ローカルLLMを使用した検出分類機能が試験運用から本採用へ昇格しました。
    • 関連する設計ドキュメント(ADR)が統合・更新され、採用判定条件、既知のエラーモード、およびフェーズ完了基準が明文化されました。
    • 運用ガイドと一時的なドキュメントが整理され、参照情報が統一されました。

Review Change Stack

Phase A〜D dogfood (累積 6 PR / 9 data points、fallback 11%、verdict variance 3 経路すべて) で ADR-038 採用条件を充足したため試験運用 → 採用へ昇格 (2026-05-15)。docs-governance §Retirement Workflow に従い ephemeral 計画書 4 ファイルを retire、permanent value は ADR-038 + ADR-040 に migrate。

主な変更:
- ADR-038 ステータス: 試験運用 → 採用、採用判定 section (累積 metrics + 実装最終構成 + 実装層選択 cost-aware + Known failure modes 3 件) を追加
- 順位 99 (cost-aware + attention dilution codify) / 順位 126 (hallucinate failure mode codify) を ADR-038 へフォルドイン land
- 4 ファイル削除: docs/local-llm-offload-{analysis,history,phase-d-outcomes,phase-d-guide}.md (計 1431 行 retire)
- ADR-039 (bounded lifetime example) / ADR-040 (analysis.md retire 反映) 更新
- Rust source / config / test fixture / pr-monitor-config.toml の参照を ADR-038 へ更新
- todo8.md に PR #119 marker (~7 日経過 stale) を既知課題として記録 (本 PR scope 外)

検証: cargo check pass / lint_screen_evals 20 pass / md_no_docs_relative 7 pass / markdownlint 0 error
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

このPRはADR-038をPhase E完了(2026-05-15)で本採用へ昇格させ、ローカルLLM分類判定の運用仕様を確定します。Ollama連携のリスク、昇格条件、実装構成、既知failure modeを詳細化し、関連ADR・検証スイート・ロードマップの参照体系をADRベース構成に移行する文書更新です。

Changes

ADR-038採用昇格とローカルLLM分類の本採用確定

Layer / File(s) Summary
ADR-038採用ステータス確定と仕様詳細化
docs/adr/adr-038-local-llm-finding-classification.md
ステータスを「試験運用」から「採用(2026-05-15)」に昇格。Phase E採否判定の達成条件(6PR/9 data points)、Ollama連携のリスク(Windows CP932漏れ、プロンプトインジェクション可能性)、昇格条件・最終実装構成・既知failure modeを詳細化。
関連ADR(ADR-039/040)の参照更新
docs/adr/adr-039-experimental-feature-standard-pattern.md, docs/adr/adr-040-local-llm-context-size.md
ADR-039の「bounded lifetime」具体例とADR-040の「コンテキスト導入背景」参照を、ADR-038の採用昇格日(2026-05-15)とPhase D達成条件(6PR/9 data points)へ置き換え。Ephemeral計画書参照を削除。
検証スイート・設定・実装参照の更新
src/cli-finding-classifier/evals/lint-screen-evals.json, src/cli-finding-classifier/tests/lint_screen_evals.rs, pr-monitor-config.toml, src/lib-ollama-client/src/lib.rs, src/hooks-post-tool-linter/src/main.rs
lint-screen evals、テストコメント、pr-monitor設定、ollama-client実装のドキュメント参照をADR-038採用状態へ更新。test fixtureのリンク表示テキストを「Phase D plan」→「TODO summary」に置換。
TODO・ロードマップ体系の再構成
docs/todo-summary.md, docs/todo6.md, docs/todo8.md
推奨実行順序表からADR-038学習エントリとfailure mode追記タスクを削除。新規タスク(write_*エラー検出ルール、lint-screenのgit diff magic-number除外、write_skip_report_loggedエラーパス回帰テスト、post-merge-feedback marker長期滞留の既知課題)を追加して実装タスク群を再構成。
次フェーズ実装層タスクの詳細化
docs/todo8.md
CLAUDE.md retirement checklist、カスタムlintルール(rule⑩)仕様、lint-screen git diff形式メタ文字列FP対策、write_skip_report_loggedエラーパス回帰テスト、post-merge-feedback marker問題の実装計画を詳細化。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • aloekun/claude-code-hook-test#139: ADR-039に新規追加された「実験運用ADRの標準パターン」を本PRが参照更新する際の直接の基準となっており、bounded lifetime参照の再整理に関連があります。
  • aloekun/claude-code-hook-test#135: lint-screen evals データセット拡張(eval13–15エントリ追加)と、本PR内の同一eval suite参照更新(lint-screen-evals.json、テストコメント)が同じ検証表面への段階的強化を構成するため関連があります。
  • aloekun/claude-code-hook-test#149: Phase D outcomes ドキュメント(docs/local-llm-offload-phase-d-outcomes.md)を本PR内で削除する際の直前段階の内容確定PRであり、phase-d終了→phase-e判定への文書遷移に直結するため関連があります。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRタイトルは Phase E における ADR-038 の採用昇格と4つの ephemeral 計画書削除という主要な変更内容を明確に反映している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/todo8.md (1)

339-343: ⚡ Quick win

/nonexistent/... 前提は cross-platform ではありません

Line 342 の「(c) は Windows でも reliable」という説明は不正確です。/nonexistent/... 依存だと OS ごとに挙動がぶれるため、テスト計画としては「親パスを通常ファイルにしてその配下へ作成を試みる」など、OS 非依存で必ず失敗する注入方法に置き換えるのが安全です。

🤖 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/todo8.md` around lines 339 - 343, Update the docs text to remove the
claim that option (c) using a "/nonexistent/..." path is reliable on Windows and
instead recommend an OS-independent failure injection: create a normal file at
the intended parent path (e.g., touch/create a regular file) and then pass a
child path under that file as `output_path` so `create_dir_all` must fail;
revise the recommendation text replacing "(c) — cross-platform、追加 dep なし、Windows
でも reliable" and the related assertion guidance to describe this parent-as-file
approach and note that tests should capture `log_stage` output or mock
`log_stage`.
🤖 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.

Nitpick comments:
In `@docs/todo8.md`:
- Around line 339-343: Update the docs text to remove the claim that option (c)
using a "/nonexistent/..." path is reliable on Windows and instead recommend an
OS-independent failure injection: create a normal file at the intended parent
path (e.g., touch/create a regular file) and then pass a child path under that
file as `output_path` so `create_dir_all` must fail; revise the recommendation
text replacing "(c) — cross-platform、追加 dep なし、Windows でも reliable" and the
related assertion guidance to describe this parent-as-file approach and note
that tests should capture `log_stage` output or mock `log_stage`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ca7b348-1796-4690-8757-dde5354f5991

📥 Commits

Reviewing files that changed from the base of the PR and between 31bb7cd and 18e045a.

📒 Files selected for processing (15)
  • docs/adr/adr-038-local-llm-finding-classification.md
  • docs/adr/adr-039-experimental-feature-standard-pattern.md
  • docs/adr/adr-040-local-llm-context-size.md
  • docs/local-llm-offload-analysis.md
  • docs/local-llm-offload-history.md
  • docs/local-llm-offload-phase-d-guide.md
  • docs/local-llm-offload-phase-d-outcomes.md
  • docs/todo-summary.md
  • docs/todo6.md
  • docs/todo8.md
  • pr-monitor-config.toml
  • src/cli-finding-classifier/evals/lint-screen-evals.json
  • src/cli-finding-classifier/tests/lint_screen_evals.rs
  • src/hooks-post-tool-linter/src/main.rs
  • src/lib-ollama-client/src/lib.rs
💤 Files with no reviewable changes (5)
  • docs/local-llm-offload-history.md
  • docs/local-llm-offload-analysis.md
  • docs/local-llm-offload-phase-d-guide.md
  • docs/local-llm-offload-phase-d-outcomes.md
  • docs/todo6.md

@aloekun aloekun merged commit bc7373a into master May 15, 2026
1 check passed
@aloekun aloekun deleted the feature/phase-e-llm-offload-adoption branch May 15, 2026 08:14
aloekun added a commit that referenced this pull request May 15, 2026
…#157)

PR #156 (Phase E land) post-merge-feedback で採用判断された 3 件を todo8.md / todo-summary.md に登録。

- 順位 132 (Tier 1, S): lint_screen.rs magic-number 検出ルールで git diff metadata (`similarity index NN%` 等) を FP 除外
  既存 順位 130 と root cause 同一、本エントリは「実装側の前処理 filter に確定」した具体策で supersede 可能
- 順位 133 (Tier 3, XS): docs-governance.md §Retirement Workflow に「diff context 由来 false alarm 防止 = grep hit は実ファイル Read で確認」明記
  PR #156 で 5 件以上の false alarm を実観測したのが採用根拠
- 順位 134 (Tier 3, S): ADR-035 に docs-only PR 評価の適用外基準リスト追加 (mutation / DRY / YAGNI / function length / test coverage / magic-number 等)
  ADR-035 の分類基準 vs 適用外基準の空白を埋める、reviewer 誤適用による開発体験劣化を構造的に防止

🤔 様子見の 4 件 (T2 #1 link checker / T2 #2 prompt injection test / T3 #3 OS 非依存 failure injection / T3 #4 Phase 5 injection risk ADR) は本 PR scope 外、Frequency / Phase 進捗で再評価。
aloekun added a commit that referenced this pull request May 17, 2026
… diff metadata strip + silent failure baseline cleanup (#159)

Bundle l 3 サブ変更を bundled で land (順位 129 + 131 + 132、todo-summary.md table 4 行整理含む)。
共通テーマ: cli-push-runner lint-screen stage の堅牢化 + I/O write 関数の silent failure 構造的防止。

順位 132 (Tier 1 / S): cli-push-runner/src/stages/lint_screen.rs に strip_diff_metadata_lines
前処理関数を追加し、similarity index NN% / index <hex> / file mode / rename 系の
diff metadata 行を LLM 入力前に決定論的に除去。PR #155-#156 で 5 観測された mistral:7b の
magic-number FP を構造的に解消。unit test 7 件 (各 metadata 系列 + content 保持 + substring 誤検出回避)。
順位 130 (prompt 改修 or 前処理 filter のいずれか) を本実装で前処理 filter に確定して supersede、
table から 130 行も削除。

順位 129 (Tier 1 / S): .claude/custom-lint-rules.toml に rule⑩ (no-write-result-discard、
pattern let\s+_\s*=\s+write_\w+\(、extensions=["rs"]、severity=error) を追加。
hooks-post-tool-linter に 8 件 unit test を追加 (positive x3 / negative x4 / dogfood x1)。
dogfood test (deployed_src_rust_passes_no_write_result_discard_rule) は src/**/*.rs を再帰走査して
clean baseline を強制。本 PR の completeness criteria に合わせて既存違反 5 件を fix:
  - cli-pr-monitor/src/stages/poll.rs: 3 箇所の let _ = write_state(...) を
    if let Err(e) = ... { log_info(...) } に置換 (非 fatal 進行 + 観測可能性回復)
  - cli-merge-pipeline/src/feedback.rs: FailedMarkerGuard::drop 内の write_failed_marker と
    feedback::run の write_pending_marker を log 化、後者は write_pending_marker_logged helper
    に抽出して fn run の 50 行ガイドライン超過を回避 (lint_screen.rs の write_skip_report_logged と同 pattern)

順位 131 (Tier 2 / M): write_skip_report_logged の error path regression test を 3 件追加。
parent が regular file な path に書込を試みて create_dir_all 失敗を確定的に誘発する方式 (Unix/Windows
両方で reliable、追加 dep 不要)。write_skip_report の Err 返却 + write_skip_report_logged の
no-panic + writable path success の 3 段で seal、将来 refactor での silent drop 回帰を機械検出。

副次: src/cli-push-runner/Cargo.toml に tempfile dev-dep を追加 (順位 131 test 用)、
todo8.md から 129/130/131/132 detail entry を削除 (Cross-File Reference Lifecycle 整合)。

検証: cargo test 全 workspace pass / pnpm build:all 成功 / 変更 crate 3 つ
(cli-push-runner / hooks-post-tool-linter / cli-pr-monitor) で cargo clippy --all-targets -- -D warnings clean。
aloekun added a commit that referenced this pull request May 18, 2026
…検出 hook 2 段構え)

## 順位 39 削除

順位 39 (takt workflow `model` フィールド必須化 lint rule) は PR #150 で
`takt-workflow-persona-without-model` rule として実装済のため、todo-summary.md
table 行と todo4.md 詳細 entry を削除。

調査の過程で、stale entry 候補 3 件のうち以下 2 件は既に削除済と判明:

- 順位 104 (ADR-007 amendment): PR #161 で既削除
- 順位 126 (ADR-038 hallucinate codify): PR #156 (Phase E) で ADR-038
  migrate + 詳細 entry 削除済

## 順位 136 新規追加 (Tier 1)

本セッション (PR cleanup-stale-rank-39 作業中) で実証された failure mode:
local working copy が stale parent (master と sibling) のまま docs/todo*.md を
読み込み、master 上で既に削除済の entry 2 件を「stale entry として削除する」と
誤判定。memory rule `feedback_verify_task_not_already_done.md` は強制力ゼロで
再発確実 (memory rule 全般の限界、`feedback_no_unenforced_rules.md` 原則の
自己事例)。Claude Code Web との並列セッション運用前提下では構造的再発確実。

structural defense として 2 hook 二段構え:

- 案 A (予防層): SessionStart hook で `jj git fetch` + master との lineage を
  additional context として AI 出力
- 案 B (最終 backstop): PreToolUse hook で stale parent 時の docs/todo*.md edit
  を hard block

`feedback_no_unenforced_rules.md` 例外条件 = 2 つの hook で機械強制可能。
ADR-039 experimental pattern 適用予定。
aloekun added a commit that referenced this pull request May 18, 2026
…検出 hook 2 段構え) (#162)

## 順位 39 削除

順位 39 (takt workflow `model` フィールド必須化 lint rule) は PR #150 で
`takt-workflow-persona-without-model` rule として実装済のため、todo-summary.md
table 行と todo4.md 詳細 entry を削除。

調査の過程で、stale entry 候補 3 件のうち以下 2 件は既に削除済と判明:

- 順位 104 (ADR-007 amendment): PR #161 で既削除
- 順位 126 (ADR-038 hallucinate codify): PR #156 (Phase E) で ADR-038
  migrate + 詳細 entry 削除済

## 順位 136 新規追加 (Tier 1)

本セッション (PR cleanup-stale-rank-39 作業中) で実証された failure mode:
local working copy が stale parent (master と sibling) のまま docs/todo*.md を
読み込み、master 上で既に削除済の entry 2 件を「stale entry として削除する」と
誤判定。memory rule `feedback_verify_task_not_already_done.md` は強制力ゼロで
再発確実 (memory rule 全般の限界、`feedback_no_unenforced_rules.md` 原則の
自己事例)。Claude Code Web との並列セッション運用前提下では構造的再発確実。

structural defense として 2 hook 二段構え:

- 案 A (予防層): SessionStart hook で `jj git fetch` + master との lineage を
  additional context として AI 出力
- 案 B (最終 backstop): PreToolUse hook で stale parent 時の docs/todo*.md edit
  を hard block

`feedback_no_unenforced_rules.md` 例外条件 = 2 つの hook で機械強制可能。
ADR-039 experimental pattern 適用予定。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant