refactor: one resolver for the app home directory (SUPER-2983)
Merged
SA
2d ago+239+239+012345678901234567890123456789-252-252-012345678901234567890123456789
First of two PRs that retire ~/.superset (Linear SUPER-2983). No change for users: the home is still ~/.superset. This makes every process find it through one function, so the move in the next PR changes one place.
What changes
resolveAppHomeDir()in@superset/agent-setup/pathsreplacesresolveSupersetHomeDir()and the CLI'sgetSupersetHomeDir().- host-service: worktrees, sessions, attachments, agent jobs, the pty-daemon manifest and socket key, the usage pointers and the per-machine project override now use it. Worktrees and sessions used to ignore
SUPERSET_HOME_DIR; they now follow it, so dev-workspace builds keep their worktrees under their own home. Existing worktrees keep their stored absolute paths. - desktop: call-time code uses the resolver. The terminal-host client and daemon compute paths at module load, so they read
app-environment'sSUPERSET_HOME_DIR, which is set before anything else loads. The two places that read the production home on purpose usedefaultAppHomeDir(). - Hook and plugin templates take the directory name from
APP_HOME_DIR_NAME. Rendered output is byte-identical tomain(checked for all seven templates), so installed hooks are not rewritten. - Tests that wrote user-override fixtures into the real
~/.superset/projectsnow use a temp home.
Verified
tscclean for agent-setup, cli, host-service, trpc and desktop (desktop's only errors are the missing generated route tree, same asmain).- Tests: agent-setup, cli, host-service, desktop
src/main/src/lib/src/shared. The one local failure,AgentJobRunner > deletes finished jobs after a day, fails the same way onmain.
Summary by cubic
First of two PRs that retire ~/.superset (Linear SUPER-2983). No change for users: every process now resolves the app home directory through one function, resolveAppHomeDir() in @superset/agent-setup/paths, so the move in the next PR changes one place.
resolveAppHomeDir()replacesresolveSupersetHomeDir()and the CLI'sgetSupersetHomeDir(); new helpers expose the default dir name and path.- Worktrees and sessions now honor
SUPERSET_HOME_DIR; dev-workspace builds keep worktrees under their own home, while existing worktrees keep their stored absolute paths. - Desktop terminal-host paths are read from
app-environment'sSUPERSET_HOME_DIR; only code that intentionally reads the production home usesdefaultAppHomeDir(). - Hook and plugin templates take the directory name from
APP_HOME_DIR_NAME, with rendered output byte-identical to before so installed hooks are not rewritten. - Tests that wrote fixtures into the real
~/.superset/projectsnow use a temp app home.
Verified: tsc clean across all touched packages, and the one failing test, AgentJobRunner > deletes finished jobs after a day, fails identically on main.
Summary by CodeRabbit
- Improvements
- App data, settings, worktrees, sessions, terminal history, and related files now use a consistent application home directory. Existing custom directory settings continue to take precedence.
- Agent integrations and host services now use the application home directory consistently when locating configuration, plugins, hooks, and host files.
- Project-specific configuration remains supported from the application home directory, while existing project lookup behavior is unchanged.