diff --git a/automaton/dashboard/ui/__pycache__/app.cpython-314.pyc b/automaton/dashboard/ui/__pycache__/app.cpython-314.pyc index 3d8b968..2aa5b26 100644 Binary files a/automaton/dashboard/ui/__pycache__/app.cpython-314.pyc and b/automaton/dashboard/ui/__pycache__/app.cpython-314.pyc differ diff --git a/automaton/dashboard/ui/app.py b/automaton/dashboard/ui/app.py index 61e1900..c823f6e 100644 --- a/automaton/dashboard/ui/app.py +++ b/automaton/dashboard/ui/app.py @@ -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 diff --git a/prompts/orchestrate.md b/prompts/orchestrate.md index 2b4a653..657aca4 100644 --- a/prompts/orchestrate.md +++ b/prompts/orchestrate.md @@ -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** diff --git a/scripts/migrate-project.sh b/scripts/migrate-project.sh index 06d2292..7554bb7 100755 --- a/scripts/migrate-project.sh +++ b/scripts/migrate-project.sh @@ -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 ==="