Skip to content

docs: PR-3a follow-up (順位 220/221) + ファイルサイズチェックフロー改善計画 (W0-W5 plan) - #218

Merged
aloekun merged 1 commit into
masterfrom
pr-docs-file-length-plan
Jun 23, 2026
Merged

docs: PR-3a follow-up (順位 220/221) + ファイルサイズチェックフロー改善計画 (W0-W5 plan)#218
aloekun merged 1 commit into
masterfrom
pr-docs-file-length-plan

Conversation

@aloekun

@aloekun aloekun commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

PR #217 (PR-3a) の post-merge-feedback follow-up と、調査の結果判明した「800 行超 file 累積問題」への改善計画を documents として land する docs-only PR

変更内容

docs/todo-summary.md

順位 220 + 221 の rows を table に追加 (順位 219 直後)。

docs/todo10.md

順位 220 + 221 の詳細 entry を追加 (## 既知課題 直前)。

新規 docs/file-length-enforcement-plan.md (537 行 / 26.8 KB)

PR-3a (#217) の作業中に判明した「800 行超 file が現在も 7 件存在する」状況への改善計画を planning doc として作成。試験運用 (本ドキュメントは "計画書" であり、PR-W0 〜 PR-W5 が全て land + dogfood 完了で 本ファイルを削除 して役割を終える)。

構成

  1. 背景: 7 file の現状リスト + 順位 147 lint の soft-nag 設計が累積を許した経緯
  2. 設計方針 (2026-06-23 ユーザー判断): C (Stop hook gate) + E (weekly audit) → 将来 B (PostToolUse block) 移行検討
  3. Phase 1 各 PR 共通の前提 (新セッション再現性のため重要):
    • 制約条件 (comment-lint Bundle Z #B-α / 関数長 50 行 / pub(crate) / test helper duplicate)
    • push 手順 (PR_SIZE_CHECK_OVERRIDE=1 必須性)
    • takt-fix iteration 中の commit ハンドリング ((no description set) 対処)
    • 検証コマンド (PR ごとの crate 名 + master baseline 取得手順)
    • CR review 対応の Convention (resolved: 却下 pattern + GraphQL fallback + 偽陽性 4 種)
    • 各 PR の post-merge-feedback handling
    • 並列作業のシリアライズ point (Cargo.lock 競合 + ordering rule + bookmark 命名規約)
  4. 作業計画: PR-W0 〜 PR-W5 (Phase 3 PR-W6 は将来検討)
  5. 進捗追跡: status table (各 PR の [ ] / [x] 更新欄)
  6. 関連 ADR / memory / 順位: PR-3a merge commit 862eb1e3 含む
  7. Appendix A: Agent 委譲 prompt template (W1-W4 共通、PR-3a で実証済 verbatim + 変数置換表)

削除条件

以下 3 条件を全て満たした時点で本 file を削除:

  1. PR-W0 〜 PR-W5 が全て master に land 済
  2. find src -name "*.rs" -not -path "*/target/*" -exec wc -l {} + | awk '$1 > 800' で 0 件
  3. PR-W5 land 後の Stop hook gate dogfood で FILE_LENGTH_CHECK_OVERRIDE=1 を使わず 1-2 セッション通過

並列セッションからの参照可能性

「並列作業を行う可能性があるため、作業内容・作業状況が他セッションから把握できる」を満たすため、Tier 1 (G1-G5) + Tier 2 (G6-G7) の項目を全て明文化:

情報 配置
何を分割するか 背景 section の 7 file table
どう分割するか Appendix A の Agent prompt template + 変数置換表
どんな制約を守るか Phase 1 共通の前提 → 制約条件
どう push するか Phase 1 共通の前提 → push 手順
どう検証するか Phase 1 共通の前提 → 検証コマンド
takt-fix iter 中の commit 扱い Phase 1 共通の前提 → takt-fix iteration 中の commit ハンドリング
CR 偽陽性への対処 Phase 1 共通の前提 → CR review 対応の Convention
post-merge-feedback handling Phase 1 共通の前提 → 各 PR の post-merge-feedback handling
並列調整 Phase 1 共通の前提 → 並列作業のシリアライズ point
PR-3a の参考実例 関連 ADR section に merge commit 862eb1e3 を cite

PR 計画における位置

master (PR-3a #217 land 済)
  ↓
本 PR (docs-only、planning + 順位 220/221) ← 本 PR
  ↓
PR-W0 (weekly audit 追加、ADR-031 workflow 拡張)
  ↓
PR-W1 〜 W4 (file split、Agent 委譲で実装)
  ↓
PR-W5 (Stop hook gate 追加、Phase 2 完了)
  ↓
[将来] PR-W6 (C → B 移行検討)

PR-3b (layered config + lib-hooks-config + ADR-039 amendment、元 PR-3) は本作業 (W0-W5) 完了後に着手予定。

Test plan

  • markdownlint: 0 errors (PostToolUse hook で確認)
  • cli-docs-lint --check cross-ref: OK (7 broken relative link を ../src/ 形式に修正済)
  • cargo test --workspace: 全 crate pass (本 PR は docs-only のため影響なし)
  • cargo clippy --workspace -- -D warnings: clean
  • takt pre-push-review approved (Result: Success)

関連 PR

PR-3a (#217) の post-merge-feedback で採用された 2 件と、調査の結果判明した
800 行超 file 累積問題への改善計画を documents として land。

## 順位 220/221 (PR #217 post-merge-feedback 採用)

- 順位 220 (🔧 Tier 2): subprocess stress test (>64KB stdout) を ADR-031
  weekly-review pipeline 経由で週次実行
  - ユーザー判断 (2026-06-23): hooks/pre-push には組み込まず週次に分離
  - `#[ignore]` 付き cargo test + ADR-031 workflow に rust-stress step 追加

- 順位 221 (💎 Tier 3): ADR-NNN (採番未確定): Safe Subprocess Stdout Pattern
  を ADR-016 appendix or 新 ADR で codify
  - 順位 220 (test 層) と 1 PR bundle 推奨
  - ADR-025 CwdRestore guard pattern を precedent として cite

## ファイルサイズチェックフロー改善計画 (新規 docs/file-length-enforcement-plan.md)

PR-3a 完了時に判明: 800 行超 file が 7 件存在 (lint hook 本体 1606 行を含む)。
現状の file_length lint (順位 147) は soft-nag のみで decision: block しない設計、
Stop hook quality_gate / pre-push quality_gate にも file_length check が無く、
ratchet 累積を防ぐ機構が欠落していた。

ユーザー判断 (2026-06-23): C (Stop hook gate) + E (weekly audit) の二段組を導入、
clean state 到達後に C → B (PostToolUse block) 移行を将来検討。

planning doc として docs/file-length-enforcement-plan.md を新設、6 PR (W0-W5)
の作業計画 + 削除条件 (全 PR land + 0 件確認 + dogfood 通過) を明文化。
並列セッションから状況を把握できる ephemeral 計画書 (試験運用、完了で削除)。
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.


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 commented Jun 23, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/aloekun/claude-code-hook-test/issues/comments/4782010354","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/aloekun/claude-code-hook-test/pull/218?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `2f404604-a92d-4092-8c68-6261aaa39746`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between 862eb1e399b2629345d3111f10f3404019bf07ac and f0c2f1d2f3be93371bdbf72a4ff2a50e7f6516ea.\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (3)</summary>\n> \n> * `docs/file-length-enforcement-plan.md`\n> * `docs/todo-summary.md`\n> * `docs/todo10.md`\n> \n> </details>\n> \n> ```ascii\n>  ____________________________________________________________________________________________________________________________________\n> < Contrary to popular belief, Unix is user friendly. It just happens to be very selective about who it decides to make friends with. >\n>  ------------------------------------------------------------------------------------------------------------------------------------\n>   \\\n>    \\   (\\__/)\n>        (•ㅅ•)\n>        /   づ\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=aloekun/claude-code-hook-test&utm_content=218)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

@aloekun
aloekun merged commit b87174c into master Jun 23, 2026
1 check passed
@aloekun
aloekun deleted the pr-docs-file-length-plan branch June 23, 2026 19:31
aloekun added a commit that referenced this pull request Jun 24, 2026
…順位 222 採用 (#219)

* docs(todo): 順位 222 採用 (PR #218 post-merge-feedback #5)

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: 様子見継続

* feat(weekly-review): file_length scan を pre-LLM step として追加 (PR-W0)

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 しない、健康診断目的)。
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