Repository navigation
fix(home): REPL history and settings follow LUCLI_HOME - #22
Conversation
ReplCommand, Terminal and Settings built their paths from user.home, so with LUCLI_HOME / -Dlucli.home set they still wrote into the real home, and Settings' settings.json wasn't the file 'system paths' reports. They now resolve the active LuCLI home through LucliPaths. Settings saved at the old location (user.home/.lucli/settings.json) are read once and copied to the active home when it has none; the old file is left untouched. Upstream: cybersonic#140 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Unit Tests (ubuntu-latest, Java 21) 63 files 63 suites 2m 36s ⏱️ Results for commit d7eb282. ♻️ This comment has been updated with latest results. |
Integration Tests (ubuntu-latest, Java 21)78 tests 78 ✅ 2m 5s ⏱️ Results for commit d7eb282. ♻️ This comment has been updated with latest results. |
|
rev1-r3 review @ 76cb0c4: APPROVE (final) RED before, reproduced. I copied the new End to end: JDK 21 jars, with an isolated
Checks against the review brief:
The default case keeps the same paths for the default PR CI: green on every job (Build ×3, Unit ×3, Integration ×2); the APT smoke check was skipped. Notes, not blocking:
Inventory: my binary runs used only sandboxed homes. |
…story-settings Signed-off-by: Peter Amiri <peter@alurium.com> # Conflicts: # CHANGELOG.md # FORK.md
|
rev1-r3 review @ d7eb282: APPROVE (final) This head is a two-parent merge of the approved 76cb0c4 and
PR CI on this head: Build ×3, Unit ×3 and Integration ×2 all pass; APT smoke skipped. mergeStateStatus is CLEAN. Ready to merge. |
Upstream issue: cybersonic#140
What
With
LUCLI_HOME(or-Dlucli.home) pointing at an isolated directory, three places still wrote into the real home, because they built their paths fromuser.home:lucli replhistory:user.home/<profile home>/repl_history;user.home/.lucli/history;Settings(settings.json, used e.g. bysecrets provider use):user.home/.lucli/settings.json. That also isn't the filelucli system pathsreports (<LUCLI_HOME>/settings.json) or the oneModuleCommandreads.How
LucliPaths.resolve().home():-Dlucli.home, thenLUCLI_HOME, then~/<profile home>.lucliprofile's settings are where they were.settings.jsonbutuser.home/.lucli/settings.jsonexists (and is a different file),Settingsreads it once and saves a copy to the active home. The legacy file is left untouched. So a saved secret-provider choice isn't lost, e.g. for an aliased binary whose profile home is~/.wheels.~/.lucli/historyto the active home without migration (history only).Tests
SettingsTest.settingsFollowTheLucliHomeProperty: settings land inlucli.home, and nothing is written underuser.home.SettingsTest.legacySettingsAreReadOnceAndCopiedToTheActiveHome: the legacy value is read and copied, and the legacy file is unchanged.ReplCommandHistoryTest.historyFileIsInTheLucliHome.wheels@ 8942048 (the newSettingsTestonly, separate worktree): exactly the 2 new cases failed (expected <…/custom-home> but was <…>;copied to the active home ==> expected true); the other 30 passed.mvn testgave 772 tests, 0 failures, 0 errors, 6 skipped. BATS not run locally (nobats-core); please rely on CI.LUCLI_HOME/HOME/-Duser.home,printf '1+1\nexit\n' | lucli repl): v0.6.2.2 wroteuser.home/.lucli/repl_history; this branch writes<LUCLI_HOME>/repl_historyand nothing underuser.home.Not in this PR (same pattern, follow-ups)
Other
user.home/.lucliconstructions remain, e.g.ServerConfigHelper.CACHE_DIR,BuiltinVariableManager(line 333),ServerCommandHandler(line 2346),CFLintDownloader, and the dependency installers' fallbacks. They're worth a separate pass with their own tests.Fork bookkeeping
CHANGELOG
## Unreleasedentry; FORK.md "Next queue" row 10.Upstream
The same change goes to
cybersonic/LuCLIas acherry-pick -xonto upstreammain(without FORK.md) once this is reviewed.🤖 Generated with Claude Code