3.9 KiB
Runtime Simplification Plan
Goal
Remove the managed runtime install/copy layer. The desktop app must run the bundled runtime in place from the application resources/install directory on macOS, Windows, and Linux.
This is a simplification task. If a change preserves the old install-manager shape under a new name, it fails the goal.
Hard Requirements
-
The bundled runtime is read-only. The desktop app must not copy the bundled runtime to app data, temp, cache, or any other writable directory.
-
The app must execute Node/CLI/server entrypoints directly from the bundled runtime root. On macOS this means inside
Paseo.app/Contents/Resources/.... On Windows and Linux this means inside the installed app resources directory. -
There is exactly one runtime per installed app. Remove versioned installed runtime directories like
runtime/<runtime-id>from the runtime execution path. -
The CLI shim may point into the installed app bundle/directory. Do not keep an extra installed runtime tree just to preserve a stable shim target across updates.
-
All mutable state remains outside the bundled runtime. Logs, sockets/pipes, PID files, daemon state,
PASEO_HOME, and any other writable files must continue to live in managed home / app data locations. -
Runtime discovery must stay cross-platform. The implementation must resolve the bundled runtime/resources path on macOS, Windows, and Linux using the app install/resources directory, not hardcoded
.appassumptions. -
Remove dead machinery, do not leave adapters behind. If install/copy/versioned-runtime code becomes unused, delete it instead of keeping fallback paths "just in case".
Non-Goals
-
Do not change how the runtime is built into the desktop app bundle in this task. This task is about runtime execution and path management, not bundling format.
-
Do not reintroduce a second runtime location for migration compatibility. It is acceptable if older installed clients do not migrate cleanly.
-
Do not add feature flags, env-guarded fallback paths, or compatibility shims unless absolutely required by a real platform constraint proven in code.
Concrete Implementation Direction
-
Treat
bundled_runtime_root(app)pluscurrent-runtime.jsonas the runtime source of truth. -
Replace
paths.runtime_rootusage for runtime execution with the bundled runtime root selected bycurrent-runtime.json. -
Delete
install_runtime_if_needed(...)and related copy/install staging logic if nothing else still needs it. -
Rework CLI shim generation so the inner launcher points at the bundled runtime's Node + CLI entrypoint directly, while still keeping mutable state (
PASEO_HOME) outside the runtime. -
Simplify
ManagedPathsand related structs ifruntime_rootandstable_runtime_rootno longer need separate installed-runtime semantics. -
Keep diagnostics/status reporting accurate. If the app reports bundled vs installed runtime roots today, update that output to reflect the new single-runtime model.
Acceptance Criteria
-
No code path copies the bundled runtime tree into app data before launching the daemon or CLI.
-
No code path depends on a versioned installed runtime directory for execution.
-
The CLI shim and daemon launch path both resolve to bundled runtime executables/resources.
-
Typecheck passes.
-
Relevant desktop/runtime tests pass, updated to reflect the new direct-from-bundle model.
-
The resulting implementation is materially simpler: fewer runtime path concepts, fewer staging/install branches, fewer indirections.
Review Bar
The implementation should be rejected if:
- it still copies the runtime anywhere before execution
- it keeps runtime version directories in the execution path
- it preserves the stable installed runtime launcher concept without a hard platform reason
- it adds migration complexity for old installs
- it introduces new fallback branches instead of removing obsolete ones