Skip to content

feat(takt): 週次レビューパイプライン Phase B — workflow + 4 facets 追加 (ADR-031)#182

Merged
aloekun merged 3 commits into
masterfrom
feat-weekly-review-phase-b
May 29, 2026
Merged

feat(takt): 週次レビューパイプライン Phase B — workflow + 4 facets 追加 (ADR-031)#182
aloekun merged 3 commits into
masterfrom
feat-weekly-review-phase-b

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 29, 2026

Summary

ADR-031 (週次プロジェクト全体レビューパイプライン) の Phase B = takt workflow + 4 facets を実装。既存 3 パイプライン (pre-push-review / post-pr-review / post-merge-feedback) が見ない whole-tree 観点 (累積複雑度 / 横断的 ADR 整合性 / ハーネス遵守 / test 設計) を補完する。

PR #181 で更新した handoff doc (docs/handoff-rank-8-weekly-review-phase-b.md) の § 4 工程順に実装。MVP scope = 3 facets (handoff § 9 step 8 ユーザー承認 2026-05-29)。

含まれる commits (2 件)

1. docs(todo): 順位 165 / 166 登録

PR #181 post-merge-feedback で採用された 2 件を docs/todo9.md + docs/todo-summary.md に登録:

PR #134 + #181 の 2 観測で Medium frequency に昇格、--body-file workaround の regression gate (順位 165) と ADR codify (順位 166) で 2 layer 補強。

2. feat(takt): 週次レビューパイプライン Phase B 本体

新規 5 ファイル:

File 役割 派生元
.takt/facets/instructions/review-simplicity-whole.md whole-tree simplicity (観点 ⑥ テストロジック筆頭) review-simplicity.md から派生 (共通化不可)
.takt/facets/instructions/review-security-whole.md whole-tree security (機密漏出 / asymmetric guard / prompt injection surface) review-security.md から派生
.takt/facets/instructions/review-architecture-whole.md ADR 整合性 / モジュール境界 / ADR-012 命名 / 循環依存 (観点 ① ハーネス遵守筆頭) 新規
.takt/facets/instructions/aggregate-weekly.md 3 reports → findings JSON + markdown (採否単位の構造化) aggregate-feedback.md を参考
.takt/workflows/weekly-review.yaml parallel 3 reviewers → 1 aggregate workflow post-merge-feedback.yaml 構造流用

ユーザー判断記録 (2026-05-29 承認)

  • MVP scope: 3 facets で start (handoff § 9 step 8)
  • dry-run: 実行する (初回 dogfood で使い勝手を観測)
  • architecture-reviewer persona: 既存 (persona_sessions.json 登録済) を再利用 → 新規定義不要を本 PR の dry-run で確認

Dogfood 結果 (本 PR 内で実行済 dry-run)

pnpm exec takt -w weekly-review -t "weekly-review dry-run 2026-05-29" を実行 (14m 31s、2 iterations、全 facet APPROVED で COMPLETE)。

検出された 5 findings

ID Facet Severity Category Location Recommendation
S01 simplicity high dead-code src/cli-pr-monitor/src/runner.rs:80-89 combine_output (5 crate に重複) ✅ 採用候補
A01 architecture high adr-alignment docs/adr/ 8 件が ephemeral todo を参照 (Cross-File Reference Lifecycle 違反) ✅ 採用候補
S02 simplicity medium test-anti-pattern lint_screen_evals.rs 共有ヘルパー prospective risk 🤔 様子見
A02 architecture low adr-naming src/__tests__/, src/__pycache__/src/ 配下 🤔 様子見
C01 security low injection lib-report-formatterpr_label defense-in-depth ❌ 却下推奨

メタ検証: A01 は本 facet (architecture-whole) が設計通り「ephemeral 参照」パターンを検出した実例。Phase B 採用直後の最初の dogfood で docs-governance.md § Cross-File Reference Lifecycle ルール違反が 8 ADR で systemic に発生していることを可視化。

アーキテクチャ設計 (ADR-031 準拠)

  • edit: false (全 facet、ADR-022 原則 1)
  • model: haiku (3 reviewers) + model: sonnet (aggregate) — ADR-040 context size trade-off に整合
  • persona: 既存 simplicity-reviewer / security-reviewer / architecture-reviewer を再利用
  • workflow 構造: parallel: [3 reviewers] → aggregate-weekly (post-merge-feedback.yaml 構造流用、fix loop なし)
  • アンチパターン回避: ADR-031 § 281 (whole-tree facet を diff 用と共通化禁止) を facet 冒頭に明示

Pre-push 検証結果

  • Quality gate (lint / test / build / rust-test): PASS
  • pre-push-review (4m 18s):
    • simplicity-review: APPROVED (2 件の non-blocking anomaly 指摘 — 下記参照)
    • security-review: APPROVED (no blocking concerns)

Pre-push reviewer non-blocking findings (本 PR では未対応、follow-up 候補)

  1. report_path documentation drift (Medium, non-blocking): aggregate-weekly.md の findings JSON 例で report_path.claude/weekly-reviews/<date>.md を指すが、その path への copy 機構が未実装。Phase C skill 実装時に dead-pointer 化リスク → Phase C 着手時に「Report Directory 直読 vs. copy 機構実装」を設計判断
  2. ADR-031 § 281 line-number citation (Low, non-blocking): review-simplicity-whole.md / review-security-whole.md 冒頭で ADR-031 を line number で引用 → section name 引用が望ましい (将来の line 挿入で silent break)。1-2 行修正で済むため follow-up 候補

Phase B+1 / Phase C 先送り

  • 順位 153 (review-harness-whole 独立 facet 化) / 順位 154 (review-todo-whole + file size pre-step): dogfood 2-3 週後に着手判断
  • Phase C (skill /weekly-review + SessionStart hook reminder): 別 PR
  • 上記 non-blocking findings: Phase C 着手時または independent follow-up で対応

Test plan

  • pnpm push で quality_gate + pre-push-review が全 PASS
  • takt dry-run (weekly-review) が COMPLETE で終了、4 reports + findings.json を Report Directory に生成
  • persona architecture-reviewer が既存 session で正常起動
  • CodeRabbit が takt facet/workflow を .takt/**/*.{md,yaml} のため code-equivalent として full review 適用 (ADR-035 除外パス)
  • CI green 確認後マージ判断

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • 週次レビューワークフローを導入し、セキュリティ/アーキテクチャ/簡素性の3観点で全体スキャンして所見を集約・出力するようになりました。
  • Documentation
    • 全ツリーレビュー向けの手順・評価基準・出力ルール(所見の統合・重複処理・重大度決定など)を追加しました。
    • 実行順序や検証タスクのTODOリストに数件の追記を行いました。

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

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: 75a8c0ea-9441-4374-a58e-9666761e9981

📥 Commits

Reviewing files that changed from the base of the PR and between 71936f2 and 0d1cf7f.

📒 Files selected for processing (5)
  • .takt/facets/instructions/aggregate-weekly.md
  • .takt/facets/instructions/review-architecture-whole.md
  • .takt/facets/instructions/review-security-whole.md
  • .takt/facets/instructions/review-simplicity-whole.md
  • .takt/workflows/weekly-review.yaml
✅ Files skipped from review due to trivial changes (2)
  • .takt/facets/instructions/review-security-whole.md
  • .takt/facets/instructions/review-simplicity-whole.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • .takt/workflows/weekly-review.yaml
  • .takt/facets/instructions/review-architecture-whole.md
  • .takt/facets/instructions/aggregate-weekly.md

📝 Walkthrough

Walkthrough

このPRは ADR-031 に定義された週次 whole-tree レビューパイプラインを実装し、simplicity/security/architecture の3ファセットを parallel で実行して全ツリーのドリフト検出を行い、集約ルールで統合して findings.json と週次レポートを生成する仕組みを追加しました。


Changes

Weekly whole-tree review pipeline

Layer / File(s) Summary
Aggregation rules and output contract
.takt/facets/instructions/aggregate-weekly.md
3つの whole-tree レビューから findings を抽出し、同一 location の重複マージ、severity 正規化、品質フィルタ、recommendation 確定、採番ルールを定義。全 finding を decision: pending で出力し、AI agent はユーザー承認なしに採用/却下処理へ進まないことを明記。
Whole-tree review facet specifications
.takt/facets/instructions/review-simplicity-whole.md, review-security-whole.md, review-architecture-whole.md
simplicity: 累積的複雑さ・デッド・オン・アライバル・過剰抽象化・テストロジック異常を Criteria 0–3 で検出。security: 複数ファイルのパターンと不変条件を対象に、unsafe/外部入力/ファイル書き込み/プロセス実行等を Glob/Grep で探索。architecture: ハーネス重複・ADR整合・docs↔source 矛盾・モジュール境界を Criterion 0–4 で検出。各出力は *-whole-review.md として analysis complete で終了。
Weekly review workflow orchestration
.takt/workflows/weekly-review.yaml
reviewers step で 3 facet を parallel 起動(各々 persona/model/policy/allowed_tools 設定)。全 reviewer が analysis complete 後、aggregate-weekly で Report Directory から 3 つの *-whole-review.md を読み取り、weekly-review.mdfindings.json を出力し、集約完了で COMPLETE へ。max_steps: 10、Codex/Opencode/claude の network_access: false
PR body truncation regression task tracking
docs/todo-summary.md, docs/todo9.md
順位165: pnpm create-pr の PR body 切り詰め問題について --body-file 経由の動作確認と truncation 回帰を検出する e2e/integration test 追加計画。順位166: ADR-028 に shell/CLI argument 切り詰めの why/how(複数行 body での --body-file 推奨理由と利用手順)を追記する計画。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Possibly related PRs

  • aloekun/claude-code-hook-test#181: 週次アグリゲーション内で「AI が approval なしに決定を進めない」禁則と decision: pending 運用を強化している点で関連。
  • aloekun/claude-code-hook-test#81: ADR-031 で定義された週次 whole-tree レビューパイプライン設計と実装の連続性があるPR。
  • aloekun/claude-code-hook-test#180: aggregate フローでの auto-adopt 防止方針や採否ハンドオフの制御に関して重複する改定を含むPR。
🚥 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タイトルは「週次レビューパイプライン Phase B — workflow + 4 facets 追加」であり、raw_summary で説明されている変更内容(ADR-031 の Phase B 実装、5つの新規ファイル追加、weekly-review ワークフローの追加)と完全に一致しており、主要な変更を正確に要約している。
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.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.takt/facets/instructions/aggregate-weekly.md (1)

99-100: ⚡ Quick win

出力契約名の記述を workflow 定義と一致させてください。

ここで output contract の findings 名 と書くと、weekly-review.yamlreport -> findings.json (format: findings-json) と読み替えが必要になり混乱します。契約名は同一表現に統一した方が安全です。

🤖 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 @.takt/facets/instructions/aggregate-weekly.md around lines 99 - 100,
文章中の「output contract の `findings` 名」という表現が workflow
定義と一致しておらず混乱を招くため、ドキュメントの該当文を `weekly-review.yaml` 側で使われている表現に合わせて統一してください:具体的には
ADR-031 § Findings に準拠した出力ファイル名は `findings.json` のまま記載しつつ、出力契約名は workflow
の定義で使われている `findings-json`(`report -> findings.json (format:
findings-json)`)に揃え、どちらがファイル名でどちらが契約名かを一文で明確に区別してください。
.takt/facets/instructions/review-security-whole.md (1)

10-13: ⚡ Quick win

unsafe 探索例を再帰前提の記述に修正してください。

grep -l "unsafe " src/ だと再帰探索にならず、対象抽出が漏れます。grep -r 相当か、ツール非依存で「src/**/*.rsGrep で検索」と明記した方が運用ミスを減らせます。

🤖 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 @.takt/facets/instructions/review-security-whole.md around lines 10 - 13, The
current pattern `grep -l "unsafe " src/` is non-recursive and misses files;
update the instruction to perform a recursive search (e.g., `grep -r -n "unsafe
" src/`) or, tool-agnostic, state explicitly to search all Rust sources under
src (e.g., "search `src/**/*.rs` for the token `unsafe` using Grep/recursive
search") so `unsafe` occurrences are discovered across subdirectories; replace
the existing `grep -l "unsafe " src/` text with this clarified,
recursive/search-all-sources phrasing.
🤖 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.

Inline comments:
In @.takt/facets/instructions/review-architecture-whole.md:
- Around line 75-76: このfacetが許可された検証手段(Read/Glob/Grep)前提であるにもかかわらず「cargo tree /
cargo modules」を必須検証として挙げている問題を修正してください:該当箇所の記述("Cyclic dependencies between
crates / modules" および "Layer violations" の項目)を、実行不能なツール依存に置き換えて grep
ベースの確認手順に書き換えるか、あるいは「任意の追加検証(例: cargo tree/cargo modules
を用いた詳細解析)」として明確に分離して記載してください。README/Glob/Grep で再現可能な grep
コマンド例や検索キーワードを短く添えるか、ツール依存を補助的手段としてラベル付けして記述を一貫させてください。

In @.takt/workflows/weekly-review.yaml:
- Around line 15-21: workflow_config.provider_options currently disables
network_access for codex and opencode but not for claude; add a claude key under
workflow_config.provider_options with network_access: false (i.e., set
provider_options.claude.network_access to false) so the actual provider used by
this workflow is also restricted; update the same block that contains
provider_options.codex and provider_options.opencode and ensure indentation and
YAML structure match the existing entries.

---

Nitpick comments:
In @.takt/facets/instructions/aggregate-weekly.md:
- Around line 99-100: 文章中の「output contract の `findings` 名」という表現が workflow
定義と一致しておらず混乱を招くため、ドキュメントの該当文を `weekly-review.yaml` 側で使われている表現に合わせて統一してください:具体的には
ADR-031 § Findings に準拠した出力ファイル名は `findings.json` のまま記載しつつ、出力契約名は workflow
の定義で使われている `findings-json`(`report -> findings.json (format:
findings-json)`)に揃え、どちらがファイル名でどちらが契約名かを一文で明確に区別してください。

In @.takt/facets/instructions/review-security-whole.md:
- Around line 10-13: The current pattern `grep -l "unsafe " src/` is
non-recursive and misses files; update the instruction to perform a recursive
search (e.g., `grep -r -n "unsafe " src/`) or, tool-agnostic, state explicitly
to search all Rust sources under src (e.g., "search `src/**/*.rs` for the token
`unsafe` using Grep/recursive search") so `unsafe` occurrences are discovered
across subdirectories; replace the existing `grep -l "unsafe " src/` text with
this clarified, recursive/search-all-sources phrasing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e98c4e89-dbb8-4242-a10a-12285c821430

📥 Commits

Reviewing files that changed from the base of the PR and between 57142ae and 71936f2.

📒 Files selected for processing (7)
  • .takt/facets/instructions/aggregate-weekly.md
  • .takt/facets/instructions/review-architecture-whole.md
  • .takt/facets/instructions/review-security-whole.md
  • .takt/facets/instructions/review-simplicity-whole.md
  • .takt/workflows/weekly-review.yaml
  • docs/todo-summary.md
  • docs/todo9.md

Comment thread .takt/facets/instructions/review-architecture-whole.md Outdated
Comment thread .takt/workflows/weekly-review.yaml
CodeRabbit Major:
- M-1: review-architecture-whole.md Criterion 4 — cargo tree/modules を任意検証として分離、
  Grep ベースの cross-grep を main 手順に (allowed_tools: Read/Glob/Grep と整合)
- M-2: weekly-review.yaml — provider_options.claude.network_access: false を追加
  (実プロバイダ claude のオフライン実行を明示)

CodeRabbit Nitpick:
- N-1: aggregate-weekly.md — findings.json (ファイル名) と findings-json (format 契約名) の
  区別を一文で明示、workflow 定義との terminology drift を解消
- N-2: review-security-whole.md — grep -l (非再帰) を Grep tool の `src/**/*.rs` 検索に
  書き換え (tool-agnostic + 再帰)

Pre-push reviewer Low:
- P-2: review-simplicity-whole.md + review-security-whole.md — ADR-031 § 281 (line number)
  を § アンチパターン: review-simplicity.md を whole-tree 用と共有してはならない (section name) に置換

保留 (本 commit では扱わない):
- P-1 (Medium): aggregate-weekly.md report_path documentation drift — Phase C 着手時に
  Report Directory 直読 vs copy 機構実装の設計判断と一緒に決定
@aloekun
Copy link
Copy Markdown
Owner Author

aloekun commented May 29, 2026

@coderabbitai review

fix commit 0d1cf7f6 で前回 review の Major × 2 (M-1 / M-2) + Nitpick × 2 (N-1 / N-2) + pre-push reviewer の Low × 1 (P-2 ADR-031 § citation) を修正済みです。再レビューをお願いします。

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

@aloekun: fix commit 0d1cf7f6 での修正内容を確認しました。前回指摘した M-1 / M-2 / N-1 / N-2 / P-2 の対応を含め、PR 全体を再レビューします。

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aloekun
Copy link
Copy Markdown
Owner Author

aloekun commented May 29, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aloekun aloekun merged commit 1ae6fb3 into master May 29, 2026
1 check passed
@aloekun aloekun deleted the feat-weekly-review-phase-b branch May 29, 2026 04:52
aloekun added a commit that referenced this pull request May 29, 2026
…ndle CR-RL 採用 3 件 (#183)

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

採用: 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) に拡張

* docs(adr): 8 ADR の ephemeral todo 参照を permanent reference に置換 (A01 fix、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 リスクなし
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