Skip to content

Add BM25 command search#1

Merged
vakovalskii merged 3 commits intomainfrom
feat/command-search
Mar 13, 2026
Merged

Add BM25 command search#1
vakovalskii merged 3 commits intomainfrom
feat/command-search

Conversation

@vakovalskii
Copy link
Copy Markdown
Collaborator

Summary

  • Port BM25 ranking engine from picoclaw (pkg/utils/bm25.gosrc/bm25.ts)
  • Add CommandSearch class with two search modes: BM25 (natural language) and regex (pattern matching)
  • Integrate ocli search command into CLI for endpoint discovery on large API surfaces

Usage

ocli search --query "upload files"        # BM25 ranked search
ocli search --regex "admin.*get" -n 5     # regex pattern match

Test plan

  • BM25Engine: 9 tests (empty input, keyword search, ranking, topK, sorting, multi-word, no-match)
  • CommandSearch: 14 tests (BM25 search, regex search, edge cases)
  • All 48 project tests pass

🤖 Generated with Claude Code

vakovalskii and others added 3 commits March 13, 2026 09:35
Port BM25 ranking engine from picoclaw and integrate command search
into the CLI, enabling discovery when --help is insufficient for
large API surfaces.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add js-yaml dependency for YAML spec parsing
- openapi-loader: auto-detect JSON/YAML by extension and content
- GitHub API test: 845 endpoints, BM25 search, regex search
- Box API test: 258 endpoints loaded from YAML format
- openapi-loader tests: YAML from file, HTTP, auto-detection
- Drift test results preserved in tests/results/
- Fixtures download script (tests/fixtures/download.sh)
- Tests skip gracefully when fixtures not downloaded

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vakovalskii vakovalskii force-pushed the feat/command-search branch from 4e3297d to 4afa4ff Compare March 13, 2026 06:51
@vakovalskii vakovalskii merged commit ee9f422 into main Mar 13, 2026
1 check passed
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