fix: downgrade missing_tasks_dir to warning for completed slices (#772)

* fix: downgrade missing_tasks_dir to warning for completed slices (#726)

When a worktree is removed and artifacts are rebuilt, tasks/ directories
aren't recreated. For completed slices this is cosmetic scaffolding, not
a structural error. Downgrade severity from "error" to "warning" so
completed milestones can render in /gsd visualize.

Also skip the missing_slice_plan warning entirely for completed slices,
since a plan file serves no purpose after completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use slice.done instead of non-existent frontmatter.status

The SummaryFrontmatter type doesn't have a `status` property.
Use `slice.done` from the roadmap parser instead, which is the
canonical completion signal already available in scope.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
TÂCHES 2026-03-16 21:09:17 -06:00 committed by GitHub
parent 912b48adad
commit ed341a95b1

View file

@ -1094,11 +1094,13 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
const tasksDir = resolveTasksDir(basePath, milestoneId, slice.id);
if (!tasksDir) {
issues.push({
severity: "error",
severity: slice.done ? "warning" : "error",
code: "missing_tasks_dir",
scope: "slice",
unitId,
message: `Missing tasks directory for ${unitId}`,
message: slice.done
? `Missing tasks directory for ${unitId} (slice is complete — cosmetic only)`
: `Missing tasks directory for ${unitId}`,
file: relSlicePath(basePath, milestoneId, slice.id),
fixable: true,
});
@ -1112,15 +1114,17 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
const planContent = planPath ? await loadFile(planPath) : null;
const plan = planContent ? parsePlan(planContent) : null;
if (!plan) {
issues.push({
severity: "warning",
code: "missing_slice_plan",
scope: "slice",
unitId,
message: `Slice ${unitId} has no plan file`,
file: relSliceFile(basePath, milestoneId, slice.id, "PLAN"),
fixable: false,
});
if (!slice.done) {
issues.push({
severity: "warning",
code: "missing_slice_plan",
scope: "slice",
unitId,
message: `Slice ${unitId} has no plan file`,
file: relSliceFile(basePath, milestoneId, slice.id, "PLAN"),
fixable: false,
});
}
continue;
}