fix(hooks): file_size_check を default ON 化 + ADR-039 mechanical lint exception codify (PR #203 follow-up) - #204
Merged
Merged
Conversation
PR #203 post-merge-feedback Tier 3 #1 (ADR-NNN: Timestamp invariant safety) を採用。 analyzer は新規 entry 提案だが、順位 198 が既に同 ADR 提案として登録済 (PR #199 T3-2) のため、新規追加ではなく既存 entry の data point 強化として merge した。 主な変更: - 動機: 2 件観測 (Medium) → 3 件観測 (High) に Frequency 昇格 - 本タスクの位置づけ: PR #203 T3-1 採用情報 + 既存 entry 強化の判断根拠を追記 - 参照: .claude/feedback-reports/203.md Tier 3 #1 + PR #203 を追加 - 設計決定 § 1 コンテキスト: PR #203 hooks-session-start port を観測実例に追加 - 派生プロジェクト適用: "順位 197 で実装予定" → "PR #203 で実装済" に更新 - 作業計画: PR #96 / #199 / #203 の 3 観測すべてを ADR 実装時に inline cite 順位 194 (task 着手前 grep 確認 rule、PR #196 採用) の初実践例となる。 analyzer の重複提案を運用層で吸収する明示的 pattern。
…判定追加 PR #203 post-merge-feedback で「順位 177 file_size_check が ADR-039 機械適用で default OFF にされ、user 期待と乖離した」事象を発見。順位 147 file_length lint (default ON 固定) と順位 177 file_size_check (default OFF) の asymmetry が 標準パターンの over-application を示した。 主な変更: § 1 (Config opt-in) の改訂 - 「適用対象を明示」する section に再構成 - 「behavior の妥当性が不確定な experimental feature」と適用範囲を限定 - 「採否判定 (採用 / 却下 / 継続) のフェーズが必要なもの」を判定基準として追加 § 1.b 新設 (mechanical lint default ON 許容) - 4 条件 (non-blocking / 決定論 / scope 限定 / recovery hint 明確) すべて満たす機能を § 1 対象外として default ON 配布を許容 - 該当する実装例: 順位 147 file_length lint / 順位 177 file_size_check - 該当しない例: post-merge-feedback (ADR-014/030) / weekly-review (ADR-031) / local-llm-finding-classification (ADR-038) - PR #197 順位 177 の誤適用を本 PR (PR #203 由来) で訂正と明記 § 新規 feature 追加時 checklist (4 点 → 5 点に拡張) - § 0 「上位判定」を最初に追加: 「そもそも § 1 適用対象か?」 - § 1.b 4 条件すべて満たす → default ON で配布、4 点 checklist は skip - 1 つでも欠ける → 従来通り 4 点 mechanical checklist 実施 - 判断に迷う場合は conservative default (default OFF) を選択 - 本判定を skip して機械適用すると order-application 発生 (PR #197 で実観測) 由来: PR #203 post-merge-feedback で発見された systemic 問題への対応。 派生プロジェクトへの自動波及はなし (本 ADR は本リポジトリ専用、`~/.claude/rules/` 配下ではないため)。
順位 177 file_size_check は ADR-007 で扱う「正規表現層 / AST 層」の判断フロー対象外で あり、metadata-only check (`std::fs::metadata.len()`) という性質上、独立した Layer 区分を設ける積極的理由がない。「Layer 0.5」概念を ADR に codify することで: - 後続の metadata-only check 追加時に Layer 0.5 への配置判断を毎回迫る - ADR-007 本体の Q1/Q2/Q3 判断フロー (regex / AST) との整合性が複雑化 - ADR-039 opt-in pattern 言及が「導入リスク」未定義のまま記載されている という systemic な over-abstraction の温床になっていた。本 PR で「順位 177 は単純な custom linter の一つとして扱う」方針 (ユーザー判断、2026-06-12) に従い、Layer 0.5 追記を削除する。今後 file_size_check 系の linter を追加する場合は ADR-007 の通常 判断フローに従い、必要なら都度 ADR 改訂で対応する。
ADR-039 § 1.b (mechanical lint 例外、本 PR で同時 codify) に従い、順位 177 file_size_check を default ON で配布する。順位 147 file_length lint と同 pattern。 主な変更: enabled = false → enabled = true - 4 条件 (non-blocking / 決定論的閾値 / scope 限定 / recovery hint 明確) すべて満たすため - additionalContext warning のみで block しない (failure mode が無害) - paths glob で scope 宣言的に限定 - todo*.md / Rust source に明示的 recovery hint コメント修正: - "ADR-039 § 3 opt-in pattern" → "ADR-039 § 1.b mechanical lint 例外" (§ 3 は bounded lifetime、opt-in は § 1。元コメントは誤参照) - "Layer 0.5" → "custom linter" (ADR-007 Layer 0.5 追記削除に追従) - 4 条件 (1.b 適用根拠) を明示 - 順位 147 file_length lint を同類例として cite - bounded lifetime dogfood の記述を削除 (mechanical lint は dogfood phase 不要) 影響: - 既存 grandfather (>50KB 既存ファイル) は touch されるまで warning なし - 触られた >50KB ファイル (例: docs/todo10.md) は次の Edit/Write で warning が出る - 本 PR で todo10.md の split (Commit 5) を同時実施し、初回 dogfood も完了させる
本 PR で順位 177 file_size_check を default ON 化したことにより、touched で 50KB 超のファイル (= 本 PR 着手時の docs/todo10.md = 57KB) に warning が出る状態になった。 本 commit で todo10.md から PR #185 〜 PR #196 era の 8 エントリを新規 docs/todo12.md に分離し、todo10.md を 27KB まで縮小して threshold 内に収める。同時に hook の dogfood としても機能 (順位 177 が想定する recovery flow = 新 todo<N+1>.md 新設 + entry 移管 が実際に機能することを実観測)。 主な変更: docs/todo12.md (新規 158 行) - 順位 176 (PR #185 T2-#4): check-ci-coderabbit format variant fixture 追加 - 順位 178 (週次レビュー S02): state.rs behavioral invariant test - 順位 179 (週次レビュー S03): rate-limit retry decision boundary test - 順位 180 (週次レビュー C01): lib-report-formatter markdown pipe escape - 順位 181 (Phase D D-A): aggregate-weekly findings.json raw JSON - 順位 182 (Phase D D-B): /weekly-review skill 重複検出 (簡易 grep) - 順位 193 (PR #196 T2-1): Companion helper group 署名整合 compile-time test - 順位 194 (PR #196 T3-5): development-workflow.md grep step 追記 - 専用ファイル (新規追加先ではない)、todo11.md と同 role docs/todo10.md (-377 行、57KB → 27KB) - 上記 8 エントリを削除 - preamble に todo12.md 分離の経緯を記述 - 新セッション確認対象を「12 file」→「13 file」に更新 docs/todo-summary.md - preamble に todo12.md の説明を追記 - 8 行の「ファイル」列を todo10.md → todo12.md に変更 (sed 一括置換) 由来: 本 PR (PR #204) の hooks-config.toml 変更 (commit 4) で file_size_check default ON 化に伴う初回 dogfood。順位 177 設計の recovery flow が機能した実証 データとなる。 技術メモ: sed -i '13,390d' で 8 entries 削除、Edit tool で 380 行の old_string 構築は実用的でないため Bash 経路を選択 (ユーザーの「適切な粒度」要件と整合、 独立 commit に集約)。
|
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 (14)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughファイルサイズ機械チェックを opt-in(disabled)から default ON(enabled)に変更し、その判断根拠を ADR-007・ADR-039 で codify する。並行して、ファイルサイズ制限回避のため todo10.md を todo12.md に分割し、全 todo ファイルの参照を一括更新する。 ChangesFile Size Check の有効化と ADR 整備
Todo ドキュメント再構成と参照更新
🎯 2 (Simple) | ⏱️ ~12 minutesPossibly 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 |
aloekun
added a commit
that referenced
this pull request
Jun 13, 2026
) * docs(todo): 順位 206/207 entries を追加 (PR #204 post-merge-feedback Tier 3 採用) * refactor(lib): combine_output を lib-subprocess に extract (順位 173a)
7 tasks
3 tasks
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
PR #203 post-merge-feedback で発見した ADR-039 over-application を是正する PR。順位 177
file_size_checkが ADR-039 § 1 機械適用でenabled = false(opt-in) になっていたが、決定論的 mechanical lint としては default ON で配布すべきだった (順位 147 file_length lint との asymmetry が判明)。ADR-039 に § 1.b mechanical lint 例外 を codify し、対象 lint を default ON に切替、本 PR の dogfood として todo10.md split も同時実施。PR #203 の post-merge-feedback (順位 198 T3-1) も同 PR に bundle (ユーザー承認、イテレーション速度優先)。
変更内容 (5 commits、thematically coherent)
設計判断
ADR-039 § 1.b 例外条項 (commit 2)
「behavior の妥当性が不確定な experimental feature」と「決定論的 mechanical lint」を区別:
順位 147 file_length lint / 順位 177 file_size_check は § 1.b 該当 (default ON で配布)。
checklist § 0 上位判定追加 (commit 2)
「そもそも § 1 適用対象か?」を最初に判定するゲートを追加。skip すると order-application 発生 (PR #197 で実観測)。
ADR-007 Layer 0.5 削除 (commit 3)
「Layer 0.5」概念は file_size_check 1 件のみのために導入したが、independent layer を設ける積極的理由がない。順位 177 を通常 custom linter の一つとして扱う方針 (ユーザー判断 2026-06-12)。今後 metadata-only check 追加は通常 ADR-007 判断フローに従う。
todo10.md split (commit 5、本 PR の dogfood)
commit 4 で file_size_check default ON 化したため、touched で 50KB 超の todo10.md (57KB) に warning が出る状態に。順位 177 設計の recovery flow (= 新 todo<N+1>.md 新設 + entry 移管) を実行し、todo10.md を 27KB まで縮小。8 entries (PR #185 〜 PR #196 era) を新規 docs/todo12.md に分離。
順位 198 への影響 (commit 1)
PR #203 post-merge-feedback Tier 3 #1 (Timestamp invariant safety ADR) を採用。analyzer は新規 entry 提案だったが、順位 198 (PR #199 T3-2) と同 ADR 提案のため、既存 entry の data point 強化として merge。
テスト結果
File-length / file-size lint 連動効果
main.rsの file-length lint (順位 147、Rust source 800 行) は本 PR 着手前から発火している既存 grandfather 状態 → 本 PR では touch なしfile_size_check(順位 177、docs/src 50KB) は本 PR の commit 5 で default ON 化 + 同時に todo10.md split で初回 dogfood (= 設計通り threshold 内に収まる recovery flow が機能)pr_size_check 1693 行 > 1500 block の override 根拠
PR_SIZE_CHECK_OVERRIDE=1を適用 (順位 151 = PR #202 で land した PR diff lines check の規定 escape 経路):参照
.claude/feedback-reports/203.mdTier 3 feat(hooks): 設定駆動型アーキテクチャに移行し配布自動化を実装 #1 (順位 198 3 観測目昇格の出典)Test plan
cargo test -p hooks-post-tool-linter file_sizeで 8 tests passcargo build --workspaceOKSummary by CodeRabbit
Documentation
Chores