Skip to content

fix: type=fix/chore dispatches on worktree=1 repos use the MAIN checkout — contamination hazard #8

Description

@jakecelentano

Scope

Realized 2026-07-18 via tower-fleet#211: a type=fix dispatch on tower-fleet (worktree=1 in the tmq registry) worked directly in /root/tower-fleet (main checkout). The agent's commit swept up 13 untracked backups/opnsense/*.gpg nightly artifacts into the PR — caught in human review, agent instructed to decontaminate (it did; PASS at clean head, merged).

The registry comment says worktree=1 repos are hazardous for in-place branch switches, but tmq's fix/chore path uses the main checkout BY DESIGN ('For fixes/chores on main, it uses the main checkout directly' — script header). That design is exactly where untracked-file contamination and concurrent-clobber hazards live. Same session, fix-openagent#41 also worked in /root/projects/openagent main (benign this time — daemon runs from installed package — but same hazard class).

Options

(a) type=fix/chore on worktree=1 repos also uses a worktree (branch from origin/main, PR from there), main-checkout path only for worktree=0 repos.
(b) Keep main-checkout for fix/chore but add an untracked-file guard: refuse to dispatch (or warn loudly in the prompt) when the main checkout has untracked/modified files; require explicit file enumeration in the agent prompt (the fleet's no-git-add--A rule).
(c) Both.

Acceptance criteria

  • Decision on (a)/(b)/(c) recorded in the tmq header comment.
  • No future dispatch on a worktree=1 repo can sweep unrelated untracked files into a PR.
  • Regression note in tms review of the next fix-type dispatch.

References

  • tower-fleet#211 (the contaminated-then-cleaned PR) · tms#59 (drift commit pattern) · memory: feedback_git_add_specific_paths.md, feedback-working-tree-hazard.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions