diff --git a/agentydragon/WORKFLOW.md b/agentydragon/WORKFLOW.md index 1fbdc94bd5..a380952561 100644 --- a/agentydragon/WORKFLOW.md +++ b/agentydragon/WORKFLOW.md @@ -6,11 +6,12 @@ ## 1. Developer Agent - **Scope**: Runs inside a sandboxed git worktree for a single task branch (`agentydragon--`). - - **Actions**: - 1. Update the task Markdown file’s **Status** to `Done` when implementation is complete. - 2. Implement the code changes for the task. - 3. Run `pre-commit run --files $(git diff --name-only)` to apply and stage any autofix changes. - 4. **Do not** run `git commit`. +- **Actions**: + 1. If the task’s **Status** is `Needs input`, stop immediately and await further instructions; do **not** implement code changes or run pre-commit hooks. + 2. Update the task Markdown file’s **Status** to `Done` when implementation is complete. + 3. Implement the code changes for the task. + 4. Run `pre-commit run --files $(git diff --name-only)` to apply and stage any autofix changes. + 5. **Do not** run `git commit`. ## 2. Commit Agent - **Scope**: Runs in the sandbox (read-only `.git`) or equivalent environment. diff --git a/agentydragon/prompts/developer.md b/agentydragon/prompts/developer.md index a3b3a51d47..70bc09ba0c 100644 --- a/agentydragon/prompts/developer.md +++ b/agentydragon/prompts/developer.md @@ -14,10 +14,11 @@ Then proceed directly to implement the full functionality in the codebase as a s Do not pause to seek user confirmation after editing the Markdown; only ask clarifying questions if you encounter genuine ambiguities in the requirements. -At any point, you may set the task’s **Status** to any valid state (e.g. Not started, Started, Needs input, Needs manual review, Done, Cancelled) as appropriate. Use **Needs input** to request further clarification or resources before proceeding. +At any point, you may set the task’s **Status** to any valid state (e.g. Not started, In progress, Needs input, Needs manual review, Done, Cancelled) as appropriate. Use **Needs input** to request further clarification or resources before proceeding. -When you have completed the implementation and updated the task file: -set the task’s **Status** to "Done". -- Run the repository’s pre-commit hooks on all changed files (e.g. `pre-commit run --files `), and stage any autofix changes. -- Do **not** stage or commit beyond hook-driven fixes. Instead, stop and await the Commit agent to record your updates. +When you have finished working on the task file: +- If the task’s **Status** is "Needs input", stop immediately and await further instructions; do **not** run pre-commit hooks or invoke the Commit agent. +- Otherwise, set the task’s **Status** to "Done". + - Run the repository’s pre-commit hooks on all changed files (e.g. `pre-commit run --files `), and stage any autofix changes. + - Do **not** stage or commit beyond hook-driven fixes. Instead, stop and await the Commit agent to record your updates. Then stop and await further instructions. diff --git a/agentydragon/tasks/task-template.md b/agentydragon/tasks/task-template.md index 0804c684a4..829c399d05 100644 --- a/agentydragon/tasks/task-template.md +++ b/agentydragon/tasks/task-template.md @@ -2,13 +2,14 @@ id = "" title = "" status = "<<>>" +freeform_status = "<<>>" dependencies = [<<>>] # last_updated = "" +++ # Task Template -# Valid status values: Not started | Started | Needs input | Needs manual review | Done | Cancelled +# Valid status values: Not started | In progress | Needs input | Needs manual review | Done | Cancelled | Merged > *This task is specific to codex-rs.* diff --git a/agentydragon/tools/manager_utils/tasklib.py b/agentydragon/tools/manager_utils/tasklib.py index a4515369b0..d7a8125fcf 100644 --- a/agentydragon/tools/manager_utils/tasklib.py +++ b/agentydragon/tools/manager_utils/tasklib.py @@ -8,6 +8,7 @@ from datetime import datetime from pathlib import Path import toml +from enum import Enum from pydantic import BaseModel, Field FRONTMATTER_RE = re.compile(r"^\+\+\+\s*(.*?)\s*\+\+\+", re.S | re.M) @@ -21,10 +22,20 @@ def task_dir(): def worktree_dir(): return task_dir() / ".worktrees" +class TaskStatus(str, Enum): + NOT_STARTED = "Not started" + IN_PROGRESS = "In progress" + NEEDS_INPUT = "Needs input" + NEEDS_MANUAL_REVIEW = "Needs manual review" + DONE = "Done" + CANCELLED = "Cancelled" + MERGED = "Merged" + class TaskMeta(BaseModel): id: str title: str - status: str + status: TaskStatus + freeform_status: str = Field(default="") dependencies: str = Field(default="") last_updated: datetime = Field(default_factory=datetime.utcnow) @@ -40,6 +51,9 @@ def load_task(path: Path) -> (TaskMeta, str): def save_task(path: Path, meta: TaskMeta, body: str) -> None: tm = meta.dict() + # Serialize enum to its string value for front-matter + if isinstance(tm.get('status'), Enum): + tm['status'] = tm['status'].value tm['last_updated'] = meta.last_updated.isoformat() fm = toml.dumps(tm).strip() content = f"+++\n{fm}\n+++\n\n{body.lstrip()}"