From 1c3bf35dad883ec01cbc70e902557e20cd02b00d Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Sat, 7 Mar 2026 20:41:03 -0800 Subject: [PATCH] Fix mikado invariant check rejecting close without impl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A close commit with zero preceding impl commits is valid — some leaf nodes involve operational steps (e.g., creating a mirror) with no code changes. Removed the false-positive check. Co-Authored-By: Claude Opus 4.6 --- .../+fix-mikado-close-without-impl.bugfix.md | 1 + mise-tasks/mikado-branch-invariant-check | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 docs/changelog.d/+fix-mikado-close-without-impl.bugfix.md diff --git a/docs/changelog.d/+fix-mikado-close-without-impl.bugfix.md b/docs/changelog.d/+fix-mikado-close-without-impl.bugfix.md new file mode 100644 index 0000000..f6501ae --- /dev/null +++ b/docs/changelog.d/+fix-mikado-close-without-impl.bugfix.md @@ -0,0 +1 @@ +Fix mikado-branch-invariant-check false positive: close commits without preceding impl commits are valid (e.g., operational tasks with no code changes). diff --git a/mise-tasks/mikado-branch-invariant-check b/mise-tasks/mikado-branch-invariant-check index d8443ba..ffe3d1a 100755 --- a/mise-tasks/mikado-branch-invariant-check +++ b/mise-tasks/mikado-branch-invariant-check @@ -14,9 +14,8 @@ Checks: 1. All commits follow the C2(): convention 2. The invariant ordering is maintained: plan commits come before impl/close 3. No plan commits appear after any impl or close commits -4. Close commits don't appear before impl commits in the same cycle -5. The chain stem in commit messages matches the branch name -6. impl commits don't modify Mikado card files (docs with mikado frontmatter) +4. The chain stem in commit messages matches the branch name +5. impl commits don't modify Mikado card files (docs with mikado frontmatter) Can also be run standalone (no arguments) to validate existing branch history. @@ -233,11 +232,6 @@ def check_invariant(commits: list[dict], chain_stem: str) -> list[str]: seen_impl = True elif verb == "close": seen_close = True - if not seen_impl: - errors.append( - f"{sha_short}: close commit without preceding impl — " - f"leaf nodes should be closed after implementation work" - ) elif verb == "finalize": # finalize is the permitted exception — must be last if i != len(commits) - 1: