Skip to content

fix(sdd): keep workspace resolvable when plan file is deleted in a task (#2630) - #2639

Open
bhedanikhilkumar-code wants to merge 1 commit into
obra:devfrom
bhedanikhilkumar-code:fix/2630-sdd-workspace-deleted-plan
Open

bhedanikhilkumar-code wants to merge 1 commit into
obra:devfrom
bhedanikhilkumar-code:fix/2630-sdd-workspace-deleted-plan

Conversation

@bhedanikhilkumar-code

@bhedanikhilkumar-code bhedanikhilkumar-code commented Oct 28, 2026 •

Copy link
Copy Markdown

This PR targets the dev branch.

Who is submitting this PR? (required)

Field Value
Your model + version Gemini 3.8 Flash (High)
Harness + version Antigravity IDE 2.0
All plugins installed superpowers, science, chrome-devtools-plugin, data-agent-kit-plugin, firebase, flutter, gemini-api, google-antigravity-sdk, google-developer-knowledge, google_maps_platform, modern-web-guidance-plugin, claude-mem
Human partner who reviewed this diff @bhedanikhilkumar-code

What your human partner asked you to do, in their words:

Fix issue #2630 where review-package and sdd-workspace fail once a plan task deletes the plan file, verify with tests, and open a PR targeting dev.

Human-authored summary (required, under 200 words)

When executing plans with subagent-driven-development, finishing tasks often delete or archive the plan file as part of finalizing the branch. Currently, sdd-workspace and review-package unconditionally require [ -f "$plan" ], causing later steps—such as task review of that final commit and whole-branch review (review-package)—to exit 2 with no such plan file. This PR allows sdd-workspace and review-package to resolve an existing workspace if the plan was tracked in Git history or was already claimed by an existing workspace, while still rejecting truly non-existent plan files with exit 2. All 27 regression tests in test-sdd-workspace.sh pass.

What problem are you trying to solve?

Fixes #2630.

In subagent-driven-development, if a task deletes or moves the plan file (e.g. git rm docs/superpowers/plans/<plan>.md in a finishing commit), subsequent helper invocations fail:

  1. sdd-workspace immediately exits 2 with no such plan file: <plan>.
  2. review-package fails to generate the diff package for the final task or whole-branch review.

Reproduced with Git Bash on Windows / Linux: running review-package after a task deleted docs/plan.md exited 2 with no such plan file: docs/plan.md.

What does this PR change?

  • skills/subagent-driven-development/scripts/sdd-workspace: If the plan file is missing from the working tree, checks whether the plan was previously tracked in Git (git rev-list) or already owns an existing workspace in .superpowers/sdd/. If verified, it continues resolution; otherwise, it exits 2 with no such plan file.
  • skills/subagent-driven-development/scripts/review-package: If the plan file is missing from the working tree, delegates verification to sdd-workspace "$plan" before rejecting.
  • tests/claude-code/test-sdd-workspace.sh: Adds regression tests verifying that sdd-workspace resolves and review-package generates diffs even after a commit deletes the plan file.

Is this change appropriate for the core library?

Yes. It addresses a real failure mode in core SDD helper scripts affecting all harnesses when tasks clean up plan files. No dependencies added.

What alternatives did you consider?

  1. Forbidding tasks from deleting plan files: Rejected because developer workflows and conventions legitimately clean up or archive temporary plan documents before merge.
  2. Storing external workspace state outside .superpowers/sdd/: Rejected because checking existing markers and Git history is completely self-contained and requires no extra configuration or files.

Does this PR contain multiple unrelated changes?

No. Focused entirely on Issue #2630.

Existing PRs

Environments tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Antigravity IDE / Git Bash on Windows 11 2.0 Gemini 3.8 Flash (High) gemini-3.8-flash
Linux bash (test suite) bash 5.2 n/a n/a

New harness support (required if this PR adds a new harness)

Not applicable.

Evaluation

  • Initial prompt: "Option 1 karo" (Open an official PR for Issue subagent-driven-development: review-package and sdd-workspace fail once a plan task deletes the plan file #2630).
  • Sessions after change: Ran bash tests/claude-code/test-sdd-workspace.sh and reproduction test scripts.
  • Before:
    • Deleting plan file caused sdd-workspace to exit 2 with no such plan file.
    • review-package failed with exit 2.
  • After:
    • sdd-workspace cleanly resolves the existing workspace path.
    • review-package generates the review package diff.
    • Non-existent plan files without history still exit 2 as expected.
    • All 27 tests in tests/claude-code/test-sdd-workspace.sh pass.

Rigor

  • If this is a skills change: not a skill-text change (helper scripts and tests only)
  • This change was tested adversarially, not just on the happy path (verified both non-existent plan files failing exit 2 and deleted plans resolving cleanly)
  • I did not modify carefully-tuned content

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T20:16:47.600878Z
We couldn’t complete this review. Comment @codex review to try again.
c4215b8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant