Skip to content

docs: A01 fix (8 ADR ephemeral todo 参照を permanent reference に置換) + Bundle CR-RL 採用 3 件#183

Merged
aloekun merged 2 commits into
masterfrom
docs-adr-ephemeral-refs-fix-A01
May 29, 2026
Merged

docs: A01 fix (8 ADR ephemeral todo 参照を permanent reference に置換) + Bundle CR-RL 採用 3 件#183
aloekun merged 2 commits into
masterfrom
docs-adr-ephemeral-refs-fix-A01

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 29, 2026

Summary

PR #182 Phase B dogfood で検出された finding WR-2026-05-29-A01 (Severity High、Category adr-alignment) の修正に加え、同 PR の post-merge-feedback で採用された Bundle CR-RL 3 件を todo に登録する 2-commit PR。

A01 は「8 永続 ADR が docs/todo*.md の section / 順位 N / Phase A-F 等の ephemeral artifact を直接参照しており、docs-governance.md § Retirement Workflow で todo entry が削除された際に silent dead pointer 化する systemic documentation drift」。Phase B dogfood で 架空ではなく実体ベース で発見された first finding。

含まれる commits (2 件)

1. docs(todo): PR #182 post-merge-feedback Bundle CR-RL 採用 3 件 + 順位 165 補足追記

PR #182 post-merge-feedback で採用された 3 件 (2026-05-29 ユーザー承認):

3 件は Bundle CR-RL タグで同 PR land 推奨 (機械強制層 + test 層 + 永続 ADR 層の 3 層補強)。本 session で実体観測 = PR #182 の monitor が 30+ 分間 rate-limit 未検出で polling 継続した root cause が RATE_LIMIT_MARKER = "Rate limit exceeded" という旧フォーマット固定値だった (現行 CR は <!-- rate limited by coderabbit.ai --> HTML マーカー + ## Review limit reached heading)。

加えて 順位 165 補足追記: PR #182 T2-#2 候補 (pnpm-create-pr-body-guard hook test) は順位 165 と scope 重複のため独立 entry 化せず本 entry に集約、supplementary fact (PR #134 で同 hook 採用判定済だが未実装の stale state) を追記。

2. docs(adr): 8 ADR の ephemeral todo 参照を permanent reference に置換 (A01 fix)

修正方針 (analyzer 推奨 3 strategy):

  1. ADR cross-references — 別 ADR に decision がある場合
  2. PR # references — git log で origin が trackable な場合
  3. Inlined constraints — detail が小さい場合

各 ADR の修正:

ADR 修正 strategy
022 parenthetical pointer 削除 (1 行) inline
023 "docs/todo.md or PR description" → "PR description" (2 行) permanent artifact only
028 "docs/todo.md #7" → "PR #59 で land、#62 移管" (1 行) PR #
029 task pointer 削除 + ADR-030 supersede note (3 箇所) ADR cross-ref
030 Phase A-F section pointer → 各 PR # 列挙 (PR #75/77/80/154) + Phase E/F priority table 化 PR # + priority table
031 Phase A-F section pointer → PR #182 + priority table PR # + priority table
033 grep procedure hardcoded list → glob (docs/todo*.md) glob-ize
034 "todo-summary/todo4 エントリ" section 全面再構成 + 新セッション checklist 再設計 PR # primary + grep-based

Operational reference として保持した箇所

修正外として残したもの (= 「workflow behavior の記述」と「intrinsic な topic 言及」):

  • ADR-031 lines 79-302 の workflow 動作記述 (todo.md に書き込む / セクション作成する behavior)
  • ADR-033 lines 1-131 (本 ADR 自体が todo.md 管理 ADR、intrinsic)
  • ADR-034 lines 195-198 (Bundle b との関係 table、順位 N と PR # が pair で記載されているため permanent reference あり)

Phase B dogfood の意義 (メタ評価)

本 PR は Phase B (PR #182) の最初の dogfood が実体ベース finding を検出した実例。weekly-review pipeline が設計通り「whole-tree でしか見えない adr-alignment systemic drift」を検出 → ユーザー承認 → 実体修正 = self-reinforcing detection loop が機能した。

dry-run finding 5 件中 A01 (本 PR) を最優先で消化。残る 採用候補 = S01 (combine_output 5 crate dead-code) は別 PR で扱う想定。

Pre-push 検証結果

  • Quality gate (lint / test / build / rust-test): PASS
  • pre-push-review (3m 12s):
    • simplicity-review: APPROVED ("All changed lines implement the docs-governance pattern. No anomalies were introduced by this diff.")
    • security-review: APPROVED

Reviewer non-blocking notes (false alarm 確認済)

reviewer が 3 件の "pre-existing typos" を context 部分に指摘:

  • adr-023:54 簡易カウント簡易カウント
  • adr-029:191 NTFS sentence 重複
  • adr-030:424 数回後数回後

実ファイル内容に重複なし (= reviewer が diff context の before+after を誤読した false alarm)。実 grep で確認済。本 PR では対応不要。

Test plan

  • pnpm push で quality_gate + pre-push-review が全 PASS
  • 8 ADR 修正後の grep verification で operational vs pointer reference の区別が clean (todo*.md / 順位 N 残存は意図的 = operational のみ)
  • CodeRabbit が 8 ADR を docs-only として処理 (ADR-035 path 基準: docs/adr/**.md は docs-only criteria 適用)
  • CI green 確認後 merge 判断

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Documentation
    • 複数の設計ドキュメント(ADR)の記述を更新し、実装タスクの進捗状況と具体的なPR番号を明確化しました。
    • CodeRabbitレート制限検出の新しいフォーマット対応に関するタスクを追加しました。
    • 内部プロセスの標準化と参照の統一を実施しました。

Review Change Stack

aloekun added 2 commits May 29, 2026 14:18
…補足追記

採用: PR #182 post-merge-feedback (2026-05-29 ユーザー承認):
- 順位 167 (T1-#1): check-ci-coderabbit の RATE_LIMIT_MARKER を新フォーマット対応に更新
- 順位 168 (T2-#1): CR rate-limit detection integration test の新旧 fixture
- 順位 169 (T3-#1): ADR-018 / ADR-034 に CR rate-limit format evolution 同期戦略 codify

3 件は Bundle CR-RL タグで同 PR land 推奨 (機械強制 + test 層 + 永続 ADR 層の 3 層補強)。

順位 165 補足追記:
- PR #182 T2-#2 採用候補 (pnpm-create-pr-body-guard hook test) は本 165 と scope 重複のため独立 entry 化せず本 entry に集約
- supplementary fact: PR #134 で pnpm-create-pr-body-guard hook 採用判定されたが未実装の state (= stale unfulfilled adoption、feedback-reports/134.md Tier 1 #1)
- 165 着手時に hook 実装済なら test 範囲を 2 層 (--body-file workaround verify + guard hook 動作 verify) に拡張
…x、Cross-File Reference Lifecycle 違反修正)

PR #182 Phase B dogfood で検出された finding WR-2026-05-29-A01 (Severity High、Category adr-alignment) の修正。
8 永続 ADR が docs/todo*.md の section / 順位 N / Phase A-F 等の ephemeral artifact を直接参照しており、
docs-governance.md § Retirement Workflow で todo entry が削除された際に silent dead pointer 化する
systemic documentation drift の構造修正。

修正方針 (analyzer 推奨 3 strategy):
1. ADR cross-references — 別 ADR に decision がある場合
2. PR # references — git log で origin が trackable な場合
3. Inlined constraints — detail が小さい場合

各 ADR の修正:
- ADR-022 line 197: parenthetical pointer 削除 (operational guideline は self-contained で完結)
- ADR-023 lines 54, 86: "docs/todo.md or PR description" → "PR description" (permanent artifact のみに集約)
- ADR-028 line 186: "docs/todo.md #7" → "PR #59 で land、PR #62 で global skill 移管"
- ADR-029 lines 191, 240, 266: task pointer 削除 + ADR-030 supersede note
  (本 ADR は ADR-030 partial supersede 対象、実装系譜は ADR-030 に集約)
- ADR-030 line 417: Phase B-F section pointer → 各 Phase の land 済 PR # (PR #75/77/80/154) を直接列挙、
  Phase E/F は priority table 参照 (specific 順位 番号は避ける)
- ADR-031 line 270: Phase A-F section pointer → PR #182 + priority table (順位 8 は trackable level の言及)
- ADR-033 line 111: grep procedure hardcoded list (todo.md/2/3) → glob (todo*.md)
  本 ADR land 時から todo4-9 が追加されており hardcode list は既に stale
- ADR-034: "todo-summary.md / todo4.md エントリ" section + "新セッションで最初に確認すべきこと"
  を全面再構成、4 component の land 状況を PR # primary table 化 (旧 順位 42 = PR #113 等)、
  新セッション checklist を ADR-018 + memory + grep ベースに置換

修正外 (operational reference として保持):
- ADR-031 lines 79, 84, 96, 121, 185, 189-191, 205, 207, 240, 242, 251, 302: workflow が
  todo.md に書き込む / セクション作成する behavior 記述 (pointer ではない operational description)
- ADR-033 lines 1, 11, 24, 93, 100, 130, 131: ADR 本体が todo.md 管理がテーマのため intrinsic
- ADR-034 lines 195-198 (Bundle b との関係 table): 順位 N と PR # / Bb-N が pair で書かれているため
  permanent reference (PR #) が常にあり、dead pointer リスクなし
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

複数の ADR ドキュメントと todo テーブルを更新し、docs/todo.md への参照を整理して PR description や permanent artifact へ移行し、実装フェーズを具体化、CR rate-limit 検出をタスク化する。

Changes

Documentation and Task Tracking Updates

Layer / File(s) Summary
ADR 参照先統一化
docs/adr/adr-022-automation-responsibility-separation.md, docs/adr/adr-023-coderabbit-reject-thread-skill.md, docs/adr/adr-028-pnpm-create-pr-gate.md, docs/adr/adr-029-post-merge-feedback-auto-trigger.md
複数 ADR から実装タスク参照(docs/todo.md)を削除、PR description タグの記録先統一化、atomic rename の環境制限(Windows 10 1607+ / NTFS)明記、ADR-030 による再設計を追記。
実装フェーズの具体化
docs/adr/adr-030-deterministic-post-merge-feedback.md, docs/adr/adr-031-weekly-review-pipeline.md
ADR-030 の Phase A–F に具体的な PR 番号(#75, #77, #80, #154 等)を明記、参照先を docs/todo-summary.md へ統一、ADR-031 の Phase A–E 状態と land 条件を箇条書きで整理。
検証・監視スキーマの拡張
docs/adr/adr-033-todo-numbering-simplification.md, docs/adr/adr-034-coderabbit-auto-monitoring.md
ADR-033 の 順位 検証ルールを docs/todo*.md glob 対応に変更、ADR-034 に Bundle a 監視状況と次セッション開始時チェックリストを追加。
CR rate-limit 機能タスク化
docs/todo-summary.md, docs/todo9.md
docs/todo-summary.md に RATE_LIMIT_MARKER 新フォーマット対応タスク(順位 167–169)追加、docs/todo9.md で pnpm-create-pr-body-guard 補足、rate-limit マーカー配列化・時刻パース拡張・統合テスト・ADR codify を含む複数エントリを追加。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 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タイトルは、8つのADRの一時的なtodo参照を永続的な参照に置換する作業(A01 fix)とBundle CR-RL採用の3件という、本PRの主要な2つの変更内容を簡潔かつ具体的に表現しており、変更内容と一致している。
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.

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


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/todo9.md (2)

865-902: 💤 Low value

テスト設計は健全だが、行番号参照に注意。

Line 872 で既存 fixture の配置を lines 1298-1370 と具体的な行番号範囲で参照していますが、これは将来のコード変更で無効になる可能性があります。ただし、fixture の設計(新旧両フォーマット対応、3 variant、独立 setup)は適切で、memory feedback_test_dry_antipattern の適用も正しく記載されています。

行番号参照は本タスク実装時の navigation に有用ですが、長期的には #[cfg(test)] モジュール内の関数名での参照がより安定します。

🤖 Prompt for 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.

In `@docs/todo9.md` around lines 865 - 902, The doc references hardcoded line
numbers (lines 1298-1370) which will drift; update the text to reference the
stable #[cfg(test)] module and the specific test helpers/functions (e.g.,
is_rate_limit_comment, parse_rate_limit, RateLimitInfo, and the test fixture
block in the #[cfg(test)] module) instead of numeric line ranges, and mention
locating the fixtures by those symbol names; keep the rest of the fixture design
(3 variants, independent setups, feedback_test_dry_antipattern) unchanged.

905-948: 💤 Low value

ADR 更新戦略は適切だが、行番号参照の脆弱性に注意。

Lines 911-912 で ADR-034 の line 64 および ADR-018 の lines 185-186 を具体的に参照していますが、ADR ドキュメント自体が更新されると行番号がずれる可能性があります。

提案されている内容自体(既知 format 一覧、検出ロジック更新手順の codify)は永続的なドキュメント層として適切で、将来の format 変更に対する構造的予防策として機能します。実装時には行番号ではなくセクション見出しでの参照を検討することを推奨します。

🤖 Prompt for 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.

In `@docs/todo9.md` around lines 905 - 948, Replace fragile line-number references
with stable section-heading anchors: update the todo entry that currently
references ADR-034 and ADR-018 by line numbers so it instead cites specific
section headings (e.g., "Known CR rate-limit formats" in ADR-034 and "PR monitor
rate-limit description" in ADR-018) and, where helpful, add explicit markdown
anchors to those sections; also update any cross-references in the ADRs and
related docs so code symbols like is_rate_limit_comment() and RATE_LIMIT_MARKERS
and the new "Known format" / "Detection update procedure" sections are
referenced by heading/anchor names rather than numeric lines to avoid breakage
when files change.
🤖 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.

Nitpick comments:
In `@docs/todo9.md`:
- Around line 865-902: The doc references hardcoded line numbers (lines
1298-1370) which will drift; update the text to reference the stable
#[cfg(test)] module and the specific test helpers/functions (e.g.,
is_rate_limit_comment, parse_rate_limit, RateLimitInfo, and the test fixture
block in the #[cfg(test)] module) instead of numeric line ranges, and mention
locating the fixtures by those symbol names; keep the rest of the fixture design
(3 variants, independent setups, feedback_test_dry_antipattern) unchanged.
- Around line 905-948: Replace fragile line-number references with stable
section-heading anchors: update the todo entry that currently references ADR-034
and ADR-018 by line numbers so it instead cites specific section headings (e.g.,
"Known CR rate-limit formats" in ADR-034 and "PR monitor rate-limit description"
in ADR-018) and, where helpful, add explicit markdown anchors to those sections;
also update any cross-references in the ADRs and related docs so code symbols
like is_rate_limit_comment() and RATE_LIMIT_MARKERS and the new "Known format" /
"Detection update procedure" sections are referenced by heading/anchor names
rather than numeric lines to avoid breakage when files change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a330ee2a-7bb1-4168-be53-06d4f0150c51

📥 Commits

Reviewing files that changed from the base of the PR and between 1ae6fb3 and e1a888e.

📒 Files selected for processing (10)
  • docs/adr/adr-022-automation-responsibility-separation.md
  • docs/adr/adr-023-coderabbit-reject-thread-skill.md
  • docs/adr/adr-028-pnpm-create-pr-gate.md
  • docs/adr/adr-029-post-merge-feedback-auto-trigger.md
  • docs/adr/adr-030-deterministic-post-merge-feedback.md
  • docs/adr/adr-031-weekly-review-pipeline.md
  • docs/adr/adr-033-todo-numbering-simplification.md
  • docs/adr/adr-034-coderabbit-auto-monitoring.md
  • docs/todo-summary.md
  • docs/todo9.md

@aloekun aloekun merged commit 193b876 into master May 29, 2026
1 check passed
@aloekun aloekun deleted the docs-adr-ephemeral-refs-fix-A01 branch May 29, 2026 06:12
aloekun added a commit that referenced this pull request May 29, 2026
…der + facet P-1 fix (ADR-031) (#184)

* docs(todo): PR #183 post-merge-feedback 採用 3 件 (順位 170-172、Bundle DG-RULES)

採用: PR #183 post-merge-feedback Tier 3 #1/#2/#3 (2026-05-29 ユーザー承認):
- 順位 170 (T3-#1): git-workflow.md § Multi-PR chaining 拡張 — 1 PR 内 multi-commit + intent 明記
  Frequency High (PR #119/#120/#121 + #183 の 4 観測)、~/.claude/ global 編集、派生プロジェクトへ自動波及
- 順位 171 (T3-#2): docs-governance.md に Operational vs Pointer reference 区別 section 追加
  本 PR (#183) A01 修正で実適用した判定ロジックを codify、Bundle DG-RULES
- 順位 172 (T3-#3): CR ephemeral artifact Nitpick の統一 skip 基準を新 memory に codify
  本 PR で実施した Nitpick skip 判断 codify、Bundle DG-RULES、本リポジトリ専用

171 + 172 は Bundle DG-RULES として同 PR land 推奨 (docs/rule + memory の 2 層補強)。

メタ評価: 3 採用候補すべてが本セッション (#181-#183 chain) の dogfood で実体観測された
行動パターンの codify — Phase B 設計の self-reinforcing detection loop が機能した実例。

実装時の前提:
- 170/171 は ~/.claude/ global 編集のため feedback_global_config_backup 適用必須
- 172 は ~/.claude/projects/.../memory/ 編集、本リポジトリ専用 (派生展開なし)

* docs(todo): 順位 173 (S01) 追加 — PR #182 dry-run の combine_output dead-code finding

* feat(phase-c): /weekly-review skill + SessionStart hook reminder + facet P-1 fix (ADR-031 Phase C)

ADR-031 Phase C を実装。Phase B (PR #182) で land した takt workflow weekly-review を
オーケストレートする skill と、~7 日経過 / failed marker 残存時に additionalContext で
promote する SessionStart hook reminder + PR #182 pre-push P-1 finding (facet report_path
drift) の修正を bundle。

Component A: skill /weekly-review (本リポジトリ内では非追跡、~/.claude/skills/weekly-review/SKILL.md として配置)
  - Phase 0: pending JSON 先読み + failed marker 検出 (resume / new run 判別)
  - Phase 1: pnpm exec takt -w weekly-review 起動 + pre-state 書込
  - Phase 2: Report Directory → .claude/weekly-reviews/<date>.md + pending JSON 構築
  - Phase 3: AskUserQuestion (multiSelect, severity-grouped) で採否一括選択
  - Phase 4: 採用 finding を docs/todo.md 「## 現在進行中」配下に新セクション展開
  - Phase 5: pending JSON consume + last-run timestamp 書込 + failed marker cleanup
  - Phase 6: 完了サマリー表示
  - best-effort 失敗ポリシー (ADR-031 §): .failed marker で次セッション SessionStart promote

Component B: SessionStart hook の weekly_review_reminder sub-feature
  - src/hooks-session-start/src/main.rs に WeeklyReviewReminderConfig 追加
  - 2 nudge 経路: (1) last-run mtime > threshold_days (default 7)、(2) failed marker 残存
  - 両方該当時は 1 nudge にまとめて出力
  - 関数 50 行制約に対応するため build_*_lines helper を分離 (compute_weekly_review_reminder_nudge を 30 行に圧縮)
  - 6 新規 unit test (disabled / 失敗 marker 列挙 / staleness 発火 / failed 発火 / config parse / dir 不在)
  - .claude/hooks-config.toml に [session_start.weekly_review_reminder] section 追加 (enabled = true で opt-in、ADR-039 experimental pattern)

Component C: aggregate-weekly.md の report_path documentation drift (P-1) 解消
  - PR #182 pre-push simplicity reviewer Anomaly 1 (Medium / non-blocking) を Phase C 着手時に対応
  - findings JSON の report_path が指す .claude/weekly-reviews/<date>.md は Phase C skill が
    copy する canonical location である旨を facet instruction で明示
  - skill 未実装 (= Phase B のみ稼働) 時は dead pointer になるが Phase C land 後に realize される
    forward-pointing 記述として位置付けを明文化

ユーザー判断 (2026-05-29):
  - Q1 MVP scope: A (skill + hook + facet fix 3 component を同 PR で land)
  - Q2 failed marker recovery: A (含める、ADR-031 § 失敗ポリシー 完全実装)
  - Q3 Bundle CR-RL 先行: A (Phase C 先行、Bundle CR-RL = 順位 167-169 は別 PR)

Phase D (e2e 検証) / Phase E (試験運用 dogfood) は別 PR で carry-forward、docs/handoff-weekly-review-phase-c-onwards.md § 4 で trackable。

* docs(handoff): Phase B handoff retire + Phase C 以降向け 新規 handoff 作成

Phase B (PR #182) land により handoff-rank-8-weekly-review-phase-b.md の retirement
条件 (本 doc § 11) を満たしたため、Phase C 以降向けの carry-forward doc を
新規作成し、本 doc を物理削除する。

新ファイル: docs/handoff-weekly-review-phase-c-onwards.md
- Phase B 完了状況の summary table (carry-forward 用)
- 7 観点責務 mapping (Phase C/D/E でも適用)
- Phase C/D/E 工程計画 (旧 doc § 4 から carry-forward)
- 重要な設計判断 (旧 doc § 5 + 本セッションでの実証 update)
- Phase C 着手時の memory rule (旧 doc § 7 carry-forward)
- Phase C 着手前提として Bundle CR-RL (順位 167-169) land 推奨

旧ファイル削除: docs/handoff-rank-8-weekly-review-phase-b.md
- 永続価値 (7 観点 mapping、ユーザー判断記録、参照リソース) は新 doc に移管
- 残タスク (Phase C/D/E) は todo-summary.md 順位 8 で trackable + 新 doc § 4
- 永続参照リンクは grep -rn 'handoff-rank-8' で本 doc 自身のみ確認
- docs-governance.md § Retirement Workflow 4 step に整合

* fix(phase-c): CR Major auto-fix — weekly_review_last_run の fail-open 修正 (Missing vs Unreadable 分離) for #184

CodeRabbit Major (auto-fix mandate per memory feedback_review_severity_auto_fix):
src/hooks-session-start/src/main.rs:513 weekly_review_days_since_last_run の
失敗時 Option<u64>::None 経由で fail-open 方針と逆の挙動 (mtime 取得失敗が
staleness ヒット扱い、誤 nudge を毎回生成)。

修正:
- enum WeeklyLastRunState { Missing, ElapsedDays(u64), Unreadable } 導入で
  3 状態を明示分離
- Missing (= 未実行 / 初回) → reminder 発火 (初回利用ナビ)
- ElapsedDays(d) → d >= threshold で発火
- Unreadable (= 権限エラー等) → reminder 抑制 (fail-open、ユーザーを誤通知で煩わせない)

test 追加 (memory feedback_test_dry_antipattern 適用、各 variant 独立):
- weekly_review_staleness_hits_for_missing_state
- weekly_review_staleness_hits_for_elapsed_above_threshold
- weekly_review_staleness_skips_for_elapsed_below_threshold
- weekly_review_staleness_skips_for_unreadable_state (CR finding の fail-open 回帰防止)

検証: cargo test -p hooks-session-start で 58 tests pass (4 new + 54 existing)、
cargo clippy -p hooks-session-start --release -- -D warnings clean。

* fix(phase-c): CR Major M-2 + Minor N-1 auto-fix for #184

CodeRabbit re-review (commit 30f19f5 = 前 fix commit) で post された 2 件を修正:

M-2 (Major, ADR-039 違反): weekly_review_reminder の default を OFF に変更
  - .claude/hooks-config.toml line 36: enabled = true → enabled = false
  - 理由: ADR-039 experimental feature standard pattern (config opt-in 契約) に整合
  - opt-in = repo config で明示 enable する運用、source の default は OFF
  - memory feedback_review_severity_auto_fix 適用 (Major 無条件自動修正)

N-1 (Minor, docs 正確性): handoff doc に failed marker 経路を追記
  - docs/handoff-weekly-review-phase-c-onwards.md line 55-56
  - SessionStart reminder の 2 経路 (7 日経過 + failed marker 検出) を明示記述
  - 実装契約と docs の整合を確保、Phase C 以降の仕様理解ずれを構造的に防止

検証: cargo test -p hooks-session-start 全 58 tests pass (binary 変更なし、config のみ)、
markdownlint clean。
aloekun added a commit that referenced this pull request May 29, 2026
…9) + 174 (#185)

* docs(todo): PR #184 post-merge-feedback 採用 1 件 (順位 174、T3-2 = ADR-039 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 採用分の完結。

* feat(rate-limit): check-ci-coderabbit の rate-limit detection を CR 新フォーマット対応に拡張 (順位 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。

* test(rate-limit): CR 新フォーマット fixture を 3 variant 追加 (順位 168 採用、T2-#1)

順位 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 化しない)。

* docs(adr): ADR-034 / ADR-018 に CR rate-limit format evolution + 検出ロジック更新手順を 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 層を確立。
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 する状態。
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