Skip to content

feat(pre-push-review): WP-07 findings handoff を markdown output-contract で標準化 — simplicity-review 契約新設・reviewer 間で列統一 (ADR-048、JSON 却下) - #252

Merged
aloekun merged 1 commit into
masterfrom
wp-07-findings-contract
Jul 6, 2026
Merged

feat(pre-push-review): WP-07 findings handoff を markdown output-contract で標準化 — simplicity-review 契約新設・reviewer 間で列統一 (ADR-048、JSON 却下)#252
aloekun merged 1 commit into
masterfrom
wp-07-findings-contract

Conversation

@aloekun

@aloekun aloekun commented Jul 6, 2026

Copy link
Copy Markdown
Owner

概要

ハーネス改善実行計画書 (docs/harness-improvement-plan.md) の WP-07: facet 間受け渡しの JSON 化 を実装する。目的は pre-push review の reviewers → fix 間の findings 受け渡しでの parse 事故・読み落とし防止。

当初計画 (findings の JSON 化 + Rust 検証 pre-step) を takt 公式仕様の調査に基づき却下し、takt idiomatic な markdown output-contract の標準化に方針転換した。判断過程は ADR-048 に記録。

公式調査の結論 (takt 0.35.3、ADR-017 で pin)

  • takt の idiomatic な facet 間 handoff は markdown レポート (output_contracts.report[].formatreports/{report:filename} 参照)。
  • 公式 OUTPUT_CONTRACT_STYLE_GUIDE.md```markdown ブロックを必須とし、プレーンテキスト/非 markdown 契約を DON'T と明記
  • output-contract スキーマに type/schema/json は無く、format は検証されない markdown テンプレート。29 builtin 契約・36 workflow・251 report 宣言すべて markdown、JSON はゼロ
  • JSON handoff は takt の流儀に反する

parse 事故の真因

「markdown だから」ではなく simplicity-review に output-contract が存在せず、reviewer 間で finding テーブルの列が不統一だったこと。format: simplicity-review はファイル解決されずリテラル文字列に degrade し、simplicity reviewer は構造強制ゼロで free-form 出力していた。

変更内容

  • .takt/facets/output-contracts/simplicity-review.md(新規契約): builtin security-review の finding テーブル構造を踏襲。simplicity reviewer に構造を強制し真因を解消。finding_id 不変性の注記も追加(本 PR の dogfood レビューで surface した改善)。
  • reviewer 間で列統一: finding_id / family_tag / severity / type / location (file:line) / issue / fix suggestion。security は builtin 契約(同一列)を使用、simplicity が同構造を mirror。
  • refutation-report.md / refute-finding.md: Survived Findings テーブルに family_tag 追加、carry-over 指示も整合。
  • 既存 workflow の format: 名にそのまま解決されるため YAML 変更ゼロpre-push-review.yaml と refute variant の両方が自動的に裨益。post-pr-review は simplicity/security reviewer を持たず対象外。

却下・見送りした代替案 (ADR-048 参照)

  • JSON handoff (当初案): 公式スタイルガイド違反・builtin/将来アップグレードと不整合 → 却下。
  • Rust 検証 pre-step (cli-push-runner): takt が LLM step 専用 + runner が takt workflow 全体を不透明に呼ぶため、reviewers→fix 境界に介入不能 → 実現不能。
  • markdown table を parse する Bash 経由 Rust validator: 有効だが、まず契約標準化の効果を観測 → 見送り(順位化候補)。

検証 (dogfood)

  • pre-push AI レビュー APPROVED(simplicity + security)。新 simplicity 契約が実際に使用され、reviewer が新フォーマット(Result: APPROVE / Anomaly Scan テーブル)で出力することを実地確認。
  • docs-lint OK / markdownlint 0 errors。
  • Rust 変更なしのため cargo test/clippy は既存通り pass(quality_gate 全通過)。

関連

  • ADR-048(本 PR で新規起票)/WP-07 状態を「実装済」に更新
  • ADR-020(fix の入力形式非依存を維持)・ADR-036(reviewer 出力の構造化)・ADR-047(refutation 列の整合)

Summary by CodeRabbit

  • Documentation
    • レビュー結果の出力形式が整理され、見やすく一貫したMarkdown仕様が明確になりました。
    • 引き継ぎ情報に必要な項目が追加され、判定結果の表示がより分かりやすくなりました。
    • レビュー用ガイドとADRが更新され、運用ルールや出力の期待値が明文化されました。

…act で標準化 — simplicity-review 契約新設・reviewer 間で列統一 (ADR-048、JSON 却下)
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

reviewers から fix への findings handoff を markdown ベースの output-contract に統一する変更です。simplicity-review.md の新規output-contractを作成し、refutation-report.md に family_tag 列を追加、refute-finding.md instructionを更新、ADR-048 を新設して意思決定を記録し、CLAUDE.md と harness-improvement-plan.md を更新しました。

Changes

Output-contract 統一とADR記録

Layer / File(s) Summary
simplicity-review output-contract 新設
.takt/facets/output-contracts/simplicity-review.md
レビュー結果、アノマリースキャン表、新規/継続/解決/再オープンのファインディング表、REJECTIONゲート条件、finding_id/Type規則を含む雛形を新規追加。
refutation-report と instruction への family_tag 追加
.takt/facets/output-contracts/refutation-report.md, .takt/facets/instructions/refute-finding.md
Survived Findings テーブルに family_tag 列と値を追加し、Location表示形式を変更。instructionの引き継ぎ項目一覧にも family_tag を明記。
ADR-048 新設とCLAUDE.md参照追加
docs/adr/adr-048-facet-findings-handoff-markdown-contract.md, CLAUDE.md
reviewers→fix間のhandoffをmarkdown契約に統一する決定を記録したADRを新設(JSON化案却下理由、決定事項、代替案却下、結論、関連ADRを含む)。CLAUDE.mdのArchitecture Decisions一覧にエントリを追加。
harness-improvement-plan.md のWP-07進捗更新
docs/harness-improvement-plan.md
WP-07のステータスを「実装済」に更新し、JSON化却下からmarkdown契約新設への方針転換経緯を追記。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • aloekun/claude-code-hook-test#47: pre-push workflowをsimplicity-reviewに切り替え、統一されたsimplicity-reviewレポート契約を期待しており、本PRのoutput-contract追加・family_tag追加と直接連携する。
  • aloekun/claude-code-hook-test#242: 同じdocs/harness-improvement-plan.mdのWP-07領域を対象に、コードレベルで重なる変更を行っている。

Poem

うさぎ跳ねてmarkdown書く
family_tag を運んでく
JSONの道は選ばずに
契約ひとつですっきりと
ADR積んで また進む

🚥 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 タイトルは WP-07 の findings handoff を markdown output-contract で標準化し、simplicity-review 契約新設と JSON 却下の主旨を適切に要約しています。
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wp-07-findings-contract

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/harness-improvement-plan.md (1)

69-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

WP-07 のタイトルを実装結果に合わせて更新してください。

JSON 化 という表現が overview row と WP-07 セクションに残っていますが、実装済みの内容は JSON ではなく markdown output-contract の標準化です。タイトルが古いと、後から読む人が「JSON handoff が入った」と誤解します。

提案
-| WP-07 | 1-B | facet 間受け渡しの JSON 化 | M | なし | 実装済(...) |
+| WP-07 | 1-B | facet 間受け渡しの output-contract 標準化 | M | なし | 実装済(...) |

WP-07 セクション見出し側も同じ表現に揃えてください。

Also applies to: 163-170

🤖 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/harness-improvement-plan.md` at line 69, Update the WP-07 title so it
matches the implemented work: replace the outdated “JSON 化” wording with the
markdown output-contract standardization reflected in ADR-048. Make the same
terminology change in both the overview row and the WP-07 section heading so the
labels stay consistent and don’t imply a JSON handoff; use the existing WP-07
and ADR-048 references to locate the affected text.
🤖 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/output-contracts/simplicity-review.md:
- Around line 19-38: The finding tables use inconsistent schemas across Current
Iteration, Carry-over, and Reopened, which breaks consumers that expect one
canonical set of columns. Update the markdown in simplicity-review.md so every
finding table uses the same ADR-048 column names and ordering, and adjust the
Carry-over/Reopened sections to match the Current Iteration table rather than
swapping in Previous/Current Evidence columns. Keep the schema uniform so
fix/refute logic can parse all finding tables with the same contract.

---

Nitpick comments:
In `@docs/harness-improvement-plan.md`:
- Line 69: Update the WP-07 title so it matches the implemented work: replace
the outdated “JSON 化” wording with the markdown output-contract standardization
reflected in ADR-048. Make the same terminology change in both the overview row
and the WP-07 section heading so the labels stay consistent and don’t imply a
JSON handoff; use the existing WP-07 and ADR-048 references to locate the
affected text.
🪄 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: ea07bfb1-657f-496f-b3ca-90825132691a

📥 Commits

Reviewing files that changed from the base of the PR and between 4a0f3f3 and b5b4b01.

📒 Files selected for processing (6)
  • .takt/facets/instructions/refute-finding.md
  • .takt/facets/output-contracts/refutation-report.md
  • .takt/facets/output-contracts/simplicity-review.md
  • CLAUDE.md
  • docs/adr/adr-048-facet-findings-handoff-markdown-contract.md
  • docs/harness-improvement-plan.md

Comment on lines +19 to +38
## Current Iteration Findings (new)
| # | finding_id | family_tag | Severity | Type | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|------|----------|-------|----------------|
| 1 | SIM-NEW-src-x-L10 | dead-code | Medium | dead-on-arrival | `src/x.ts:10` | Helper with no caller | Remove or wire up |

## Carry-over Findings (persists)
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | SIM-PERSIST-src-y-L30 | deep-nesting | `src/y.ts:30` | `src/y.ts:30` | Nesting persists | Flatten with guard clause |

## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| SIM-RESOLVED-src-x-L10 | `src/x.ts:10` helper removed |

## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | SIM-REOPENED-src-y-L55 | deep-nesting | `Previously flattened at src/y.ts:30` | `Recurred at src/y.ts:55` | Nesting reintroduced | Flatten again |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

列スキーマを全 finding table で統一してください。

Current Iteration だけが Severity / Type / Location を持ち、Carry-over / ReopenedPrevious Evidence / Current Evidence に差し替わっています。さらに見出しの大小文字も ADR-048 の canonical 列名とズレています。fix / refute が表ごとに別スキーマを扱わずに済むよう、全 table を同じ列セットに揃えてください。

提案
-| # | finding_id | family_tag | Severity | Type | Location | Issue | Fix Suggestion |
+| # | finding_id | family_tag | severity | type | location | issue | fix suggestion |

同じ列セットを Carry-over / Reopened にも適用してください。

🤖 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/output-contracts/simplicity-review.md around lines 19 - 38, The
finding tables use inconsistent schemas across Current Iteration, Carry-over,
and Reopened, which breaks consumers that expect one canonical set of columns.
Update the markdown in simplicity-review.md so every finding table uses the same
ADR-048 column names and ordering, and adjust the Carry-over/Reopened sections
to match the Current Iteration table rather than swapping in Previous/Current
Evidence columns. Keep the schema uniform so fix/refute logic can parse all
finding tables with the same contract.

@aloekun
aloekun merged commit 52f6d22 into master Jul 6, 2026
1 check passed
@aloekun
aloekun deleted the wp-07-findings-contract branch July 6, 2026 11:42
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