Skip to content

docs: weekly-review 通知可視化改善の計画書を追加 (PR-N1〜N3 handoff) - #298

Merged
aloekun merged 1 commit into
masterfrom
docs/weekly-review-notification-plan
Jul 18, 2026
Merged

docs: weekly-review 通知可視化改善の計画書を追加 (PR-N1〜N3 handoff)#298
aloekun merged 1 commit into
masterfrom
docs/weekly-review-notification-plan

Conversation

@aloekun

@aloekun aloekun commented Jul 18, 2026

Copy link
Copy Markdown
Owner

概要

weekly-review reminder (ADR-031) が「発火しているのにユーザーに見えない」問題の解消計画書を追加する。状態ファイルの jj workspace 分裂と、発火の観測不能も併せて修正対象とする。

本 PR は計画書 (handoff doc) の追加のみで、実装は含まない。実装は後続の PR-N1〜N3 で段階投入する。

背景 (2026-07-19 調査)

  • weekly-review reminder は SessionStart hook で正しく発火しているが、出力が additionalContext のみのためユーザーの画面に表示されず、約 4 週間気付かれなかった (根本原因)。
  • .claude/weekly-review-last-run.json が gitignore 済み untracked で jj workspace 間に共有されず、メイン workspace 側では常に「未実行」判定で発火し続けていた (ADR-045 との相互作用)。
  • hooks-session-start が lib-telemetry (ADR-055) 未統合で、nudge の発火実績を観測できなかった。

計画 (3 PR 段階投入)

  • PR-N1: systemMessage によるユーザー可視通知 (weekly 限定) + additionalContext 文言強化 + 新 ADR 起案
  • PR-N2: last-run 状態のメイン workspace canonical 化 (lib-jj-helpers に解決関数追加、claude-code-skills 側も更新)
  • PR-N3: session-start nudge の telemetry 統合 (観測層のみ)

ライフサイクル

PR-N1〜N3 の land + dogfood (削除条件 1〜4) 完了で本ファイルを削除する。計画の履歴は git log と ADR-059 / ADR-031 / ADR-045 / ADR-055 追記に残るため、本ファイルを残す必要はない (ADR-031 の ephemeral handoff doc retire と同運用)。

Summary by CodeRabbit

  • ドキュメント
    • weekly-review reminder が画面に表示されない問題に対する改善計画を追加しました。
    • 通知の可視化、ワークスペース間での実行状況の統一、セッション開始時の観測性向上に向けた段階的な対応方針を整理しました。
    • テスト・検証手順および運用上の確認事項を記載しました。

発火しているのにユーザーに見えない weekly-review reminder (ADR-031) の解消計画。
systemMessage による可視化 (PR-N1)、last-run 状態のメイン workspace canonical 化
(PR-N2)、session-start nudge の telemetry 統合 (PR-N3) を 3 PR 段階投入する handoff doc。
PR-N1〜N3 の land + dogfood 完了で本ファイルは削除して役割を終える。
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

weekly-review reminder の可視化、main workspace を基準にした状態管理、session-start telemetry 統合に向けた PR-N1〜PR-N3 の計画と検証・運用手順を文書化しています。

Changes

weekly-review 通知改善計画

Layer / File(s) Summary
背景と設計判断
docs/weekly-review-notification-plan.md
reminder が additionalContext のみで表示されること、workspace 間で last-run 状態が分裂すること、telemetry 未統合の状況と設計判断を整理しています。
PR-N1: 可視通知
docs/weekly-review-notification-plan.md
systemMessage の追加、additionalContext の変更、session-start 出力の構造化、設定・テスト・表示確認の内容を定義しています。
PR-N2: 状態共有
docs/weekly-review-notification-plan.md
main workspace root を基準にした last-run 読込、workspace ローカル状態の扱い、skill・ADR 更新と履歴救済手順を定義しています。
PR-N3 と完了手順
docs/weekly-review-notification-plan.md
session-start nudge の telemetry 記録、出力確認、即時運用手順、計画書削除条件を記載しています。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 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 weekly-review通知の可視化改善に関する計画書追加という変更内容と一致しており、PR-N1〜N3の手渡し文脈も適切です。
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/weekly-review-notification-plan

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.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Monitor 分析 (GitHub Actions バックストップ)

  • トリガー: issue_comment (created) / 実行 run
  • CI: CodeRabbit レビューが pending (処理中、"Review in progress")。他の CI check なし。テスト/ビルド系の失敗は無し
  • レビュー状況: CodeRabbit — レビュー未着 (処理中コメントのみ、findings 未生成)。人間レビュアーによる review/inline comment は無し (reviews: [], pulls/.../comments: [])
  • Verdict: approved (現時点で applicable な指摘が 0 件のため。CodeRabbit 未着分は次回発火時に再評価が必要)

Applicable Findings (Critical / High / Major)

該当なし

Applicable Findings (Medium 以下)

該当なし

Filtered (not applicable)

該当なし

差分概要 (レビュー指摘が無いための軽量サマリー)

  • 変更ファイル: docs/weekly-review-notification-plan.md (新規追加、+192/-0) の 1 ファイルのみ
  • 変更の性質: ADR-031 (weekly-review reminder) の可視性問題を解消するための PR-N1〜N3 分割実装計画書 (docs-only)。ADR-035 の docs-only 判定基準 (全変更が docs/**、実行コード変更なし) に該当
  • 内容: 新規 ADR 起案 (systemMessage 可視化)、last-run 状態のワークスペース canonical 化、telemetry 統合の 3 段階計画。実コード変更は無く、計画書自体の記述のみ

次のアクション

  • CodeRabbit のレビューが完了 (findings 発生 または no-issues 確定) した時点で、次回イベント発火時に本 workflow が再分析を行う想定。現時点では待機不要
  • mergeStateStatus: UNSTABLE は CodeRabbit チェックが pending であることに起因する可能性が高く、レビュー完了後に解消されるか要確認 (アクション不要、経過観察)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
docs/weekly-review-notification-plan.md (4)

92-96: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

JSON builder の既存出力を保持するテストを追加してください。

現状の計画は systemMessage の有無だけを検証しています。hookSpecificOutput.additionalContext など既存フィールドが保持されること、systemMessage 無効時にキーを省略するのか null にするのかまで、既存 JSON 契約を含めてテストしてください。

🤖 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/weekly-review-notification-plan.md` around lines 92 - 96, The tests for
build_session_start_json should verify the complete existing JSON contract,
including preservation of hookSpecificOutput.additionalContext and other
established fields. Cover both Some and None system_message cases, asserting
that systemMessage is present with its value when provided and omitted or null
exactly according to the existing output behavior when absent.

35-41: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

systemMessage の外部仕様を実装時点で再検証できる形にしてください。

SessionStart での利用可否、トップレベル配置、additionalContext との併用可否を主要な設計前提にしています。対象 Claude Code バージョンと公式仕様への参照を ADR-059 または本計画に固定し、仕様変更時に再確認できるようにしてください。

🤖 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/weekly-review-notification-plan.md` around lines 35 - 41, 計画内の Claude
Code hooks 仕様記述に、対象 Claude Code バージョンと公式ドキュメントへの参照を固定して追記してください。ADR-059
または本計画の該当箇所で、SessionStart 対応、systemMessage のトップレベル配置、additionalContext
との併用可否を再検証できる形にし、仕様変更時に確認できる参照情報を残してください。

173-175: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Telemetry 検証を「1 行追加」より強くしてください。

JSONL が正しく parse できること、hookkindiddecisionsession_id が期待値であること、1 回の発火で重複記録されないことまで確認してください。単に行が追加されたかだけでは、壊れた JSON や誤った nudge ID でも成功扱いになります。

🤖 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/weekly-review-notification-plan.md` around lines 173 - 175,
「テスト・検証」節の新セッション起動時の telemetry 確認を強化し、firings JSONL の追加行を JSON として parse
できることを検証してください。解析結果の hook、kind、id、decision、session_id が期待値と一致すること、および 1
回の発火で重複記録されないことも確認し、単なる行数増加だけで成功扱いにしないでください。

90-91: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

二重通知時の振る舞いを明記してください。

systemMessage を表示したうえで、モデルにも初回応答で同じ reminder を伝えさせると、ユーザーに同一通知が二重表示される可能性があります。systemMessage と追加文脈の文言を重複させない方針、またはフォールバック時の条件を定義してください。

🤖 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/weekly-review-notification-plan.md` around lines 90 - 91,
追記した「セッション最初の応答で reminder を伝える」指示と systemMessage
の二重通知を避ける方針を明記してください。systemMessage が表示された場合はモデルに同じ reminder を伝えさせず、systemMessage
が表示されない場合のみ追加文脈の指示を適用するなど、フォールバック条件と重複しない挙動を
docs/weekly-review-notification-plan.md の該当箇所に定義してください。
🤖 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.

Inline comments:
In `@docs/weekly-review-notification-plan.md`:
- Line 16: Update the “背景 (2026-07-19 調査結果)” section to use the actual
investigation date or explicitly mark it as planned/provisional, ensuring it is
not presented as confirmed future information. Reconcile all references in the
document, including the elapsed-days statement and same-day occurrence claims,
with the review baseline of 2026-07-18 under the documented JST date convention.
- Around line 20-24: weekly-review の 7 日判定を `weekly_review.rs`
の仕様として明記し、`last_run_at` からの経過時間が 7 日未満・ちょうど 7 日・7
日超過の場合の発火結果を明確にしてください。あわせて、境界直前・7 日ちょうど・境界直後の 3
ケースをテストに追加し、実装の判定と仕様が一致することを確認してください。

---

Nitpick comments:
In `@docs/weekly-review-notification-plan.md`:
- Around line 92-96: The tests for build_session_start_json should verify the
complete existing JSON contract, including preservation of
hookSpecificOutput.additionalContext and other established fields. Cover both
Some and None system_message cases, asserting that systemMessage is present with
its value when provided and omitted or null exactly according to the existing
output behavior when absent.
- Around line 35-41: 計画内の Claude Code hooks 仕様記述に、対象 Claude Code
バージョンと公式ドキュメントへの参照を固定して追記してください。ADR-059 または本計画の該当箇所で、SessionStart
対応、systemMessage のトップレベル配置、additionalContext
との併用可否を再検証できる形にし、仕様変更時に確認できる参照情報を残してください。
- Around line 173-175: 「テスト・検証」節の新セッション起動時の telemetry 確認を強化し、firings JSONL の追加行を
JSON として parse できることを検証してください。解析結果の hook、kind、id、decision、session_id
が期待値と一致すること、および 1 回の発火で重複記録されないことも確認し、単なる行数増加だけで成功扱いにしないでください。
- Around line 90-91: 追記した「セッション最初の応答で reminder を伝える」指示と systemMessage
の二重通知を避ける方針を明記してください。systemMessage が表示された場合はモデルに同じ reminder を伝えさせず、systemMessage
が表示されない場合のみ追加文脈の指示を適用するなど、フォールバック条件と重複しない挙動を
docs/weekly-review-notification-plan.md の該当箇所に定義してください。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 29c21d37-db0b-41e1-a571-e8c6afb68895

📥 Commits

Reviewing files that changed from the base of the PR and between da02412 and 760e105.

📒 Files selected for processing (1)
  • docs/weekly-review-notification-plan.md

> 3. PR-N2 land 後、secondary workspace (ccht-improve) からのセッションで経過日数が「未実行」ではなく実日数で表示されることを確認済
> 4. PR-N3 land 後、`.claude/telemetry/firings-*.jsonl` に session-start nudge の発火行が記録されることを確認済

## 背景 (2026-07-19 調査結果)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

未来日付の調査結果を確定情報として残さないでください。

レビュー基準日は 2026-07-18 ですが、ここでは 2026-07-19 を「調査結果」として扱い、Line [181] では 18 日経過、Line [183]-[185] では同日発生済みの事実として参照しています。実際の調査日へ修正するか、予定・仮置きであることを明記し、経過日数も再計算してください。

Based on learnings: docs/ の prose 日付は JST として解釈しますが、文書内の日付とレビュー基準日の整合性は維持してください。

🤖 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/weekly-review-notification-plan.md` at line 16, Update the “背景
(2026-07-19 調査結果)” section to use the actual investigation date or explicitly
mark it as planned/provisional, ensuring it is not presented as confirmed future
information. Reconcile all references in the document, including the
elapsed-days statement and same-day occurrence claims, with the review baseline
of 2026-07-18 under the documented JST date convention.

Source: Learnings

Comment on lines +20 to +24
- ADR-031 の weekly-review reminder は SessionStart hook (`src/hooks-session-start/src/weekly_review.rs`) が
`.claude/weekly-review-last-run.json` の `last_run_at` を見て 7 日超過で発火する設計。
2026-06-23 (PR #216) に `.claude/hooks-config.toml` で enable された。
- **reminder は正しく発火している**。しかし hook の出力は `hookSpecificOutput.additionalContext` のみで、
これは **Claude のコンテキストに注入されるだけでユーザーの画面には表示されない**。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

7 日判定の境界条件を仕様として固定してください。

「7 日超過」は通常 > 7 を意味しますが、threshold 7>= 7 とも読めます。7 日ちょうどに発火するのかを明記し、境界直前・ちょうど・直後のテストケースを追加してください。

Also applies to: 87-89

🤖 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/weekly-review-notification-plan.md` around lines 20 - 24, weekly-review
の 7 日判定を `weekly_review.rs` の仕様として明記し、`last_run_at` からの経過時間が 7 日未満・ちょうど 7 日・7
日超過の場合の発火結果を明確にしてください。あわせて、境界直前・7 日ちょうど・境界直後の 3
ケースをテストに追加し、実装の判定と仕様が一致することを確認してください。

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Monitor 分析 (GitHub Actions バックストップ)

  • トリガー: pull_request_review (submitted) / 実行 run
  • CI: analyze check が pending (処理中)。CodeRabbit check は pass (Review completed)。失敗中の check なし。mergeStateStatus: UNSTABLEanalyze pending に起因する可能性が高い
  • レビュー状況: CodeRabbit — COMMENTED でレビュー提出済み (2026-07-18T20:55:47Z、actionable 2 件 + nitpick 4 件)。人間レビュアーによるレビューなし
  • Verdict: user_decision (.takt/facets/instructions/analyze-coderabbit.md の 3-way 基準: Critical/High/Major の applicable finding は無く、Medium 以下の applicable finding のみ存在)

Applicable Findings (Critical / High / Major)

該当なし

Applicable Findings (Medium 以下)

# File (Line) Reviewer Issue Recommended Action
1 docs/weekly-review-notification-plan.md (16) CodeRabbit 「背景 (2026-07-19 調査結果)」がレビュー基準日 (2026-07-18) より未来日付で、確定情報として記述されている (18日経過・同日発生済みという記述含む) 実際の調査日に修正するか、予定/仮置きである旨を明記し、経過日数・同日発生の記述も基準日と整合させる
2 docs/weekly-review-notification-plan.md (35-41) CodeRabbit systemMessage の SessionStart 対応・トップレベル配置・additionalContext 併用可否という設計前提について、対象 Claude Code バージョンや公式ドキュメントへの参照が固定されていない ADR-059 (起案予定) または本計画の該当箇所に、参照した Claude Code バージョン・公式ドキュメントへの言及を追記し、仕様変更時に再検証できるようにする
3 docs/weekly-review-notification-plan.md (90-91) CodeRabbit systemMessage 表示と「セッション最初の応答で reminder を伝える」指示が両方効いた場合、同一通知がユーザーに二重表示されうる懸念に対する方針が未記載 systemMessage 表示時はモデルに同じ reminder を重複させない、または systemMessage 非表示時のみ追加文脈指示を適用する旨をフォールバック条件として明記する

Filtered (not applicable)

# File (Line) Issue Filter Reason
1 docs/weekly-review-notification-plan.md (20-24, 87-89 にも適用) 7日判定の境界条件 (>7>=7 か) が曖昧、境界直前/ちょうど/直後のテストケース追加を要求 ADR-035 docs-only: PR は docs/weekly-review-notification-plan.md のみの新規追加 (+192/-0) で ADR-035 の docs-only 判定条件を満たす。本指摘はテストケース追加という test coverage 系の要求であり、ADR-035 が docs-only PR から除外する評価基準に該当
2 docs/weekly-review-notification-plan.md (92-96) JSON builder (build_session_start_json) の既存出力 (additionalContext 等) を保持するテストを追加すべき、との要求 ADR-035 docs-only: 同上、test coverage 系のためスコープ外
3 docs/weekly-review-notification-plan.md (173-175) telemetry 検証を JSONL parse・フィールド一致・重複記録なしまで強化すべき、との要求 ADR-035 docs-only: 同上、test coverage 系のためスコープ外

次のアクション

  • Medium 以下の 3 件 (未来日付の記述整合、仕様参照の版固定、二重通知方針の明記) は severity が低いため、次のローカルセッションでの docs 修正時にまとめて反映するかユーザー判断で良い
  • analyze check が pending のままの場合、完了を待ってから merge 判断すること (現時点でアクション不要、経過観察)

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