Skip to content

feat(cli): thread Config into the share path - #200

Draft
ecalifornica wants to merge 1 commit into
robert/config-exportfrom
robert/config-share
Draft

feat(cli): thread Config into the share path#200
ecalifornica wants to merge 1 commit into
robert/config-exportfrom
robert/config-share

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Part of #184 (PR 8 of the plan there). Stacked on the export PR (branch robert/config-export). path-cli only.

What

  • run() passes &Config to cmd_share. share_explicit, derive_session, and resolve_destination take it as a parameter. The two Config::load() sites in cmd_share are gone.
  • The picker bundle and the freshness-stat bundle come from providers::harness_bundle(config).
  • HarnessBundle::from_environment is deleted. share was its last caller.
  • sync::fresh_cache_id takes &Config. No record surface in the sync engine loads a Config per call.
  • share_config::resolve_remote takes &Config and locates config.toml through Config::config_dir. The ~/ expansion of a rule's dir still uses the free home_dir().
  • cache.rs and cmd_pathbase.rs still resolve their directory through the free config_dir(). Later PRs own them.
  • Upload-side environment reads are untouched: $PATHBASE_URL, the credentials file, and the cmd_export Pathbase machinery keep their current form.

Emscripten

  • All touched code and the deleted from_environment are native-only (cfg(not(target_os = "emscripten"))), so the emscripten build is unaffected.

Behavior change

Tests

  • The resolve_destination unit tests take a Config carrying the temp config dir. cmd_share sets no environment variable and needs no TEST_ENV_LOCK guard.
  • The engine test fresh_cache_id_tracks_source_and_eviction passes the jail Config.
  • tests/integration.rs share_configured_repo_requires_login and share_configured_repo_uploads_when_authed run the binary with $TOOLPATH_CONFIG_DIR set, so Config reaches resolve_remote end to end.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The share command receives `&Config` from run() and passes it down:
the harness bundle, the derive helpers, the manifest record surfaces,
and the configured-remote lookup.

- `cmd_share::run` takes `&Config`. `share_explicit`,
  `derive_session`, and `resolve_destination` take it as a parameter.
- The picker bundle and the freshness-stat bundle come from
  `providers::harness_bundle(config)`.
- `sync::fresh_cache_id` takes `&Config`. It is the last record
  surface that loaded one per call.
- `share_config::resolve_remote` takes `&Config` and resolves the
  config file through `Config::config_dir`.
- `HarnessBundle::from_environment` is deleted. Share was its last
  caller.
@github-actions

Copy link
Copy Markdown

🔍 Preview deployed: https://5f4d65d9.toolpath.pages.dev

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.

1 participant