Skip to content

fix(sdd): ownership markers stop same-basename plans sharing a workspace - #2138

Open
obra wants to merge 1 commit into
devfrom
fix/sdd-workspace-ownership
Open

fix(sdd): ownership markers stop same-basename plans sharing a workspace#2138
obra wants to merge 1 commit into
devfrom
fix/sdd-workspace-ownership

Conversation

@obra

@obra obra commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Problem (#2045)

sdd-workspace slugs by basename "$plan" .md, so docs/alpha/plan.md and docs/beta/plan.md resolve to one workspace and task-brief silently overwrites the other plan's brief — the single source of task requirements, gitignored, unrecoverable. Reproduced live during triage and again in this PR's RED run (alpha's brief ends up containing beta's text).

Design (settled on #2045 after closing PR #2120)

  • Slugs stay basename-derived — no ugly path slugs, no rename churn.
  • Out-of-repo plans keep working (absolute-path marker).
  • No migration break: a marker-less workspace (pre-marker or legacy) is adopted in place and marked — in-flight plans keep resolving. The documented tradeoff: the first collision on a legacy marker-less workspace adopts rather than detects; marker-less workspaces age out as plans finish.
  • Ownership marker: each workspace records its owning plan's normalized path (plan-path; repo-relative in-repo, absolute outside). Marker names a different plan → disambiguate to <slug>-<parent-dir>, then a counter.
  • Relative/absolute/../ spellings of one plan normalize (physical path) to one workspace. All cds are CDPATH= cd -- guarded (carried from fix(sdd): slug the workspace by plan path, not basename #2120's review findings).

task-brief and review-package need no changes — they delegate to sdd-workspace and hold no slug logic (verified).

TDD evidence

8 new assertions written first, RED against the unmodified script — including the live #2045 reproduction (both plans → .superpowers/sdd/plan, brief clobbered) — then GREEN across the full suite with all 13 pre-existing assertions unmodified. One SKILL.md line updated because disambiguation makes the exact-path parenthetical false; ledger-check prose untouched.

Note: this appends to test-sdd-workspace.sh alongside #2134 and #2136 — whichever lands later gets a trivial append-order rebase.

Reported by @CRGDan in #2045; reproduction and test patterns credit @crisnahine's closed #2120. Fixes #2045.

Who is submitting

Claude Fable 5 on Claude Code 2.1.228 (implementation subagent + controller review of the full diff), working the triage build queue directed by @obra, who reviews the diff.

@arittr @ada-sen — review requested.

sdd-workspace slugged workspaces by basename alone, so docs/alpha/plan.md
and docs/beta/plan.md resolved to one directory and task-brief silently
overwrote the other plan's brief — the single gitignored source of task
requirements, unrecoverable once clobbered.

Each workspace now records its owning plan in a plan-path marker
(repo-relative in-repo, absolute outside). Lookup keeps basename slugs
and existing behavior for the common case: a markerless workspace is
adopted in place (no migration break for in-flight plans), a marker
naming this plan is a match, and a marker naming a different plan
disambiguates with the plan's parent-directory name, then a counter.
Plan paths are normalized (CDPATH-guarded physical cd) so relative,
absolute, and ../ spellings of one plan share one workspace.

task-brief and review-package delegate to sdd-workspace and need no
changes. SKILL.md's workspace bullet no longer promises the exact
<plan-basename> path, since disambiguated workspaces differ.

Reported by @CRGDan; reproduction and test groundwork by @crisnahine
in PR #2120.

Fixes #2045
@obra
obra requested a review from arittr August 13, 2026 00:36
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