docs: weekly-review 通知可視化改善の計画書を追加 (PR-N1〜N3 handoff) - #298
Conversation
発火しているのにユーザーに見えない 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 完了で本ファイルは削除して役割を終える。
📝 WalkthroughWalkthroughweekly-review reminder の可視化、main workspace を基準にした状態管理、session-start telemetry 統合に向けた PR-N1〜PR-N3 の計画と検証・運用手順を文書化しています。 Changesweekly-review 通知改善計画
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🤖 PR Monitor 分析 (GitHub Actions バックストップ)
Applicable Findings (Critical / High / Major)該当なし Applicable Findings (Medium 以下)該当なし Filtered (not applicable)該当なし 差分概要 (レビュー指摘が無いための軽量サマリー)
次のアクション
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
docs/weekly-review-notification-plan.md (4)
92-96: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winJSON 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 winsystemMessage の外部仕様を実装時点で再検証できる形にしてください。
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 winTelemetry 検証を「1 行追加」より強くしてください。
JSONL が正しく parse できること、
hook・kind・id・decision・session_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
📒 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 調査結果) |
There was a problem hiding this comment.
🎯 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
| - 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 のコンテキストに注入されるだけでユーザーの画面には表示されない**。 |
There was a problem hiding this comment.
🎯 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
ケースをテストに追加し、実装の判定と仕様が一致することを確認してください。
🤖 PR Monitor 分析 (GitHub Actions バックストップ)
Applicable Findings (Critical / High / Major)該当なし Applicable Findings (Medium 以下)
Filtered (not applicable)
次のアクション
|
概要
weekly-review reminder (ADR-031) が「発火しているのにユーザーに見えない」問題の解消計画書を追加する。状態ファイルの jj workspace 分裂と、発火の観測不能も併せて修正対象とする。
本 PR は計画書 (handoff doc) の追加のみで、実装は含まない。実装は後続の PR-N1〜N3 で段階投入する。
背景 (2026-07-19 調査)
additionalContextのみのためユーザーの画面に表示されず、約 4 週間気付かれなかった (根本原因)。.claude/weekly-review-last-run.jsonが gitignore 済み untracked で jj workspace 間に共有されず、メイン workspace 側では常に「未実行」判定で発火し続けていた (ADR-045 との相互作用)。計画 (3 PR 段階投入)
systemMessageによるユーザー可視通知 (weekly 限定) + additionalContext 文言強化 + 新 ADR 起案ライフサイクル
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