1#!/usr/bin/env bash2# Resolve and ensure the working-tree directory SDD uses for one plan's3# short-lived artifacts: task briefs, implementer reports, review packages,4# and the progress ledger. Print the plan directory's absolute path.5#6# One directory per plan (.superpowers/sdd/<plan-basename>/) so a follow-up7# plan in the same working tree can never read or overwrite another plan's8# artifacts. A stale ledger misread as current progress makes controllers9# skip whole task sequences — plan-scoping removes that failure structurally.10#11# Basename slugs collide when two plans share a filename (docs/alpha/plan.md12# vs docs/beta/plan.md), so each workspace records its owning plan's path in13# a plan-path marker (repo-relative in-repo, absolute outside). A workspace14# owned by a different plan is skipped and the slug disambiguated with the15# plan's parent-directory name, then a counter. A workspace with no marker16# predates the marker scheme and is adopted for the current plan so in-flight