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 into
masterfrom
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 into
masterfrom
feature/p5-bundle-f1-rate-limit-park

Conversation

@aloekun

@aloekun aloekun commented May 7, 2026

Copy link
Copy Markdown
Owner

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

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

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
aloekun added a commit that referenced this pull request Jun 6, 2026
本 PR は以下 4 つの作業を 1 コミットに統合:

## A. PR #196 post-merge-feedback 採用 2 件 (順位 193, 194 登録)

PR #196 (Bundle 195-FB) post-merge-feedback 8 件のうち 2 件採用、6 件却下/様子見。

採用 (todo10.md に entry 追加、todo-summary.md table に行追加):
- 順位 193 (T2): Companion helper group 署名整合 compile-time validation test
- 順位 194 (T3): development-workflow.md \"1. Plan First\" に Codification
  重複確認 step 追記

却下/様子見の詳細は .claude/feedback-reports/196.md 参照。

## B. queue 棚卸し (順位 ≤ 100 の 32 件を audit)

8 件削除 + 7 件改訂で queue の signal/noise 改善:

削除 8 件 (既存 land 確認、または動機失効):
- 順位 41 (Bundle Y2 効果定量計測): 動機の主軸失効 (Bundle Z 完成 + Z2 不採用)
- 順位 42, 43, 46 (rate-limit auto-retry 系): PR #97/#113/#129/#185 段階 land 完了
- 順位 45 (--list-findings Rust モード): PR #101 で land 済
- 順位 57 (Aggregation cap integration test): PR #171 で land 済
- 順位 93 (coding-style.md partial fix 例追加): ~/.claude/rules/common/
  coding-style.md に既に section 存在
- 順位 97 (with_num_ctx serialization test): lib.rs:494 で mockito test 実体存在

改訂 7 件 (Status update 2026-06-06 を front-matter に追加、現状反映):
- 順位 11: ADR-018 park / ADR-030 短命プロセス移行後の再現確認が前段
- 順位 19: ADR-037/043/PR #194 land 後の残余 case baseline 観測が前段
- 順位 27: Phase D-7 = PR #154 land 済を反映
- 順位 38: ADR-031 採用昇格済 (PR #192) → Bundle W/X land のみ残依存
- 順位 40: PR #175 push-runner bookmark_check 実装済 → skill 側は二重防御に縮小
- 順位 51: 採用案 C (fix.md instruction 追加) は land 済、残作業 = dogfood 観測のみ
- 順位 92: ADR-038 採用昇格済 (PR #156) で Phase d 運用入り、動機書き換え

cross-reference 修復:
- 順位 49: 旧依存 Bundle a Sub-PR 2 (順位 42/43/46) 消滅を反映
- 順位 61: 旧依存 順位 45 land 済を反映

## C. todo9.md → todo11.md 分割

todo9.md が 75KB / 890 行に到達し読み取り安定性閾値 (50KB) 超過のため分割:

- todo9.md (37KB / 454 行): 既存ルール仕組み化バンドル (順位 146-151) + 週次
  レビュー拡張 (順位 152-154) を保持
- todo11.md (41KB / 453 行、新規): PR-specific follow-up entries 10 件
  (順位 157, 160, 161, 162, 163, 165, 170, 171, 172, 173)

theme-based split で意味的分離 + 両ファイルとも 50KB 閾値以下に収まる。
todo-summary.md table の file 参照を Python script で一括更新 (10 件)、
todo-summary.md 冒頭の \"追加先ファイル\" 説明を todo10.md に更新。

## D. 順位 177 優先度引上げ

PostToolUse hook ファイルサイズ検出 task が 4 回目の同型観測に到達 (PR #133 +
#172 + #186 + 本セッション = Very High frequency)。CLAUDE.md code-review.md
\"同型 finding の閾値判定\" (3 観測 = Tier 1 昇格) を超え systemic risk 閾値到達。

3 箇所同期更新:
- todo10.md entry 本体に Status update 2026-06-06 blockquote 追加、優先度を
  \"Tier 1\" → \"Tier 1 (優先実装)\" に格上げ
- todo-summary.md table 行で Tier 列を太字 + 注記、dependency 列に urgency note
- todo-summary.md 末尾の戦略 note に \"直近優先 (2026-06-06 ユーザー指示)\"
  段落を新設、Bundle 195-FB-Followup (順位 193 + 194) の次の PR で消化推奨と
  specific call-out

## 統計

- 10 ファイル変更 (1 新規)
- ~670 lines insertions, ~910 lines deletions (net ~240 行削減)
- 全 todo*.md が 50KB 閾値以下に収まる (todo9: 37KB, todo10: 36KB, todo11: 41KB)

## 参照

- .claude/feedback-reports/196.md (採否確定 commit、PR #196 由来)
- memory feedback_post_merge_feedback_adoption_requires_user_approval per
  ユーザー承認済
- memory feedback_todo_no_history (削除は痕跡なし、コメントマーカー不使用)
- ADR-035 (docs-only PR 評価ポリシー)
- ADR-033 (採番管理簡素化、順位 renumber は避けて semantic markers で表現)
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