fix: make task_done_missing_summary fixable in doctor to prevent validate-milestone skip loop (#820) (#842)
This commit is contained in:
parent
d593b2e367
commit
1f67ce250b
1 changed files with 24 additions and 1 deletions
|
|
@ -1144,8 +1144,31 @@ export async function runGSDDoctor(basePath: string, options?: { fix?: boolean;
|
|||
unitId: taskUnitId,
|
||||
message: `Task ${task.id} is marked done but summary is missing`,
|
||||
file: relTaskFile(basePath, milestoneId, slice.id, task.id, "SUMMARY"),
|
||||
fixable: false,
|
||||
fixable: true,
|
||||
});
|
||||
// Write a stub summary so validate-milestone can proceed.
|
||||
// This prevents infinite skip loops when tasks are marked done
|
||||
// without summaries (#820).
|
||||
if (shouldFix("task_done_missing_summary")) {
|
||||
const stubPath = join(
|
||||
basePath, ".gsd", "milestones", milestoneId, "slices", slice.id, "tasks",
|
||||
`${task.id}-SUMMARY.md`,
|
||||
);
|
||||
const stubContent = [
|
||||
`---`,
|
||||
`status: done`,
|
||||
`result: unknown`,
|
||||
`doctor_generated: true`,
|
||||
`---`,
|
||||
``,
|
||||
`# ${task.id}: ${task.title || "Unknown"}`,
|
||||
``,
|
||||
`Summary stub generated by \`/gsd doctor\` — task was marked done but no summary existed.`,
|
||||
``,
|
||||
].join("\n");
|
||||
await saveFile(stubPath, stubContent);
|
||||
fixesApplied.push(`created stub summary for ${taskUnitId}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!task.done && hasSummary) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue