Compare commits

..

1 Commits

Author SHA1 Message Date
Jesse Vincent 2a500febcc fix(requesting-code-review): anchor the multi-commit BASE_SHA alternative to the merge base
The '# or origin/main' alternative fed a moving ref into the reviewer's
two-dot diff: once origin/main advances past the branch point, main's new
files appear as phantom deletions the reviewer can't distinguish from real
ones. Reproduced during triage (2026-08-12): a scratch repo with main
advanced one commit shows 'main-new.txt | 1 -' in the branch's diff.
git merge-base origin/main HEAD anchors the range to the branch point,
matching how sdd's review-package already computes BASE.

Reported in #2118 (wan-huiyan). Fixes #2118.
2026-08-13 00:26:43 +00:00
4 changed files with 3 additions and 22 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ Dispatch a code reviewer subagent to catch issues before they cascade. The revie
**1. Get git SHAs:**
```bash
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
BASE_SHA=$(git rev-parse HEAD~1) # or: git merge-base origin/main HEAD
HEAD_SHA=$(git rev-parse HEAD)
```
@@ -25,9 +25,7 @@ git rev-parse --verify --quiet "$head" >/dev/null || { echo "bad HEAD: $head" >&
if [ $# -eq 4 ]; then
out=$4
else
# Invoke via bash rather than direct exec: some extractors (Python zipfile)
# strip Unix exec bits when unpacking marketplace packages (#2040).
dir=$("${BASH:-bash}" "$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
out="$dir/review-$(git rev-parse --short "$base")..$(git rev-parse --short "$head").diff"
fi
@@ -21,9 +21,7 @@ n=$2
if [ $# -eq 3 ]; then
out=$3
else
# Invoke via bash rather than direct exec: some extractors (Python zipfile)
# strip Unix exec bits when unpacking marketplace packages (#2040).
dir=$("${BASH:-bash}" "$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
dir=$("$(cd "$(dirname "$0")" && pwd)/sdd-workspace" "$plan")
out="$dir/task-${n}-brief.md"
fi
-15
View File
@@ -189,21 +189,6 @@ PLAN
echo " status: $wt_status"
fi
# --- helpers survive a mode-stripping extractor dropping exec bits (#2040) ---
local stripped="$TEST_ROOT/stripped-scripts"
mkdir -p "$stripped"
cp "$SDD_SCRIPTS/sdd-workspace" "$SDD_SCRIPTS/task-brief" "$SDD_SCRIPTS/review-package" "$stripped/"
chmod -x "$stripped"/*
local noexec_out noexec_rc=0
noexec_out="$(cd "$repo" && bash "$stripped/task-brief" plan-b.md 1 2>&1)" || noexec_rc=$?
if [[ "$noexec_rc" -eq 0 && -f "$repo/.superpowers/sdd/plan-b/task-1-brief.md" ]]; then
pass "task-brief works with no exec bit on sdd-workspace"
else
fail "task-brief works with no exec bit on sdd-workspace"
echo " rc: $noexec_rc"
echo " output: $noexec_out"
fi
echo ""
if [[ "$FAILURES" -ne 0 ]]; then
echo "FAILED: $FAILURES assertion(s)."