Skip to content

CLI sub-command search-only#446

Merged
castelao merged 26 commits into
mainfrom
search_only
May 28, 2026
Merged

CLI sub-command search-only#446
castelao merged 26 commits into
mainfrom
search_only

Conversation

@castelao
Copy link
Copy Markdown
Member

@castelao castelao commented May 26, 2026

Support faster iterations on seaching new documents.

@castelao castelao self-assigned this May 26, 2026
@castelao castelao added the enhancement Update to logic or general code improvements label May 26, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

❌ Patch coverage is 61.53846% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.44%. Comparing base (f88e93e) to head (0a2acb2).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
compass/scripts/search.py 58.59% 62 Missing and 3 partials ⚠️
compass/_cli/common.py 19.04% 17 Missing ⚠️
compass/_cli/main.py 0.00% 2 Missing ⚠️
compass/_cli/process.py 50.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (61.53%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   56.11%   56.44%   +0.32%     
==========================================
  Files          63       66       +3     
  Lines        6080     6279     +199     
  Branches      591      614      +23     
==========================================
+ Hits         3412     3544     +132     
- Misses       2598     2662      +64     
- Partials       70       73       +3     
Flag Coverage Δ
unittests 56.44% <61.53%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@castelao castelao marked this pull request as ready for review May 28, 2026 00:34
@castelao castelao requested a review from ppinchuk as a code owner May 28, 2026 00:34
Copilot AI review requested due to automatic review settings May 28, 2026 00:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new compass search-only CLI subcommand that runs just the web-search portion of the COMPASS pipeline and emits a JSON or human-readable summary report of ranked URLs per jurisdiction, intended to speed up iteration on search/retrieval configuration before invoking the full pipeline. Logging setup is refactored out of process.py into a shared compass/_cli/common.py helper so the new subcommand can reuse it.

Changes:

  • New compass.scripts.search_only orchestration module (engine resolution, per-jurisdiction async search, blacklist/duplicate/top-N filtering, JSON + text reporting).
  • New compass._cli.search_only Click subcommand wired into compass/_cli/main.py, with options for config, output path/format, -n URL count override, verbosity, and one-shot plugin registration.
  • Extracted setup_cli_logging into compass/_cli/common.py and updated process.py to consume it; added unit tests for the new script helpers and CLI command.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compass/_cli/common.py New shared CLI logging helper extracted from process.py.
compass/_cli/process.py Switched to shared setup_cli_logging helper, removed local copy.
compass/_cli/main.py Registers the new search-only subcommand.
compass/_cli/search_only.py New Click subcommand wiring config loading, plugin registration, run, and output.
compass/scripts/search_only.py Core search-only orchestration, filtering, and report formatting.
tests/python/unit/scripts/test_search_only.py Unit tests for engine resolution, filters, and summary rendering.
tests/python/unit/scripts/test_cli_search_only.py CLI-level tests covering JSON/summary output, -n override, and plugin registration.

Comment thread compass/scripts/search.py
Comment thread compass/scripts/search.py
Copy link
Copy Markdown
Collaborator

@ppinchuk ppinchuk left a comment

Choose a reason for hiding this comment

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

Honestly this looks great! Just a few minor requests here and there

Comment thread compass/scripts/search.py
Comment thread compass/scripts/search_only.py Outdated
Comment thread compass/scripts/search.py
Comment thread compass/scripts/search_only.py Outdated
Comment thread compass/scripts/search_only.py Outdated
Comment thread compass/scripts/search_only.py Outdated
Comment thread compass/scripts/search.py
Comment thread compass/_cli/search_only.py Outdated
Comment thread compass/scripts/search_only.py Outdated
Comment thread compass/scripts/search.py
castelao added 3 commits May 27, 2026 20:32
Add number of duplicates in the criteria to order, such that the targets
found multiple times (engines / queries) are probably the right target.
@castelao castelao added the p-medium Priority: medium label May 28, 2026
@castelao
Copy link
Copy Markdown
Member Author

@ppinchuk , I think I addressed everything. Please, close the conversations that you agree and let me know if it is missing anything.

@ppinchuk
Copy link
Copy Markdown
Collaborator

@ppinchuk , I think I addressed everything. Please, close the conversations that you agree and let me know if it is missing anything.

Thank you!!! Just a few discussion points left

@castelao
Copy link
Copy Markdown
Member Author

For the records, I renamed to search instead of search-only. Using just search is clear enough. Files and functions updated to reflect that.

@castelao
Copy link
Copy Markdown
Member Author

@ppinchuk , thanks for the feedback and review!

@castelao castelao merged commit 1d2bbc5 into main May 28, 2026
21 checks passed
@castelao castelao deleted the search_only branch May 28, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Update to logic or general code improvements p-medium Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants