Skip to content

docs(adr): D-1 ADR amendments bundle + workflow gap#145

Merged
aloekun merged 1 commit into
masterfrom
d-1-adr-amendments
May 12, 2026
Merged

docs(adr): D-1 ADR amendments bundle + workflow gap#145
aloekun merged 1 commit into
masterfrom
d-1-adr-amendments

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 11, 2026

Summary

Phase D dogfood の 1 本目 (D-1)。Phase D 前提整備 PR #144 land 後の 3 件 ADR 採用 + Phase D 計画 land + workflow gap 反映 を bundled。

採用済 task (順位)

D-1 lint_screen dogfood: skipped

Phase D guide §1 の「session-only opt-in」 ([lint_screen] enabled = true を commit せず runtime のみ反映) は jj の auto-snapshot 性質と本質的に衝突する ことが D-1 着手時に判明。push-runner-config.toml を編集すると即座に @ にスナップショットされ、pnpm push がその commit を remote に送ってしまうため「local enable / remote disable」が成立しない。

D-1 は ADR markdown のみで lint_screen が code lint findings を検出しない予測 (informational 0 件) のため、本 PR は enabled = false のまま push して dogfood をスキップ。Phase A 前提整備 PR #144 で pipeline integration は smoke test 4 件で seal 済のため、D-1 skip による metrics ロスは限定的。

順位 115 (env var override) を D-2 着手前に land して、D-2 / D-3 で実 dogfood を実施する。

diff stat

種類 行数
docs (ADR 3 件 + analysis.md + todo*.md) 約 270 行
Rust (lib-ollama-client/src/lib.rs コメント圧縮) 14 行 (insert 4 / delete 10)
合計 (workflow gap fix 後) 9 files, +228 / -70 ≒ 298 line changes

Test plan

  • cargo test -p lib-ollama-client (17 tests pass、コメント変更で test 影響なし)
  • cargo check -p lib-ollama-client (compile pass)
  • markdownlint (0 error) — ADR 3 件 + analysis.md + todo*.md + CLAUDE.md
  • takt pre-push-review APPROVE (2 回目 = ZERO findings、ADR-040 内部不整合 fix 後)
  • CodeRabbit review (PR 作成後の自動 trigger)
  • 順位 115 land 後の D-2 で env var override workflow を実証

関連

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • Documentation

    • アーキテクチャ意思決定記録(ADR)を追加・更新し、ローカルLLMのコンテキストサイズとタイムアウト設定の判断基準を明文化しました。
  • Chores

    • 内部ドキュメント及びコメントを整備し、今後の機能管理オプション(環境変数オーバーライド)の計画を記録しました。

Review Change Stack

…4) + workflow gap 反映

Phase D dogfood の 1 本目 (D-1)。3 件 ADR 採用 + Phase D 計画 land + workflow gap 反映を bundled。

順位 112 (PR #142 T3-#3): ADR-038 に 2 section 追記
  - Diagnostic logging scope: eprintln (CLI 前提) と structured logging 移行条件
  - 90% 閾値 rationale: 保守採用根拠 + Phase D 完了時の precision/recall 評価方針

順位 113 (PR #142 T3-#4): ADR-027 に metrics override 判断基準追記
  - Incidental change vs Responsibility change の線引き
  - Override 記述様式 (Override / Reason / Rationale の 3 項目)

順位 114 (PR #143 T3-#1): ADR-040 新規作成
  - mistral:7b context size 実測値 (8K 512MB 5-20s ↔ 32K 2GB 30-90s)
  - step_timeout 3.33x 比例係数の根拠
  - num_ctx 選定 flow chart
  - CLAUDE.md ADR index 追加
  - lib-ollama-client/src/lib.rs L128-139 dogfood evolution コメントを 4 行参照に短縮

Phase D 計画 land + workflow gap (新規):
  - analysis.md に D-1/D-2/D-3 PR 構成 + 計測手順 + 想定リスクを追加
  - D-1 着手時に判明した workflow gap (jj auto-snapshot vs session-only opt-in) を計測手順に反映
  - env var override (LINT_SCREEN_ENABLED) を todo8.md / todo-summary.md (順位 115) に backlog 登録
  - D-1 自身は dogfood skip、env var override land 後に D-2 / D-3 で実 dogfood 実施

D-1 lint_screen 状態: skipped。Phase D guide §1 session-only opt-in workflow が jj auto-snapshot と
本質的に衝突するため、配列 env var override の cli-push-runner 実装 (順位 115) を D-2 前に land 必須。
@aloekun
Copy link
Copy Markdown
Owner Author

aloekun commented May 11, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57cebff0-382b-4530-b62a-c641ba97d2f4

📥 Commits

Reviewing files that changed from the base of the PR and between c4ad2c0 and 58f3cc9.

📒 Files selected for processing (9)
  • CLAUDE.md
  • docs/adr/adr-027-push-review-simplicity-focus.md
  • docs/adr/adr-038-local-llm-finding-classification.md
  • docs/adr/adr-040-local-llm-context-size.md
  • docs/local-llm-offload-analysis.md
  • docs/todo-summary.md
  • docs/todo6.md
  • docs/todo8.md
  • src/lib-ollama-client/src/lib.rs
💤 Files with no reviewable changes (1)
  • docs/todo6.md

📝 Walkthrough

Walkthrough

このPRはドキュメント主体の更新であり、ローカルLLMのコンテキストサイズ選定方針を ADR-040 として新規定義し、既存ADRの運用指針を拡張、Phase D実行計画を整理している。タスク追跡の完了処理と LINT_SCREEN_ENABLED オーバーライド機構も併行更新。

Changes

Local LLM Context Size ADR及びPhase D実行計画

Layer / File(s) Summary
ADR-040新規導入
docs/adr/adr-040-local-llm-context-size.md
mistral:7b対象 num_ctx 選定方針(8K/32K実測値)、step_timeout sublinear拡大根拠、新規LLM導入フロー、Pros/Cons、Phase E条件付き本採用規約を明文化。
ADR-027 Metricsオーバーライド判定基準
docs/adr/adr-027-push-review-simplicity-focus.md
metrics違反の incidental vs responsibility 判定基準(「diff削除で PR主目的達成不能か」で区別)、incidental override の必須3項目記述化、silent override禁止を追記。
ADR-038 Logging及び閾値方針
docs/adr/adr-038-local-llm-finding-classification.md
JSON parse error の stderr出力スコープ、structured logging移行条件、overflow_hint 90%閾値根拠、Phase D迄の閾値固定化、派生プロジェクト別再キャリブレーション方針を追記。
Phase D計画・実行手順
docs/local-llm-offload-analysis.md
Phase A/B/C完了(2026-05-11)と num_ctx 32768 引上げ、Phase C dogfood fallback改善(3/3→1/3)を記録。lint_screen.rs の classifier stderr取込(ClassifierOutput / render_diagnostic / smoke tests)、LINT_SCREEN_ENABLED env var オーバーライド、D-1/D-2/D-3 PR計測手順を整備。
タスク追跡更新
docs/todo6.md, docs/todo-summary.md, docs/todo8.md
完了タスク 2件(ADR-038/ADR-027追記)を todo6.md から削除。todo-summary.md に「LINT_SCREEN_ENABLED 環境変数追加(順位115、D-2依存)」を追加。todo8.md で実装タスク詳細化(設計論点・実施計画・完了基準)。
ドキュメント索引及びコメント
CLAUDE.md, src/lib-ollama-client/src/lib.rs
CLAUDE.md に ADR-040 エントリ追加。DEFAULT_NUM_CTX コメントを簡潔化(詳細経緯→dogfood進化と次フェーズ方針)。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • aloekun/claude-code-hook-test#142: lib-ollama-client の overflow 診断・メタデータ出力を実装し、本PRがその実装内容をADRドキュメント化・設計決定として固定化。
  • aloekun/claude-code-hook-test#137: num_ctx 8192 段階での変更を記録し、本PRが段階的進化(32768迄の展開)と最終的な設計決定を整理・永続化。
  • aloekun/claude-code-hook-test#122: docs/local-llm-offload-analysis.md の Phase dogfood計画を先行更新し、本PRが Phase D実行計画・LINT_SCREEN_ENABLED機構を拡張。
🚥 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 タイトルは、ADR 修正・新規作成(ADR-038/027/040)とワークフローギャップ対応という PR の主要な内容を的確に反映しており、変更内容を明確に要約している。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

@aloekun aloekun merged commit bcd8f3c into master May 12, 2026
1 check passed
@aloekun aloekun deleted the d-1-adr-amendments branch May 12, 2026 05:17
aloekun added a commit that referenced this pull request May 12, 2026
…1/103/106) (#146)

* docs(todo,analysis): post-merge-feedback PR #145 採用 2 件登録 + Phase D D-1 完了反映

PR #145 (D-1) merge 後の post-merge-feedback で採用された 2 件 (Tier 3 #1 + #3) を todo 系列に登録し、analysis.md の Phase D section に D-1 land 状況と副産物を反映する。

順位 116 (Tier 3 XS、PR #145 T3-#1):
  - ADR-040 step_timeout 説明に sublinear / KV cache locality clarification 追記
  - 実測値 600s 採択 / 保守上限 720s / sublinear 性の KV cache 根拠

順位 117 (Tier 3 S、PR #145 T3-#3):
  - coding-style.md § Cross-File Reference Lifecycle に ephemeral → permanent 知識移管 edit order を追記
  - 3 ステップ原則 (① permanent target 先行作成・validate → ② 参照追加 → ③ 参照元削除)

analysis.md Phase D section 更新:
  - D-1 land 状況 (PR #145、298 行、ZERO findings APPROVE) を table の状態列に反映
  - 順位 115 を D-2 前 critical path として明示
  - D-1 dogfood outcome として 4 項目記録 (skip 理由 / workflow gap 発見 / ADR-040 fix / migration codify)

順位 115 (Tier 1) の rationale に「post-merge-feedback Tier 1 #1 で再 validate 済」を追記。

* feat(hooks-post-tool-linter): D-2 lint rule code touch (順位 101/103/106)

Phase D dogfood の 2 本目 (D-2)。lint rule の test gap + struct doc + self-exclusion guards を bundled。

順位 101 (PR #140 T1-#1 採用): rule⑧ depth-1 root MD edge case test 2 件追加
  - md_no_docs_relative_detects_root_level_back_reference (CLAUDE.md fixture)
  - md_no_docs_relative_detects_root_readme_back_reference (README.md fixture)
  - 「fire = true positive」整理を doc comment と test 名で明示
  - root-level MD からの ../docs/ 参照は repo 外を指す broken link で真陽性が正しい挙動

順位 103 (PR #140 T1-#3 採用): CustomRule struct に lint runner field reference doc comment 追加
  - サポート field 一覧 (id/pattern/severity/message/extensions/why/fix/example) を /// で記述
  - planned field (paths、順位 102) も併記し設計-実装 gap を構造的に予防
  - custom-lint-rules.toml 冒頭コメントに main.rs CustomRule struct への動線追加

順位 106 (PR #141 T2-#1 採用): self-exclusion invariant test に 2 false-green guards 追加
  - assert!(path.exists()) — deployed TOML 削除 / 移動時の silent pass 抑止
  - assert!(extensions contains "toml") — rule scope 変更時の silent degradation 抑止
  - 各 assertion message に silent degradation のリスクと由来 (順位 106 / PR #141 T2-#1) を inline で記述

cargo test pass: hooks-post-tool-linter 95 tests (新規 2 + 既存 +1 強化、ZERO regression)。

PR #145 = D-1 と同様、lint_screen dogfood は順位 115 (env var override) land 前のため skip。
aloekun added a commit that referenced this pull request May 12, 2026
…hase D D-1 workflow gap 解消)

Phase D D-1 (PR #145) 着手時に発見した workflow gap (jj auto-snapshot vs session-only opt-in) を
解消する env var override 経路を cli-push-runner に追加する。post-merge-feedback Tier 1 #1 で再
validate された Tier 1 priority。D-3 (順位 102) 着手前の critical path。

順位 115 (PR #145 post-merge-feedback Tier 1 #1):

実装 (config.rs):
  - ENV_LINT_SCREEN_ENABLED const = "LINT_SCREEN_ENABLED"
  - parse_lint_screen_env() pure function: env raw value → LintScreenEnvOverride enum
    * true / 1 / yes / on (case-insensitive、空白 trim) → ForceEnable
    * false / 0 / no / off / "" / unset → RespectToml (no-op)
    * その他 → InvalidValue (warning emit + 安全側で TOML 値尊重)
  - apply_lint_screen_env_override() side-effect: env をTOML override に適用
    * ForceEnable + [lint_screen] section absent → default LintScreenConfig 生成 (enabled=true)
    * ForceEnable + section present → enabled = true で上書き
    * RespectToml → no-op (片方向設計、誤って commit しても remote PR は default OFF)
  - load_config() で TOML parse 後・validate 前に apply_lint_screen_env_override 呼出

unit test 10 件追加:
  - parse_lint_screen_env_unset_yields_respect_toml
  - parse_lint_screen_env_force_enable_variants (8 variants)
  - parse_lint_screen_env_respect_toml_variants (8 variants)
  - parse_lint_screen_env_invalid_value (5 variants)
  - apply_env_override_force_enable_on_absent_section_creates_lint_screen_config
  - apply_env_override_force_enable_overwrites_toml_false
  - apply_env_override_respect_toml_keeps_toml_enabled_true
  - apply_env_override_respect_toml_keeps_toml_enabled_false
  - apply_env_override_unset_keeps_toml_section_absent
  - apply_env_override_invalid_value_respects_toml

docs:
  - Phase D guide §1 Setup を env var ベースに rewrite (旧 'config 編集' 記述を削除)
    * PowerShell example: $env:LINT_SCREEN_ENABLED = "true" / Remove-Item env:LINT_SCREEN_ENABLED
    * 片方向設計の意義 + ADR-039 試験運用標準パターンとの整合
  - analysis.md Phase D section を順位 115 land 反映に更新 (D-3 unblock、D-1/D-2 副産物 list 整理)
  - todo8.md / todo-summary.md から順位 115 entry 削除

cargo test pass: cli-push-runner 67 tests (新規 10 + 既存 57、ZERO regression)。

Phase D 進行: D-1 ✅ / D-2 ✅ / 順位 115 ✅ / D-3 ⏳ (env var workflow で初の実 dogfood)
aloekun added a commit that referenced this pull request May 12, 2026
…hase D D-1 workflow gap 解消) (#147)

Phase D D-1 (PR #145) 着手時に発見した workflow gap (jj auto-snapshot vs session-only opt-in) を
解消する env var override 経路を cli-push-runner に追加する。post-merge-feedback Tier 1 #1 で再
validate された Tier 1 priority。D-3 (順位 102) 着手前の critical path。

順位 115 (PR #145 post-merge-feedback Tier 1 #1):

実装 (config.rs):
  - ENV_LINT_SCREEN_ENABLED const = "LINT_SCREEN_ENABLED"
  - parse_lint_screen_env() pure function: env raw value → LintScreenEnvOverride enum
    * true / 1 / yes / on (case-insensitive、空白 trim) → ForceEnable
    * false / 0 / no / off / "" / unset → RespectToml (no-op)
    * その他 → InvalidValue (warning emit + 安全側で TOML 値尊重)
  - apply_lint_screen_env_override() side-effect: env をTOML override に適用
    * ForceEnable + [lint_screen] section absent → default LintScreenConfig 生成 (enabled=true)
    * ForceEnable + section present → enabled = true で上書き
    * RespectToml → no-op (片方向設計、誤って commit しても remote PR は default OFF)
  - load_config() で TOML parse 後・validate 前に apply_lint_screen_env_override 呼出

unit test 10 件追加:
  - parse_lint_screen_env_unset_yields_respect_toml
  - parse_lint_screen_env_force_enable_variants (8 variants)
  - parse_lint_screen_env_respect_toml_variants (8 variants)
  - parse_lint_screen_env_invalid_value (5 variants)
  - apply_env_override_force_enable_on_absent_section_creates_lint_screen_config
  - apply_env_override_force_enable_overwrites_toml_false
  - apply_env_override_respect_toml_keeps_toml_enabled_true
  - apply_env_override_respect_toml_keeps_toml_enabled_false
  - apply_env_override_unset_keeps_toml_section_absent
  - apply_env_override_invalid_value_respects_toml

docs:
  - Phase D guide §1 Setup を env var ベースに rewrite (旧 'config 編集' 記述を削除)
    * PowerShell example: $env:LINT_SCREEN_ENABLED = "true" / Remove-Item env:LINT_SCREEN_ENABLED
    * 片方向設計の意義 + ADR-039 試験運用標準パターンとの整合
  - analysis.md Phase D section を順位 115 land 反映に更新 (D-3 unblock、D-1/D-2 副産物 list 整理)
  - todo8.md / todo-summary.md から順位 115 entry 削除

cargo test pass: cli-push-runner 67 tests (新規 10 + 既存 57、ZERO regression)。

Phase D 進行: D-1 ✅ / D-2 ✅ / 順位 115 ✅ / D-3 ⏳ (env var workflow で初の実 dogfood)
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