test(hooks): UTF-8 boundary + aggregation cap 拡充 (順位 125 + 57 + 91) - #171
Merged
Conversation
…ation Invariant pattern) PR #170 post-merge-feedback の Tier 3 #1 採用結果として、ADR-041 (Test Isolation Patterns for Multi-Condition Guards) に新 section "State Preservation Invariant" (once-set-never-overwritten) を 追記する task を 順位 142 として登録。 PR #168/169/170 で write-once 不変式 (state.fix_push_time.or_else(...) 形式) のテストカバレッジ漏れが連続観測されたことが trigger。ADR-041 既存 section は Multi-Condition Guards (early-return) のみで、write-once 不変式は 別 pattern class として未収録だったため補強する。順位 141 で takt-fix が 自動追加した 3 件の preservation test (poll.rs / monitor.rs) を参照実装と して cite し、3 点セット test pattern (既存値あり / 新値提供 / preservation 確認) を明文化する。
…t 追加 (順位 125 採用) PR #151 (T2-#1) で hooks-post-tool-comment-lint-rust の byte_offset_to_line を multi-byte boundary test 拡充で production bug を発見した経験を横展開。hooks-post-tool-linter の build_violation_json (L500) は content[..m.start()] による str slicing を行うが、 regex::Match::start() が char boundary を保証するため panic 安全。 本 test は line 算出 (.bytes().filter(|b| *b == b'\n').count() + 1) が multi-byte content (日本語/emoji/結合文字) でも正しく動作することを empirical に seal する。将来 char_indices() ベースへの書き換え等で line off-by-one regression が入った場合に検知する。 string-processing 系の hooks のうち他 (pre-tool-validate / session-start / stop-quality / user-prompt-feedback-recovery / stop-feedback-dispatch) は as_bytes() を write 用途で 使用するのみで offset 操作を持たないため横展開 scope 外。
…S truncate contract test 追加 (順位 57 採用) collect_all_violations (L551) は find_violations と find_function_length_violations の両 source を extend した後に truncate(MAX_VIOLATIONS) で合計を cap する設計。既存 cap test (max_violations_capped / function_length_violations_capped) は各 source 単体の cap のみ検証し、合算 truncate の contract が機械強制されていなかった gap を補填。 将来の lint 追加時に L562 の truncate(MAX_VIOLATIONS) を削除した regression (= 合計が MAX を超える) を catch する explicit 安全網。 fixture: 長 function (55 行 > MAX_FUNCTION_LINES=50) 1 件 + 非 doc コメント 25 行 → find_function_length_violations 1 件 + find_violations が cap で 20 件 → 合計 21 件 → truncate 後 20 件に cap される contract を assert。
…eedback_verify_task_not_already_done.md 適用) PR #132 (Phase c MVP land = 2026-05-09) 直後の post-merge-feedback で entry 化された 順位 91 だが、本セッション着手前の jj log + 既存 test 確認で src/cli-push-runner/src/config.rs の test module L325-481 に既に 5 件の lint_screen parse test が存在することを発見: - config_parses_with_lint_screen_section_full_fields (L326): 全 7 field deserialize - config_parses_with_lint_screen_section_minimal_only_enabled (L370): enabled=false でも Some 構築 - config_lint_screen_section_absent_yields_none (L402): section 不在 → None - config_lint_screen_numeric_defaults_resolve_via_constants (L441): default 値 fallback - config_lint_screen_string_defaults_resolve_via_constants (L456): default 値 fallback entry の作業計画 4 項目はすべてカバー済 (silent field rename 防止 / 全 field deserialize / section 不在時 None / default 値検証)。post-merge-feedback で採用された後、別 PR で 先行 land 済だった可能性が高い。 memory rule feedback_verify_task_not_already_done.md (todo 着手前に既実装検証 → stale entry を削除に再目的化) の正典的 dogfood 例として価値あり。Bundle i のペアタスク 順位 92 (scale-aware eval fixtures) は別タスクとして残し、bundle 表記は historical note 化。 - docs/todo6.md: 順位 91 entry (L13-39) 削除 - docs/todo-summary.md: 順位 91 行削除 + 順位 92 行を独立タスクとして修正
|
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 (5)
💤 Files with no reviewable changes (1)
📝 Walkthrough概要このPRは、進行中タスク( 変更内容タスク追跡更新
推奨される関連PR
🎯 2 (Simple) | ⏱️ ~12 分 🚥 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 |
aloekun
added a commit
that referenced
this pull request
May 25, 2026
…jj split の -m 必須化 (順位 144) (#172) * docs(todo): 順位 143 + 144 新規追加 — PR #171 post-merge-feedback 採用 2 件 (Bundle 171: T2-#4 fixture helper + T3-#8 jj hook) * refactor(hooks-pre-tool-validate): BlockedPattern に exception field 追加 (順位 144 Phase 1) * feat(hooks-pre-tool-validate): jj-message-required preset 追加 (順位 144 Phase 2) * test(hooks-pre-tool-validate): block/allow/non-regression test 拡充 (順位 144 Phase 3) * chore(hooks): build + deploy hooks-pre-tool-validate exe + 順位 144 entry 削除 (Phase 4)
4 tasks
aloekun
added a commit
that referenced
this pull request
May 25, 2026
* 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 超過解消)
5 tasks
aloekun
added a commit
that referenced
this pull request
Jun 6, 2026
本 PR は以下 4 つの作業を 1 コミットに統合: ## A. PR #196 post-merge-feedback 採用 2 件 (順位 193, 194 登録) PR #196 (Bundle 195-FB) post-merge-feedback 8 件のうち 2 件採用、6 件却下/様子見。 採用 (todo10.md に entry 追加、todo-summary.md table に行追加): - 順位 193 (T2): Companion helper group 署名整合 compile-time validation test - 順位 194 (T3): development-workflow.md \"1. Plan First\" に Codification 重複確認 step 追記 却下/様子見の詳細は .claude/feedback-reports/196.md 参照。 ## B. queue 棚卸し (順位 ≤ 100 の 32 件を audit) 8 件削除 + 7 件改訂で queue の signal/noise 改善: 削除 8 件 (既存 land 確認、または動機失効): - 順位 41 (Bundle Y2 効果定量計測): 動機の主軸失効 (Bundle Z 完成 + Z2 不採用) - 順位 42, 43, 46 (rate-limit auto-retry 系): PR #97/#113/#129/#185 段階 land 完了 - 順位 45 (--list-findings Rust モード): PR #101 で land 済 - 順位 57 (Aggregation cap integration test): PR #171 で land 済 - 順位 93 (coding-style.md partial fix 例追加): ~/.claude/rules/common/ coding-style.md に既に section 存在 - 順位 97 (with_num_ctx serialization test): lib.rs:494 で mockito test 実体存在 改訂 7 件 (Status update 2026-06-06 を front-matter に追加、現状反映): - 順位 11: ADR-018 park / ADR-030 短命プロセス移行後の再現確認が前段 - 順位 19: ADR-037/043/PR #194 land 後の残余 case baseline 観測が前段 - 順位 27: Phase D-7 = PR #154 land 済を反映 - 順位 38: ADR-031 採用昇格済 (PR #192) → Bundle W/X land のみ残依存 - 順位 40: PR #175 push-runner bookmark_check 実装済 → skill 側は二重防御に縮小 - 順位 51: 採用案 C (fix.md instruction 追加) は land 済、残作業 = dogfood 観測のみ - 順位 92: ADR-038 採用昇格済 (PR #156) で Phase d 運用入り、動機書き換え cross-reference 修復: - 順位 49: 旧依存 Bundle a Sub-PR 2 (順位 42/43/46) 消滅を反映 - 順位 61: 旧依存 順位 45 land 済を反映 ## C. todo9.md → todo11.md 分割 todo9.md が 75KB / 890 行に到達し読み取り安定性閾値 (50KB) 超過のため分割: - todo9.md (37KB / 454 行): 既存ルール仕組み化バンドル (順位 146-151) + 週次 レビュー拡張 (順位 152-154) を保持 - todo11.md (41KB / 453 行、新規): PR-specific follow-up entries 10 件 (順位 157, 160, 161, 162, 163, 165, 170, 171, 172, 173) theme-based split で意味的分離 + 両ファイルとも 50KB 閾値以下に収まる。 todo-summary.md table の file 参照を Python script で一括更新 (10 件)、 todo-summary.md 冒頭の \"追加先ファイル\" 説明を todo10.md に更新。 ## D. 順位 177 優先度引上げ PostToolUse hook ファイルサイズ検出 task が 4 回目の同型観測に到達 (PR #133 + #172 + #186 + 本セッション = Very High frequency)。CLAUDE.md code-review.md \"同型 finding の閾値判定\" (3 観測 = Tier 1 昇格) を超え systemic risk 閾値到達。 3 箇所同期更新: - todo10.md entry 本体に Status update 2026-06-06 blockquote 追加、優先度を \"Tier 1\" → \"Tier 1 (優先実装)\" に格上げ - todo-summary.md table 行で Tier 列を太字 + 注記、dependency 列に urgency note - todo-summary.md 末尾の戦略 note に \"直近優先 (2026-06-06 ユーザー指示)\" 段落を新設、Bundle 195-FB-Followup (順位 193 + 194) の次の PR で消化推奨と specific call-out ## 統計 - 10 ファイル変更 (1 新規) - ~670 lines insertions, ~910 lines deletions (net ~240 行削減) - 全 todo*.md が 50KB 閾値以下に収まる (todo9: 37KB, todo10: 36KB, todo11: 41KB) ## 参照 - .claude/feedback-reports/196.md (採否確定 commit、PR #196 由来) - memory feedback_post_merge_feedback_adoption_requires_user_approval per ユーザー承認済 - memory feedback_todo_no_history (削除は痕跡なし、コメントマーカー不使用) - ADR-035 (docs-only PR 評価ポリシー) - ADR-033 (採番管理簡素化、順位 renumber は避けて semantic markers で表現)
4 tasks
7 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
Test 拡充重点の 3 タスクバンドル。production code 変更ゼロ、test 追加のみで副作用最小。
hooks-post-tool-linter::build_violation_jsonの multi-byte content での line 算出 defensive test を追加。PR feat(hooks): Phase D D-5 — comment-lint test 拡充 + MAX cap break scope test #151 で発見したbyte_offset_to_lineの char-boundary panic 対策の string-processing 系 hooks への横展開hooks-post-tool-comment-lint-rust::collect_all_violationsのtruncate(MAX_VIOLATIONS)contract test を追加。両 source (comment + function length) 混在 fixture で合計 21 件 → 20 cap を assert、L562 の truncate 削除 regression を機械強制src/cli-push-runner/src/config.rsL325-481 に 5 件の lint_screen parse test が既に存在しており、memory rulefeedback_verify_task_not_already_done.mdの正典的 dogfood 例Commits
svdocs(todo): 順位 142 entry 追加 (既存変更、ADR-041 補強の予約 entry)nlotest(hooks-linter): 順位 125 UTF-8 multi-byte content での line 算出 defensive testrlztest(hooks-comment-lint-rust): 順位 57 collect_all_violations の MAX_VIOLATIONS truncate contract testyudocs(todo): 順位 91 既実装発見で削除AI review (pre-push)
両 reviewer が 1 iteration 内 APPROVE。
Test plan
cargo test --workspace: 全 pass (~1300 tests, 0 failures)cargo clippy -p hooks-post-tool-linter -p hooks-post-tool-comment-lint-rust: cleancargo fmt --check: clean (pre-existing baseline drift は scope 外)cargo test run_custom_rules_line_number_correct_with_multibyte_contentpasscargo test collect_all_violations_truncates_combined_total_to_maxpass関連
.claude/feedback-reports/151.md)ADR-035 適用: docs/* と test code のみで production logic 変更なし、code-logic criteria (mutation / error handling / DRY / YAGNI) は適用外。
Summary by CodeRabbit
新しいテストの追加
これらのテストにより、リンターツールの堅牢性と信頼性が向上しています。