Repository navigation
Closed
Labels
Description
Overview
The run-app skill says a scratch HOME keeps the Tauri app's files and database out of the real home. In practice, launching bun run dev:tauri with HOME=/tmp/nsh created a database and a registry in the real ~/.nodespace, and the webview kept the previous install's localStorage. A session that believes it is isolated is not.
Problem Statement
Observed on a machine whose ~/.nodespace held only models/:
- Launched with
HOME=/tmp/nsh,CARGO_HOMEandRUSTUP_HOMEset to the real paths, as the skill describes. - During that launch,
~/.nodespace/databases.tomlwas created (the file's birth time is the app's launch), registering a default database at~/.nodespace/database/nodespace.db. That database file was also created at launch and written to for the following 10 minutes..model-verify-keywas created too. - The daemon and the app then disagreed about which database was default (
01M691W94…in the real-home registry, a different id in the scratch one), and every call failed withno database registered with id …. A tab click closed the tab as a result. - The webview's
localStoragestill held the previous install's tab state and active database id, so WebKit storage was not relocated byHOMEeither. - The mechanism (how the app resolves its home) was not determined; it is evidently not
$HOMEalone.
Proposed Solution
Make a scratch launch write nothing to the real home, or state exactly what it does write and how to avoid it, so the person running it is not surprised.
Documentation
- Local Builds - how the dev app is built and launched.
- ADR-053 - the database registry and where it lives.
- Daemon and CLI Lifecycle - how the app starts and registers the daemon.
- Updates: the run-app skill (
.claude/skills/run-app/SKILL.md), whose isolation claims must match.
Acceptance Criteria
- The cause is identified: which code resolves the home or registry directory and why
HOMEdoes not move it. - A launch with
HOMEpointed at a scratch directory creates no file in the real~/.nodespace, or the run-app skill states each path that is written outside the scratch home and how to relocate it. - The webview's persisted storage is either relocated by the same setting or the skill says how to start from empty storage.
- A test or script check covers the home resolution used by the app and the daemon, so the two cannot select different registries.
- The run-app skill's isolation section matches the behavior.
- Code passes
bun run quality:fix;bun run test:changedpasses.
Technical Specifications
Reference Files
.claude/skills/run-app/SKILL.md- the isolation claims for browser and desktop launchespackages/desktop-app/app-lib/src/daemon_setup.rs- app-side daemon installation and registrationpackages/daemon/src/lib.rs- how the state directory and registry path are resolved (NODESPACE_HOME,NODESPACED_DB_PATH)
Related Issues
- None
Activity
mstomar125 commentedon Nov 2, 2026
Picking this up (sweep drain).
mstomar125 commentedon Nov 3, 2026
Picking this up (sweep drain).
Forward the home redirect to the systemd unit and test service-defini…
Forward the home redirect to the systemd unit; add a model download s…
mstomar125 commentedon Nov 3, 2026
Merged: the Linux systemd unit now forwards HOME and NODESPACE_HOME like the launchd plist, with tests for the unit lines and for a plist whose paths contain spaces and XML metacharacters. Still open: the cause of the webview localStorage carry-over, a test that the app and daemon pick the same registry, the live macOS scratch-HOME check, and the Linux systemd run (a scratch HOME alone does not isolate systemctl --user).
🤖 Generated with Claude Code
mstomar125 commentedon Nov 5, 2026
Closing: the part that needs no device is merged (the Linux systemd unit forwards HOME and NODESPACE_HOME like the launchd plist, with tests). The remaining work, which needs a real desktop app and a systemd host, is tracked in #4244.
🤖 Generated with Claude Code