Skip to content

docs(pipeline+adr): Bundle a 拡張 (#D-1 + #D-3 統合) + ADR-034 起案#100

Merged
aloekun merged 1 commit into
masterfrom
docs/bundle-a-expansion-adr-034
May 2, 2026
Merged

docs(pipeline+adr): Bundle a 拡張 (#D-1 + #D-3 統合) + ADR-034 起案#100
aloekun merged 1 commit into
masterfrom
docs/bundle-a-expansion-adr-034

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 2, 2026

Summary

  • 旧 Bundle Z2 (#D-1 + #D-4) を再構成: #D-1 + #D-3 を Bundle a に統合#D-2 取り下げ (#D-3 で代替)、#D-4 保留 (思考連続性低下リスク、Bundle Z Phase 2/3 完了後再評価)
  • docs/pipeline-token-efficiency.md の #D セクション全体に status マーキング、Bundle 編成 / 期待効果 / 進捗管理 table を改訂
  • docs/todo.md 推奨実行順序サマリーに 順位 44 (#D-1) + 順位 45 (#D-3) を追加、Bundle a 戦略段落を 4 component / 2 Sub-PR 分割に拡張
  • docs/todo4.md に 2 詳細 entry 追加 (ADR-033 template 準拠、別セッション実装の前提情報を網羅)
  • ADR-034 新規起案「CodeRabbit 監視・対話の自動化戦略」+ CLAUDE.md にリンク追加

Context

  • Why: Bundle Y2 効果でパイプラインが加速 (1〜2m/iter) した結果として CR rate-limit 発生頻度が増えた逆説的副作用への対策方針を、PR feat(hooks): Bundle Z Phase 1 - Rust comment lint hook + 計画書再編 #99 セッション末のユーザー判断で確定。#D-4 (Claude 応答スタイル簡素化) は思考連続性低下リスクで保留に転換 (中間出力削減 → 後段 context 再構築コスト増の trade-off 懸念)
  • Trigger: .claude/feedback-reports/99.md の Tier 2 fix(hooks): Replace matcher追加 & deploy時のpermissions保持 #4 + Tier 3 refactor(deploy): 出力先へのテンプレート配布を廃止 #5 採用、ユーザー将来希望「rate-limit 確認 + 再 review 依頼 + ポーリング全自動化」、本セッションで実施した 4 シナリオ ユーザーストーリー検討
  • Scope decision: docs-only 変更で実装変更なし。別セッションで Bundle a の Sub-PR 1 (#D-1 + #D-3) → Sub-PR 2 (cli-pr-monitor rate-limit auto-retry + ADR-018 改訂) の順で実装する想定。別セッション実装に必要な情報 (関連コンポーネント / ADR / memory / todo entry) を ADR-034「実装に必要な情報」セクションに網羅

Validation

  • pre-push-review: verdict=APPROVE (1 iteration / 1m 40s, 2026-05-02 16:48 JST)
    • simplicity-review: APPROVE (docs-only)
    • security-review: APPROVE (実行コード変更なし、トラスト境界不変)
  • markdownlint: 0 errors (CLAUDE.md / ADR-034 / docs/todo.md / docs/todo4.md、計 4 files)
  • ADR-033 検証 (本タスク追加分): 0 件違反 (table 外で 順位 N 表記なし)
  • cross-reference 整合: Bundle Z2 retire / Bundle a 統合 / ADR-034 参照が一貫
  • 別セッションでの Bundle a Sub-PR 1 / Sub-PR 2 実装による dogfood: 未実施 (本 PR は計画書 + ADR の docs-only update に scope 限定)

References

Summary by CodeRabbit

リリースノート

  • Documentation
    • CodeRabbit自動監視・対話戦略に関するアーキテクチャ決定記録(ADR-034)を追加
    • パイプラインのトークン効率性に関する政策ドキュメントを更新
    • 推奨実行順序サマリーと関連タスク一覧を更新

PR #99 セッション末のユーザー判断を反映:
- 旧 Bundle Z2 (#D-1 + #D-4) を再構成
- #D-1 (gh CLI 規則) + #D-3 (check-ci-coderabbit --list-findings) を
  Bundle a に統合
- #D-2 は #D-3 で代替のため取り下げ
- #D-4 は思考連続性低下リスクで保留 (Bundle Z Phase 2/3 完了後に再評価)

更新内容:

docs/pipeline-token-efficiency.md:
- #D-1〜#D-4 の status マーキング
- 採用判定 table 改訂、Bundle 編成 table で Bundle Z2 retire + Bundle a 追加
- 期待効果 table の二段化 (#D-1+#D-3 と #D-4 保留)
- 統合効果試算改訂、進捗管理 table の status 更新

docs/todo.md:
- 順位 44 (#D-1) + 順位 45 (#D-3) を推奨実行順序サマリーに追加
- Bundle a 戦略段落を 2 Sub-PR 分割に拡張

docs/todo4.md:
- 2 entry 追加 (ADR-033 template 準拠、別セッション実装の前提情報を網羅)

docs/adr/adr-034-coderabbit-auto-monitoring.md (新規):
- CodeRabbit 監視・対話の自動化戦略
- 別セッション実装を前提に「実装に必要な情報」セクションで関連コンポーネント /
  ADR / memory / todo entry を一括参照
- #D-4 再評価条件と Bundle a 着手時の reality check も明記

CLAUDE.md:
- ADR-034 リンクを Architecture Decisions リストに追加

別セッションで Bundle a の Sub-PR 1 (#D-1 + #D-3) → Sub-PR 2 (cli-pr-monitor
rate-limit auto-retry + ADR-018 改訂) の順で実装する想定。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

📝 Walkthrough

Walkthrough

PR は ADR-034(CodeRabbit 監視・対話の自動化戦略)を新規定義し、rate-limit 自動検出・再トリガー、token 削減対策、cli-pr-monitor の状態永続化による session 超え recovery といった実装計画を文書化しました。関連する採用判定と todo 項目も更新されました。

Changes

ADR-034 と実装計画の統合

Layer / File(s) Summary
ADR 定義
docs/adr/adr-034-coderabbit-auto-monitoring.md
新規 ADR-034 として rate-limit 自動検出(walkthrough comment ポーリング・regex マッチング)、@coderabbitai review の自動再投稿、cli-pr-monitor session 状態スキーマ拡張による unlock-time 追跡、gh CLI POST/GET 最適化ルール、および check-ci-coderabbit --list-findings による構造化 findings JSON 出力を定義。実装は 2 サブ PR に分割し、token 削減層と rate-limit 自動化層を段階的展開。
アーキテクチャ参照
CLAUDE.md
Architecture Decisions リストに ADR-034 への参照リンクを追加。
採用判定と戦略更新
docs/pipeline-token-efficiency.md
Bundle Z2 を再構成し、#D-1(git-workflow.md 追記)と #D-3(check-ci-coderabbit --list-findings モード)を Bundle a として採用に切り替え。#D-2(wrapper スクリプト)を取り下げ、#D-4(応答スタイル簡素化)を保留に据え置き。採用判定テーブル、Bundle 累積効果見積、進捗管理表を整合更新。
実装タスク追跡
docs/todo.md, docs/todo4.md
PR #99 として Bundle a 実装タスク(cli-pr-monitor rate-limit auto-retry、@coderabbitai review 自動トリガー、ADR-018/ADR-009 ポリシー明文化、gh CLI 使用規則拡記、check-ci-coderabbit --list-findings Rust モード実装)を推奨実行順序サマリーおよび詳細計画書に追記。各タスクの依存関係・検証指標を明確化。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #90: docs/todo*.md への同一内容(cli-pr-monitor rate-limit auto-retry)の追記が重複しており、関連度が高い
  • PR #97: ADR-034 の実装仕様(rate-limit 検出、check-ci-coderabbit JSON findings、cli-pr-monitor state/unlock-time + auto-retry)を定義する本PR と、実装内容が直結している
  • PR #89: cli-pr-monitor の rate-limit 処理変更(polling・anti-duplicate・auto-retry)に関する同一 todo エントリ更新を行っており、直接関連
🚥 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 タイトルは主な変更内容(Bundle a 拡張、ADR-034 起案、#D-1 と #D-3 の統合)を正確に反映しており、ドキュメント整備の重点が明確に示されています。
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.


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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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 (4)
docs/adr/adr-034-coderabbit-auto-monitoring.md (2)

95-101: ⚡ Quick win

JSON schema の具体例が有用

--list-findings の出力 JSON schema 例 (lines 95-101) は実装の明確化に貢献しています。この schema が context snippet 3 (src/cli-pr-monitor/src/state.rs の update_state_from_check_result) で消費される際、rate_limit_unlock_atscheduled_retry_post フィールドも同 JSON に含めるべきかを明記すると、Sub-PR 1 と Sub-PR 2 の API contract が明瞭になります。

現状の schema 例には findings 配列のみですが、実装セクション (lines 77-79) で言及されている rate-limit 関連フィールドが含まれるかどうかが不明です。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adr/adr-034-coderabbit-auto-monitoring.md` around lines 95 - 101, The
JSON example for `--list-findings` only shows a findings array but omits the
rate-limit fields consumed by update_state_from_check_result; update the example
JSON (the block at lines 95-101) to include top-level optional fields
rate_limit_unlock_at and scheduled_retry_post (with their expected types/format,
e.g. ISO8601 timestamp or null) so the API contract between the CLI and
src/cli-pr-monitor/src/state.rs::update_state_from_check_result is explicit;
mention in the doc that these fields are optional and how they are interpreted
by update_state_from_check_result.

77-79: ⚡ Quick win

Schema 拡張フィールド名の不整合を確認

ADR では rate_limit_unlock_at (ISO 8601) と scheduled_retry_post (bool) の追加を記述していますが、context snippet (src/cli-pr-monitor/src/state.rs) には既存の rate_limit_last_retriggered_at が確認できます。新フィールドが既存の rate_limit / rate_limit_retries / rate_limit_last_retriggered_at とどう共存するか、実装時の整合性を確保するため、context snippet 1 の既存スキーマとの統合方針を本セクションに明記することを推奨します。

例: 「rate_limit_unlock_atRateLimitState 構造体内に追加するか、PrMonitorState の top-level フィールドとして追加するかを実装時に確定」等の補足があると、実装者が迷わずに済みます。

Based on learnings: context snippet 1 shows existing rate-limit tracking fields in PrMonitorState and RateLimitState structs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/adr/adr-034-coderabbit-auto-monitoring.md` around lines 77 - 79, The ADR
mentions adding `rate_limit_unlock_at` and `scheduled_retry_post` but doesn't
explain how they coexist with existing fields like `rate_limit`,
`rate_limit_retries`, and `rate_limit_last_retriggered_at` seen in
src/cli-pr-monitor/src/state.rs; update the ADR section to explicitly state the
chosen integration strategy (e.g., whether `rate_limit_unlock_at` will be added
into the existing `RateLimitState` struct or as a top-level field on
`PrMonitorState`, and how `scheduled_retry_post` maps to retry logic and
`rate_limit_retries`), reference the exact symbols `RateLimitState`,
`PrMonitorState`, `rate_limit_last_retriggered_at`, `rate_limit_retries`,
`rate_limit_unlock_at`, and `scheduled_retry_post`, and include a short note
describing expected invariants and migration/compatibility behavior for existing
state files.
docs/todo4.md (2)

435-436: ⚡ Quick win

Session 超え recovery 機構選定の検討ポイントが適切

「詰まっている箇所」で session 超え auto-trigger の機構選定 (cli-pr-monitor 自身の long sleep vs SessionStart hook recovery) を挙げていますが、ADR-034 (lines 75-81) では SessionStart hook recovery を前提とした設計になっています。

この「詰まっている箇所」記載は実装時の最終確認として有用ですが、ADR-034 が既に方針を示している点を明記すると、着手時の迷いが減ります。例: 「ADR-034 では SessionStart hook 経由の recovery を推奨しているが、実装時に運用パターンを再評価」等。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/todo4.md` around lines 435 - 436, Update the note about session-over
auto-trigger decisions to state ADR-034 prefers SessionStart hook-based recovery
(i.e., use SessionStart hook + state file for recovery) while still keeping the
original evaluation step — mention cli-pr-monitor long-sleep vs SessionStart
hook as an implementation-time re-evaluation and reference existing rate-limit
logic (handle_rate_limit_retry / PR `#97` Phase 4) for considering extension vs
replacement.

421-421: ⚡ Quick win

Schema 拡張フィールドの記載を確認

Line 421 で .claude/cli-pr-monitor-state.json schema 拡張として rate_limit_unlock_at, scheduled_retry_post 等 を言及していますが、ADR-034 (line 77-79) では rate_limit_unlock_at (ISO 8601) と scheduled_retry_post (bool) が明記されています。

「等」という表記が他のフィールドも追加する可能性を示唆していますが、ADR-034 では 2 フィールドのみです。実装時の混乱を避けるため、「等」を削除して具体的なフィールド名のみを列挙することを推奨します。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/todo4.md` at line 421, Update the TODO line to remove the vague "等" and
explicitly list only the two fields defined in ADR-034: rate_limit_unlock_at
(ISO 8601) and scheduled_retry_post (bool) for the
`.claude/cli-pr-monitor-state.json` schema so the item matches ADR-034 and
avoids implying additional unspecified fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/adr/adr-034-coderabbit-auto-monitoring.md`:
- Around line 95-101: The JSON example for `--list-findings` only shows a
findings array but omits the rate-limit fields consumed by
update_state_from_check_result; update the example JSON (the block at lines
95-101) to include top-level optional fields rate_limit_unlock_at and
scheduled_retry_post (with their expected types/format, e.g. ISO8601 timestamp
or null) so the API contract between the CLI and
src/cli-pr-monitor/src/state.rs::update_state_from_check_result is explicit;
mention in the doc that these fields are optional and how they are interpreted
by update_state_from_check_result.
- Around line 77-79: The ADR mentions adding `rate_limit_unlock_at` and
`scheduled_retry_post` but doesn't explain how they coexist with existing fields
like `rate_limit`, `rate_limit_retries`, and `rate_limit_last_retriggered_at`
seen in src/cli-pr-monitor/src/state.rs; update the ADR section to explicitly
state the chosen integration strategy (e.g., whether `rate_limit_unlock_at` will
be added into the existing `RateLimitState` struct or as a top-level field on
`PrMonitorState`, and how `scheduled_retry_post` maps to retry logic and
`rate_limit_retries`), reference the exact symbols `RateLimitState`,
`PrMonitorState`, `rate_limit_last_retriggered_at`, `rate_limit_retries`,
`rate_limit_unlock_at`, and `scheduled_retry_post`, and include a short note
describing expected invariants and migration/compatibility behavior for existing
state files.

In `@docs/todo4.md`:
- Around line 435-436: Update the note about session-over auto-trigger decisions
to state ADR-034 prefers SessionStart hook-based recovery (i.e., use
SessionStart hook + state file for recovery) while still keeping the original
evaluation step — mention cli-pr-monitor long-sleep vs SessionStart hook as an
implementation-time re-evaluation and reference existing rate-limit logic
(handle_rate_limit_retry / PR `#97` Phase 4) for considering extension vs
replacement.
- Line 421: Update the TODO line to remove the vague "等" and explicitly list
only the two fields defined in ADR-034: rate_limit_unlock_at (ISO 8601) and
scheduled_retry_post (bool) for the `.claude/cli-pr-monitor-state.json` schema
so the item matches ADR-034 and avoids implying additional unspecified fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 516187b6-3213-425d-8875-e425e4d715e0

📥 Commits

Reviewing files that changed from the base of the PR and between b522b0c and 6bab289.

📒 Files selected for processing (5)
  • CLAUDE.md
  • docs/adr/adr-034-coderabbit-auto-monitoring.md
  • docs/pipeline-token-efficiency.md
  • docs/todo.md
  • docs/todo4.md

@aloekun aloekun merged commit e1dc0ab into master May 2, 2026
1 check passed
@aloekun aloekun deleted the docs/bundle-a-expansion-adr-034 branch May 2, 2026 08:35
aloekun added a commit that referenced this pull request May 2, 2026
…101)

* docs(todo): Bundle a Sub-PR 2 integration test entry + 順位 46 を実行順序に追加

PR #100 post-merge-feedback で生成された Sub-PR 2 follow-up エントリを反映:
- 順位 46 を docs/todo.md 推奨実行順序に追加 (Bundle a Sub-PR 2 integration test)
- docs/todo4.md に詳細エントリ追加 (cli-pr-monitor rate-limit auto-retry の test 計画)

設計根拠は ADR-034 参照。実装は Sub-PR 2 で着手予定。

* feat(check-ci-coderabbit): --list-findings Rust モード追加 (Bundle a Sub-PR 1 #D-3)

ADR-034 Bundle a Sub-PR 1 の token 削減層。CodeRabbit インラインレビュー
コメントを構造化 JSON `{"findings": [...]}` で出力する新モードを追加する。

- CliArgs に `--list-findings` フラグ + `--push-time` の epoch 0 fallback
- ListedFinding struct (severity / file / line / summary / url) + 出力 envelope
- parse_listed_findings: thread root のみ抽出 + `resolved:` reply による outdated filter
- GhPullComment に id / in_reply_to_id / html_url を拡張
- run_list_findings: CI / rate-limit / status check を skip して findings のみ取得
- 単体テスト 16 件追加 (resolve filter / push_time / 非 CR 著者 / schema 検証 等)

Sub-PR 2 (cli-pr-monitor の rate-limit auto-retry) で本 API を消費する想定。
gh CLI 規則 (#D-1) は global rule (~/.claude/rules/common/git-workflow.md) に
追記済 (リポ外)。

* fix(review): apply CodeRabbit fixes for #101

Resolved findings:
- [Minor] src/check-ci-coderabbit/src/main.rs:666 `push_time` 境界を inclusive に揃えてください。
- [Major] src/check-ci-coderabbit/src/main.rs:1197 取得失敗を空配列に潰さないでください。
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