feat(cli): thread Config into the query path - #197
Draft
ecalifornica wants to merge 1 commit into
Draft
Conversation
|
🔍 Preview deployed: https://e57be2dc.toolpath.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #184 (PR 5 of the plan there). Stacked on #196. path-cli only.
What
run()passes&Configtocmd_query.sync_query_scopetakes it as a parameter; the transitional per-callConfig::load()at itssync_bundlecall site is gone.providers::harness_bundle(config)in place ofHarnessBundle::from_environment().query::runtakes the$TOOLPATH_QUERY_EXPLAINvalue as anexplain: Option<&str>parameter;cmd_querysuppliesconfig.toolpath_query_explain. The truthiness check (non-empty, not0) stays at the planner. The query engine reads no environment variable.cmd_query::runconsumesconfigon every target (the explain value feedsquery::run), so it needs no lint expectation.sync_query_scopekeeps its#[cfg(not(target_os = "emscripten"))]gate;providers::harness_bundlecarries the same gate.Behavior change
path queryauto-sync of pi, Windows only: the CLI injectsConfig::home_dir(), which falls back to$USERPROFILE. The pi resolver's internal lookup reads$HOMEonly (pi: resolver home lookup ignores $USERPROFILE #192). With$HOMEunset, the implicit sync enumerates%USERPROFILE%\.pi\agent\sessions. This matches thep cache syncchange in feat(cli): thread Config through the cache-sync path #196.Tests
tests/query.rssetsTOOLPATH_QUERY_EXPLAIN=1on the spawned binary at three sites and asserts the plan line, so the Config-to-planner threading is covered end to end.tests/integration.rsimport_after_query_sync_is_a_noop_not_an_errorexercises the auto-sync path throughproviders::harness_bundle.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.