Skip to content

feat(cli): thread Config into the query path - #197

Draft
ecalifornica wants to merge 1 commit into
robert/config-syncfrom
robert/config-query
Draft

feat(cli): thread Config into the query path#197
ecalifornica wants to merge 1 commit into
robert/config-syncfrom
robert/config-query

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Part of #184 (PR 5 of the plan there). Stacked on #196. path-cli only.

What

  • run() passes &Config to cmd_query. sync_query_scope takes it as a parameter; the transitional per-call Config::load() at its sync_bundle call site is gone.
  • The auto-sync bundle comes from providers::harness_bundle(config) in place of HarnessBundle::from_environment().
  • query::run takes the $TOOLPATH_QUERY_EXPLAIN value as an explain: Option<&str> parameter; cmd_query supplies config.toolpath_query_explain. The truthiness check (non-empty, not 0) stays at the planner. The query engine reads no environment variable.
  • emscripten: cmd_query::run consumes config on every target (the explain value feeds query::run), so it needs no lint expectation. sync_query_scope keeps its #[cfg(not(target_os = "emscripten"))] gate; providers::harness_bundle carries the same gate.

Behavior change

Tests

  • No new tests. tests/query.rs sets TOOLPATH_QUERY_EXPLAIN=1 on the spawned binary at three sites and asserts the plan line, so the Config-to-planner threading is covered end to end.
  • tests/integration.rs import_after_query_sync_is_a_noop_not_an_error exercises the auto-sync path through providers::harness_bundle.

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

@github-actions

Copy link
Copy Markdown

🔍 Preview deployed: https://e57be2dc.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