Skip to content

docs(adr): ADR-030 を起案 — 決定論的 post-merge-feedback (Phase A)#75

Merged
aloekun merged 4 commits intomasterfrom
docs/adr-030-phase-a
Apr 25, 2026
Merged

docs(adr): ADR-030 を起案 — 決定論的 post-merge-feedback (Phase A)#75
aloekun merged 4 commits intomasterfrom
docs/adr-030-phase-a

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented Apr 25, 2026

Summary

  • ADR-030 (docs/adr/adr-030-deterministic-post-merge-feedback.md) を新規作成
  • 2 層アーキテクチャ (L1 takt 同期実行 + L2 UserPromptSubmit recovery) を採用、4 facets で構成
  • ADR-014 を full supersede、ADR-029 を partial supersede (層 1 流用、層 3-4 廃止)
  • CLAUDE.md の Architecture Decisions リストに ADR-030 エントリを追加
  • docs/todo.md の完了済 Phase A セクションを削除 (運用ルール: 完了タスクは ADR/仕組みに反映後に削除)

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 push quality gate: lint / test / build / rust-test 全 PASS (15s)
  • pre-push review: @- の差分が ADR/docs のみで Rust コード差分なしのため diff 空判定でスキップ (正しい挙動)
  • cspell warning は Information レベル (takt / dogfood 等の project 固有語、既存 ADR と同じ扱い)
  • post-merge: ADR-030 設計の妥当性は Phase B 実装 + Phase F dogfood で検証

References

  • ADR-030 (本 PR で新規作成)
  • ADR-014 — full supersede 対象 (ステータス更新は Phase E で実施)
  • ADR-029 — partial supersede 対象 (層 1 流用、層 3-4 廃止)
  • ADR-015 / ADR-018 — 「機械的 = Rust、AI = takt」原則の先行事例
  • ADR-020 — facets 共通化方針の根拠
  • ADR-022 / ADR-028 — 整合性確認済 (本 ADR は内部 artifact のみで原則 1 / 外部可視ゲートに整合)
  • PR chore(gitignore): post-merge-feedback pending file を除外 (ADR-029) #74 — silent loss が実証された dogfood セッション
  • docs/todo.md「マージ後フィードバック機構の決定論化」(Phase B-F 残)

Summary by CodeRabbit

  • ドキュメンテーション
    • マージ後フィードバックの新しいアーキテクチャ決定(ADR-030)を追加
    • 同期的なタクト型ワークフローによる決定論的処理、失敗マーカーを使ったソフトフェイルと再試行フローを導入
    • フェーズ別の実装計画、検証手順、回復フローの利用方法を追記(出力は内部アーティファクトのみ)

aloekun added 2 commits April 25, 2026 15:30
- 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 リスト追記
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 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: fca915fb-608c-40be-a211-27111409be09

📥 Commits

Reviewing files that changed from the base of the PR and between a75f241 and 4afd3e6.

📒 Files selected for processing (2)
  • docs/adr/adr-030-deterministic-post-merge-feedback.md
  • docs/todo.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/todo.md

📝 Walkthrough

Walkthrough

CLAUDE.md と docs/adr/ および docs/todo.md を更新し、ポストマージフィードバックを決定論的なタクト仲介同期実行と障害マーカーベースの復旧で実施する ADR-030 を追加します(内部レポート出力とソフトフェイル動作を定義、ADR-014 を完全、ADR-029 を部分的に置換)。

Changes

Cohort / File(s) Summary
ADR とトップレベルの ADR 索引
CLAUDE.md, docs/adr/adr-030-deterministic-post-merge-feedback.md
ADR-030 を追加。マージパイプラインから同期タクトワークフロー post-merge-feedback を起動し、4 段階のファセットで解析・集約を行う設計を記述。成功時は .claude/feedback-reports/<pr>.md を生成、失敗時は .claude/feedback-reports/<pr>.md.failed マーカーを書き込み(soft-fail)。hooks-user-prompt-feedback-recovery フックによる *.md.failed 検出時の再試行指示を定義。ADR-014 を完全、ADR-029 を部分的に上書きする旨を明示。
計画・実行手順(TODO)
docs/todo.md
ADR-030 に基づく実装フェーズと検証計画を更新(タクトワークフロー実装、復旧フック実装、旧機構廃止、ドッグフード検証、入力抽出ルールやテスト手順の詳細)。

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #42: takt ファセットとポストマージフィードバック統合に関する変更 — ADR-030 の takt 統合案と直接関連。
  • PR #73: docs/todo.md に関する変更で ADR-029 関連タスクの調整を含む — ADR-030 による ADR 置換と関連。
  • PR #69: ADR-029 を対象とした過去の設計変更 — ADR-030 が部分的に置き換える対象。
🚥 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 プルリクエストのタイトルは ADR-030 の導入と決定論的 post-merge-feedback アーキテクチャの実装(Phase A)を正確に反映しており、変更セットの主要な目的と完全に一致している。
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between ae1cfe7 and 3ebe766.

📒 Files selected for processing (3)
  • CLAUDE.md
  • docs/adr/adr-030-deterministic-post-merge-feedback.md
  • docs/todo.md

Comment thread docs/adr/adr-030-deterministic-post-merge-feedback.md Outdated
Comment thread docs/todo.md Outdated
Comment thread docs/todo.md Outdated
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 ローカル実ユーザー名を含む絶対パスはドキュメントに残さない方がよいです。
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: 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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5bf4c81a-8923-4bbb-8fe4-00548ee301a3

📥 Commits

Reviewing files that changed from the base of the PR and between 3ebe766 and a75f241.

📒 Files selected for processing (1)
  • docs/todo.md

Comment thread docs/todo.md Outdated
- ADR-030 line 143: ユーザー名入りパスを %USERPROFILE% プレースホルダに置換
- todo.md line 84: code fence に言語指定 'text' を追加 (markdownlint MD040)

(takt fix が拾い切れなかった残 2 件を手動対応)
@aloekun aloekun merged commit 8434c6a into master Apr 25, 2026
1 check passed
@aloekun aloekun deleted the docs/adr-030-phase-a branch April 25, 2026 09:26
aloekun added a commit that referenced this pull request Apr 25, 2026
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 妥当性確認済。
aloekun added a commit that referenced this pull request Apr 25, 2026
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 妥当性確認済。
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