Repository navigation
Description
Problem
A checkout that a command on PATH runs from is kept from reduction only when it is reduce-only, that is, found through ~/.codex/worktrees or the home folder scan (#5764). Every other discovered checkout has no such keep: one found beside a known project, a child of maintenance.discoverRoots, and a registered workspace. A tool built in one of those, with a launcher symlinked from a PATH directory into its .build, target or node_modules/.bin, loses that output when the checkout goes idle or the disk is under pressure, and the installed command breaks until it is rebuilt.
Evidence
- feat: discover tool folders and scan the home folder for checkouts #5764 added
launcherReason(packages/stim-cli/src/workspace/launchers.ts) and applies it only where the checkout is reduce-only. The first version applied it to every discovered checkout and was narrowed because reading about a thousand PATH symlinks made a fake-clock test indaemon-cadence.test.tstime out, not for a product reason. - Measured read cost on one MacBook: 55 to 72 ms for 995 symlinks.
- The last review of feat: discover tool folders and scan the home folder for checkouts #5764 raised the case of a
maintenance.discoverRootsentry inside a Codex worktree: the named child is an ordinary discovered checkout and its output can be cleared even though a PATH launcher points into it. - Existing protection for these checkouts is running-process evidence only: a process executing from the path keeps it; an installed command that is not running does not.
Cause
Not a defect in #5764: the keep was scoped to the checkouts that change introduced. The exposure for sibling-discovered and root-discovered checkouts predates it.
Fix idea
Needs a product decision: apply the PATH launcher keep to every discovered checkout, and possibly to registered workspaces, by the same rule #5764 uses (read with the running-process evidence, fail closed). It trades one read of the PATH directories per evidence read, and a checkout with any PATH launcher into it being kept whole, against installed tools surviving cleanup. The cadence test needs an injected launcher reader first.
Activity
janicduplessis commentedon Nov 16, 2026
Maintainer decision, 2026-11-15: "Work on all those and lmk tomorrow", in answer to a message whose open items included this one, put to the maintainer as: "#5765 (keep checkouts that a command on your PATH runs from): I recommend extending the keep to every discovered checkout and registered workspace. It only makes cleanup keep more, and costs one read of the PATH folders (55-72 ms measured)."
Scope: apply the PATH launcher keep by the rule #5764 uses (read with the running-process evidence, fail closed) to every discovered checkout and to registered workspaces. The cadence test gets an injected launcher reader first. Starts after #5767 merges, since both touch discovery evidence.