feat(weekly-review): file_length scan を pre-LLM step として追加 (PR-W0) + 順位 222 採用 - #219
Merged
Conversation
PR #218 (docs PR、ファイルサイズチェックフロー改善計画 + 順位 220/221 採用) の post-merge-feedback で承認された #5 を採用: 順位 222 (💎 Tier 3、Effort XS): `~/.claude/CLAUDE.md` に「複数セッション跨ぎの計画文書作成時は AI が 先走らずユーザー確認後に方針報告し GO/NO-GO を得る」ルール追加 由来: PR #218 session 内で Plan file 作成完了報告後、AI がユーザー承認 なしに PR-W0 着手しようとして `[Request interrupted by user]` で停止 された実観測 (Severity Medium、Frequency Low 初観測、Effort XS、 Adoption Risk None)。memory `feedback_no_unauthorized_reorder` の補強 として「planning doc 作成のような大きな task 完了時は GO/NO-GO 確認待ち」 を明文化、派生プロジェクトへ `~/.claude/CLAUDE.md` 経由で自動波及。 採用しなかった項目: - #1 (weekly audit を feedback entry にも明示): 計画書 PR-W0 で既に管理 - #3 (lib-subprocess stress test): 順位 220 と完全重複 - #4 (Agent template PMF entry): 計画書 Appendix A で既に capture、却下 - #2/#6/#7: 様子見継続
ADR-031 weekly-review pipeline に deterministic Rust pre-step として 800 行超 file の scan を追加。LLM facet 不要、純機械測定。 順位 147 (file_length lint) は touch-trigger ratchet で「触られた file の 編集時のみ警告」設計のため、未触り state の violation を可視化できない。 本 step は毎週 1 回 master HEAD に対して 800 行超 file を全件列挙し、 aggregate-weekly facet の input に注入して watchlist として report 化する。 PR-3a (PR #217) で 7 件の 800 行超 file が判明した経緯から、Phase 1 (file split work、PR-W1 〜 W4) の進捗 dashboard としても機能する。 全 file ≤ 800 行に到達後も恒久的に監視継続。 由来: docs/file-length-enforcement-plan.md PR-W0 (PR #218 で land)、 severity = warning (block しない、健康診断目的)。
|
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 (6)
📝 WalkthroughWalkthrough週次レビューワークフローに Changesfile-length-watchlist facet追加
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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. 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 |
Merged
7 tasks
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
docs/file-length-enforcement-plan.md(PR #218 で land 済) で計画した PR-W0 (Weekly audit / E) を実装する。ADR-031 weekly-review pipeline に deterministic な file_length scan を pre-LLM step として追加 し、800 行超 file の現状を毎週 1 回機械的に可視化する。順位 147 (file_length lint、PR #202) は
hooks-post-tool-comment-lint-rustの PostToolUse hook として実装されており、触られた file の編集時のみadditionalContextで 800 行超を警告する設計 (soft-nag、touch-trigger ratchet)。このため未触り state の violation は警告されず、PR-3a (#217) 時点で 7 件の累積を許す結果となった。本 PR はその構造的盲点を「週次 audit」で補う最初の機構。順位 147 の touch-trigger と本 step の whole-tree scan が補完関係で 2 層防御を形成する。
変更内容
新 facet
file-length-watchlist.takt/workflows/weekly-review.yamlのreviewersparallel step に追加 (4 番目の parallel facet)。simplicity-reviewer(file length は SRP / simplicity 観点と整合)haiku(cheap、command 実行 + 整形のみ)review(read-only、既存 reviewer と一貫)Bash+Read(find/wc/awk 実行用)file-length-watchlist(新規)file-length-watchlist.md(Report Directory)analysis complete(step-levelall("analysis complete")rule と整合)新 instruction
.takt/facets/instructions/file-length-watchlist.md決定論的 shell command を実行し、出力を markdown table に整形する deterministic instruction:
出力 markdown は以下の構造:
docs/file-length-enforcement-plan.mdPhase 1 (PR-W1〜W4) との関係を明示LLM 判断の余地なし。命令通りに Bash を実行し、出力を整形するだけ。
aggregate-weeklyinstruction の更新.takt/facets/instructions/aggregate-weekly.mdを 3 reports → 4 reports に拡張:file-length-watchlist.mdを追加計画書 status 更新
docs/file-length-enforcement-plan.mdの進捗追跡 table でPR-W0を[in progress]にマーク。merge 後に[x]+ PR 番号に更新する想定 (本 file 削除条件 1 / 3)。設計上のポイント
/weekly-reviewでの AskUserQuestion 採否 flow は LLM findings のみが対象、watchlist は単なる health check)findcommand / aggregate-weekly 注入)Test plan
markdownlint: 0 errors (PostToolUse hook で各 Edit 確認)cli-docs-lint --check cross-ref: OK (planning doc 内 link は../src/形式)/weekly-review実行で実観測 (本 PR merge 後、weekly schedule に合わせて発火)dogfood は本 PR land 後の次の weekly run (= 2026-06-30 周辺、ADR-031 § Phase E トリガー方式 per "前回実行から 7 日経過で promote" reminder) で行う。
PR 計画における位置
PR-W1 〜 W4 が land するごとに、本 watchlist の件数が 7 → 6 → 5 → 4 → ... → 0 と減少する想定。0 件到達後は恒久 audit として継続。
関連 PR / commit
docs: PR-3a follow-up + ファイルサイズチェックフロー改善計画、merged at 2026-06-23T19:31:19Z): 本作業の起点となる planning doc を landrefactor(hooks): 3 hook の main.rs を module 分割, merged): file_length lint 違反が 7 file 累積している事実を顕在化docs(todo): 順位 222 採用): PR docs: PR-3a follow-up (順位 220/221) + ファイルサイズチェックフロー改善計画 (W0-W5 plan) #218 post-merge-feedback refactor(deploy): 出力先へのテンプレート配布を廃止 #5 採用 entry (独立 commit で含まれる)bonus content
本 PR には 2 つの commit が含まれる:
docs(todo): 順位 222 採用 (PR #218 post-merge-feedback #5)—~/.claude/CLAUDE.mdに「AI 先走り防止」rule 追加の todo entryfeat(weekly-review): file_length scan を pre-LLM step として追加 (PR-W0)— 本 PR の主目的Summary by CodeRabbit
New Features
Documentation
Chores