CB-624: add scripts/rename-checkout.sh (rename checkout claude-bridge -> fleetd) #143

Merged
ltms merged 2 commits from worker/cb-624-script-ff7bc2-3 into main 2026-08-23 06:09:19 +02:00
Member

Implements unit A of CB-624 / issue #128.

What: one new script, scripts/rename-checkout.sh, modeled on redeploy-bridged.sh.

  • --check (read-only) reports all five surfaces: files in the checkout holding the old absolute path (with hit counts), the installed launchd plist and its ProgramArguments, the Claude Code project-state dirs at old and new slug, git worktrees whose .git pointer names the old path, and the running daemon with its jar path.
  • Apply mode: refuses a dirty tree or an existing target; stops the daemon first (launchctl unload when supervised, plain kill otherwise), waits for real process exit; moves the checkout; moves the Claude Code project-state dir using slugs derived from both paths via tr '/.' '-'; rewrites each worktree's .git pointer found through .git/worktrees/*/gitdir; rewrites gitignored bridged/bridged.yaml and the installed plist if they exist (backups kept, plutil -lint after the plist); restarts (launchctl load when supervised) and verifies /healthz plus a FRESH bridged listening line anchored to a line-count marker taken before the stop. Ends by listing references it deliberately left alone.

Checks run: bash -n passes; shellcheck is not installed on this machine so it could not run; --check executed for real against the live machine (output in the worker report). Apply mode was NOT executed — it would move the running system out from under the fleet, per the ticket's hard limits.

Untested branch, stated plainly: the bridged.yaml rewrite path could not be exercised from a worktree (the file is gitignored and exists only in the live checkout). The code path is written but unverified.

Implements unit A of CB-624 / issue #128. **What:** one new script, `scripts/rename-checkout.sh`, modeled on `redeploy-bridged.sh`. - `--check` (read-only) reports all five surfaces: files in the checkout holding the old absolute path (with hit counts), the installed launchd plist and its ProgramArguments, the Claude Code project-state dirs at old and new slug, git worktrees whose `.git` pointer names the old path, and the running daemon with its jar path. - Apply mode: refuses a dirty tree or an existing target; stops the daemon first (`launchctl unload` when supervised, plain kill otherwise), waits for real process exit; moves the checkout; moves the Claude Code project-state dir using slugs derived from both paths via `tr '/.' '-'`; rewrites each worktree's `.git` pointer found through `.git/worktrees/*/gitdir`; rewrites gitignored `bridged/bridged.yaml` and the installed plist if they exist (backups kept, `plutil -lint` after the plist); restarts (launchctl load when supervised) and verifies /healthz plus a FRESH `bridged listening` line anchored to a line-count marker taken before the stop. Ends by listing references it deliberately left alone. **Checks run:** `bash -n` passes; shellcheck is not installed on this machine so it could not run; `--check` executed for real against the live machine (output in the worker report). Apply mode was NOT executed — it would move the running system out from under the fleet, per the ticket's hard limits. **Untested branch, stated plainly:** the bridged.yaml rewrite path could not be exercised from a worktree (the file is gitignored and exists only in the live checkout). The code path is written but unverified.
agent added 1 commit 2026-08-23 05:55:40 +02:00
CB-624: add scripts/rename-checkout.sh to rename the checkout safely
CI / contract (pull_request) Successful in 46s
CI / build (pull_request) Successful in 1m32s
d43f670285
Renames ~/LTMS/claude-bridge -> ~/LTMS/fleetd as one auditable command,
modeled on redeploy-bridged.sh. --check reports every surface holding the
old absolute path (checkout files, launchd plist, Claude Code project
state, worktree .git pointers, running daemon). Apply mode stops the
daemon first (launchctl-aware), moves the checkout and the Claude Code
project-state slug dir derived from both paths, repairs worktree gitdir
pointers, rewrites bridged.yaml and the installed plist if they exist,
restarts, and verifies /healthz plus a fresh 'bridged listening' line
anchored to a pre-stop marker.
ltms added 1 commit 2026-08-23 06:07:18 +02:00
CB-624: report three more rename surfaces as report-only
CI / contract (pull_request) Successful in 55s
CI / build (pull_request) Successful in 1m14s
51bdec22e7
--check gains section 6 counting ~/.claude.json (the projects entry keyed
by the old absolute path), ~/.config/herdr/session.json, and JetBrains
recentProjects.xml / trusted-paths.xml across every IntelliJIdea* version.
Apply mode's closing summary lists the same three with manual follow-ups.

None of the three is rewritten automatically, on purpose: ~/.claude.json
is global live Claude Code config, herdr session.json is live process
state, and JetBrains rewrites its own files when the project is reopened
at the new path. Header comment states the reason for each so it does not
read as an oversight.

JetBrains stores these paths as its $USER_HOME$ macro rather than a
literal absolute path, so the counter matches both forms and says which
form the hits used.
ltms merged commit 08f1a79800 into main 2026-08-23 06:09:19 +02:00
ltms deleted branch worker/cb-624-script-ff7bc2-3 2026-08-23 06:09:19 +02:00
Sign in to join this conversation.