@afokapu/atdd-flow 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tasks.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afokapu/atdd-flow",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Filesystem-first Desk registry for projects, seats, tasks, threads, and handoffs.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tasks.ts CHANGED
@@ -246,8 +246,10 @@ export async function unblock(root: string, projectName: string, id: string, arg
246
246
  const task = await readTask(root, projectName, taskId(id));
247
247
  const actor = await canonicalAddress(root, required(words(args, "--by"), "--by"));
248
248
  if (actor !== task.coordinator) throw new Error(`Only ${task.coordinator} may unblock task ${id}.`);
249
- if (task.status !== "in_progress") throw new Error(`Task ${id} can only be unblocked while in_progress.`);
249
+ if (task.status !== "todo" && task.status !== "in_progress") throw new Error(`Task ${id} can only be unblocked while todo or in_progress.`);
250
250
  if (!task.blocker) throw new Error(`Task ${id} has no blocker to clear.`);
251
+ const waiting = await ready(root, projectName, task);
252
+ if (waiting.length) throw new Error(`Task ${id} is waiting on: ${waiting.join(", ")}.`);
251
253
  const { assertDependentsMayUnblock } = await import("./ephemeral-resources");
252
254
  await assertDependentsMayUnblock(root, { project: projectName, task: id });
253
255
  delete task.blocker;