Skip to content

feat(cli-pr-monitor): rate-limit Posted park 予約 + ADR-018 transient failure 明文化 (順位 80+82 / §A-2 P-5)#129

Merged
aloekun merged 2 commits intomasterfrom
feature/p5-bundle-f1-rate-limit-park
May 7, 2026
Merged

feat(cli-pr-monitor): rate-limit Posted park 予約 + ADR-018 transient failure 明文化 (順位 80+82 / §A-2 P-5)#129
aloekun merged 2 commits intomasterfrom
feature/p5-bundle-f1-rate-limit-park

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 7, 2026

Summary

  • §A-2 Phase 5 dogfood P-5 (Bundle f-1 partial) — 5 PR シリーズの最終 PR
  • 順位 80 (Tier 1): rate-limit auto-retry の Posted 経路で park 予約 → silent exit を構造的に防止
  • 順位 82 (Tier 3): ADR-018 に transient failure auto-retry scope を表形式で明文化、順位 81 defer 理由も記録
  • 順位 81 (Tier 1): 1 観測のみで systemic 性未確認、defer 判断 (re-trigger 条件 = 2 件以上の同型観測)
  • §A-2 ledger に P-4 (PR test(cli-pr-monitor): cross-module overflow safety + 2100 baseline (順位 76+77 / §A-2 P-4) #128) dogfood 結果 を記録 (agreement 1/1 / latency 6.6s / fallback 0/1 = P-2 から大幅改善)

Changes

src/cli-pr-monitor/src/stages/poll.rs (順位 80 fix)

finalize_posted_retrigger を拡張: 投稿後 silent exit ではなく必ず park を返す。

観点 Before After
戻り値 (success path) None (polling 継続) Some(park_poll_result) (terminal)
state.action (変更なし) "parked_review_recheck"
state.next_wakeup_at_unix (None のまま) now + review_recheck_wait_secs
state.wakeup_reason (None のまま) "rate_limit_post_retrigger"
PARK signal (出力なし) format_park_signal で stdout 出力
Timeout 経路 rate-limit detection 後でも到達 到達不可 (park で必ず terminal)

call chain: handle_rate_limit_branch / dispatch_rate_limit_outcome / finalize_posted_retrigger 各関数に review_recheck_wait_secs: u64 引数を thread。

新 unit tests (2 件):

  • finalize_posted_retrigger_schedules_park_after_post — success path で park action / wakeup time / wakeup_reason / dedup 用 last_retriggered_at が全て設定されることを assert
  • finalize_posted_retrigger_action_required_when_write_state_fails — write_state 失敗時は action_required で抜ける (sibling parity with finalize_parked)

docs/adr/adr-018-pr-monitor-takt-migration.md (順位 82)

## 追記 (2026-05-08): 順位 80 — auto-retry の transient failure scope 明文化 セクション追加:

  • 対象 transient failure 4 種を表形式で列挙 (rate-limit 待機型/即時型 + CR 投稿エラー + wakeup 未予約 fallback)
  • 順位 80 fix の Before/After を明文化
  • 順位 81 defer 理由を 3 観測閾値ルールで説明 + Re-trigger 条件規定

docs/local-llm-offload-analysis.md (§A-2 計測ログ P-4)

P-4 (PR #128) outcome 記録:

P-4 (順位 76+77): PR #128, merged 2026-05-08, findings: 1 (CR Nitpick: cross_module_* 命名 misleading)、agreement: 1/1 (100%)、latency: 6.6s/件、fallback: 0/1 (P-2 の 1/1 から改善)、normalized_issue: Japanese 50 chars (length contract pass、P-2 の 100>80 violation から改善)

docs/todo.md / docs/todo5.md

  • 順位 80 / 82 詳細エントリ削除 (完了タスク削除規約)
  • 順位 81 は defer 注記付きで残置 (re-trigger 条件 + 作業計画は ADR-018 §追記 2026-05-08 と整合)
  • 別 commit (docs(todo): 順位 80 + 82 ... 完了に伴い削除 + 順位 81 defer 注記) で分離

§A-2 dogfood 全 5 PR 集計

P PR findings classifier agreement latency fallback 備考
P-0 #123 smoke 1 件 ✅ 妥当 enabled=true land
P-1 #125 0 (CR APPROVE) ❌ 未起動 N/A N/A N/A findings ゼロで dogfood 不発
P-2 #126 1 Nitpick 手動 synthetic 1/1 (100%) 6.4s 1/1 (length) review body 抽出漏れ判明
P-3 #127 rate-limit blocked ❌ 未起動 N/A N/A N/A CR rate-limit が dogfood blocker
P-4 #128 1 Nitpick 手動 synthetic 1/1 (100%) 6.6s 0/1 length contract pass、改善傾向

観察:

  • 5 PR 中 classifier に実データ流せたのは 2 PR (P-2, P-4) のみ
  • agreement rate: 2/2 = 100% (目標 ≥80% 達成、ただし N=2 は統計的有意性低)
  • latency: 平均 6.5s/件 (目標 ≤5s/件 を超過、改善余地あり)
  • fallback rate: 1/2 = 50% (但し P-2 → P-4 で 0% に推移、prompt 改善で更に下げられる可能性、§8.D 候補)
  • dogfood 阻害要因の分類: findings ゼロ / review body 抽出漏れ / rate-limit の 3 種類が観測 — local-llm 採用判断時の post-mortem material として価値あり

ADR-038 昇格判定

§A-2 dogfood 完了時点での昇格判定:

  • 条件 1 (5 PR dogfood + 妥当性確認): ✅ 5 PR 完了、agreement rate 100% (但し N=2 で限定的)
  • 条件 3 (token 削減効果): ❓ 計測不可 (classifier 起動率 40% で session token Δ 比較が困難)

本 PR では昇格判断を保留。dogfood 完了報告は ADR-038 試験運用継続として別 PR (or 後続 session) で扱う。

Test plan

  • cargo test -p cli-pr-monitor finalize_posted_retrigger — 2/2 pass (新規)
  • cargo test -p cli-pr-monitor — 170 active passed (regression なし)
  • pre-push-review APPROVE
  • release build + deploy (.claude/cli-pr-monitor.exe)
  • (post-merge) classifier 起動確認 + §A-2 P-5 計測ログ記録 + dogfood 集計の最終確定

関連

  • 順位 80 / 82 / 81 — 旧 docs/todo5.md 詳細エントリ (順位 80 + 82 削除、81 defer 注記)
  • §A-2 P-5 (本 PR) — docs/local-llm-offload-analysis.md 計測ログ
  • ADR-018 §追記 2026-05-08 — transient failure scope の明文化
  • ADR-038 §試験運用 — dogfood 完了報告は本 PR スコープ外、後続評価

aloekun added 2 commits May 8, 2026 00:55
… transient failure 明文化 (順位 82) + §A-2 P-4 ledger (§A-2 P-5)

§A-2 Phase 5 dogfood P-5 (Bundle f-1 partial)。PR #120 で観測された rate-limit
auto-retry の silent exit (RateLimitOutcome::Posted → polling 継続 → max_duration
timeout) を構造的に解消。

順位 80 (Tier 1, T1-1) — finalize_posted_retrigger に park 予約を追加:
- Before: 投稿後 write_state → None 返し → polling 継続 → timeout で silent exit
- After: 投稿後 state.action = parked_review_recheck + next_wakeup_at_unix =
  now + review_recheck_wait_secs を設定 + format_park_signal で PARK 出力 →
  Some(park_poll_result) で必ず terminal を返す
- handle_rate_limit_branch / dispatch_rate_limit_outcome /
  finalize_posted_retrigger 各関数に review_recheck_wait_secs 引数を thread
- 2 unit tests 追加 (success 経路 + write_state 失敗 action_required 経路)

順位 82 (Tier 3, T3-2) — ADR-018 に追記:
- 対象 transient failure pattern を表形式で 4 種列挙
  (rate-limit 待機型/即時型 + CR 投稿エラー + wakeup 未予約 fallback)
- 順位 80 fix の実装ポイント (Before/After) を明文化
- 順位 81 (CR 投稿エラー) を defer した理由を 3 観測閾値ルールで説明

順位 81 (Bundle f-1 残部、Tier 1 T1-2):
- 1 観測のみ (PR #120) で systemic 性未確認のため defer
- 同型 error が 2 件以上観測されたら再活性化 (re-trigger 条件を ADR-018 で規定)
- 本セッションのユーザー方針 feedback_no_unenforced_rules と整合

§A-2 計測ログ P-4 結果記録:
- P-4 (PR #128): 1 finding (CR Nitpick: cross_module_* 命名 misleading)
  - classifier: action=human_review / confidence=0.9 (P-2 の 0.0 から大幅改善)
  - normalized_issue: Japanese 50 chars (length contract pass)
  - latency: 6.6s/件、fallback: 0/1 (P-2 の 1/1 から改善)
  - agreement: 1/1 (100%、私評価=human_review と一致)

170 active tests pass (新 2 件追加)、regression なし。
build + deploy 済 (.claude/cli-pr-monitor.exe)。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@aloekun has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 6 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a1c6273-52ec-403f-867d-8015d4d03de6

📥 Commits

Reviewing files that changed from the base of the PR and between 95c754a and b8f4698.

📒 Files selected for processing (5)
  • docs/adr/adr-018-pr-monitor-takt-migration.md
  • docs/local-llm-offload-analysis.md
  • docs/todo.md
  • docs/todo5.md
  • src/cli-pr-monitor/src/stages/poll.rs

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 eb67bde into master May 7, 2026
1 check passed
@aloekun aloekun deleted the feature/p5-bundle-f1-rate-limit-park branch May 7, 2026 16:10
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