fix(search_packages): relax nix package search constraints and score on the tool side - #647
fix(search_packages): relax nix package search constraints and score on the tool side#647Scott McMaster (scottmcmaster) wants to merge 2 commits into
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Caution
The process_results sort closure calls relevance_score(a, &a.name) — scoring each result against its own name rather than the user's search query.
apps/native/src-tauri/src/evolve/search_packages.rs:265
Caution
When use_regex = true, the new code calls regex::escape(query) before passing it to nix search, which escapes all regex metacharacters and turns the query into a literal string search.
apps/native/src-tauri/src/evolve/search_packages.rs:84
2 finding(s) posted as inline comments.
f4b793c to
4820a04
Compare
🎨 Storybook previewUpdated for b4b7d9e
|
📋 PR Overview
🔬 Coverage
|
4820a04 to
ea35db8
Compare
ea35db8 to
b4b7d9e
Compare






Summary
This is for issue 617 -- another try at making the
search_packagestool return good results with less churn (my white whale).The ^ and $ anchors overconstrain the nix search so you can see this kind of churn:
With this change:
Then you can see much happier results more like this (note the scoring implied in the agent's evolution logs in the UI):
In addition to not missing pretty obvious things, by return just MORE results, we give the agent the opportunity to make better decisions in future search and edit steps.
Test Plan
Some new unit tests, plus manual testing.
Docs