Skip to content

docs(adr): ADR-041 Test Isolation Patterns + 順位 78 placeholder 化 (順位 139 land)#169

Merged
aloekun merged 3 commits into
masterfrom
rank-139-adr-041-test-isolation
May 22, 2026
Merged

docs(adr): ADR-041 Test Isolation Patterns + 順位 78 placeholder 化 (順位 139 land)#169
aloekun merged 3 commits into
masterfrom
rank-139-adr-041-test-isolation

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 22, 2026

Summary

Background

PR #120 W-001 で enrich_with_classifier_skips_when_disabled テストが OR-guard (if !config.enabled || state.findings.is_empty() { return; }) の責務混在 = vacuous assertion 問題 (classified_findings が空のまま → 早期 return 由来か他経路由来か判別不能) を抱えていた。PR #168 で sentinel pattern + 直交 precondition setup により構造的解決。本 PR は、2 PR 横断で観測された pattern を project ADR として永続化する。

global checklist (code-review.md 順位 84) は要件を 1 行で示すが、本 ADR は問題の具体例・設計原則・実装例 (poll.rs 2 variant の抜粋コード)・適用範囲・既存資料との関係を記述し、将来の複合 guard test 実装者が独立して参照できる reference layer になる。

Files changed

File Nature
docs/adr/adr-041-test-isolation-patterns.md 新規 (137 行) — PR #120 W-001 history + sentinel pattern + 2 variant 実装例 + 適用範囲
CLAUDE.md ADR-041 link を Architecture Decisions list に追加 (+1 行)
docs/todo-summary.md 順位 78 行 placeholder 化 / 順位 139 行 ADR-041 確定 / PR #168 post-merge-feedback explanation block update
docs/todo5.md 順位 78 詳細 entry 内の ADR-041 reference 7 箇所を ADR-NNN に書き戻し + 番号 history コメント追加
docs/todo8.md 順位 139 entry を ADR-041 確定形に変更 + 順位 135 entry の動機/参照を 3 段 (038→041→NNN) history に update

差分規模: +170 / -25 = 145 net 行 (docs-only PR)。

Test plan

  • markdownlint: 全ファイル 0 error (PostToolUse hook で連続 verify 済)
  • Cross-file reference 整合: 順位 78 / 順位 139 / 順位 135 で番号 history 一貫
  • fabricated URL なし (grep github.com/aloekun docs/adr/ で no match、advisor 指摘の 2 箇所を plain inline code に修正済)
  • ADR の cross-link target は全て実在 path (~/.claude/rules/common/code-review.md は plain code text、src/cli-pr-monitor/src/stages/poll.rs は実在 file)
  • Multi-point synchronization: ADR-041 番号確定に伴う 4 ファイル横断の placeholder 整理を同一 commit で実施 (code-review.md § Multi-point synchronization の実例 dogfood)
  • pre-push-review: APPROVE (1 iteration、docs-only PR として scope 適用外項目を正しく除外)

Notes

  • 順位 139 entry (todo8.md) は本 PR land 後の post-merge-feedback サイクルで削除予定 (memory: feedback_todo_no_history、マージ → 即削除)。
  • 順位 78 (Rust timestamp arithmetic safety) は今後 land 時 PR で空き番号を取得する運用に統一 (順位 135 codified policy)。
  • ADR-041 ステータスは「試験運用 (2026-05-22)」で開始、後続 PR で pattern 改良があれば supersede 余地を残す (直近 ADR-029〜ADR-040 の慣習に整合)。

Summary by CodeRabbit

  • Documentation
    • 「ADR-041: Test Isolation Patterns for Multi-Condition Guards」を新規追加し、sentinelパターンや直交な前提設定のテスト設計例、適用範囲、Pros/Consを明記しました
    • ADR一覧にADR-041を追記して参照を確定化しました
    • TODO/優先度サマリーや運用メモを更新し、ADR番号のプレースホルダ運用と再割当に関する注記を反映しました

Review Change Stack

aloekun added 2 commits May 22, 2026 14:04
…lation Patterns for Multi-Condition Guards) 新規追加

PR #168 post-merge-feedback の Tier 3 #2 採用結果として、複合 guard test の
test isolation pattern を project-level ADR で codify する task を順位 139
として登録。ADR 番号は順位 135 codified placeholder policy に従い land 時 PR
で確定する運用 (現状 ADR-NNN placeholder、PR #120 W-001 + PR #168 の 2 PR
横断 Frequency Medium で採用判断)。
… (順位 139 land) — 順位 78 番号 placeholder 化
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 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: 0f7fed9f-f688-4408-ae93-8d85d8306d25

📥 Commits

Reviewing files that changed from the base of the PR and between 67a514e and 35b6109.

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

📝 Walkthrough

Walkthrough

複合ガード関数のテスト分離パターンを ADR-041 として新規定義し、CLAUDE.md に登録。todo ドキュメント群の ADR 参照を統一し、ADR 番号の hardcode 回避と land 時の採番確定運用方針を明文化しました。

Changes

ADR-041 定義と登録

Layer / File(s) Summary
ADR-041 ドキュメント作成と CLAUDE.md 登録
docs/adr/adr-041-test-isolation-patterns.md, CLAUDE.md
enrich_with_classifier を例に、sentinel pre-population と OR-guard の直交 precondition assertion を ADR として定義。Pros/Cons・適用範囲・関連資料を記載し、CLAUDE.md のアーキテクチャ決定リストに ADR-041 を追加登録。

ADR 番号付与プロセスと参照整備

Layer / File(s) Summary
todo-summary.md における ADR-041 反映と placeholder 運用
docs/todo-summary.md
順位 78 を ADR-NNN プレースホルダへ置換(land 時に確定する運用)。順位 139 に PR #168 の採用として ADR-041 を追記。post-merge-feedback として確定手順と artifact relocation の未文書化ギャップを追記。
todo5.md と todo8.md における ADR-NNN placeholder 方針確立
docs/todo5.md, docs/todo8.md
ADR-041 参照を ADR-NNN に統一し、ADR-NNN (採番未確定、land 時に確定) プレースホルダ方針を明文化。todo8.md に本 PR による ADR-041 確定取得の記録を追加。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 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-041テスト分離パターンの追加と順位78のプレースホルダ化という、変更内容の主要な側面を正確に反映している。
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: 1

🤖 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 `@docs/todo8.md`:
- Around line 358-369: The checklist heading "#### 作業計画 (本 PR で完了)" is
inconsistent with the unchecked item "- [ ] PR description で
`docs/adr/adr-041-test-isolation-patterns.md` への link ..." — either mark that
checkbox as completed ("- [x]") if the PR description already contains the
link/summary, or change the heading to something like "作業計画 (本 PR での進捗)" to
reflect mixed completion; update the line containing the unchecked item or the
heading accordingly in docs/todo8.md so the checklist state matches the header.
🪄 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: 12320979-1f14-4726-8509-ef4990ababe3

📥 Commits

Reviewing files that changed from the base of the PR and between 08a9ce3 and 67a514e.

📒 Files selected for processing (5)
  • CLAUDE.md
  • docs/adr/adr-041-test-isolation-patterns.md
  • docs/todo-summary.md
  • docs/todo5.md
  • docs/todo8.md

Comment thread docs/todo8.md
@aloekun
Copy link
Copy Markdown
Owner Author

aloekun commented May 22, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aloekun aloekun merged commit 1fba8b6 into master May 22, 2026
1 check passed
@aloekun aloekun deleted the rank-139-adr-041-test-isolation branch May 22, 2026 08:12
aloekun added a commit that referenced this pull request May 23, 2026
…_MERGEABLE signal (順位 140 entry 追加) (#170)

* docs(todo): 順位 140 新規追加 — PR #169 T3-#2 採用 (順位 135 codified placeholder policy を ADR 昇格)

PR #169 post-merge-feedback の Tier 3 #2 採用結果として、順位 135
「ADR 番号 hardcode 撤廃 placeholder policy」を正式 ADR に昇格する task を
順位 140 として登録。PR #111/#132/#169 の 3 PR で適用実証済 (特に PR #169 で
順位 78 が ADR-038 → 041 → NNN の 3 段振り直し dogfood を完了) で、現在は
ephemeral todo entry 内の codify 限り = 派生プロジェクトへの transferability
不足を解消する目的。ADR 番号は順位 135 policy 自身に従い ADR-NNN placeholder
で登録 (= self-dogfood)、land 時 PR で確定する。

* docs(todo): 順位 141 新規追加 — CR rate-limit detection bug 修正 (shortcut 追加案: fix_push_time 固定 + 早期 merge 判断 signal)

PR #169 セッションで systemic 観測された CR rate-limit detection bug を順位 141
として登録。当初案 (defense-in-depth + 4 test) はユーザーから「処理時間が増える可能性」
の指摘を受け、shortcut 追加案 = 主軸 C (fix_push_time 固定) + 早期 merge 判断 signal
(mergeable CLEAN なら 5-10 分で人間判断) の 2 機能に絞った最小実装に書き換え。

feedback_pipeline_over_rules.md 適用 = ルール codify ではなくパイプライン側の機械的
修正で Claude 判断介入を排除する原則の最初の実装事例。既存 auto-retry path は維持し、
ユーザーが「待つ」を選んだ場合は通常 flow に合流する設計で、wall clock (rate-limit
reset 38 分 + retry 最大 2.5 時間) と手間軽減のバランスを取る。

* feat(cli-pr-monitor): 順位 141 実装 — fix_push_time 固定 + RATE_LIMIT_BUT_MERGEABLE signal (CR rate-limit detection bug 修正)
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