Skip to content

feat: Bundle CR-RL — CR rate-limit detection を新フォーマット対応に拡張 (順位 167-169) + 174 - #185

Merged
aloekun merged 4 commits into
masterfrom
feat-bundle-cr-rl
May 29, 2026
Merged

feat: Bundle CR-RL — CR rate-limit detection を新フォーマット対応に拡張 (順位 167-169) + 174#185
aloekun merged 4 commits into
masterfrom
feat-bundle-cr-rl

Conversation

@aloekun

@aloekun aloekun commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

Bundle CR-RL = RATE_LIMIT_MARKER 旧フォーマット固定値が CR の新フォーマット (<!-- rate limited by coderabbit.ai --> HTML マーカー + ## Review limit reached heading + More reviews will be available in N minutes wait time) を検出できず、cli-pr-monitorRateLimitOutcome::Parked 経路 (ADR-018 設計) が silent regression で完全無効化されていた critical bug を 3 層で構造的に修正。

実体観測根拠:

加えて PR #184 post-merge-feedback で採用された T3-2 (ADR-039 checklist 拡張) を todo 化する commit を同 PR に bundle (ユーザー判断 2026-05-29「既存変更同 PR 許容、commit のみ分離」)。

含まれる commits (4 件)

1. docs(todo): 順位 174 (PR #184 T3-2 採用)

PR #184 post-merge-feedback T3-#2 採用: ADR-039 experimental feature lifecycle checklist 拡張 task を todo 化。新規 feature 追加時の config schema ↔ feature flag default OFF ↔ docs / config example ↔ test coverage の 4 点整合 mechanical checklist。PR #184 M-2 (weekly_review_reminderenabled = true 違反) は checklist があれば self-review で捕捉可能だった。

T3-1 (Feedback adoption pattern ADR) は不採用 (analyzer rubric と user 判断の完全一致を formalize するのは構造的に困難、memory feedback_no_unenforced_rules 延長線上の原則)。

2. feat(rate-limit): 順位 167 (T1-#1) 機械強制層

src/check-ci-coderabbit/src/main.rs の rate-limit detection を CR 新フォーマット対応に拡張:

注: ADR-039 experimental feature pattern は本タスクには不適用 (rate-limit detection は ADR-018 で既に決定済の standard feature であり experimental ではない)。

3. test(rate-limit): 順位 168 (T2-#1) test 層

#[cfg(test)] mod に 3 新規 fixture を追加 (旧 6 fixture は backward compat 維持):

  • rate_limit_detected_from_new_format_with_html_marker_and_full_wait_time — HTML マーカー + 標準 wait time
  • rate_limit_detected_from_new_format_with_minutes_only — 短縮形 (seconds 省略)
  • rate_limit_picks_latest_when_mixed_old_and_new_formats — 旧 + 新混在で時系列最新が選ばれる

memory feedback_test_dry_antipattern 適用 (各 fixture 独立 setup、共通 helper 化しない)。

4. docs(adr): 順位 169 (T3-#1) ADR 永続 reference 層

  • ADR-034 に新 section「既知 CR rate-limit format 一覧」+「検出 logic 更新手順 (6 step)」追加
    • 既知 format 表 (発見時期 / body marker / wait time regex の 3 列、format 追加で append しやすい構造)
    • 検出 logic 更新の標準手順を明文化 (= 将来 CR が format 変更した場合の同型 silent regression を構造的予防)
    • HTML マーカー優先の理由を明示 (UI 文言より stable な可能性)
  • ADR-018 lines 185-186 の rate-limit 表 description を「順位 167 で multi-variant 対応済、詳細は ADR-034 § 既知 CR rate-limit format 一覧 参照」に書き換え

検証結果

  • cargo build (release): clean
  • cargo test -p check-ci-coderabbit: 82 tests pass (79 既存 + 3 新規 fixtures)
  • cargo clippy -p check-ci-coderabbit -- -D warnings: clean
  • pre-push-review (2m 36s): simplicity-review APPROVED + security-review APPROVED (No blocking anomalies detected)

メタ評価

本 PR は PR #182 セッションで dogfood 実体観測した structural finding (CR rate-limit marker drift) を 3 commit 分離で構造修正した実例。Phase B (PR #182) で確立した weekly-review pipeline が「rule では検出できない rate-limit detection の format drift」を実体観測経由で拾い、Bundle CR-RL として系統的に修正できた = self-reinforcing detection loop の中期成果。

format 更新手順の codify (ADR-034) により、本 PR land 後の 次回 CR format 変更時 は同型の 30+ 分 polling 浪費を回避可能になる構造化が確立。

Test plan

  • cargo test -p check-ci-coderabbit で 82 tests pass (旧 6 + 新 3 fixtures + その他)
  • cargo clippy clean
  • markdownlint clean (ADR-034 + ADR-018)
  • pre-push-review APPROVED
  • CodeRabbit が本 PR 自身を新 format detection 対象として review (= self-reference test、本 PR 内で CR が rate-limit に遭遇した場合 fix 後の挙動を実観測)
  • CI green 確認後 merge 判断
  • (post-merge) 次の rate-limit 観測時に新 detection 経路で RateLimitOutcome::Parked が機能することを実観測

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • New Features

    • CodeRabbit のレート制限検出が複数フォーマットに対応しました。従来の検出方式に加え、新しいフォーマットも自動的に認識し、待機時間をより正確に抽出できるようになりました。
  • Documentation

    • レート制限検出とモニタリングに関する設計ドキュメントを更新しました。実装状態の詳細を追加し、フォーマット変更への対応手順を明記しました。

Review Change Stack

aloekun added 4 commits May 29, 2026 21:14
… checklist 拡張)

採用: PR #184 post-merge-feedback Tier 3 #2 (2026-05-29 ユーザー承認):
- 順位 174 (T3-#2): ADR-039 experimental feature lifecycle checklist 拡張
  - 新規 experimental feature 追加時の self-review checklist を ADR-039 に追加
  - 4 点整合確認: config schema ↔ feature flag default OFF ↔ docs / config example ↔ test coverage
  - PR #184 M-2 (weekly_review_reminder 'enabled = true' 違反) の self-review 捕捉化が目的
  - 本リポジトリ内 ADR 編集のみ、派生プロジェクトには波及しない (ADR-039 自体は global pattern として参照される構造のため、文書編集は本リポジトリで完結)

不採用 (2026-05-29 ユーザー判断記録):
- T3-1 (Feedback adoption pattern ADR 新設): 不採用。analyzer の Severity/Frequency/Effort rubric は推奨でしかなく user 判断と完全一致しないため、整合性ある判定基準を rule 化するのは構造的に困難。memory feedback_no_unenforced_rules の延長線上にある原則
  → T3-1 と T3-2 の対比 = discretionary judgment (T3-1) vs mechanical 4 点 checklist (T3-2) の境界判別の実例
  → 採用判断自体が「rule 化可能な finding」と「discretionary 依存 finding」を区別する meta-judgment

却下推奨 (analyzer 既判定): T1-1 / T1-2 / T2-2 / T3-3 (NLP 必要 / 過剰一般化 / unenforced rule)
様子見: T2-1 (ADR-039 compliance Rust test、dogfood 2+ 観測後)

メタ評価: 本セッション (#181#182#183#184) で計 17 件の採用候補が抽出され、Phase B 設計の self-reinforcing detection loop が full session 単位で機能した実例。本 commit は最終 PR #184 採用分の完結。
…ーマット対応に拡張 (順位 167 採用、T1-#1)

PR #182 セッションで実体観測した CR rate-limit detection の silent regression を修正:

旧実装 (= silent regression の原因):
- src/check-ci-coderabbit/src/main.rs:251 RATE_LIMIT_MARKER = 'Rate limit exceeded' 単一固定
- is_rate_limit_comment() が現行 CR の新フォーマットを検出できず常に false 返却
- extract_wait_time() が 'Please wait N minutes and M seconds' のみ対応
- 結果: cli-pr-monitor の RateLimitOutcome::Parked 経路 (ADR-018 設計) が完全無効化、
  通常 review_recheck 経路で 5 分単位 polling に fallback (PR #182 で 30+ 分浪費を実観測)

修正:
- RATE_LIMIT_MARKER (const &str) → RATE_LIMIT_MARKERS (const &[&str]) を multi-variant 配列化
  - 旧 marker: 'Rate limit exceeded' (backward compat)
  - 新 marker: 'rate limited by coderabbit.ai' (HTML マーカー、PR #182/#184 で実観測)
- is_rate_limit_comment() を multi-variant check に refactor
- extract_wait_time() に新フォーマット regex を追加
  - 新 format: 'More reviews will be available in N minutes and S seconds'
  - 旧 format も backward compat 維持

注: ADR-039 experimental feature pattern は本タスクには不適用 (rate-limit detection は
ADR-018 で既に決定済の standard feature であり experimental ではない)。

Bundle CR-RL の機械強制層。test 層 (順位 168) と docs 層 (順位 169) は後続 commit。
順位 167 と pair の test 層。RATE_LIMIT_MARKERS 配列化 + extract_new_format_wait_time の
backward compat 保証 + silent regression 防止用 regression gate を確立。

追加 fixture (旧 6 fixture は backward compat のため維持):
- 新 format 標準形: HTML マーカー + Review limit reached + N minutes and S seconds
- 新 format 短縮形: HTML マーカー + N minutes only
- 旧 + 新混在: 同一 PR に 2 種類の rate-limit comment が時系列で混在するケース

memory feedback_test_dry_antipattern 適用 (各 fixture 独立 setup、共通 helper 化しない)。
…ク更新手順を codify (順位 169 採用、T3-#1)

Bundle CR-RL の docs/ADR 層。順位 167 (機械強制層) + 168 (test 層) と同 PR で land。

ADR-034 追加 section: 既知 CR rate-limit format 一覧 + 検出 logic 更新手順
  - 既知 format (発見時期昇順): 旧 'Rate limit exceeded' + 新 'rate limited by coderabbit.ai'
  - format 変更時の更新手順 (6 step: 観測 → grep → marker 配列 append → regex 追加 → fixture 追加 → ADR-034 update)
  - HTML マーカー優先の理由 (heading 文言や本文より stable な可能性)

ADR-018 lines 185-186 更新:
  - 旧 marker 単一前提の description を「順位 167 で multi-variant 対応済、詳細は ADR-034 参照」に書き換え
  - rate-limit 経路の設計根拠は ADR-018 維持、format detection 詳細は ADR-034 に集約

将来 CR が format 変更時に同じ silent regression を回避する永続 reference 層を確立。
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 286cb19f-4f24-4a8c-af88-0eff74f4309e

📥 Commits

Reviewing files that changed from the base of the PR and between 3f00f87 and 4743c5a.

📒 Files selected for processing (5)
  • docs/adr/adr-018-pr-monitor-takt-migration.md
  • docs/adr/adr-034-coderabbit-auto-monitoring.md
  • docs/todo-summary.md
  • docs/todo9.md
  • src/check-ci-coderabbit/src/main.rs

📝 Walkthrough

Walkthrough

PR は CodeRabbit の rate-limit コメント検出を複数フォーマット対応へ拡張し、待機時間抽出を旧・新フォーマットの専用関数に分割した改善と、新規 experimental feature 追加時の 4 点整合チェックリストを追加した。

Changes

Rate-limit detection multi-format support

Layer / File(s) Summary
Rate-limit detection strategy documentation
docs/adr/adr-034-coderabbit-auto-monitoring.md, docs/adr/adr-018-pr-monitor-takt-migration.md
ADR-034 で walkthrough comment の body/updated_at を直接 polling する方式へ移行。多段階の RATE_LIMIT_MARKERS と regex により旧・新フォーマットを判定し、format drift 時の marker・regex・fixture・ADR 表更新の標準手順を明記。ADR-018 の transient failure table を RATE_LIMIT_MARKERS + reset_time 判定に更新。
Multi-format rate-limit marker and wait-time extraction
src/check-ci-coderabbit/src/main.rs
RATE_LIMIT_MARKERS を複数マーカー対応へ変更し、待機時間抽出を extract_old_format_wait_timePlease wait ...)と extract_new_format_wait_timeMore reviews will be available in ...)に分割。共通関数 extract_wait_time が両フォーマットをフォールバック実装。
Multi-format detection and mixed-format tests
src/check-ci-coderabbit/src/main.rs
新フォーマット(HTML マーカー付き)検出テストと、旧・新混在時に最新コメント採用により wait 値を決定することを検証。

Experimental feature lifecycle checklist

Layer / File(s) Summary
ADR-039 experimental feature checklist expansion
docs/todo9.md
新規 feature 追加時に schema・feature flag・docs example・disabled test の 4 点整合を self-review で機械的に確認する ADR-039 チェックリスト定義。PR #184 の実例、grandfathered case、作業計画、完了基準を記載。
Checklist reference in execution order summary
docs/todo-summary.md
推奨実行順序サマリー表に ADR-039 checklist 拡張タスク(順位 174)を参照行として追加。

Possibly related PRs

  • aloekun/claude-code-hook-test#102: cli-pr-monitor の rate-limit skip logic が rate-limit comment 認識に依存し、本 PR で check-ci-coderabbit の rate-limit marker 検出・待機時間抽出が改善されることで連携。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 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 タイトルは、CR rate-limit detection の新フォーマット対応という主要な変更を明確に説明しており、ドキュメント更新や TODO 追加も含む複数の関連タスクを参照している。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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 and usage tips.

@aloekun
aloekun merged commit 7f8b613 into master May 29, 2026
1 check passed
@aloekun
aloekun deleted the feat-bundle-cr-rl branch May 29, 2026 13:42
aloekun added a commit that referenced this pull request May 29, 2026
…+ todo10.md 新設 (#186)

PR #185 post-merge-feedback 採用 (2026-05-29 ユーザー承認):
- 順位 175 (T1-#1): cargo clippy を stop_quality ステップに追加 (Rust lint structural gap 補填)
- 順位 176 (T2-#4): check-ci-coderabbit format extraction 関数への variant fixture 追加

user 追加要望 (2026-05-29):
- 順位 177: PostToolUse hook — Edit/Write したファイルのサイズ閾値超過検出 + 分割促進

Phase D dogfood 採用 (2026-05-30 ユーザー承認、週次レビュー 2026-05-30 実行):
- 順位 178 (週次レビュー S02): state.rs behavioral invariant test を ADR-041 pattern で追加
- 順位 179 (週次レビュー S03): rate-limit retry decision boundary test を rstest parameterized で追加
- 順位 180 (週次レビュー C01): lib-report-formatter に markdown pipe / newline escape を追加 (prompt injection 防御)
- 順位 181 (Phase D dogfood D-A): aggregate-weekly facet の findings.json 出力を raw JSON にする (facet output bug fix)
- 順位 182 (Phase D dogfood D-B): /weekly-review skill に重複検出 (簡易 grep + 3 択 AskUserQuestion) を Phase 4 で追加

Phase D dogfood 実行サマリー (handoff doc § 4 e2e 検証):
- takt workflow weekly-review 起動 → 22m 52s 完走 → 12 findings 検出 (high 1 / medium 5 / low 6)
- Phase C skill flow を実観測:
  - Phase 0 (pending file + failed marker 検出): clean state
  - Phase 1 (takt 起動): pre-state 書込 → background 実行
  - Phase 2 (成果物 copy): .takt/runs/ → .claude/weekly-reviews/2026-05-30.md + pending JSON 構築
  - Phase 3 (採否選択): user 承認経由で 5 件採用 (S02/S03/C01/D-A/D-B)
  - Phase 4 (todo 展開): 順位 178-182 として docs/todo10.md に追加 (順位 N system pattern 採用、ADR-031 「週次レビュー採用 (date)」section ではなく既存 priority table integration 重視)
  - Phase 5 (state file 更新): pending JSON consume + last-run timestamp 書込
- 観測した skill 改善点 (= 順位 181 / 182 として codify):
  - findings.json が  フェンス wrap で出力 (facet 出力 bug、skill 内手動 strip workaround)
  - WR-2026-05-30-S05 が既存 順位 173 と完全重複 (重複検出 MVP 未実装の実証)

不採用 / 様子見 (analyzer 推奨を user 承認、2026-05-30):
- 週次レビュー S01 / C02 / C03: 様子見 (large refactor / overflow practical mitigated / future-only risk)
- 週次レビュー S04 / S05 / S06 / S07 / S08 / A01: 却下 (YAGNI / 重複 / 既存 comment で intent 明確 / serde idiomatic / docs trivial drift)

todo10.md 状態:
- 17KB → 34KB (5 entries 追加後)、50KB threshold まで余裕
- 既存 todo.md / todo2.md 〜 todo9.md は引き続き有効、相互独立

メタ評価: 本セッション (#181#182#183#184#185) 5 PR chain + Phase D dogfood で計 28 件の todo 採用 (post-merge-feedback 22 件 + user 主導 1 件 + 週次レビュー dogfood 5 件)、Phase B 設計の self-reinforcing detection loop が **full session 単位での dogfood cycle complete** を実証。本 commit は Phase D 完了 + Phase E (試験運用 1-2 週 dogfood + ADR-031 本採用化 + handoff retire) に carry-forward する状態。
aloekun added a commit that referenced this pull request Jun 3, 2026
…nup (#193)

* docs(adr-031): § Adoption Criteria threshold 追加 + ADR-039 cross-ref (PR #192 T3-#5)

PR #192 post-merge-feedback Tier 3 #5 採用。Phase E land 時 § 採用判定の根拠 は
観測値の記録のみで「閾値」が暗黙だった。5 閾値 (採用率 ≥ 40% / wall-clock ≤ 10 分 /
FP ≤ 5% / context 圧迫なし / systemic 検出力) を ADR-031 inline で永続記録、
将来 trial ADR の採用判定で参照可能化。

ADR-039 § 関連 にも back-link を追加し双方向 link 形成、§ Bounded lifetime の
3 値判定 (採用 / 却下 / 継続) の具体化例として参照可能。Tier 3 #6 (ADR-039 audit)
の価値も部分吸収。

* docs(todo): Bundle CR-RL stale entry cleanup (順位 167/168/169 — PR #185 で land 済)

PR #185 (commit 7f8b613) で Bundle CR-RL の実装 3 件は全て land 済:
- 順位 167: RATE_LIMIT_MARKERS multi-variant 配列化 (main.rs:261)
- 順位 168: 新 format fixture 3 variant (full / minutes-only / mixed)
- 順位 169: ADR-018 lines 185-186 multi-variant 表記 + ADR-034 § 既知 format 一覧 + § 検出 logic 更新手順

todo9.md / todo-summary.md の stale entry を削除して in-progress を反映。
memory feedback_verify_task_not_already_done の本来用途 (= 既 land 済タスクを
stale entry 削除に再目的化) を実適用。
aloekun added a commit that referenced this pull request Jun 3, 2026
* feat(hooks): merge 前 mechanical gate 強化 (Bundle 順位 175 + 155)

- 順位 175: stop_quality / quality_gate に `cargo clippy --workspace -- -D warnings` step 追加
  (PR #185 Tier 1 #1、Rust lint structural gap 補填)
- 順位 155: cli-pr-monitor fix chain 末尾に `master..@` 範囲の空 commit sweep 追加
  (PR #174 Tier 1 #1、kqvluqyv 事例の構造的予防)
- 前提として既存 clippy errors 5 件を併せて修正
  (question_mark / doc_lazy_continuation x3 / manual_strip)

新規テスト: parse_empty_change_ids 4 unit + sweep_empty_commits_in_pr_range 統合 2 件

* docs(todo): 順位 175 + 155 完了に伴い削除

* fix(review): apply CodeRabbit fixes for #194

Resolved findings:
- [Minor] push-runner-config.toml:64 コメント説明が最新の設定と矛盾しています。
- [Major] src/cli-pr-monitor/src/fix_commit.rs:248 削除対象の revset が広すぎます。
- [Minor] src/cli-pr-monitor/src/fix_commit.rs:238 `jj log` の結合出力をそのまま change_id 一覧として parse しないでください。
- [Major] src/cli-pr-monitor/src/stages/repush.rs:169 新しい sweep を `master` 固定・常時有効で配線しないでください。
- [Major] src/hooks-pre-tool-validate/src/main.rs:847 `behind` 判定不能時に gate をバイパスしており fail-closed 契約に反しています
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 で表現)
aloekun added a commit that referenced this pull request Jun 12, 2026
…exception codify (PR #203 follow-up) (#204)

* docs(todo): 順位 198 を PR #203 T3-1 採用で 3 観測目に昇格

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。

* docs(adr-039): mechanical lint exception を § 1.b として明記 + checklist 上位判定追加

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/`
配下ではないため)。

* docs(adr-007): Layer 0.5 file_size_check 追記を削除

順位 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 改訂で対応する。

* fix(hooks-config): file_size_check を default ON 化 + 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 も完了させる

* docs(todo): todo10.md を分割して file_size_check 50KB threshold 内に収める

本 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 に集約)。
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