fix(diagnose): place step 4's edits in a worktree #195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/diagnose-check-worktree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
An agent can run
diagnoseon a failing test that is no regression,for instance when an
execute-plantask meets a failure of unknowncause. In that case no step opens a scratch worktree: step 2 opens one
only for an agreed reproduction, and step 3 only for a bisect. When the
agent then tests a hypothesis by editing code, such as adding a log
line or reverting a hunk, step 4 does not say where to edit. The agent
is left with the main checkout or the task's own worktree. Step 5, the
Overview, and the workflow page all remove a scratch worktree that was
never opened. Fixes #194.
Two alternatives were set aside. Opening the worktree in step 1 would
add a worktree to diagnoses that only read. Making step 5 conditional
on its own would leave step 4's edits with no place to go.
What changed
Step 4 now runs a check that changes files in the scratch worktree, and
opens one from
open-worktreewhen none is open, as step 3 alreadydoes for a bisect. A check that only reads does not need a worktree.
The Overview and step 5 remove a scratch worktree only when one was
opened.
On the workflow page, the "Reads and writes" line says the skill
changes code only in a scratch worktree it removes at the end, and the
chart's last node reads "Remove any scratch worktree".
How to verify
Read
.agents/skills/diagnose/SKILL.mdon the branch as an agent witha failing test that is no regression. Steps 2 and 3 open nothing. Step
4 sends an edit for a hypothesis to a scratch worktree it opens, and
step 5 removes it. A diagnosis whose checks only read reaches step 5
with nothing to remove. On
main, step 4 names no place for the edit,and step 5 removes a worktree that does not exist.
On the tip,
bash tests/verify-agent-config.sh,bash tests/check-work-folder.sh,.agents/hooks/shellcheck.sh repo,prettier --check '**/*.md',scripts/verify-agent-config.sh, andgit diff --check mainall pass. No test checks this prose. Thebehavioral evals were not run, since each run is billed.
https://claude.ai/code/session_012CBsgjdkRDt2uVUmT7bj64