The herdr sidebar names a worktree by its key, and a rename sticks #476
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#476
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
iw startlabels a herdr workspace<project>-<key>—iw-cli-IW-463,iw-cli-dashboard-control-plane. The label does not fit the herdr sidebar, sothe worktree is hard to find. A worktree opened in herdr's own UI carries the
short name (
ACA-569,MEDECA-430), which reads much better in the same list.The label is also renamed by hand in herdr, to make a worktree findable. Today
that rename is unsafe in principle:
HerdrLookup.resolvefalls back to thelabel when it has no path candidate.
Outcome
IW-463,dashboard-control-plane.be confused by a renamed workspace.
Design
Split the one
namethe port carries into two values:name— the addressing name,<project>-<key>. Unchanged. It is thetmux session name, and
LiveHerdrOps.candidatePathderives the siblingcheckout path from it.
label— a display name,key.value. Written once at creation, neverread back.
The checkout path becomes the sole identity under herdr.
candidatePathalready computes a deterministic sibling of the repo root; only its
.filter(os.exists)stops it from answering beforeiw startcreates thedirectory. Removing that filter makes the path route serve every call,
including the
iw startcollision check — which is the one case the labelroute exists for today.
Changes
WorktreePath— addworkspaceLabel: String = key.value.TerminalWorkspaceOps.create(name, label, workDir).LiveTmuxOpsdiscardsthe label;
LiveHerdrOpssends it asworktree open --label.UnavailableWorkspaceOpsandFakeCommandEnvfollow.Start.scala:256,Open.scala:119.LiveHerdrOps.candidatePath— drop.filter(os.exists).Open.scala:99— replaceenv.workspace.isInside && env.workspace.currentName.contains(sessionName)with
env.workspace.isCurrent(sessionName), which compares workspace idsunder herdr and session names under tmux. Without this,
iw openinside thetarget worktree stops printing "Already in session" and re-focuses itself.
OpenHarnessTest,StartHarnessTest,HerdrArgvTest,HerdrLookupTest. Docs:docs/api/WorktreeTypes.md, then rebuild thepublished skills.
BATS is unaffected — every suite forces
IW_WORKSPACE_BACKEND=tmux.Decisions to take during the work
Delete the label route in
HerdrLookup? After thecandidatePathchange,
resolve's label fallback andhas's label test are unreachable,and
byLabelhas no caller. Leaving them is dead code that invites a wronganswer later; removing them is a rewrite of a reviewed unit. Needs Michal's
call before the code is touched.
currentNameon the port. After theOpen.scalachange it has noproduction caller. Keep or drop.
Effort slugs lose the project.
dashboard-control-planealone does notsay which repository. herdr nests a worktree under its parent workspace, so
this may already be answered in the sidebar. Confirm by eye before closing.
Notes
reopened. They still resolve, by path.
HerdrAgentReaderandAgentSessionServicekey an agent on its working directory.herdr worktree open --labelis optional, so the flag could be droppedinstead and herdr would derive a name from the branch. Rejected: it puts the
naming in herdr's hands and leaves us no way to change it.