Skip to content

refactor(cli): the search path is a parameter below the composition root - #215

Draft
ecalifornica wants to merge 1 commit into
robert/config-github-tokenfrom
robert/config-search-path
Draft

refactor(cli): the search path is a parameter below the composition root#215
ecalifornica wants to merge 1 commit into
robert/config-github-tokenfrom
robert/config-search-path

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Part of #187. path-cli only. No library changes. No user-visible changes.

What

  • config::search_path() reads $PATH in the config module, next to the other environment reads. It returns the directories in order, and an empty list when $PATH is unset.
  • cmd_resume takes the value as a parameter. run computes it once. run_with_strategy threads it to the harness probe, the harness picker, the projection, and the invocation builder. The path_override test seam is deleted; tests pass the real parameter.
  • cmd_export takes it in cursor_open_hints. That function prints the "open the workspace in Cursor.app" hint after a cursor export or resume, and probes for a cursor binary to pick the hint text.
  • Tests pass a tempdir of fake binaries as the search path instead of mutating $PATH. The $PATH guards (ScopedPath in the integration support module, ScopedPathForResume in the unit tests) are deleted.

Question for review

fuzzy.rs keeps its own $PATH probe (which("fzf"), the picker-backend check). Where should its value live?

  • A field on Config: free to thread (every caller already holds &Config). But $PATH is the OS binary search list, not a toolpath setting; execvp consults the live environment, not the snapshot; and the figment layer is UTF-8 strings while $PATH is an OsString list.
  • A SearchPath parameter: keeps Config a settings snapshot, costs a parameter through ~12 picker call sites.

Until decided, the probe stays put. The lint PR in this stack marks it #[expect(clippy::disallowed_methods)]. A follow-up PR implements the decision and removes the exception.

@ecalifornica ecalifornica changed the title robert/config search path refactor(cli): the search path is a parameter below the composition root Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://b5f59c96.toolpath.pages.dev

@ecalifornica
ecalifornica force-pushed the robert/config-search-path branch from 0797151 to 9bdc3f2 Compare August 14, 2026 19:49
config::search_path reads $PATH in the config module, next to the other
environment reads. It returns the directories of $PATH in order, and an
empty list when $PATH is unset.

cmd_resume takes the value as a parameter: run computes it and passes it
to run_with_strategy, which threads it to the harness probe, the harness
picker, the projection, and the invocation builder. cmd_export takes it
in cursor_open_hints, threaded from the export command entry and from
the resume projection.

fuzzy.rs keeps its own probe. The design decision about that probe goes
to review.

Tests pass a directory of fake binaries instead of mutating $PATH. The
$PATH guards in the unit tests and in the integration support module are
deleted.
@ecalifornica
ecalifornica force-pushed the robert/config-search-path branch from 9bdc3f2 to 5d151af Compare August 18, 2026 20:10
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