refactor(claude): PathResolver::new takes a required home argument - #208
Open
ecalifornica wants to merge 1 commit into
Open
refactor(claude): PathResolver::new takes a required home argument#208ecalifornica wants to merge 1 commit into
ecalifornica wants to merge 1 commit into
Conversation
|
🔍 Preview deployed: https://b059d9ee.toolpath.pages.dev |
ecalifornica
force-pushed
the
robert/config-claude
branch
from
August 14, 2026 19:49
f000364 to
a4b6be7
Compare
ecalifornica
marked this pull request as ready for review
August 17, 2026 17:06
ecalifornica
commented
Aug 17, 2026
| /// field name matches its variable. | ||
| const CONFIG_ENV_VARS: &[&str] = &[ | ||
| "APPDATA", | ||
| "CLAUDE_CLI_DEBUG", |
Collaborator
Author
There was a problem hiding this comment.
This will change when review feedback is addressed:
#191 (comment)
) toolpath-claude reads no environment variable. The caller supplies the home directory; the crate keeps the layout below it (`<home>/.claude`). Library (breaking, 0.13.0): - `PathResolver::new(home)` takes the home directory as a required argument. `ClaudeConvo::new(home)` and `ConvoIO::new(home)` take the same argument. - Delete the `Default` impls on the three types, `with_home`, the private `dirs::home_dir` helper, and the `NoHomeDirectory` error variant. - Keep `with_claude_dir` as the full override. - The home directory is always present, so `home_dir()`, `claude_dir()`, `projects_dir()`, `history_file()`, `project_dir()`, `conversation_file()`, `ConvoIO::claude_dir_path()`, and `ConvoIO::conversation_exists()` return a value, not a `Result`. Callers inside the crate drop the dead error arms. - Verbose parse warnings are a `bool` parameter. `ConversationReader::read_conversation_with(path, verbose_warnings)` takes it directly. `ConvoIO::with_verbose_warnings` and `ClaudeConvo::with_verbose_warnings` store it and pass it down. `ConversationReader::read_conversation(path)` warns about the first 5 unparseable lines only. path-cli: - `providers::claude_resolver` returns `Option<PathResolver>`. `None` means `Config` carries no home directory, so Claude is out of reach. - `harness_bundle` omits the Claude manager in that case. - `providers::require_claude_resolver` reports "cannot determine the home directory" for the 6 commands that target Claude. - `Config` reads `$CLAUDE_CLI_DEBUG`. `providers::claude_verbose_warnings` turns its presence into the flag every `ClaudeConvo` receives, so the variable keeps its behavior for CLI users. Version bump per the release checklist: crate manifest, workspace dependency, site/_data/crates.json, CHANGELOG.md.
ecalifornica
force-pushed
the
robert/config-claude
branch
from
August 18, 2026 20:09
a4b6be7 to
23a51c3
Compare
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 #185: the crate reads no environment variable,
Configowns every read, and the caller supplies what the crate used to resolve itself.Judgment calls:
read_conversation(path)stays quiet on damaged files. Context: a conversation file is a Claude Code session log (~/.claude/projects/**/*.jsonl), the reader tolerates unparseable lines, and by default it warns about the first 5. Verbose warnings cover every line and are an explicit opt-in viawith_verbose_warnings(bool)orread_conversation_with(path, verbose_warnings). The flag is in this PR because$CLAUDE_CLI_DEBUGselects it, and this refactor moves every environment read out of the crate.$CLAUDE_CLI_DEBUGset, whatever its value. This matches the deletedstd::env::var(...).is_ok()check exactly.Configstores the rawOption<String>;providers::claude_verbose_warningsowns the presence-is-the-signal interpretation. The variable keeps its behavior for CLI users.providers::claude_resolverreturnsOption<PathResolver>, the harness bundle silently omits Claude, and the 6 commands that target Claude error throughrequire_claude_resolver.session_chain,ChainIndex) is semantically untouched. Its share of the diff is the mechanical?removals from the infallible accessors.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.