diff --git a/agentydragon/README.md b/agentydragon/README.md index f75221ef47..e638379980 100644 --- a/agentydragon/README.md +++ b/agentydragon/README.md @@ -59,7 +59,7 @@ Tasks live under `agentydragon/tasks/` as individual Markdown files. Please upda - - Without `--agent`, this creates or reuses a worktree at - `agentydragon/tasks/.worktrees/-` off the `agentydragon` branch. - - With `--agent`, after setup it launches the Developer Codex agent in that workspace (using `prompts/developer.md` and the task file), + - With `--agent`, after setup it runs pre-commit checks (aborting on failure), then launches the Developer Codex agent in that workspace (using `prompts/developer.md` and the task file), - and when the developer agent exits, it automatically runs the Commit agent helper to stage fixes and commit the work. **Commit agent helper**: in `agentydragon/tasks/`, run: diff --git a/agentydragon/tasks/25-guard-tool-output-sequencing-rust.md b/agentydragon/tasks/25-guard-tool-output-sequencing-rust.md index f93416da84..3d209635be 100644 --- a/agentydragon/tasks/25-guard-tool-output-sequencing-rust.md +++ b/agentydragon/tasks/25-guard-tool-output-sequencing-rust.md @@ -1,7 +1,7 @@ +++ id = "25" title = "Guard Against Missing Tool Output in Rust Server Sequencing" -status = "Reopened" +status = "Needs input" dependencies = "" # No prerequisites last_updated = "2025-06-25T22:50:01.000000" +++ diff --git a/agentydragon/tasks/create-task-worktree.sh b/agentydragon/tasks/create-task-worktree.sh index 0a0a245126..c0d92213e5 100755 --- a/agentydragon/tasks/create-task-worktree.sh +++ b/agentydragon/tasks/create-task-worktree.sh @@ -26,8 +26,9 @@ while [[ $# -gt 0 ]]; do Usage: $0 [-a|--agent] [-s|--shell] [-i|--interactive] [-t|--tmux] [...] Options: - -a, --agent create/reuse worktree and launch a Codex agent with prompt injection; - when the agent exits, auto-run commit helper + -a, --agent create/reuse worktree, run pre-commit checks (aborting on failure), + and launch a Codex agent with prompt injection; when the agent exits, + auto-run commit helper -s, --shell create/reuse worktree and launch an interactive Codex shell (no prompt injection, skip auto-commit) -i, --interactive run the agent in interactive mode (no 'exec'); implies --agent @@ -140,6 +141,16 @@ echo "Done." if [ "$agent_mode" = true ]; then echo "Launching Developer Codex agent for task $task_slug in sandboxed worktree" cd "${worktree_path}" + # Before launching the developer agent, run pre-commit checks and abort if hooks fail + if command -v pre-commit >/dev/null 2>&1; then + echo "Running pre-commit checks in $(pwd)" + if ! pre-commit run --all-files; then + echo "Error: pre-commit checks failed. Fix issues before launching the developer agent." >&2 + exit 1 + fi + else + echo "Warning: pre-commit is not installed; skipping pre-commit checks." >&2 + fi echo "Launching Developer Codex agent for task $task_slug in sandboxed worktree" if [ "$shell_mode" = true ]; then # Interactive shell mode: no prompt, skip commit helper diff --git a/agentydragon/tools/check_task_cycles.py b/agentydragon/tools/check_task_cycles.py index 8bc8abd306..aab257f1ad 100755 --- a/agentydragon/tools/check_task_cycles.py +++ b/agentydragon/tools/check_task_cycles.py @@ -14,10 +14,14 @@ def main(): # Load all tasks and separate merged vs non-merged merged = set() deps_map = {} + id_to_path = {} + # skip template/plan files and any worktree copies + wt_root = task_dir() / '.worktrees' for md in task_dir().rglob('[0-9][0-9]-*.md'): - if md.name == 'task-template.md' or md.name.endswith('-plan.md'): + if md.name == 'task-template.md' or md.name.endswith('-plan.md') or md.is_relative_to(wt_root): continue meta, _ = load_task(md) + id_to_path[meta.id] = md if meta.status == 'Merged': merged.add(meta.id) else: @@ -36,7 +40,11 @@ def main(): def visit(n): if n in stack: cycle = stack[stack.index(n):] + [n] - print(f"Circular dependency detected: {' -> '.join(cycle)}") + cycle_str = ' -> '.join(cycle) + print(f"Circular dependency detected: {cycle_str}", file=sys.stderr) + print("Paths involved in cycle:", file=sys.stderr) + for tid in cycle: + print(f" {id_to_path.get(tid, tid)}", file=sys.stderr) sys.exit(1) if n in visited: return diff --git a/agentydragon/tools/check_task_frontmatter.py b/agentydragon/tools/check_task_frontmatter.py index 40094a73ac..a6c98328e0 100755 --- a/agentydragon/tools/check_task_frontmatter.py +++ b/agentydragon/tools/check_task_frontmatter.py @@ -28,13 +28,15 @@ ALLOWED_STATUSES = ["Not started", "Started", "Needs manual review", "Done", "Ca def main(): failures = 0 + # skip template/plan files and any worktree copies + wt_root = tasklib.worktree_dir() for md in tasklib.task_dir().rglob('[0-9][0-9]-*.md'): - if md.name == 'task-template.md' or md.name.endswith('-plan.md'): + if md.name == 'task-template.md' or md.name.endswith('-plan.md') or md.is_relative_to(wt_root): continue try: task, _body = tasklib.load_task(md) except ValueError as e: - print(e) + print(f"{md}: {e}", file=sys.stderr) failures += 1 if failures: diff --git a/agentydragon/tools/manager_utils/agentydragon_task.py b/agentydragon/tools/manager_utils/agentydragon_task.py index d95307edc9..b3d602bd5c 100644 --- a/agentydragon/tools/manager_utils/agentydragon_task.py +++ b/agentydragon/tools/manager_utils/agentydragon_task.py @@ -31,8 +31,10 @@ def status(): # Load all task metadata, reporting load errors with file path all_meta: dict[str, TaskMeta] = {} path_map: dict[str, Path] = {} + wt_root = worktree_dir() for md in sorted(task_dir().rglob('[0-9][0-9]-*.md')): - if md.name in ('task-template.md',) or md.name.endswith('-plan.md'): + # skip task template, plan files, and any worktree copies + if md.name in ('task-template.md',) or md.name.endswith('-plan.md') or md.is_relative_to(wt_root): continue try: meta, _ = load_task(md)