diagnose: step 4's checks have no worktree when none is open #194

Closed
opened 2026-11-05 07:58:55 +01:00 by motoko · 0 comments
Collaborator

Location

.agents/skills/diagnose/SKILL.md, steps 2 to 5 and the Overview, with
the "Reads and writes" of docs/workflows/diagnose.md. Seen on main
at 1c87aae.

Evidence

Step 2 opens a scratch worktree from open-worktree only when a
reproduction is agreed with the user, and step 3 opens one only for a
bisect. When a failing test is the reproduction and the failure is not
a regression, no worktree is open. Step 4 still rules hypotheses in or
out "with the smallest check", and a check often edits code, such as
adding a log line or reverting a hunk. AGENTS.md puts every change to
files in a worktree, and the Overview and the page say the skill works
in a scratch worktree it removes at the end. Step 5's "remove the
scratch worktree" also assumes one exists.

Scenario

A task in execute-plan meets a failing test of unknown cause and runs
diagnose. The test is the reproduction, and the failure is not a
regression, so no worktree is opened. To test a hypothesis, the agent
edits the code. No step says where: in the task's worktree, where the
edit mixes into the change, or in a scratch worktree the skill does not
open. At step 5 there is nothing to remove.

Smallest fix

In step 4, run checks that change files in the scratch worktree, opened
from open-worktree when none is open, as step 3 already does for a
bisect. Other options were set aside: always opening it in step 1 adds
a step for diagnoses that only read, and saying that step 4's checks
only read does not match checks that run code.

https://claude.ai/code/session_012CBsgjdkRDt2uVUmT7bj64

## Location `.agents/skills/diagnose/SKILL.md`, steps 2 to 5 and the Overview, with the "Reads and writes" of `docs/workflows/diagnose.md`. Seen on `main` at 1c87aae. ## Evidence Step 2 opens a scratch worktree from `open-worktree` only when a reproduction is agreed with the user, and step 3 opens one only for a bisect. When a failing test is the reproduction and the failure is not a regression, no worktree is open. Step 4 still rules hypotheses in or out "with the smallest check", and a check often edits code, such as adding a log line or reverting a hunk. `AGENTS.md` puts every change to files in a worktree, and the Overview and the page say the skill works in a scratch worktree it removes at the end. Step 5's "remove the scratch worktree" also assumes one exists. ## Scenario A task in `execute-plan` meets a failing test of unknown cause and runs `diagnose`. The test is the reproduction, and the failure is not a regression, so no worktree is opened. To test a hypothesis, the agent edits the code. No step says where: in the task's worktree, where the edit mixes into the change, or in a scratch worktree the skill does not open. At step 5 there is nothing to remove. ## Smallest fix In step 4, run checks that change files in the scratch worktree, opened from `open-worktree` when none is open, as step 3 already does for a bisect. Other options were set aside: always opening it in step 1 adds a step for diagnoses that only read, and saying that step 4's checks only read does not match checks that run code. https://claude.ai/code/session_012CBsgjdkRDt2uVUmT7bj64
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
claudiomaradonna/agent-foundry#194
No description provided.