Problem
jcode_storage::jcode_dir() falls back to ~/.jcode whenever JCODE_HOME is unset, including inside cargo test binaries. Any test that forgets to sandbox writes into the developer's real state.
Reproduction (macOS, origin/master 691c6f5)
- Note
ls ~/.jcode/active_pids | wc -l and ls ~/.jcode/sessions | wc -l.
cargo test --workspace --lib with JCODE_HOME unset.
- Result: 159 new active-pid markers (for example
session_existing_live_takeover, session_atomic_target_11) and 103 fixture session files (session_atomic_source_*, Reconnect Takeover Rejected, ...) in the real home; last_seen_changelog rewritten.
Expected
Tests never touch the real ~/.jcode.
History
Per-suite guards keep missing cases: #1487 (copilot), #1489 (communicate), and the fixes for #1133, #1142, #1365. A root fallback in jcode_dir() for test binaries would cover all of them.
Problem
jcode_storage::jcode_dir()falls back to~/.jcodewheneverJCODE_HOMEis unset, including insidecargo testbinaries. Any test that forgets to sandbox writes into the developer's real state.Reproduction (macOS, origin/master 691c6f5)
ls ~/.jcode/active_pids | wc -landls ~/.jcode/sessions | wc -l.cargo test --workspace --libwithJCODE_HOMEunset.session_existing_live_takeover,session_atomic_target_11) and 103 fixture session files (session_atomic_source_*,Reconnect Takeover Rejected, ...) in the real home;last_seen_changelogrewritten.Expected
Tests never touch the real
~/.jcode.History
Per-suite guards keep missing cases: #1487 (copilot), #1489 (communicate), and the fixes for #1133, #1142, #1365. A root fallback in
jcode_dir()for test binaries would cover all of them.