feat: move the app home from ~/.superset to ~/.paradev (SUPER-2985)

Merged
SA
2d ago
+1052-148

Stacked on #9157. Moves the app's per-machine home from ~/.superset to ~/.paradev at boot and drops every other mention of ~/.superset from the code (Linear SUPER-2985). Also bundles pdev 0.2.5.

The boot step (@superset/agent-setup/legacy-home-move, the only code that still names .superset)

Desktop main (app-environment.ts), host-service (serve.ts) and the CLI (commands/middleware.ts) run it before anything touches the home. When the process uses the default home and ~/.superset is still a real directory, it:

  1. stops host-services running from ~/.superset, by the pid in each host/<org>/manifest.json, and only when that pid's command line is a host-service (a manifest outlives a crash or reboot, so its pid may now be another program). They cache worktree paths, watch them and write host.db. The pty daemon keeps running: its socket is in the temp dir keyed by org, so the next host-service adopts it and open terminals survive;
  2. carries pdev's files already in ~/.paradev (agent/) into the old directory, refusing on a name clash;
  3. renames ~/.superset to ~/.paradev and leaves a ~/.superset symlink. The symlink covers older CLI and host-service builds and absolute paths inside worktrees (venvs, caches) that we cannot rewrite;
  4. records the move in legacy-home-move.json and links Claude Code's session folders under the worktrees' new paths, so /resume and --continue keep their history. Claude keys sessions by real path (measured). This covers every Claude config dir: ~/.claude, CLAUDE_CONFIG_DIR entries and per-account dirs under home or ~/.config, touching only dirs whose projects/ holds old worktree entries.

Then host-service and the desktop rewrite the absolute paths in host.db and local.db (a no-op once applied) and run git worktree repair, so git and the DB agree. If a step fails, that run keeps using ~/.superset and the next boot tries again. If two processes race (desktop and CLI), the loser adopts the winner's move; if something recreates ~/.superset before the symlink lands, the move is kept. A custom SUPERSET_HOME_DIR (dev builds) is left alone, and the step never runs under a test runner.

Also

  • The resolver is SUPERSET_HOME_DIR, else ~/.paradev. The env var keeps its name: installed agent hook configs call $SUPERSET_HOME_DIR/hooks/notify.sh (renaming it is SUPER-2988).
  • New projects default to ~/.paradev/projects. The agent wrappers skip ~/.paradev/bin as well as ~/.superset/bin when finding the real binary, so terminals opened before the move cannot recurse.
  • Golden-box cleanup strips both ~/.paradev/host and ~/.superset/host while boxes roll over.
  • The CLI's tests now load the root test preload, which isolates the home. A shell-ready-evidence test that wrote into the real home is gone.
  • pdev 0.2.5 (ParadevAI/router #16, #17) keeps everything in ~/.paradev/agent and leaves the rest of ~/.paradev to the app. The bump also brings 0.2.3 (cloud mode behind PDEV_REMOTE_*, router stream retry). The pdev asset is uploaded to the sandbox CDN.

Verified

  • tsc clean; agent-setup, cli, host-service and desktop suites pass (same one main failure as #9157).

  • End to end on a scratch HOME with the real code under Electron's Node (better-sqlite3 is built for it): a git repo with a worktree under ~/.superset, a host.db from createDb, a live fake host-service, pdev files and a Claude session folder. After the step: moved, symlink in place, fake host stopped, pdev files kept, host.db rewritten, git worktree list shows the new path and git status works there, Claude folder linked, second run does nothing.

  • In the dev desktop app, booted with HOME pointed at a scratch folder holding a copy of this worktree's dev data as ~/.superset, pdev files in ~/.paradev/agent, a git worktree under ~/.superset/worktrees, a host.db row for it and a Claude session folder (dev URL scheme kept; the pty-daemon socket kept in a scratch run dir so it never met the real daemon):

    • first boot logged Moved the app home, left ~/.superset -> .paradev, opened local.db and all five orgs' host.db under ~/.paradev; the host.db row and git worktree list showed the new path, the Claude folder was linked, pdev's file was kept;
    • signed in, created a project (default parent ~/.paradev/projects) and a worktree workspace from the composer; the worktree landed in ~/.paradev/worktrees/... and its terminal ran there with SUPERSET_HOME_DIR=~/.paradev and ~/.paradev/bin first on PATH;
    • second boot did nothing, reopened the workspace, and the terminal session came back after the restart.

Summary by CodeRabbit

  • New Features
    • The app now uses ~/.paradev as its default home and migrates existing data from ~/.superset, updating saved project and worktree references. A compatibility link is created when possible.
    • Claude project sessions are linked to their corresponding locations after migration.
    • New projects and worktrees now default to locations under ~/.paradev.
  • Updates
    • The bundled pdev version is updated to 0.2.5, with support for macOS and Linux on arm64 and x64.