# RESEARCH: move-completed-tasks-to-complete-folder ## Objective When `--transition complete` is called, move the task directory from `tasks//` to `tasks/complete//`. Keep `--list` and `--audit` showing only active tasks. Allow `--task ` to find completed tasks by fallback. ## Current Behavior `--transition complete` only writes the `.state` file to `"complete"`. The task directory stays in `tasks//` alongside active tasks, cluttering the listing and audit. ## Design ### _task_dir fallback Add a fallback in `_task_dir`: if `tasks//` doesn't exist, check `tasks/complete//`. This ensures `--task ` and `--transition` still work for completed tasks. ### cmd_transition move After `_write_state(task_path, target)`, if `target == "complete"`, compute the tasks root and move `task_path` to `tasks/complete//`. Create `tasks/complete/` if it doesn't exist. Refuse if a completed task with the same name already exists. ### _all_task_dirs unchanged Do NOT scan `tasks/complete/` in `_all_task_dirs`. Completed tasks are out of sight from `--list` and `--audit`. The fallback in `_task_dir` is sufficient for targeted lookups. ### cmd_create_task `_task_dir` already returns the completed path via fallback, so `cmd_create_task` will see `task_path.exists()` and refuse with "already exists". No separate check needed. ## Risks - **Audit:** `--audit` uses `_all_task_dirs` which doesn't scan `tasks/complete/`, so completed tasks are invisible to audit. This is the desired behavior. - **Loop references:** If a loop's `current_task` points to a completed task, the audit at line 954 checks `_task_dir(ltask, args.project).exists()` which will find the completed task via fallback. Correct. - **`--transition` on completed tasks:** `_task_dir` finds the completed task, `_require_state` reads `"complete"`, and `LEGAL_TRANSITIONS.get("complete", [])` returns `[]`, so any transition is refused. Correct.