(task_id: str)
| 123 | |
| 124 | |
| 125 | def complete_task(task_id: str) -> str: |
| 126 | task = load_task(task_id) |
| 127 | if task.status != "in_progress": |
| 128 | return f"Task {task_id} is {task.status}, cannot complete" |
| 129 | task.status = "completed" |
| 130 | save_task(task) |
| 131 | unblocked = [t.subject for t in list_tasks() |
| 132 | if t.status == "pending" and t.blockedBy and can_start(t.id)] |
| 133 | print(f" \033[32m[complete] {task.subject} ✓\033[0m") |
| 134 | msg = f"Completed {task.id} ({task.subject})" |
| 135 | if unblocked: |
| 136 | msg += f"\nUnblocked: {', '.join(unblocked)}" |
| 137 | print(f" \033[33m[unblocked] {', '.join(unblocked)}\033[0m") |
| 138 | return msg |
| 139 | |
| 140 | |
| 141 | # ── Prompt Assembly (from s10, synced) ── |
no test coverage detected