code_worktree
Apply code edits in an isolated temporary git worktree, gate the change with a verification command, and commit to the current branch only when verification passes.
Instructions
Land a risky change safely: apply runs edits in a temp git worktree, your verify command gates it, and only on pass does the commit fast-forward into the CURRENT branch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | preview default; apply: dry_run=false; status: list. | |
| changes | No | Required for preview/apply: [{path, new_content, delete}]. | |
| dry_run | No | true = preview. | |
| message | No | Commit message. | |
| task_id | Yes | Task id. | |
| timeout | No | verify_cmd timeout ms. | |
| request_id | No | Idempotency key. | |
| verify_cmd | No | Non-zero = abort + rollback. | |
| workspace_dir | Yes | Project root (abs, git repo). | |
| expected_state_revision | No | Optimistic guard. |