Skip to content

docs: file-length-enforcement-plan PR-W2/W4 land 反映 + PR #231 feedback todo 登録 (順位 242-245) - #232

Merged
aloekun merged 2 commits into
masterfrom
docs-plan-land-w2w4-fb231
Jul 1, 2026
Merged

docs: file-length-enforcement-plan PR-W2/W4 land 反映 + PR #231 feedback todo 登録 (順位 242-245)#232
aloekun merged 2 commits into
masterfrom
docs-plan-land-w2w4-fb231

Conversation

@aloekun

@aloekun aloekun commented Jul 1, 2026

Copy link
Copy Markdown
Owner

概要

docs-only PR。file-length-enforcement-plan の進捗更新と、PR #231 (PR-W4) の post-merge-feedback 採用項目 (ユーザー承認済み) を反映。

変更内容 (2 コミット)

1. docs(plan): file-length-enforcement-plan PR-W2/W4 を land 済 に更新

進捗追跡:

PR 状態
W0 [x] #219
W1 [x] #220
W2 [x] #224
W3 [x] #230
W4 [x] #231
W5 [ ] not started

残タスクは PR-W5 (Stop hook gate) のみ。workspace 全体で 800 行超 0 件 (plan 削除条件 #2 達成済)。

2. docs(todo): PR #231 post-merge-feedback 採用 4 件を登録 (順位 242-245)

ユーザー承認済みの採用項目:

  • 242 🚀 Tier 1: invoke_classifier の stdin write → drain 順序修正で pipe deadlock 解消 (別 PR、CodeRabbit Major、pre-existing)
  • 243 💎 Tier 3: pub(crate) vs pub 可視性チェックリストを module split 手順に追加
  • 244 💎 Tier 3: per-module test helper 複製方針を coding-style.md に明文化
  • 245 💎 Tier 3: PR_SIZE_CHECK_OVERRIDE=1 適用ポリシーを push-runner-config.toml に明文化

🤔 様子見 (T1-1 / T3-4) は保留、❌ 却下推奨 5 件は却下確定 (いずれもユーザー承認済み)。

備考

Summary by CodeRabbit

  • Documentation
    • 進捗表を更新し、完了済みの作業項目を反映しました。
    • 新しい作業候補を追加し、今後の対応順と実施内容を整理しました。
    • 進行中タスク一覧に、順序調整や運用ルールの明文化に関する項目を追記しました。

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aloekun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b4d5fe9b-17ca-4939-b10c-13c397efb3f7

📥 Commits

Reviewing files that changed from the base of the PR and between 874145b and a386cbf.

📒 Files selected for processing (2)
  • docs/todo-summary.md
  • docs/todo13.md
📝 Walkthrough

Walkthrough

計画・進捗ドキュメントにおいて、PR-W2(#224)とPR-W4(#231)を「land済」ステータスへ更新し、todo-summary.mdとtodo13.mdに新規タスク(stdin/drain順序修正、可視性チェックリスト、test helper複製方針、PR_SIZE_CHECK_OVERRIDE適用ポリシー)を追記した。

Changes

ドキュメント更新

Layer / File(s) Summary
PR完了ステータスの反映
docs/file-length-enforcement-plan.md
PR-W2(#224)とPR-W4(#231)の章冒頭ステータスおよび進捗追跡表を「未着手」から「land済(マージ日時付き)」に更新。
新規タスクの追記
docs/todo-summary.md, docs/todo13.md
推奨実行順序サマリー表にタスク242-245を追加し、invoke_classifierのdeadlock対策、pub(crate)/pub可視性チェックリスト、test helper複製方針、PR_SIZE_CHECK_OVERRIDE適用ポリシーの作業計画と完了基準をtodo13.mdに詳述。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • aloekun/claude-code-hook-test#133: 同じdocs/todo-summary.mdの「推奨実行順序サマリー」表構造を扱っており、本PRはそのテーブルに新規タスク行とステータスを追加している。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR-W2/W4 の完了反映と PR #231 の todo 追加を正しく示しており、変更内容と一致しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/todo13.md`:
- Around line 473-479: The checklist entry about `pub` visibility is inaccurate
and should be clarified in the module split guidance. Update the description in
the affected checklist item to state that `pub` is still valid for access from
other modules within the same crate, while `pub(crate)` is the preferred form
for crate-wide sharing in this binary-crate context, and note that `pub` becomes
an external API surface only when a library target is present. Keep the wording
consistent with the existing references to module split guidance and the
visibility checklist so it is clear where to apply this rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c80e739e-cc2b-4a41-98dc-02762f9d07d4

📥 Commits

Reviewing files that changed from the base of the PR and between bf6977c and 874145b.

📒 Files selected for processing (3)
  • docs/file-length-enforcement-plan.md
  • docs/todo-summary.md
  • docs/todo13.md

Comment thread docs/todo13.md
@aloekun
aloekun force-pushed the docs-plan-land-w2w4-fb231 branch from 874145b to a386cbf Compare July 1, 2026 11:29
@aloekun
aloekun merged commit 64f9643 into master Jul 1, 2026
1 check passed
@aloekun
aloekun deleted the docs-plan-land-w2w4-fb231 branch July 1, 2026 15:01
aloekun added a commit that referenced this pull request Jul 2, 2026
…ied-files batch mode + [file_length_gate] opt-in (#234)

* docs(todo): PR #232 post-merge-feedback 採用 1 件を登録 (順位 246)

* feat(hooks): PR-W5 file-length Stop gate — comment-lint --check-modified-files batch mode + [file_length_gate] opt-in

Phase 1 (PR-W1〜W4、#220/#224/#230/#231) で 800 行以下に整えた clean state を恒久維持する
強制層。hooks-post-tool-comment-lint-rust に --check-modified-files batch mode を追加し、
Stop hook quality_gate の 1 step として PR 範囲 (base..@) の .rs file 行数を検査。
800 行超が 1 件でもあれば exit 1 で Stop を block する (Option C-2)。

実装:
- src/hooks-post-tool-comment-lint-rust/src/modified_files_check.rs (新規、17 tests)
- main.rs に --check-modified-files dispatch 追加、Cargo.toml に toml 依存追加
- .claude/hooks-config.toml に file-length step + [file_length_gate] section

mechanical refactor、behavior 不変。既存 lint (comment/function/file_length/metrics) は不変。

## ADR-039 3 点セット (experimental feature 標準パターン)

- Config opt-in (default OFF): gate_enabled() が unwrap_or(false)。本 repo のみ dogfood で enabled=true
- Kill-switch: 下表
- Bounded lifetime: file-length-enforcement-plan.md 削除条件 3 (override 未使用で 1-2 セッション通過)

## Kill-switch table

| 起動経路 | 停止コマンド | 影響範囲 |
|---|---|---|
| .claude/hooks-config.toml の [file_length_gate] enabled=true + file-length step | enabled=false (恒久) | Stop hook の file-length 判定のみ (他 step 不変) |
| Stop hook 発火時に file-length step 実行 | env FILE_LENGTH_CHECK_OVERRIDE=1 (緊急、truthy 値) | 当該 Stop の判定を skip |

## 設計判断

- jj 変更検出は base branch を config 引数化 (default master、ADR-021 § Revset Composability)
- cmd path は cmd.exe の forward-slash 非対応のため backslash TOML literal string
- jj 失敗時は fail-closed で block (ADR-043、stop_hook_active retry-skip が永続 lock を防止)
- templates (TS/Python) は Rust 非対象のため未追加

## 検証

- cargo test -p hooks-post-tool-comment-lint-rust: 116 pass / clippy clean / fmt clean
- cargo test --workspace: regression なし / cargo clippy --workspace clean
- dogfood (deploy 済 exe): clean=exit0 / 850行file=block / OVERRIDE(=1,=true)=bypass / enabled=false=no-op / self-host=exit0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(review): CodeRabbit #234-1 fail-closed 対応 + 削除 file skip 補正

CodeRabbit Major #234-1 (読み取り不能な既存 .rs は fail-closed に) を適用:
collect_oversize_files を Result 化し、存在するのに読めない .rs は Err → exit 1 (block)。

さらに削除 file 誤検知を補正: jj diff --name-only は削除 file も列挙する (実測確認) ため、
Path::exists() で存在確認し削除 file (非存在) は skip する。これがないと file split
refactor (元 file 削除を伴う、本 plan が促進する作業そのもの) を gate が誤 block する。
CodeRabbit の指摘文言も「*既存* .rs」であり削除 file は対象外。

- collect_oversize_files: filter(Path::exists) + Result<Vec, String>
- fail-closed 診断を run_check_modified_files で block 表示 (ADR-043 § 原則1)
- tests: skips_deleted_file (skip) + errors_on_present_but_unreadable (Err) で両分岐を assert

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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