feat: Bundle 既存ルール仕組み化 — file_length lint + pr_size_check stage (順位 147 + 151) - #202
Merged
Merged
Conversation
|
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 (8)
📝 WalkthroughWalkthroughPR ChangesPR Size Check Pipeline
File Length Violation Detection
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 |
6 tasks
aloekun
added a commit
that referenced
this pull request
Jun 22, 2026
…er enable (#216) 5 entries の stale cleanup と weekly review reminder の試験運用元 enable。 ## Stale entry cleanup (5 件) PR #202 / #215 で land 済だが docs/todo*.md に entry が残存していた タスクを削除: - 順位 147 (File length lint, todo9.md) — PR #202 - 順位 151 (PR diff lines check, todo9.md) — PR #202 - 順位 212 (PowerShell dispatch, todo10.md) — PR #215 - 順位 213 (parse_coderabbit_status test, todo10.md) — PR #215 - 順位 214 (parse_actionable_comments test, todo10.md) — PR #215 順位 215 (coding-style.md "Defensive State Reset" section 追加) は PR #215 で todo entry を追加しただけで実装は未着手のため保持。 grep "Defensive State Reset" ~/.claude/rules/common/coding-style.md で実体確認済。 ## weekly_review_reminder の試験運用元 enable .claude/hooks-config.toml [session_start.weekly_review_reminder] を enabled = false → true に変更。 ADR-031 (週次レビュー pipeline) は 2026-06-01 に本採用化済みだが、 Phase E 観測で「reminder は実発火していない」状態が継続し最後の実行から 21 日経過 (2026-06-01 → 2026-06-23) していたため、試験運用元では明示的に enable する運用に切替。派生プロジェクト deploy 時の default は ADR-039 § 1 opt-in 契約に従い OFF 維持。 本変更は PR-3 (layered config: [features].enabled allow-list 移行) で 真の opt-in 切り替えになるまでの暫定。toml に rationale comment block を 明記済み。 ## PR 計画における位置 PR-1 (本 PR) → PR-3 (layered config) → PR-2 (Stop hook todo cleanup check) の 3 PR plan の 1 件目。PR-3 で本 PR の `enabled = true` は `[features].enabled` allow-list 登録に置き換わる。
7 tasks
aloekun
added a commit
that referenced
this pull request
Jun 23, 2026
… 違反解消) (#217) * docs(todo): 順位 216-219 採用 (PR #216 post-merge-feedback T1-1/T3-1/T3-2/T3-3) PR #216 (cleanup-stale-todo-weekly-enable) の post-merge-feedback で 6 提案中 4 件 (T1-1 / T3-1 / T3-2 / T3-3) をユーザー承認 (2026-06-23) し docs/todo-summary.md + docs/todo10.md に entry 化: - 順位 216 (🔧 Tier 2、Bundle 216-217): `no-workstream-seq-names-in-config` lint rule 追加 — config comment 内 `PR-[0-9]+` ephemeral workstream sequence の機械的検出。analyzer Tier 1 分類は memory feedback_tier_classification に従い project Tier 2 (mechanical = T2) に再分類。 - 順位 217 (💎 Tier 3、Bundle 216-217): coding-style.md § Cross-File Reference Lifecycle に config file comments の permanent artifact 扱い明記 + workstream sequence 禁止例追加 (順位 216 の文書層補完、2 層防御)。 - 順位 218 (💎 Tier 3): ADR-039 § Bounded Lifetime + patterns.md に provisional `enabled` 変更時の todo entry 必須化を追加 (config comment-only tracking の silent aging 防止)。 - 順位 219 (💎 Tier 3): development-workflow.md § 設計 doc/実装の同期チェック に「commit description 言及 ≠ 実装完了」明文化 (PR #216 cleanup での 順位 215 救出事例を inline cite、analyzer naïve assumption の構造的予防)。 採用されなかった T2-1 / T2-2 (analyzer cross-check / provisional auto-detect) は 🤔 様子見継続。Frequency Low 初観測 + Effort M + takt test infra 未調査のため、 2 PR 以上の再観測後に Tier 1 昇格を再評価する方針。 ファイル変更: - docs/todo-summary.md: table に 4 rows 追加 (順位 215 直後、lines 89-92) - docs/todo10.md: 詳細 entry 4 件追加 ("## 既知課題" 直前、lines 512/568/620/674) * refactor(hooks): hooks-session-start / hooks-pre-tool-validate / hooks-post-tool-linter を module 分割 3 hook crate の main.rs を coding-style.md § File Organization (800 行 max) 内に収まる module 構成に分割。behavior 不変な mechanical refactor で、各関数の signature / export 関係は維持し、test も co-located mod tests として各 module に分散する。 PR-3 (layered config refactor) の前置 PR (PR-3a)。順位 147 (file_length lint) が PR #202 で land、本 PR-3a で 3 hook の touch-trigger ratchet 違反を解消することで PR-3b (layered config) を clean state で進められる。 対象: - src/hooks-session-start/src/main.rs (1611 行) → 6-7 module - src/hooks-pre-tool-validate/src/main.rs (2914 行) → 5-7 module - src/hooks-post-tool-linter/src/main.rs (3316 行) → 6-8 module 完了基準: - 全 module ファイルが 800 行以下 - cargo clippy --workspace -- -D warnings clean - cargo test --workspace pass (behavior 不変) - PostToolUse comment-lint-rust の file_length lint 0 件 * fix(hooks): takt-fix iter 3 — CR Critical/Major findings 解消 (PR-3a follow-up) PR #217 (pr3a-hooks-module-split) の CodeRabbit review で検出された Critical / Major / Minor findings を takt post-pr-review の 3 iter fix で 解消した変更を land。 ## 修正内容 (CR severity 別) ### Critical (1 件 / 採用) - docs/todo10.md: 順位 216 (no-workstream-seq-names-in-config rule) の test_coverage 宣言で拡張子カバレッジ欠落と test 命名不一致を修正 (other_ext_tests に jsonc test を追加、main_ext_tests の test 名を TOML schema 規約と整合) ### Major (3 件 / 採用) - src/hooks-pre-tool-validate/src/todo_staleness.rs: run_jj_with_timeout で child stdout をブロッキング待機していたパイプバッファ枯渇デッド ロックを修正。spawn_stdout_drainer + poll_child_with_deadline 関数を 抽出してバックグラウンド drain に変更 (ADR-016 subprocess safety pattern) - src/hooks-session-start/src/jj_helpers.rs: 同型の deadlock 修正 (spawn_stdout_drainer + poll_child_with_deadline 抽出)。両 module で identical pattern を共有 - src/hooks-session-start/src/reaper.rs: .failed marker の atomic file creation を File::create_new() で保証 (TOCTOU window 解消) ### Minor (2 件 / 採用) - docs/todo10.md: line 532 markdown 引用符の閉じ括弧不一致を修正 - src/check-ci-coderabbit/src/rate_limit.rs + src/hooks-session-start/ src/reaper.rs: parse_iso8601_to_unix で Z suffix を strip_suffix で validate (trim_end_matches では invalid timestamp も accept していた) ### Minor (1 件 / 却下) - src/hooks-pre-tool-validate/src/config.rs: TODO_STALENESS_DEFAULT_BRANCH を "master" → "main" 提案。本リポジトリは master を default branch として運用しているため却下。他 module の "main" 参照は aspirational / transitional な記述で、本 module の "master" が正しい。 ## 検証 - cargo test --workspace: 437 tests pass (本 PR 関連: 71 + 221 + 145、 rate_limit.rs 周辺は別 crate test で cover) - cargo clippy --workspace -- -D warnings: clean - takt post-pr-review: 3 iterations / 39m 32s / approved (structured_output) * fix(todo): 順位 216 entry の extensions から plain `json` 削除 (CR Critical L530 採用) CR Critical L530 で「Task 216 の test_coverage 宣言に拡張子カバレッジ欠落」 として指摘された不整合を解消: - extensions = ["toml", "yaml", "yml", "jsonc", "json"] のうち plain `json` は comment 構文を持たず本 rule (`no-workstream-seq-names-in-config`) の対象外 = test 未定義状態だった - jsonc が JSON-with-comments を cover するため json は rule scope から除外 - extensions = ["toml", "yaml", "yml", "jsonc"] に縮小 なお同 thread 内で指摘された「`no_workstream_seq_skips_github_pr_number` が main_ext_tests.toml に配置されている」点は coverage.rs の実装 (positive/negative semantic を強制しない、宣言 test 名の存在のみ check) と rule⑫ 既存 pattern との整合により現状維持。CR Major (path → workspace dep) と CR Minor (master → main) は rejection 理由を thread reply で記録済。
This was referenced Jun 24, 2026
aloekun
added a commit
that referenced
this pull request
Jun 24, 2026
…PR-W1、self-host irony 解消) (#220) * docs(plan): PR-W0 を [x] #219 (merged at 2026-06-24T16:07:42Z) に更新 PR #219 (PR-W0、weekly-review に file_length scan facet 追加) が 2026-06-24T16:07:42Z に master へ land したことを受けて、 docs/file-length-enforcement-plan.md の進捗追跡 table の PR-W0 status を `[in progress]` → `[x] #219` に更新する。 * refactor(hooks-post-tool-comment-lint-rust): main.rs を module 分割 (PR-W1) docs/file-length-enforcement-plan.md PR-W1 を実装。 lint hook 本体 (1606 行) を coding-style.md § File Organization (800 行 max) 内に収まる module 構成に分割。behavior 不変な mechanical refactor で 関数 signature・公開 API・field 名・default 値はすべて保持。 順位 147 (file_length lint、PR #202 land) を自分自身に適用した self-host の整合性を確立。本 PR が land すれば 7 files 中 1 件 (1606 行) を 800 行 以下に解消、weekly-review file_length watchlist の件数が 7 → 6 に減少。 分割計画は計画書 PR-W1 section + Appendix A Agent prompt template 参照。 PR-3a (#217) の hooks-session-start 分割と同型 procedure を Agent 委譲で 実装、behavior 不変性は test count 不変 + cargo clippy clean で verify。
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
Bundle "既存ルール仕組み化" —
~/.claude/rules/common/に書かれているが mechanical enforcement されていなかった 2 つの size limit を hook + push 両層の機械強制に昇格する。順位 147: file_length lint 追加 (
hooks-post-tool-comment-lint-rust)coding-style.md§ File Organization の 800 行 max ガイドラインを決定論的に維持additionalContext)soft nagのため override env は持たない (block しない nag に override は無意味)順位 151: pr_size_check stage 追加 (
cli-push-runner)git-workflow.md§ Multi-PR chaining の 「1 PR あたり 250-800 lines」 目安を決定論的に維持jj diff --stat -r '<default_branch>..@'で insertions + deletions を計測warning_threshold = 800(警告のみ) /block_threshold = 1500(push 停止)PR_SIZE_CHECK_OVERRIDE=1(大型 refactoring 時のバイパス)scratch_file_warningtemplate ベース)default_branch引数化で rule⑫no-hardcoded-jj-revset-range適用、alternative branch ("main" 等) 対応Self-dogfood の結果
jj diff --stat -r 'master..@'= 921 行 → warning_threshold (800) 超過、block_threshold (1500) 未満で warning のみhooks-post-tool-comment-lint-rust/src/main.rsでRUST_FILE_TOO_LONG正常発火を確認Semantic 注記 (147)
todo 文言「順位 48 と同 touch-trigger ratchet」を whole-file flag で実装。ファイル全体は常に「触られている」ので関数長の
body overlap検査がそのまま translate せず、aggressive (任意 Edit で flag) を採用。soft nag なので開発フローを妨げない (block しない)。Test plan
cargo test --workspace全 PASS (cli-push-runner 169 / comment-lint-rust 100 / その他)cargo clippy --workspace -- -D warnings0 warningspnpm build:all成功関連 ADR
no-hardcoded-jj-revset-range): 151 で適用、format!("{}..@", default_branch)で組立Summary by CodeRabbit
リリースノート
New Features
PR_SIZE_CHECK_OVERRIDE環境変数でバイパス可能。Documentation