feat(cli-pr-monitor): 順位 141 land — fix_push_time 固定 + RATE_LIMIT_BUT_MERGEABLE signal (順位 140 entry 追加)#170
Merged
Conversation
…er policy を ADR 昇格) PR #169 post-merge-feedback の Tier 3 #2 採用結果として、順位 135 「ADR 番号 hardcode 撤廃 placeholder policy」を正式 ADR に昇格する task を 順位 140 として登録。PR #111/#132/#169 の 3 PR で適用実証済 (特に PR #169 で 順位 78 が ADR-038 → 041 → NNN の 3 段振り直し dogfood を完了) で、現在は ephemeral todo entry 内の codify 限り = 派生プロジェクトへの transferability 不足を解消する目的。ADR 番号は順位 135 policy 自身に従い ADR-NNN placeholder で登録 (= self-dogfood)、land 時 PR で確定する。
…案: fix_push_time 固定 + 早期 merge 判断 signal) PR #169 セッションで systemic 観測された CR rate-limit detection bug を順位 141 として登録。当初案 (defense-in-depth + 4 test) はユーザーから「処理時間が増える可能性」 の指摘を受け、shortcut 追加案 = 主軸 C (fix_push_time 固定) + 早期 merge 判断 signal (mergeable CLEAN なら 5-10 分で人間判断) の 2 機能に絞った最小実装に書き換え。 feedback_pipeline_over_rules.md 適用 = ルール codify ではなくパイプライン側の機械的 修正で Claude 判断介入を排除する原則の最初の実装事例。既存 auto-retry path は維持し、 ユーザーが「待つ」を選んだ場合は通常 flow に合流する設計で、wall clock (rate-limit reset 38 分 + retry 最大 2.5 時間) と手間軽減のバランスを取る。
…ERGEABLE signal (CR rate-limit detection bug 修正)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughcli-pr-monitor の rate-limit 検出ロジックに Changesrate-limit 検出の正確性向上と早期 merge 判定
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
5 tasks
aloekun
added a commit
that referenced
this pull request
May 24, 2026
…171) * docs(todo): 順位 142 新規追加 — PR #170 T3-#1 採用 (ADR-041 補強: State Preservation Invariant pattern) PR #170 post-merge-feedback の Tier 3 #1 採用結果として、ADR-041 (Test Isolation Patterns for Multi-Condition Guards) に新 section "State Preservation Invariant" (once-set-never-overwritten) を 追記する task を 順位 142 として登録。 PR #168/169/170 で write-once 不変式 (state.fix_push_time.or_else(...) 形式) のテストカバレッジ漏れが連続観測されたことが trigger。ADR-041 既存 section は Multi-Condition Guards (early-return) のみで、write-once 不変式は 別 pattern class として未収録だったため補強する。順位 141 で takt-fix が 自動追加した 3 件の preservation test (poll.rs / monitor.rs) を参照実装と して cite し、3 点セット test pattern (既存値あり / 新値提供 / preservation 確認) を明文化する。 * test(hooks-linter): UTF-8 multi-byte content での line 算出 defensive test 追加 (順位 125 採用) PR #151 (T2-#1) で hooks-post-tool-comment-lint-rust の byte_offset_to_line を multi-byte boundary test 拡充で production bug を発見した経験を横展開。hooks-post-tool-linter の build_violation_json (L500) は content[..m.start()] による str slicing を行うが、 regex::Match::start() が char boundary を保証するため panic 安全。 本 test は line 算出 (.bytes().filter(|b| *b == b'\n').count() + 1) が multi-byte content (日本語/emoji/結合文字) でも正しく動作することを empirical に seal する。将来 char_indices() ベースへの書き換え等で line off-by-one regression が入った場合に検知する。 string-processing 系の hooks のうち他 (pre-tool-validate / session-start / stop-quality / user-prompt-feedback-recovery / stop-feedback-dispatch) は as_bytes() を write 用途で 使用するのみで offset 操作を持たないため横展開 scope 外。 * test(hooks-comment-lint-rust): collect_all_violations の MAX_VIOLATIONS truncate contract test 追加 (順位 57 採用) collect_all_violations (L551) は find_violations と find_function_length_violations の両 source を extend した後に truncate(MAX_VIOLATIONS) で合計を cap する設計。既存 cap test (max_violations_capped / function_length_violations_capped) は各 source 単体の cap のみ検証し、合算 truncate の contract が機械強制されていなかった gap を補填。 将来の lint 追加時に L562 の truncate(MAX_VIOLATIONS) を削除した regression (= 合計が MAX を超える) を catch する explicit 安全網。 fixture: 長 function (55 行 > MAX_FUNCTION_LINES=50) 1 件 + 非 doc コメント 25 行 → find_function_length_violations 1 件 + find_violations が cap で 20 件 → 合計 21 件 → truncate 後 20 件に cap される contract を assert。 * docs(todo): 順位 91 [lint_screen] config parse test を既実装発見で削除 (memory feedback_verify_task_not_already_done.md 適用) PR #132 (Phase c MVP land = 2026-05-09) 直後の post-merge-feedback で entry 化された 順位 91 だが、本セッション着手前の jj log + 既存 test 確認で src/cli-push-runner/src/config.rs の test module L325-481 に既に 5 件の lint_screen parse test が存在することを発見: - config_parses_with_lint_screen_section_full_fields (L326): 全 7 field deserialize - config_parses_with_lint_screen_section_minimal_only_enabled (L370): enabled=false でも Some 構築 - config_lint_screen_section_absent_yields_none (L402): section 不在 → None - config_lint_screen_numeric_defaults_resolve_via_constants (L441): default 値 fallback - config_lint_screen_string_defaults_resolve_via_constants (L456): default 値 fallback entry の作業計画 4 項目はすべてカバー済 (silent field rename 防止 / 全 field deserialize / section 不在時 None / default 値検証)。post-merge-feedback で採用された後、別 PR で 先行 land 済だった可能性が高い。 memory rule feedback_verify_task_not_already_done.md (todo 着手前に既実装検証 → stale entry を削除に再目的化) の正典的 dogfood 例として価値あり。Bundle i のペアタスク 順位 92 (scale-aware eval fixtures) は別タスクとして残し、bundle 表記は historical note 化。 - docs/todo6.md: 順位 91 entry (L13-39) 削除 - docs/todo-summary.md: 順位 91 行削除 + 順位 92 行を独立タスクとして修正
4 tasks
aloekun
added a commit
that referenced
this pull request
May 25, 2026
* docs(adr): ADR-042 ルール vs 仕組み化の境界基準 — 試験運用 ADR 新設 + CLAUDE.md ADR list 追加 * docs(todo): 仕組み化方針切替 — todo9.md 新設 + 順位 142/143/144/145 + 146-151 追加 + 順位 44/61 hook 化転換 + 122→136 統合 (Bundle 既存ルール仕組み化) PR #172 (順位 144 = jj-message-required hook) の dogfood 成功を受けた仕組み化方針切替に関する一連の todo system 更新: - 順位 142 entry 追加 (PR #170 T3-#1 採用 ADR-041 補強 State Preservation Invariant pattern) - 順位 143/144 entry 追加 (PR #171 post-merge-feedback Bundle 171 = 複言語 fixture helper + jj-message-required hook) - 順位 145 entry 追加 (PR #172 T2-#1 採用 preset matrix test) - 順位 146-151 entry 新規追加 (既存ルール仕組み化バンドル: secret detection / file length lint / test coverage CI gate / subprocess pipe truncate hook 拡張 / magic number lint / PR diff lines check) - 順位 44 (gh CLI 使用規則) を docs 追記から PreToolUse hook 化方針に転換 - 順位 61 (CR review.body 手動 scan) を docs 追記から check-ci-coderabbit CLI 拡張方針に転換 - 順位 122 (新 todo 着手前の既実装確認) を 順位 136 (working copy staleness hook) に統合 - todo9.md 新設 (todo8.md 50KB 接近のため、新規追加先を todo9.md に移行) - todo-summary.md 更新方針 + table 更新 + Bundle 171 タグ整備 memory rule `feedback_pipeline_over_rules.md` 適用 = rule docs → mechanism shift の体系的記録。 * chore(todo): land 済 entry 削除 + bundle-history 分離 (size 50KB 超過解消)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
state.jsonにfix_push_timefield を追加し、wakeup ごとに更新されない固定値を保持。CR walkthrough overlay のupdated_atがevent_time >= push_timefilter で「過去扱い」で除外される構造バグを解消。gh pr view --json mergeable,mergeStateStatusを取得、MERGEABLE+CLEAN+ 未解決 thread 0 件なら[RATE_LIMIT_BUT_MERGEABLE]signal を stdout 出力。Claude は AskUserQuestion 経由でユーザー判断 (5-10 分で merge / wait を選択) → wall clock を 38 分以上の reset 待ちから短縮。Background
PR #169 セッションで
cli-pr-monitorの CR rate-limit 検出機構が、再 push 後の wakeup recheck 経路で構造的に動作不能な状態が systemic 観測された。check-ci-coderabbitのparse_rate_limitはevent_time >= push_timefilter で「過去 session の古い rate-limit comment」を除外する safety guard を持つが、push_timeがstate.started_at(wakeup ごとに現在時刻に更新される値) を再利用するため、CR の walkthrough overlay のupdated_atが push_time より過去になると検出対象から外れる。今回 CR が overlay (06:08:02Z) を投稿したが、wakeup 4 回目の started_at =06:27:14Zで filter 除外 →rate_limit: null→ auto-retry path に乗らず手動介入で merge へ進んだ。memory
feedback_pipeline_over_rules(本セッションで codify) を適用 = 「動作の不確実さはパイプラインで吸収、ルール codify では対処しない」原則の最初の実装事例。当初案 (defense-in-depth + 4 test) はユーザーから「処理時間が増える可能性」の指摘を受け、shortcut 追加案 = 主軸 C + 早期 merge 判断 signal の 2 機能に絞った最小実装に縮小。Design
主軸 C: fix_push_time 固定
PrMonitorStateにfix_push_time: Option<String>(legacy 互換)fix_push_time = utc_now_iso8601()設定、wakeup 経路で state から再利用check-ci-coderabbitへの--push-time引数にfix_push_timeを優先 (fallback topush_timeで legacy 互換)早期 merge 判断 signal (本 PR の核)
finalize_parked末尾でemit_shortcut_signal_if_eligible(state, rl, pr_info)呼びevaluate_rate_limit_shortcutpure 関数で 3 条件 (mergeable + clean + threads 0) 評価[RATE_LIMIT_BUT_MERGEABLE]signal 出力 (PARK signal は引き続き出力、両方を Claude が読む)CR 仕様変更時の挙動 (graceful degradation)
Files changed
src/cli-pr-monitor/src/state.rsPrMonitorState::fix_push_timefield 追加 + new() / legacy test / roundtrip test 更新src/cli-pr-monitor/src/util.rsPrInfo::fix_push_timefield 追加 +get_pr_info初期化src/cli-pr-monitor/src/stages/create_pr.rsbuild_pr_info_from_gh_outputで fresh push 時に fix_push_time 設定src/cli-pr-monitor/src/stages/monitor.rsrun_monitor_onlyの fresh/resume 経路で fix_push_time 設定 +resume_fix_push_time_or_started_athelper +init_or_resume_stateで state 維持 + 新規 testsrc/cli-pr-monitor/src/stages/poll.rsPollContext::fix_push_time追加 +build_state_for_iteration/finalize_*_parkで fix_push_time 維持 +run_one_iterationで effective_push_time 算出 + 早期 merge 判断 signal 一式 (4 関数 + 5 test)docs/todo-summary.mddocs/todo8.mdTest plan
cargo test -p cli-pr-monitor: 188 passed / 0 failed (新規 8 件 + 既存 180 件、takt-fix で自動補強 3 件含む)cargo test -p check-ci-coderabbit: 79 passed / 0 failed (regression なし、本 PR は check-ci-coderabbit 側 logic は不変、呼び出し側で push_time に fix_push_time を優先するだけ)pnpm build:all: 全 5 exe ビルド +.claude/deploy 成功resume_returns_fix_push_time_from_state_when_set(monitor.rs): helper の Case A 検証finalize_initial_review_park_preserves_existing_fix_push_time(poll.rs): non-None preservationfinalize_review_recheck_park_preserves_existing_fix_push_time(poll.rs): sibling parityNotes
feedback_pipeline_over_rules.mdを codify、本 PR がその最初の実装事例。signal出力後の Claude 側 AskUserQuestion 処理は本 PR scope 外 (signal を読んで判断する Claude 側の流れは memory + AskUserQuestion tool で対応)。Summary by CodeRabbit
Documentation
Bug Fixes