Skip to content

Update web crawl conditions - #501

Merged
ppinchuk merged 37 commits into
mainfrom
pp/fix_collection
Jul 21, 2026
Merged

Update web crawl conditions#501
ppinchuk merged 37 commits into
mainfrom
pp/fix_collection

Conversation

@ppinchuk

Copy link
Copy Markdown
Collaborator

Specifically, we now assume that if a user provides a website via the jurisdictions input, that it is ground truth and does not need to be validated. If they do NOT provide a jurisdiction website but there is a model config we can use, then a search engine search will be applied (along with a validation). If a website is not given and LLM parameters are not available, a web crawl will not happen.

@ppinchuk ppinchuk self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 22:23
@ppinchuk
ppinchuk requested a review from castelao as a code owner July 16, 2026 22:23
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements topic-python-general Issues/pull requests related to python p-high Priority: high labels Jul 16, 2026

Copilot AI 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.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates the jurisdiction website discovery / crawl gating logic so that user-supplied jurisdiction websites are treated as ground truth, while website discovery via search happens only when LLM configs are available (and is validated), otherwise website crawling is skipped.

Changes:

  • Removed the validate / validate_user_website_input switches and simplified call sites accordingly.
  • Updated collection steps to (1) normalize a provided website to base domain and (2) only attempt website discovery when LLM models are configured.
  • Updated tests and request model-configuration documentation to match the new behavior.

Reviewed changes

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

Show a summary per file
File Description
tests/python/unit/scripts/test_download.py Updates unit test to match the new find_jurisdiction_website signature.
support/jurisdictions/update_jur_websites.py Updates internal tooling to call find_jurisdiction_website without the removed validate kwarg.
compass/scripts/download.py Removes validate parameter and unconditional “return first candidate” path; website candidates are now always LLM-validated.
compass/pipeline/jurisdiction.py Removes validate_user_website_input from the workflow configuration.
compass/pipeline/data_classes.py Makes model registry available whenever user_model_input is provided; expands model config docs.
compass/pipeline/coordinator.py Removes validate_user_website_input plumbing when creating workflows.
compass/pipeline/collection/steps.py Reworks website resolution: normalize provided URL; only search for a website when LLM models exist; removes user-website validation logic.
Comments suppressed due to low confidence (1)

compass/scripts/download.py:249

  • find_jurisdiction_website will raise a KeyError if model_configs is empty or missing LLMTasks.DEFAULT. Since the function is a public helper (also used by tooling), please add explicit input validation with a clear error (e.g., raise COMPASSValueError stating that a default model config is required for website validation) or handle the no-model case by returning None before attempting validation.
    model_config = model_configs.get(
        LLMTasks.JURISDICTION_MAIN_WEBSITE_VALIDATION,
        model_configs[LLMTasks.DEFAULT],
    )

Comment thread compass/pipeline/collection/steps.py
Comment thread compass/pipeline/collection/steps.py
Comment thread tests/python/unit/scripts/test_download.py
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.07071% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.15%. Comparing base (3648fb2) to head (f0e72db).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
compass/scripts/download.py 10.00% 27 Missing ⚠️
compass/extraction/water/graphs.py 0.00% 16 Missing ⚠️
compass/common/base.py 64.28% 5 Missing ⚠️
compass/extraction/small_wind/graphs.py 0.00% 4 Missing ⚠️
compass/extraction/wind/graphs.py 0.00% 4 Missing ⚠️
compass/services/cpu.py 20.00% 4 Missing ⚠️
compass/_cli/common.py 0.00% 3 Missing ⚠️
compass/pipeline/collection/steps.py 84.21% 2 Missing and 1 partial ⚠️
compass/utilities/logs.py 66.66% 3 Missing ⚠️
compass/validation/utilities.py 0.00% 3 Missing ⚠️
... and 9 more

❌ Your patch status has failed because the patch coverage (57.07%) 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     #501      +/-   ##
==========================================
+ Coverage   62.59%   63.15%   +0.55%     
==========================================
  Files          77       77              
  Lines        7047     7064      +17     
  Branches      706      703       -3     
==========================================
+ Hits         4411     4461      +50     
+ Misses       2502     2469      -33     
  Partials      134      134              
Flag Coverage Δ
unittests 63.15% <57.07%> (+0.55%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@ppinchuk
ppinchuk merged commit c7ab90f into main Jul 21, 2026
31 checks passed
@ppinchuk
ppinchuk deleted the pp/fix_collection branch July 21, 2026 02:36
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-high Priority: high topic-python-general Issues/pull requests related to python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants