summaryrefslogtreecommitdiff
path: root/skills/subagent-driven-development/scripts/review-package
AgeCommit message (Collapse)Author
2026-10-23fix(sdd): act on the cwd's working tree only, drop the plan-repo fallbackJesse Vincent
sdd-repo fell back to the plan file's repository when the current directory was outside any repository. That made the plugin-cache case silently succeed somewhere: an agent that cd'd into the skill directory and passed an absolute plan path got whichever checkout that path pointed into. With the plan in the main checkout (where writing-plans leaves it) and execution in a linked worktree, that is the #2429 wrong-worktree bug again, with exit 0. A real session (sdd-cwd-eval sdd-A-5) took exactly this path and only landed in the right place because its plan path happened to be the worktree's. The SDD and executing-plans helpers now pick their repository the way git does: the current directory's working tree, or DIR when given -C DIR. Outside any working tree, sdd-workspace, task-brief, review-package, task-start and task-done all stop with the shared message and write nothing, even when the plan's absolute path is inside a repository. sdd-repo no longer takes PLAN_FILE, since the plan has no say. The two "outside any repository ... uses the plan's repository" tests and the task-start/task-done fallback tests become assertions that the shared message comes out and nothing is written, in the cwd or the plan's repository. Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
2026-10-23fix(sdd): one no-repo message that puts "run from your working tree" firstJesse Vincent
sdd-repo's no-repository message told every caller to run 'git init'. That is the right fix for a new project, but the other way to reach it is standing in the wrong directory, such as the plugin's own skill directory after reading "from this skill's directory" literally. There, 'git init' would turn the plugin cache into a repository and hide the real mistake. task-start and task-done were worse. They still read HEAD and BASE in the bare cwd while the brief and ledger went through sdd-repo. From a non-repo cwd with the plan in a repo that has commits, task-start wrote the brief into the plan's repo, then printed git's fatal plus "HEAD has no commit yet ... make an initial commit first" and exited 2. task-done printed git's fatal. review-package in a repo with no commit said "bad BASE: HEAD~1". Every helper that can hit this (sdd-workspace, task-brief, review-package, task-start, task-done) now stops with the same message from sdd-repo, naming the current directory and offering init-and-commit only as the new-project case: SDD scripts must run from inside the git working tree you're executing in, with at least one commit (current directory: <PWD>). If this is a new project, run 'git init' and make a first commit, then rerun. sdd-repo gains --with-commit, which also refuses a repository whose HEAD has no commit. review-package, task-start and task-done pass it because they need HEAD as a BASE or a review range; sdd-workspace and task-brief do not, so a brief can still be written right after git init. task-start and task-done now read HEAD and BASE with git -C in the repository sdd-repo names. Resolution is otherwise unchanged: the cwd's repo, else the plan's, else exit 2. sdd-repo is now executable like its siblings. Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
2026-10-23fix(sdd): pick the scripts' repository deliberately, add -C DIR, explain a ↵Jesse Vincent
missing repo The SDD helpers found their repository with a bare `git rev-parse --show-toplevel` in the caller's cwd, and review-package ran every git command there too. Three reports trace back to that one line: - #2429: outside any repository (the skill's own directory in a 7.0 package has no .git), sdd-workspace fed `cd` an empty path. bash 5.2 treats that as a no-op and wrote the workspace into the cwd after printing git's bare fatal; Git Bash failed with "cd: null directory". A controller working on worktree B from worktree A had no way to name B. - #1799: the only way to aim review-package at a worktree was a `cd <worktree> ; review-package ...` compound, which harnesses cannot allowlist because the path and BASE change on every run. - #2242: in a greenfield directory with no repository, task-brief and sdd-workspace printed git's fatal and then carried on in the cwd (or crashed, depending on bash), review-package said "bad BASE: HEAD~1", and task-start printed an empty BASE with exit 0. A new sdd-repo helper is the single place that picks the repository: the cwd's working tree (or -C DIR's), exactly as git does. Anywhere else it stops with exit 2 and one shared message. sdd-workspace and review-package both use it, so they cannot disagree. The cwd still wins over the plan's location on purpose: writing-plans leaves the plan uncommitted in the main checkout, so an executor working in a linked worktree passes the main checkout's plan path, and its workspace and commits belong to the worktree. Resolving from PLAN_FILE first (draft #2439) breaks exactly that flow: review-package then diffs the main checkout and fails with "empty commit range". sdd-workspace, task-brief and review-package take an optional leading `-C DIR` that runs them as if started in DIR, as git -C does, so a caller can name another worktree in one allowlistable command. Each script resolves its own directory before the cd, so the documented `bash scripts/review-package` form from the skill directory keeps working with -C. PR #1809's version cd's first and then fails to find sdd-workspace (exit 127) in that form. task-start now refuses (exit 2) to print a BASE when HEAD has no commit, instead of printing "base: HEAD" or "base: " with exit 0. Co-authored-by: citizen204 <citizen204@users.noreply.github.com> Claude-Session: https://claude.ai/code/session_01SHANcr4A71nzuU9et4Fnba
2026-09-17Merge pull request #2134 from obra/fix/sdd-helpers-no-exec-bitDrew Ritter
fix(sdd): invoke sdd-workspace via bash so helpers survive stripped exec bits
2026-08-13fix(sdd): reject empty or non-descendant BASE..HEAD ranges in review-packagefix/review-package-range-guardsJesse Vincent
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
2026-08-13fix(sdd): invoke sdd-workspace via bash so helpers survive stripped exec bitsfix/sdd-helpers-no-exec-bitJesse Vincent
Codex marketplace users hit 'Permission denied' running SDD helpers: some extractors (Python zipfile) discard Unix mode attributes when unpacking the package, so task-brief's and review-package's direct exec of their sibling sdd-workspace fails. Our packaging preserves 0755 (git archive | tar -xpf, asserted by the existing packaging test) — the bits are lost on the consumer side, which no packaging change can reach. Invoking the sibling via "${BASH:-bash}" makes the exec bit irrelevant. TDD: new regression case copies the helpers, chmod -x, runs task-brief via bash — RED with the reported rc=126 Permission denied, GREEN after. Reported in #2040 (michaelholcomb-creator). Fixes #2040.
2026-07-19feat(sdd): plan-scoped workspace — one .superpowers/sdd/<plan> dir per planJesse Vincent
sdd-workspace now requires the plan file and resolves .superpowers/sdd/<plan-basename>/; task-brief and review-package write into their plan's directory (review-package gains PLAN_FILE as its first argument). Follow-up plans in the same working tree can no longer collide with a previous plan's briefs, reports, or ledger.
2026-06-18fix(sdd): write artifacts to working-tree .superpowers/sdd, not .git/ (#1780)Jesse Vincent
2026-06-16Shared: unique review-package collateral namesJesse Vincent
2026-06-16Add review-package script; close fix-dispatch test gapJesse Vincent
scripts/review-package generates the reviewer's input deterministically: commit list, stat summary, and net diff with -U10 context, written to a file from an explicit BASE. Live runs showed controllers improvising 'git diff HEAD~1..HEAD', which silently truncates multi-commit tasks, and svelte's five fix dispatches shipped without re-running any tests — fix dispatches now explicitly carry the implementer's re-run-and-report contract.