Skip to content

refactor(cli): remove the last environment reads below the composition root - #205

Draft
ecalifornica wants to merge 1 commit into
robert/config-cachefrom
robert/config-cleanup
Draft

refactor(cli): remove the last environment reads below the composition root#205
ecalifornica wants to merge 1 commit into
robert/config-cachefrom
robert/config-cleanup

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #184; path-cli only. The free home_dir() is deleted and its 2 callers take the value from &Config; cmd_derive::run takes &Config from cmd_p, which removes the last transitional Config::load(). Outside tests, run() is the only Config::load() caller, and $PATH (3 sites) is the only environment variable read below it: a binary lookup is execution environment, not configuration. CONFIG_ENV_VARS and the Config fields match 1:1, 8 for 8, and every field has a consumer. The cmd_resume resolve_input tests drop their environment scaffolding; TEST_ENV_LOCK keeps 2 users, and the integration tests' ScopedHome keeps its writes because they drive the composition root (#183 owns that).

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://04cd9353.toolpath.pages.dev

@ecalifornica
ecalifornica force-pushed the robert/config-cleanup branch from a30b91b to 8d97f75 Compare August 14, 2026 19:49
@ecalifornica
ecalifornica marked this pull request as ready for review August 17, 2026 17:02
@ecalifornica
ecalifornica requested a review from akesling August 17, 2026 17:02
@ecalifornica ecalifornica assigned akesling and unassigned akesling Aug 17, 2026
@ecalifornica
ecalifornica force-pushed the robert/config-cleanup branch from 8d97f75 to 07d8d28 Compare August 18, 2026 20:09
…n root (#184)

Delete the free `home_dir()` from config.rs. Its two callers take a
`&Config` already: `cmd_share::bail_no_sessions` and
`share_config::resolve_remote` now use `Config::home_dir()`.

Thread `&Config` into `p derive` and delete its transitional
`Config::load()`. `Config::load()` runs once, in `run()`.

Test cleanup:
- `sync::engine::tests::with_cfg` builds a `Config` only. It drops the
  `$TOOLPATH_CONFIG_DIR` write and the `TEST_ENV_LOCK` hold.
- Two `cmd_resume` tests drop their `$TOOLPATH_CONFIG_DIR` write and
  their `TEST_ENV_LOCK` hold.

`$PATH` is the only variable read below the root. It is the execution
environment, not configuration.
@ecalifornica
ecalifornica force-pushed the robert/config-cleanup branch from 07d8d28 to 305031c Compare August 25, 2026 20:23
@ecalifornica
ecalifornica marked this pull request as draft August 25, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Config at the composition root

2 participants