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:
Binary file not shown.
@@ -106,11 +106,20 @@ class DashboardHandler(SimpleHTTPRequestHandler):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _find_tasks_dir(project_root: Path) -> Path | None:
|
def _find_tasks_dir(project_root: Path) -> Path | None:
|
||||||
"""Return the tasks directory. Checks both standard locations."""
|
from ..core.scope import detect_scope
|
||||||
candidates = [
|
_, scope = detect_scope()
|
||||||
project_root / ".automaton" / "tasks",
|
# Framework mode: tasks live inside .automaton/
|
||||||
project_root / "tasks",
|
# 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:
|
for p in candidates:
|
||||||
if p.exists() and p.is_dir():
|
if p.exists() and p.is_dir():
|
||||||
return p
|
return p
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Specifically:
|
|||||||
7. {project}/.automaton/extensions/contracts/*.md — Additive extensions loaded after global contracts
|
7. {project}/.automaton/extensions/contracts/*.md — Additive extensions loaded after global contracts
|
||||||
8. ~/.automaton/scripts/*.sh — Always from global framework
|
8. ~/.automaton/scripts/*.sh — Always from global framework
|
||||||
9. {project}/.automaton/extensions/scripts/*.sh — Additive extensions loaded before global scripts (pre-processing)
|
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
|
## 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
|
#### New tasks from user input
|
||||||
If {task-description} contains a description for a NEW task, the Orchestrator MUST:
|
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`)
|
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
|
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.
|
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
|
## 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**
|
1. Has `VERDICT.md` with `PASS` (non-empty) → **Complete**
|
||||||
2. Has `VERDICT.md` with `NEEDS_REVIEW` or `FAIL` (non-empty) → **Human Intervention**
|
2. Has `VERDICT.md` with `NEEDS_REVIEW` or `FAIL` (non-empty) → **Human Intervention**
|
||||||
|
|||||||
@@ -107,6 +107,18 @@ while IFS= read -r -d '' project_file; do
|
|||||||
fi
|
fi
|
||||||
done < <(find "$PROJECT_AUTOMATON" -maxdepth 1 -type f -name "*.md" -o -name "*.sh" -print0 2>/dev/null || true)
|
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
|
# Report
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== Migration Summary ==="
|
echo "=== Migration Summary ==="
|
||||||
|
|||||||
Reference in New Issue
Block a user