feat(hooks-pre-tool-validate): jj-message-required preset で jj new / jj split の -m 必須化 (順位 144)#172
Conversation
…加 (順位 144 Phase 1)
|
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 (4)
📝 WalkthroughWalkthroughBlockedPattern 型に exception フィールドを追加し、パターンマッチ後の条件付き許可ロジックを実装。新プリセット jj-message-required を導入して -m/--message オプション未指定時のコマンドをブロック。プリセット解決ロジックを関数分割で整理し、コンフィグ有効化とドキュメント更新を実施。 Changesjj-message-required プリセット実装とドキュメント更新
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 |
* docs(adr): ADR-042 ルール vs 仕組み化の境界基準 — 試験運用 ADR 新設 + CLAUDE.md ADR list 追加 * docs(todo): 仕組み化方針切替 — todo9.md 新設 + 順位 142/143/144/145 + 146-151 追加 + 順位 44/61 hook 化転換 + 122→136 統合 (Bundle 既存ルール仕組み化) PR #172 (順位 144 = jj-message-required hook) の dogfood 成功を受けた仕組み化方針切替に関する一連の todo system 更新: - 順位 142 entry 追加 (PR #170 T3-#1 採用 ADR-041 補強 State Preservation Invariant pattern) - 順位 143/144 entry 追加 (PR #171 post-merge-feedback Bundle 171 = 複言語 fixture helper + jj-message-required hook) - 順位 145 entry 追加 (PR #172 T2-#1 採用 preset matrix test) - 順位 146-151 entry 新規追加 (既存ルール仕組み化バンドル: secret detection / file length lint / test coverage CI gate / subprocess pipe truncate hook 拡張 / magic number lint / PR diff lines check) - 順位 44 (gh CLI 使用規則) を docs 追記から PreToolUse hook 化方針に転換 - 順位 61 (CR review.body 手動 scan) を docs 追記から check-ci-coderabbit CLI 拡張方針に転換 - 順位 122 (新 todo 着手前の既実装確認) を 順位 136 (working copy staleness hook) に統合 - todo9.md 新設 (todo8.md 50KB 接近のため、新規追加先を todo9.md に移行) - todo-summary.md 更新方針 + table 更新 + Bundle 171 タグ整備 memory rule `feedback_pipeline_over_rules.md` 適用 = rule docs → mechanism shift の体系的記録。 * chore(todo): land 済 entry 削除 + bundle-history 分離 (size 50KB 超過解消)
Summary
順位 144 (PR #171 T3-#8 採用) 単独実装。PreToolUse hook で
jj new/jj splitの-m/--message引数なし呼び出しを mechanical に block し、混合 commit 事故 +jj spliteditor hang を構造的に防止する。Background
PR #171 セッションで
jj new忘れにより 順位 57 commit と 順位 91 commit の変更が混入する事故が発生 (後でjj split -mで recovery 済)。post-merge-feedback の analyzer 原案は~/.claude/rules/common/git-workflow.mdへの docs 化だったが、feedback_no_unenforced_rules.md適用でユーザー判断 hook による mechanical enforcement に方針変更 (2026-05-24 セッション、feedback_pipeline_over_rules.md適用)。Design
BlockedPattern構造体拡張:exception: Option<Regex>field 追加 (Rust 標準regexcrate が negative lookahead 非対応のため 2 段判定で実装)validate_commandロジック拡張: pattern match 後、exception regex が hit すればcontinueで allowjj-message-required:(?im)(^|&&|;|\|\||\||&|\n)\s*(?:[A-Za-z_][A-Za-z0-9_]*=\S+\s+|command\s+|env\s+)*jj\s+(new|split)\b\s(-m|--message)\bhooks-config.tomlで明示有効化 (派生プロジェクト breaking change リスク軽減)設計判断 (ユーザー承認済 2026-05-24)
jj new引数なしも block (=-mを強制)jj new <revision>(例:jj new master) で-mなしも blockjj splitinteractive (=-mなし) は editor hang issue があるため strong blockjj直接呼び出しのみ (pnpm jj-new等のラッパーは scope 外)Commits
tkdocs(todo): 順位 143 + 144 新規追加 (Bundle 171 entry 登録)yvrefactor: BlockedPattern に exception field 追加 (Phase 1)utfeat: jj-message-required preset 追加 (Phase 2)kotest: block/allow/non-regression test 拡充 (Phase 3)uqchore: build + deploy exe + 順位 144 entry 削除 (Phase 4)Test plan
cargo test -p hooks-pre-tool-validate: 158 pass (14 新規 test、既存 144 件 regression なし).claude/hooks-pre-tool-validate.exe直接 stdin 投入で確認jj new→ exit 2 + 修正手順 feedback ✅jj new -m "WIP"→ exit 0 (allow) ✅関連
.claude/feedback-reports/171.md)feedback_pipeline_over_rules.md/feedback_no_unenforced_rules.mdOut of scope
feedback_dogfood_evals_two_phase.md適用)pnpm jj-new等の wrapper 経由は scope D により対象外 (設計判断確定)Summary by CodeRabbit
リリースノート
新機能
jj new/jj splitコマンドでメッセージ指定を必須化するプリセット「jj-message-required」を追加しましたテスト
ドキュメント