docs(adr): ADR-030 を起案 — 決定論的 post-merge-feedback (Phase A)#75
docs(adr): ADR-030 を起案 — 決定論的 post-merge-feedback (Phase A)#75
Conversation
- ADR-014 を full supersede、ADR-029 を partial supersede - 2 層アーキテクチャ (L1 takt 同期実行 + L2 UserPromptSubmit recovery) を採用 - 4 facets (analyze-pr / analyze-session / analyze-prepush-reports / aggregate-feedback) で構成 - silent loss 問題の構造分析と選択肢比較を明文化 - todo.md Phase A チェック更新、CLAUDE.md ADR リスト追記
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCLAUDE.md と docs/adr/ および docs/todo.md を更新し、ポストマージフィードバックを決定論的なタクト仲介同期実行と障害マーカーベースの復旧で実施する ADR-030 を追加します(内部レポート出力とソフトフェイル動作を定義、ADR-014 を完全、ADR-029 を部分的に置換)。 Changes
Sequence Diagram(s)sequenceDiagram
participant MergePipeline as Merge Pipeline
participant Takt as Takt Workflow
participant Facet1 as PR Analysis Facet
participant Facet2 as Transcript Facet
participant Facet3 as Prepush Aggregation
participant Facet4 as Final Aggregation
participant FS as Repo FS
participant Hook as UserPromptRecovery Hook
MergePipeline->>Takt: 起動(同期)
Takt->>Facet1: PR 分析(diff/reviews)
Takt->>Facet2: トランスクリプト解析(project JSONL, time-range)
Takt->>Facet3: 事前プッシュレポート集約
Takt->>Facet4: フィードバック集約
Facet4->>FS: `.claude/feedback-reports/<pr>.md`を書き込み(成功)
alt 失敗時
Facet4->>FS: `.claude/feedback-reports/<pr>.md.failed` マーカーを書き込み
FS->>Hook: フックが `*.md.failed` を検出(追加コンテキスト:pnpm feedback-retry <pr>)
Hook->>MergePipeline: ユーザに再試行指示を注入
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
docs/todo.md (1)
112-115: 環境依存の絶対パスは抽象化しておくのがおすすめです。
E:\work\...直書きだと他環境で読み手が追従しづらいので、<skills_repo>などの論理名に寄せると運用しやすくなります。Also applies to: 145-145, 174-175, 255-255
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/todo.md` around lines 112 - 115, Replace the hard-coded Windows absolute path "E:\work\..." used in the docs with a configurable logical placeholder (e.g., "<skills_repo>" or "<local_skills_path>") across the referenced documents—specifically update analyze-pr.md, analyze-session.md, analyze-prepush-reports.md and aggregate-feedback.md (and the other occurrences at the indicated ranges) so that examples and references use the abstracted placeholder instead of the environment-dependent path; ensure any explanatory text notes how to substitute the placeholder for local environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/adr/adr-030-deterministic-post-merge-feedback.md`:
- Line 143: The ADR contains a real user-home path
"C:\Users\HIROKI\.claude\projects\e--work-claude-code-hook-test\"; replace any
real usernames with a generic placeholder (e.g. use "<USER_HOME>" or "~" instead
of "C:\Users\HIROKI") and update the example path lines such as
"~/.claude/projects/<project-id>/<session-id>.jsonl" to consistently use the
placeholder; ensure all occurrences of "HIROKI" or the explicit Windows path are
anonymized in the document.
In `@docs/todo.md`:
- Around line 34-35: Update the guarantee phrasing in the table rows for "L1
Floor" and "L2 Recovery" to match ADR-030 terminology: replace "Exactly-once" in
the L1 Floor row with ADR-030's wording (e.g., "成功時 at-most-once / 失敗時は
`.failed` により再試行可能"), and ensure any guarantee text for "L2 Recovery" also uses
ADR-030 language and semantics rather than "At-least-once" if it conflicts; keep
the existing notes about determinism and user-triggered retries but normalize
the guarantee column to ADR-030's definition across both rows.
- Line 48: The document contains a local absolute path that exposes a real
username (`C:\Users\HIROKI\.claude\projects\e--work-claude-code-hook-test\`);
replace that exact string with a non-PII placeholder like
`<USER_HOME>\.claude\projects\<PROJECT_NAME>\` (or simply `<USER_HOME>/...`)
throughout docs/todo.md to remove PII, and ensure any similar occurrences use
the placeholder format instead of real user names.
---
Nitpick comments:
In `@docs/todo.md`:
- Around line 112-115: Replace the hard-coded Windows absolute path
"E:\work\..." used in the docs with a configurable logical placeholder (e.g.,
"<skills_repo>" or "<local_skills_path>") across the referenced
documents—specifically update analyze-pr.md, analyze-session.md,
analyze-prepush-reports.md and aggregate-feedback.md (and the other occurrences
at the indicated ranges) so that examples and references use the abstracted
placeholder instead of the environment-dependent path; ensure any explanatory
text notes how to substitute the placeholder for local environments.
🪄 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: d528b864-b18a-4612-a1f4-5994494083e5
📒 Files selected for processing (3)
CLAUDE.mddocs/adr/adr-030-deterministic-post-merge-feedback.mddocs/todo.md
Resolved findings: - [Major] docs/adr/adr-030-deterministic-post-merge-feedback.md:143 ADR 内の実ユーザー名入りパスは匿名化してください。 - [Major] docs/todo.md:35 保証レベルの表現を ADR-030 と統一してください。 - [Major] docs/todo.md:48 ローカル実ユーザー名を含む絶対パスはドキュメントに残さない方がよいです。
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/todo.md (1)
112-116: ローカル絶対パス参照はプレースホルダ化を推奨します。
E:\work\...のような環境依存パスが複数箇所にあり、将来の移植・引き継ぎ時に読解コストが上がります。<SKILLS_REPO>などの論理名に寄せると保守しやすいです。🧹 例: 表記統一の方向性
- - **`analyze-pr.md`**: ... (`E:\work\claude-code-skills\analyze-pr\SKILL.md` を参照) + - **`analyze-pr.md`**: ... (`<SKILLS_REPO>/analyze-pr/SKILL.md` を参照) - - `E:\work\claude-code-skills\post-merge-feedback\` 削除 + - `<SKILLS_REPO>/post-merge-feedback/` 削除Also applies to: 145-146, 174-176, 255-255
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/todo.md` around lines 112 - 116, Replace hard-coded local absolute paths like "E:\work\claude-code-skills\..." in docs/todo.md with a portable placeholder (e.g., "<SKILLS_REPO>") so references to analyze-pr.md, analyze-session.md, analyze-prepush-reports.md, aggregate-feedback.md and any other mentions become environment-agnostic; update the entries that mention the path inside the bullet list and any other occurrences (including the post_steps branch notes under src/cli-merge-pipeline where type="ai") to use the placeholder consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/todo.md`:
- Around line 84-90: The fenced code block in the shown snippet uses triple
backticks with no language tag (the opening "```"), causing markdownlint MD040;
update the opening fence to include a language token such as "text" (i.e. change
"```" to "```text") so the block is language-specified while keeping the block
content identical.
---
Nitpick comments:
In `@docs/todo.md`:
- Around line 112-116: Replace hard-coded local absolute paths like
"E:\work\claude-code-skills\..." in docs/todo.md with a portable placeholder
(e.g., "<SKILLS_REPO>") so references to analyze-pr.md, analyze-session.md,
analyze-prepush-reports.md, aggregate-feedback.md and any other mentions become
environment-agnostic; update the entries that mention the path inside the bullet
list and any other occurrences (including the post_steps branch notes under
src/cli-merge-pipeline where type="ai") to use the placeholder consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
- ADR-030 line 143: ユーザー名入りパスを %USERPROFILE% プレースホルダに置換 - todo.md line 84: code fence に言語指定 'text' を追加 (markdownlint MD040) (takt fix が拾い切れなかった残 2 件を手動対応)
PR #75 の post-merge-feedback で得られた Tier 1 提案を実装。 custom-lint-rules.toml に新規 rule を追加: - pattern: 'C:\Users\[A-Za-z][A-Za-z0-9_-]+\|/home/[a-z][a-z0-9_-]+/' - extensions: md / txt - severity: error - placeholder (<USER_NAME>, %USERPROFILE%, ~/, $HOME) は character class ([A-Za-z] / [a-z]) で開始位置を縛り自動除外 由来: PR #75 で同種 PII 指摘が 3 箇所同時発生 (ADR-030 line 143、 todo.md line 35/48)。PR #74 でも前例あり、CodeRabbit Major 指摘の 頻出パターンとして Plankton Tier 1 (決定論的防止) で固定化する。 カスタムリンタは std::fs::read_to_string で runtime ロードのため exe rebuild 不要。既存 45 件のリンターテスト全 PASS で regex 妥当性確認済。
PR #75 の post-merge-feedback で得られた Tier 1 提案を実装。 custom-lint-rules.toml に新規 rule を追加: - pattern: 'C:\Users\[A-Za-z][A-Za-z0-9_-]+\|/home/[a-z][a-z0-9_-]+/' - extensions: md / txt - severity: error - placeholder (<USER_NAME>, %USERPROFILE%, ~/, $HOME) は character class ([A-Za-z] / [a-z]) で開始位置を縛り自動除外 由来: PR #75 で同種 PII 指摘が 3 箇所同時発生 (ADR-030 line 143、 todo.md line 35/48)。PR #74 でも前例あり、CodeRabbit Major 指摘の 頻出パターンとして Plankton Tier 1 (決定論的防止) で固定化する。 カスタムリンタは std::fs::read_to_string で runtime ロードのため exe rebuild 不要。既存 45 件のリンターテスト全 PASS で regex 妥当性確認済。
Summary
docs/adr/adr-030-deterministic-post-merge-feedback.md) を新規作成Context
PR #74 マージ後の dogfood で、ADR-029 設計の silent loss 問題 が顕在化した。Stop hook + skill ベースの auto-trigger は Claude のターン取得次第で機能せず、決定論的実行が成立しなかった (4 層トリガーのうち層 3-4 が非決定的)。skill 機構は本質的に "ask-based" であり must-run 要件には構造的に不適合という設計上の知見が得られた。
本 PR は ADR-030 を起案し、ADR-015 / 018 で確立された「機械的 = Rust、AI = takt」原則の 3 例目 として、takt workflow による同期実行 + 失敗マーカー recovery 機構へ移行する設計を明文化する。本 PR は 設計のみ で実装は含まない (Phase B-F は別 PR)。
Validation
pnpm pushquality gate: lint / test / build / rust-test 全 PASS (15s)@-の差分が ADR/docs のみで Rust コード差分なしのため diff 空判定でスキップ (正しい挙動)takt/dogfood等の project 固有語、既存 ADR と同じ扱い)References
Summary by CodeRabbit