8 Commits

Author SHA1 Message Date
kshitijk4poor 2932195c22 fix(skills): give the provider cut one owner inside the parallel walker
The dashboard endpoint GET /api/skills/hub/search passes its user-supplied
`source` straight into parallel_search_sources and never applied the merged
provider cut, so ?source=nvidia returned a mixed set. That was the fourth
caller of the walker; the cut was copy-pasted at three of them and missing
at the fourth.

parallel_search_sources already computes the normalized provider filter, so
the cut now lives there — applied per source before results are counted and
merged. Every caller (CLI search via unified_search, CLI browse, TUI-gateway
browse, dashboard router) sees the same rule with no provider logic of its
own, source_counts stop reporting rows that are then dropped, and the three
duplicated call-site cuts are deleted. do_browse keeps its provider-specific
"No skills found for provider" message.

Also:
- HermesIndexSource.search now treats a whitespace-only provider_filter as
  "no filter", matching GitHubSource.search (the two adapters previously
  disagreed on the same keyword argument; unreachable through the walker,
  which pre-normalizes).
- The regression-test fixture seeds tap caches by github_provider_for label
  instead of case-sensitive repo literals, and serializes metas through
  _skill_meta_to_dict, so a DEFAULT_TAPS casing change can no longer silently
  unseed the fixture.

Validation: 121 targeted tests green; disabling the walker cut fails the
pre-existing test_unified_search_provider_filter_keeps_index_source with the
expected clawhub leak; 4/4 regression cases still red on unpatched main.
2026-09-15 14:15:59 +05:30
kshitijk4poor 69d181011b refactor(skills): skip wrong-provider taps and give the provider-filter idiom one owner
Follow-up polish on the provider-filter-before-limit fix:

- GitHubSource.search now skips taps whose repo maps to a different provider
  instead of enumerating every tap and filtering afterwards. A tap's repo fixes
  the provider of every result it yields (github_provider_for is the only source
  of extra.provider in this adapter), so the skip is lossless and avoids up to 23
  useless tap enumerations per provider-filtered search — real GitHub API calls
  against the 60/hr unauthenticated budget and the 30s overall timeout when the
  index is unavailable. The now-redundant post-loop filter is dropped.
- _provider_filter_of() is the single owner of "does --source name a provider";
  it replaces the four inline copies of the strip/lower/membership idiom in
  _select_active_sources, parallel_search_sources, unified_search and do_browse.
- _tap_cache_key() is shared by _list_skills_in_repo and the regression test so
  the seeded tap cache can never drift from the production key format.
- _entry_provider() dedupes the raw-index provider extraction used by both the
  pre-ranking filter and the scoring loop in HermesIndexSource.search.
- browse_skills (the TUI-gateway browse path) now applies the same merged
  provider cut as do_browse; it accepted a provider value but returned
  unfiltered results.

Validation: 121 targeted tests green; the regression tests go red on both
adapters when either the tap skip or the index pre-filter is neutralized, and
4/4 red on unpatched main; live CLI repro returns 0 results on main and 3/3
provider matches on this stack.
2026-09-15 14:15:59 +05:30
Danylo Borodchuk e75b5a2d38 fix(skills): filter providers before limiting search results 2026-09-15 14:15:59 +05:30
Teknium 2dcd97d648 simplify(compat): tools/skills_hub — drop 51 re-exports/aliases, repoint 25 callers + 11 test files 2026-09-03 13:22:48 -07:00
Teknium d8f8fb58f6 refactor(skills_hub): per-module compaction pass — dedupe builders, collapse defensive layers, tighten docstrings 2026-09-02 21:42:18 -07:00
Teknium 25543bc785 refactor(skills_hub): table-driven hub path resolvers; flatten index fetch/search loops 2026-09-02 20:20:20 -07:00
Teknium d320d5f741 refactor(termhub): compact re-export blocks and wrap companion-module docstrings 2026-09-02 15:59:18 -07:00
Teknium 208e5b2312 refactor(skills_hub): table-driven hub path resolvers; extract index fetch + source router + parallel search to skills_hub_search 2026-09-02 15:53:18 -07:00