feat: 決定論的ロジック層への TDD ハーネスを導入#465
Conversation
ミューテーションテスト対象(mutmut/stryker)と同一スコープの実装変更を red→green→refactor で行う方針を導入する。ワークフロー正本 (.claude/rules/common/tdd.md)、機械ゲート(scripts/lint-tdd.sh / make lint-tdd、test.yml に組み込み)、AI 向け段階制御スキル(/tdd)を 新設し、既存ルール・development.md・CONTRIBUTING.md から誘導する。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces ADR-0019 to mandate test-driven development (red→green→refactor) for changes to deterministic logic layers identified via mutmut (backend) and Stryker (web) mutation-test configurations. It adds a Estimated code review effort: 3 (Moderate) | ~25 minutes ChangesTDD Gate Introduction
Sequence Diagram(s)sequenceDiagram
participant CI as CI Workflow
participant Script as lint-tdd.sh
participant Git as Git
CI->>Script: bash scripts/lint-tdd.sh
Script->>Git: resolve base ref / merge-base
Script->>Script: check Tdd-Exempt trailer or TDD_EXEMPT=1
alt exempt
Script-->>CI: exit 0 (skip)
else not exempt
Script->>Git: diff changed files vs base
Script->>Script: parse mutmut/stryker globs
Script->>Script: classify impl vs test file changes
alt missing test diff for matched impl
Script-->>CI: ERROR + exit 1
else
Script-->>CI: OK + exit 0
end
end
Possibly related PRs
Suggested labels: 🚥 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 |
main に取り込まれた ADR-0018(GitHub連携経歴書ドラフト生成)と 本ブランチの ADR-0019(TDD 導入)が docs/adr/README.md と docs/design-principles.md で衝突していたため解消(番号順に両方保持)。
Summary
.claude/rules/common/tdd.md(backend/web 編集時に自動ロード)を新設し、既存のbackend/test.md/web/test.md/CLAUDE.mdから誘導scripts/lint-tdd.sh(make lint-tdd)を新設。TDD 対象の実装変更にテスト差分が随伴しているかを検証し、make lint/make ciおよび CI(test.ymlの test-backend ジョブ)に組み込み。振る舞いを変えない変更はTdd-Exempt: <理由>コミットトレーラーで除外可能/tdd(.claude/skills/tdd/SKILL.md)を新設。対象判定 → テスト設計提示 → red(失敗確認)→ green → refactor の各フェーズで停止・報告するdocs/development.md/CONTRIBUTING.mdに人間向けの概説を追記、docs/adr/README.md/docs/design-principles.mdの索引を更新設計判断
backend/pyproject.tomlの[tool.mutmut] only_mutate/web/stryker.conf.jsonのmutate)を SSoT として共有(ADR-0017 と対になる事前プロセス)Test plan
make lint-adr-indexgreen(ADR 索引の drift なし)make lint-tddの動作確認: 対象ファイルのみ変更→fail / テスト随伴→pass /Tdd-Exemptトレーラー→skip /TDD_EXEMPT=1→skip / stryker 除外パターン(pdfjs.ts)→対象外make ci(lint + backend pytest + web vitest 365 件 + build)greentest.ymlの新ステップが期待どおり動くことは本 PR の CI 結果で確認する🤖 Generated with Claude Code
Summary by CodeRabbit