Repository navigation
fix(sdd): reject empty or non-descendant BASE..HEAD ranges in review-package - #2136
Merged
Merged
Conversation
…package When an SDD implementer commits to the wrong branch (#2050), the BASE..HEAD range handed to review-package is either empty or not rooted at BASE. Both cases previously produced a review package silently — an empty one lets the reviewer approve "clean" work that isn't there. Add two mechanical guards after BASE/HEAD validation, exiting 3 (vs 2 for usage errors) so callers can distinguish range problems: - git merge-base --is-ancestor BASE HEAD, else "HEAD is not a descendant of BASE" - git rev-list --count BASE..HEAD > 0, else "empty commit range" Guard shape credits the analysis in closed PR #2082 by @stantheman0128. Fixes #2050
This was referenced Sep 18, 2026
jmbruzos
pushed a commit
to jmbruzos/superpowers
that referenced
this pull request
Oct 19, 2026
…kspace keeps a repo's own .kdd/sdd/.gitignore review-package exits 3 on a HEAD that does not descend from BASE or an empty range (upstream obra#2136), and calls sdd-workspace through bash. sdd-workspace writes .kdd/sdd/.gitignore only when missing (upstream obra#2399). Upstream's two range-guard cases ported, plus a create-only case; all three failed before. Items 5, 6; AC3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
filipjurcicek-filevine
added a commit
to filipjurcicek-filevine/superpowers
that referenced
this pull request
Nov 5, 2026
The fork's sdd-workspace, task-brief, and review-package were identical to v6.3.0, so the upstream versions apply as they are: - sdd-repo (new): the helpers act on the git repository of the current directory, as git does, and stop with exit 2 outside one. All take -C DIR for another working tree (obra#2429, obra#1799). - sdd-workspace: a plan-path marker gives plans with the same basename separate workspaces (obra#2138), and a committed .superpowers/sdd/.gitignore is no longer overwritten (obra#2161). - task-brief: finds task IDs such as A1, 6b, and 2.1, and Task 6 no longer matches Task 6b (obra#2459). It refuses a brief that an unclosed code fence would run to the end of the plan (obra#2436). - review-package: an empty or non-descendant BASE..HEAD exits 3 (obra#2136). The skills now say to run each helper by its absolute path from the working tree, not "from this skill's directory", which made agents run the helpers against the plugin cache (obra#2525). Tests: upstream test-sdd-workspace.sh and test-sdd-helper-paths.sh. The path test failed on 5 skill lines before the wording change and passes after it. All nine offline suites pass; shellcheck is clean. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
review-packagebuilds a review package from whatever BASE/HEAD range it's handed. When an SDD subagent commits to the wrong branch (#2050's reported failure: an implementer committed to main instead of its worktree), the range is either empty — the reviewer sees nothing and approves 'clean' work — or contains commits that aren't descendants of the expected base. Both silently corrupt the review chain SDD's correctness depends on.Fix
Five lines after the existing BASE/HEAD validation, in the script's own style:
git merge-base --is-ancestor "$base" "$head"— reject with 'HEAD is not a descendant of BASE', exit 3git rev-list --count— reject an empty range, exit 3Exit 3 distinguishes range corruption from usage errors (exit 2). This is the mechanical-enforcement shape requested on #1588; prompt-side wording changes are deliberately out of scope (they need evals).
TDD evidence
Two new assertions in
tests/claude-code/test-sdd-workspace.sh(divergent BASE built viacommit-tree, and BASE==HEAD). RED against the unmodified script (both cases: exit 0, no stderr), GREEN with the guards; all 15 suite assertions pass.Note: this touches
review-packagenear PR #2134's hunk — whichever lands second gets a trivial rebase.Reported by @conradstorz in #2050; guard shape credited to closed PR #2082 (@stantheman0128). Fixes #2050.
Who is submitting
Claude Fable 5 on Claude Code 2.1.228 (implementation subagent + controller review), working the triage build queue directed by @obra, who reviews the diff.
@arittr @ada-sen — review requested.