Fix task directory gap in upgrade process

The additive extension model refactor moved prompts/contracts/scripts into
.automaton/ but never addressed where tasks live. Two conventions existed:
framework keeps tasks in .automaton/tasks/, Orchestrator creates project
tasks at tasks/.

Fixes:
- Dashboard _find_tasks_dir() now scope-aware: framework mode prefers
  .automaton/tasks/, project mode prefers tasks/ at project root
- migrate-project.sh: if tasks exist in .automaton/tasks/ (old model),
  move them to tasks/ (project root)
- Orchestrator prompt: documents that tasks location depends on scope
This commit is contained in:
2026-06-13 21:33:23 -04:00
parent e3e45a23f2
commit 741364654c
4 changed files with 34 additions and 8 deletions
+14 -5
View File
@@ -106,11 +106,20 @@ class DashboardHandler(SimpleHTTPRequestHandler):
@staticmethod
def _find_tasks_dir(project_root: Path) -> Path | None:
"""Return the tasks directory. Checks both standard locations."""
candidates = [
project_root / ".automaton" / "tasks",
project_root / "tasks",
]
from ..core.scope import detect_scope
_, scope = detect_scope()
# Framework mode: tasks live inside .automaton/
# Project mode: tasks live at project root, .automaton/tasks/ may be a symlink
if scope == "framework":
candidates = [
project_root / ".automaton" / "tasks",
project_root / "tasks",
]
else:
candidates = [
project_root / "tasks",
project_root / ".automaton" / "tasks",
]
for p in candidates:
if p.exists() and p.is_dir():
return p
+8 -3
View File
@@ -19,7 +19,7 @@ Specifically:
7. {project}/.automaton/extensions/contracts/*.md — Additive extensions loaded after global contracts
8. ~/.automaton/scripts/*.sh — Always from global framework
9. {project}/.automaton/extensions/scripts/*.sh — Additive extensions loaded before global scripts (pre-processing)
10. Any existing files under {project}/tasks/
10. {project}/tasks/ — Project tasks (project mode) or ~/.automaton/tasks/ (framework mode)
## VRAM Detection
@@ -201,7 +201,10 @@ If the user says "orchestrate" or "continue" with no new task description, the O
#### New tasks from user input
If {task-description} contains a description for a NEW task, the Orchestrator MUST:
1. Generate a kebab-case task name from the description (e.g., "add user auth" → `add-user-auth`)
2. Create the task folder: `{project}/tasks/{task-name}/` (empty — no artifact files)
2. Create the task folder. Task location depends on scope:
- **Framework mode** (inside ~/.automaton/): `~/.automaton/tasks/{task-name}/`
- **Project mode** (in a user project): `{project}/tasks/{task-name}/`
The dashboard reads from both locations automatically.
3. **Immediately drive it to completion** using the auto-execution loop
Note: `IMPLEMENTATION.md` is the artifact produced by the implementation phase, not the Orchestrator. Do not pre-create it. **Do not create an empty `IMPLEMENTATION.md` for new tasks** — this is inconsistent with the Orchestrator's own rule and can confuse the Research phase.
@@ -237,7 +240,9 @@ In manual mode, the Orchestrator only **reports** the current state and the next
## State Determination
Examine the tasks/ directory and determine the state of each task folder. Check from the most advanced state backward. **Important**: Always check that artifacts are non-empty before considering them as indicators of task state.
Examine the tasks/ directory and determine the state of each task folder. The tasks directory is:
- **Framework mode**: `~/.automaton/tasks/`
- **Project mode**: `{project}/tasks/` Check from the most advanced state backward. **Important**: Always check that artifacts are non-empty before considering them as indicators of task state.
1. Has `VERDICT.md` with `PASS` (non-empty) → **Complete**
2. Has `VERDICT.md` with `NEEDS_REVIEW` or `FAIL` (non-empty) → **Human Intervention**
+12
View File
@@ -107,6 +107,18 @@ while IFS= read -r -d '' project_file; do
fi
done < <(find "$PROJECT_AUTOMATON" -maxdepth 1 -type f -name "*.md" -o -name "*.sh" -print0 2>/dev/null || true)
# Task directory — old model stored tasks in .automaton/tasks/, new model uses tasks/
OLD_TASKS="$PROJECT_AUTOMATON/tasks"
NEW_TASKS="$PROJECT_DIR/tasks"
if [ -d "$OLD_TASKS" ] && [ ! -e "$NEW_TASKS" ]; then
echo " MOVING .automaton/tasks/ → tasks/ (tasks should be at project root)"
mv "$OLD_TASKS" "$NEW_TASKS"
MOVED+=(".automaton/tasks/ -> tasks/")
elif [ -d "$OLD_TASKS" ] && [ -d "$NEW_TASKS" ]; then
echo " NOTICE Both .automaton/tasks/ and tasks/ exist — keeping both"
KEPT+=(".automaton/tasks/ and tasks/")
fi
# Report
echo ""
echo "=== Migration Summary ==="