From d2ba5eefdebef2fe8cacbcd7fdeb737b8462c7cd Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Thu, 5 Mar 2026 20:09:57 -0800 Subject: [PATCH] Add regression test commit policy to CLAUDE.md (#982) Two-commit structure for bug fix PRs: first commit adds the failing test (CI red), second commit adds the fix (CI green). Proves in the GitHub PR UI that the test genuinely catches the bug. --- CLAUDE.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 098b77ea..e1c1c942 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -113,6 +113,15 @@ tail -f "$(cat /tmp/cmux-last-debug-log-path 2>/dev/null || echo /tmp/cmux-debug - Focus events: `focus.panel`, `focus.bonsplit`, `focus.firstResponder`, `focus.moveFocus` - Bonsplit events: `tab.select`, `tab.close`, `tab.dragStart`, `tab.drop`, `pane.focus`, `pane.drop`, `divider.dragStart` +## Regression test commit policy + +When adding a regression test for a bug fix, use a two-commit structure so CI proves the test catches the bug: + +1. **Commit 1:** Add the failing test only (no fix). CI should go red. +2. **Commit 2:** Add the fix. CI should go green. + +This makes it visible in the GitHub PR UI (Commits tab, check statuses) that the test genuinely fails without the fix. + ## Pitfalls - **Custom UTTypes** for drag-and-drop must be declared in `Resources/Info.plist` under `UTExportedTypeDeclarations` (e.g. `com.splittabbar.tabtransfer`, `com.cmux.sidebar-tab-reorder`).