diff --git a/agentydragon/README.md b/agentydragon/README.md index 2966b0d56e..756e08a97d 100644 --- a/agentydragon/README.md +++ b/agentydragon/README.md @@ -25,9 +25,16 @@ Tasks live under `agentydragon/tasks/` as individual Markdown files. Please upda ### Branch & Worktree Workflow - **Branch convention**: work on each task in its own branch named `agentydragon/-`. -- **Worktree helper**: run `create-task-worktree.sh -` - in `agentydragon/tasks/` to create or reuse a worktree at - `agentydragon/tasks/.worktrees/-` off the `master` branch. +- **Worktree helper**: in `agentydragon/tasks/`, run: +- +- ```sh +- create-task-worktree.sh [--agent] - +- ``` +- +- Without `--agent`, this creates or reuses a worktree at +- `agentydragon/tasks/.worktrees/-` off the `master` branch. +- With `--agent`, after setup it launches a Codex agent in that workspace, +- preloaded to work on the specified task from its Markdown file. --- diff --git a/agentydragon/tasks/14-ai-generated-approval-predicates.md b/agentydragon/tasks/14-ai-generated-approval-predicates.md new file mode 100644 index 0000000000..69a3387fbc --- /dev/null +++ b/agentydragon/tasks/14-ai-generated-approval-predicates.md @@ -0,0 +1,39 @@ +# Task 14: AI‑Generated Approval Predicate Suggestions + +> *This task is specific to codex-rs.* + +## Status + +**General Status**: Not started +**Summary**: Not started; missing Implementation details (How it was implemented and How it works). + +## Goal + +When a shell command is not auto-approved, the approval prompt should include 1–3 AI-generated approval predicates. Each suggestion is a time-limited Python predicate snippet plus an explanation of the full set of permissions it would grant. Users can pick one suggestion to append to the session’s approval policy as a broader-scope allow rule. + +## Acceptance Criteria + +- When a command is not auto-approved, show up to 3 suggested predicates inline in the TUI approval dialog. +- Each suggestion consists of: + - A Python code snippet defining a predicate function. + - An AI-generated explanation of exactly what permissions or scope that predicate grants. + - A TTL or expiration timestamp indicating how long it will remain active. +- Users can select one suggestion to append to the session’s list of approval predicates. +- Predicates are stored in session state (in-memory) for the duration of the session. +- Provide a slash/CLI command (`/inspect-approval-predicates`) to list current predicates, their code, explanations, and timeouts. +- Support headless and interactive modes equally. + +## Implementation + +**How it was implemented** +*(Not implemented yet)* + +**How it works** +*(Not implemented yet)* + +## Notes + +- Reuse the existing AI reasoning engine to generate predicate suggestions. +- Represent predicates as Python functions returning a boolean. +- Ensure that expiration is enforced and stale predicates are ignored. +- Integrate the new `/inspect-approval-predicates` command into both the TUI and Exec CLI. \ No newline at end of file diff --git a/agentydragon/tasks/create-task-worktree.sh b/agentydragon/tasks/create-task-worktree.sh index 8d82d9f99b..1ace9a20ee 100755 --- a/agentydragon/tasks/create-task-worktree.sh +++ b/agentydragon/tasks/create-task-worktree.sh @@ -7,8 +7,26 @@ set -euo pipefail +agent_mode=false +while [[ $# -gt 0 ]]; do + case "$1" in + -a|--agent) + agent_mode=true + shift + ;; + -h|--help) + echo "Usage: $0 [-a|--agent] -" + echo " -a, --agent after creating/reusing, launch a codex agent in the task workspace" + exit 0 + ;; + *) + break + ;; + esac +done + if [ "$#" -ne 1 ]; then - echo "Usage: $0 -" + echo "Usage: $0 [-a|--agent] -" exit 1 fi @@ -38,4 +56,10 @@ else echo "Worktree for $branch already exists at $worktree_path" fi -echo "Done." \ No newline at end of file +echo "Done." + +if [ "$agent_mode" = true ]; then + echo "Launching codex agent for task $task_slug in $worktree_path" + cd "$worktree_path" + codex "Read the task definition in agentydragon/tasks/$task_slug.md and update its **Status** and **Implementation** sections to make progress on the task. Continue editing the file until the task is complete." +fi \ No newline at end of file