Skip to content

feat(routing): add natural-language search to dirctl routing search - #1783

Merged
paralta merged 5 commits into
mainfrom
feat/nl-routing-search
Jul 13, 2026
Merged

paralta merged 5 commits into
mainfrom
feat/nl-routing-search

Conversation

@paralta

@paralta paralta commented Jul 10, 2026

Copy link
Copy Markdown
Member

This PR adds free-text query support to dirctl routing search, mirroring the NL search already available in dirctl search. When a positional query is given, the OASF extractor decomposes it into skill and domain signals (keyword signals are dropped — the DHT has no name/description index), each signal becomes a routing DHT query, and results are returned ranked by match_score descending. Structured routing search also gains score-sorted output, fixing the prior behaviour where results arrived in arbitrary DHT discovery order.

  • The extractor uses semantic-only weights and a lower min-score threshold (0.1 vs the 0.3 default for local search): the DHT indexes exact taxonomy names, so recall matters more than precision and lexical overlap only hurts conceptual queries.
  • DecomposeWithMinScore is introduced as a parameterised variant of Decompose so routing can widen the threshold without affecting the local index search path.

paralta added 3 commits July 10, 2026 12:15
Signed-off-by: Catarina Paralta <[email protected]>
Signed-off-by: Catarina Paralta <[email protected]>
@github-actions

github-actions Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedJul 13, 2026, 10:13 AM

@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jul 10, 2026
Signed-off-by: Catarina Paralta <[email protected]>
@codecov

codecov Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 34.92063% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/cmd/routing/nlsearch.go 0.0% 33 Missing ⚠️
cli/cmd/routing/search.go 82.6% 2 Missing and 2 partials ⚠️
cli/internal/nlsearch/decompose.go 0.0% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@paralta
paralta marked this pull request as ready for review July 10, 2026 13:39
@paralta
paralta requested a review from a team as a code owner July 10, 2026 13:39
@tkircsi

tkircsi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Just one small comment. The "and results are returned ranked by match_score descending" is true only for the "limited" recordset defined by the --limit flag not for the entire recordset. Order happens after the limit. Maybe the default limit could be higher or the order should be happened on the server side.

@tkircsi tkircsi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! added a small finding.

Comment thread cli/cmd/routing/search.go Outdated
Provide a free-text query as a positional argument to use natural-language
search: the OASF extractor (set up by 'dirctl init') decomposes the phrase
into skill and domain signals. Each signal is queried independently against
the routing DHT and results are ranked by match score, best-first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's "the discovered window, reordered," not true global top-N.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good point! thanks for reviewing 👍

Signed-off-by: Catarina Paralta <[email protected]>
@paralta
paralta merged commit 3a9ff52 into main Jul 13, 2026
33 checks passed
@paralta
paralta deleted the feat/nl-routing-search branch July 13, 2026 10:51
@paralta paralta linked an issue Jul 14, 2026 that may be closed by this pull request
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Order routing and local search results by match-score relevance

2 participants