feat(pre-push-review): WP-06 反証(refute) facet 追加 — reviewers→verify(haiku)→fix (ADR-047 試験運用) - #250
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughpre-push-review-refute facetを追加し、reviewersとfixの間にverify(反証)ステップを挟む新workflowを導入した。関連するfacet指示書、出力契約、ADR-047ドキュメント、push-runner設定(refute_enabled/refute_workflow)とRust側のworkflow解決ロジックを追加・更新した。 ChangesRefute Facet 導入
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PushRunner
participant Reviewers
participant Verify
participant Fix
participant Supervise
PushRunner->>Reviewers: run simplicity + security review
Reviewers->>Verify: needs_fix findings
Verify->>Verify: refute findings (haiku)
alt findings survive
Verify->>Fix: survived findings
Fix->>Reviewers: apply fix / loop back
Fix->>Supervise: unable to proceed
else all refuted
Verify->>Supervise: ALL_REFUTED
end
Supervise-->>PushRunner: COMPLETE (ready to push)
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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: 1
🧹 Nitpick comments (1)
src/cli-push-runner/src/config/mod.rs (1)
114-129: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win誤設定時にサイレントにフォールバックする点の可観測性を改善できる。
refute_enabled = trueかつrefute_workflow未指定(または空文字列)の場合、警告なしに既存ワークフローへフォールバックします。設計上のフェイルセーフとしては妥当ですが、ユーザーが「有効化したつもりが実は反証facetが動いていない」ことに長期間気づけない可能性があります。main.rsの呼び出し元でこの分岐時にログを1行出すと運用上の助けになります。♻️ 提案例
pub(crate) fn resolve_takt_workflow(config: &Config) -> String { if let Some(pre_push) = &config.pre_push_review { if pre_push.refute_enabled == Some(true) { if let Some(workflow) = &pre_push.refute_workflow { - return workflow.clone(); + if !workflow.is_empty() { + return workflow.clone(); + } + log_info("pre_push_review.refute_workflow が空文字列のため base workflow にフォールバックします"); } + log_info("pre_push_review.refute_enabled=true ですが refute_workflow 未指定のため base workflow にフォールバックします"); } } config.takt.workflow.clone() }🤖 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 `@src/cli-push-runner/src/config/mod.rs` around lines 114 - 129, `resolve_takt_workflow` は誤設定時に現行 `config.takt.workflow` へ静かにフォールバックするため、`main.rs` でこの関数の戻り値を使う直前に分岐を追加し、`pre_push_review.refute_enabled = true` なのに `refute_workflow` が未指定・空のときは警告ログを1行出してください。`resolve_takt_workflow` と `Config.pre_push_review` を参照して、フォールバック発生時にユーザーが気づけるように可観測性を上げてください。
🤖 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/supervise.md:
- Around line 10-13: The current ready-to-push check is looking at the entire
Report Directory instead of only the fix report for the current verify run, so
it can be blocked by older timestamped reports. Update the logic in the
refutation-report handling path to identify and inspect only the report tied to
the current verify execution, using the same report-selection behavior as
fix.md, and ignore past iteration files like {filename}.{timestamp} when
deciding whether there is “no fix report.” Ensure the ALL_REFUTED path in the
refutation-report flow only evaluates the current run’s report before marking
ready to push.
---
Nitpick comments:
In `@src/cli-push-runner/src/config/mod.rs`:
- Around line 114-129: `resolve_takt_workflow` は誤設定時に現行 `config.takt.workflow`
へ静かにフォールバックするため、`main.rs` でこの関数の戻り値を使う直前に分岐を追加し、`pre_push_review.refute_enabled
= true` なのに `refute_workflow` が未指定・空のときは警告ログを1行出してください。`resolve_takt_workflow` と
`Config.pre_push_review` を参照して、フォールバック発生時にユーザーが気づけるように可観測性を上げてください。
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 106fd782-31ce-4f44-9695-fffd7a4d28d9
📒 Files selected for processing (14)
.takt/facets/instructions/fix.md.takt/facets/instructions/refute-finding.md.takt/facets/instructions/supervise.md.takt/facets/output-contracts/refutation-report.md.takt/workflows/pre-push-review-refute.yamlCLAUDE.mddocs/adr/adr-047-prepush-refute-facet.mddocs/harness-improvement-plan.mdpush-runner-config.tomlsrc/cli-push-runner/src/config/lint_screen.rssrc/cli-push-runner/src/config/mod.rssrc/cli-push-runner/src/main.rssrc/cli-push-runner/src/stages/takt.rstemplates/push-runner-config.toml
| ## Optional: refutation-report.md (pre-push-review-refute only) | ||
|
|
||
| If the Report Directory contains `refutation-report.md` with Verdict `ALL_REFUTED` and there is no fix report, the verify (refute) step rejected every reviewer finding as a false positive, so there is intentionally no code change. Confirm the rejection reasons are sound (each should cite concrete code-level evidence). If they are, this is **ready to push** -- any wrongly-rejected finding is recaught by the post-pr CodeRabbit layer. If a rejection reason looks unsound, treat it as **issues detected**. | ||
|
|
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== supervise.md ==\n'
cat -n .takt/facets/instructions/supervise.md | sed -n '1,120p'
printf '\n== fix.md ==\n'
cat -n .takt/facets/instructions/fix.md | sed -n '1,220p'
printf '\n== search: ALL_REFUTED / fix report / timestamp ==\n'
rg -n "ALL_REFUTED|fix report|refutation-report|timestamp|current iteration|current run|current execution|pre-push-review-refute|ready to push" .takt -SRepository: aloekun/claude-code-hook-test
Length of output: 16054
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== pre-push-review-refute.yaml (relevant sections) ==\n'
sed -n '1,240p' .takt/workflows/pre-push-review-refute.yaml
printf '\n== refutation-report output contract ==\n'
sed -n '1,220p' .takt/facets/output-contracts/refutation-report.md
printf '\n== refute-finding instruction ==\n'
sed -n '1,220p' .takt/facets/instructions/refute-finding.md
printf '\n== search for fix report file names ==\n'
rg -n "fix report|fix-report|refutation-report|Report Directory|Survived Findings|Rejected Findings" .takt -SRepository: aloekun/claude-code-hook-test
Length of output: 19826
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== fix-supervisor.md ==\n'
sed -n '1,220p' .takt/facets/instructions/fix-supervisor.md
printf '\n== search for fix report / report name definitions ==\n'
rg -n "name: fix|fix report|fix-report|convergence_verdict|Work results|Convergence verdict|Report Directory.*fix" .takt -S
printf '\n== workflow around fix/supervise in pre-push-review.yaml ==\n'
sed -n '1,260p' .takt/workflows/pre-push-review.yamlRepository: aloekun/claude-code-hook-test
Length of output: 12482
現在イテレーションの fix report だけを判定してください
fix.md の通り past iteration reports は {filename}.{timestamp} で同じ Report Directory に残るため、ディレクトリ全体で「fix report がない」を見ると、古い fix report が 1 つ残っているだけで ALL_REFUTED でも ready-to-push に進めません。判定対象は現在の verify 実行に紐づく report に限定してください。
🧰 Tools
🪛 LanguageTool
[grammar] ~10-~10: Ensure spelling is correct
Context: ...: refutation-report.md (pre-push-review-refute only) If the Report Directory contains `refuta...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 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/supervise.md around lines 10 - 13, The current
ready-to-push check is looking at the entire Report Directory instead of only
the fix report for the current verify run, so it can be blocked by older
timestamped reports. Update the logic in the refutation-report handling path to
identify and inspect only the report tied to the current verify execution, using
the same report-selection behavior as fix.md, and ignore past iteration files
like {filename}.{timestamp} when deciding whether there is “no fix report.”
Ensure the ALL_REFUTED path in the refutation-report flow only evaluates the
current run’s report before marking ready to push.
…aiku)→fix (ADR-047 試験運用) reviewers と fix の間に verify(refute, haiku) step を挟み、reviewer(sonnet) の false positive を fix 前に反証・却下して無駄な fix iteration を削減する。誤って却下した真の finding は post-pr CodeRabbit 層で回収 (安全網、ADR-019)。 - 新 workflow .takt/workflows/pre-push-review-refute.yaml — loop_monitors.cycle を [reviewers, verify, fix] に更新し膠着検出を維持 - refute-finding.md instruction + refutation-report.md output-contract を新設 - fix.md / supervise.md は refutation-report.md 存在時のみ参照で後方互換 (ADR-020) - opt-in: push-runner-config.toml [pre_push_review] refute_enabled (本リポ dogfood で true、templates は default OFF)。cli-push-runner の resolve_takt_workflow で workflow 切替 (ADR-039) - verify 全却下時は supervise 経由 (安全側) - ADR-047 起票 (試験運用、2026-07-20 に採否判定) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5459c02 to
6b27303
Compare
概要
ハーネス改善実行計画書 (
docs/harness-improvement-plan.md) の WP-06: 反証(refute)facet 追加 を実装する。pre-push review の false positive 起因の無駄な fix iteration を、reviewers と fix の間に挟んだ verify (refute) step で削減する (adversarial verification)。設計根拠は ADR-047 (試験運用、ADR-039 標準パターン準拠) に集約。
フロー
変更内容
.takt/workflows/pre-push-review-refute.yamlを新設 (reviewers→verify→fix→supervise)。loop_monitors.cycleを[reviewers, verify, fix]に更新し膠着検出を維持。refute-finding.md(instruction) +refutation-report.md(output-contract) を新規追加。fix.md/supervise.mdはrefutation-report.mdが存在する場合のみ参照 (post-pr-review / refute 無効時は従来動作、ADR-020)。push-runner-config.tomlに[pre_push_review]section を追加。本 PR は導入のみで default OFF (refute_enabled = false)。workflow 切替判定を cli-push-runner のresolve_takt_workflowに単一集約。templates/push-runner-config.tomlも default OFF を継承。PrePushReviewConfig+resolve_takt_workflow+ main.rs/takt.rs 配線 + ユニットテスト 4 本。Kill-switch / Bounded lifetime
refute_enabled = falseで即座に現行pre-push-review(verify なし) へ。永続停止はpre-push-review-refute.yamlを削除する revert PR。refute_enabled = true) はマージ後の別 PR で開始する (未検証の refute workflow でこの導入 PR 自体を自己レビューするブートストラップを回避)。dogfood 開始から 2 週間で採否判定。検証
cargo test -p cli-push-runner: 175 passed / 0 failed (resolve_takt_workflowの 4 テスト含む)関連
docs/harness-improvement-plan.mdの状態を「実装済」に更新Summary by CodeRabbit
新機能
改善