Skip to content

Conversation

@ppinchuk
Copy link
Collaborator

@ppinchuk ppinchuk commented Feb 5, 2026

Set up a lot of groundwork to easier support plugins in COMPASS and ultimately get to a point where we can run extraction based on a schema alone.

@ppinchuk ppinchuk self-assigned this Feb 5, 2026
@ppinchuk ppinchuk added the enhancement Update to logic or general code improvements label Feb 5, 2026
@ppinchuk ppinchuk requested a review from castelao as a code owner February 5, 2026 07:37
Copilot AI review requested due to automatic review settings February 5, 2026 07:37
@ppinchuk ppinchuk added p-critical Priority: critical refactor Code improvements that do not change functionality topic-python-general Issues/pull requests related to python labels Feb 5, 2026
Copy link
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

This PR implements Part 1 of a major refactor to support a plugin-based architecture in COMPASS. The changes establish groundwork for easier plugin support and schema-based extraction.

Changes:

  • Introduces a new plugin system with base classes (BaseExtractionPlugin, ExtractionPlugin) and interfaces for heuristics, text collectors, extractors, and parsers
  • Refactors existing extraction modules (solar, wind, small_wind, water) to use the new plugin architecture
  • Moves Jurisdiction class from compass.utilities.location to compass.utilities.jurisdictions and consolidates jurisdiction-related utilities
  • Adds ExtractionContext class to support multi-document extraction workflows
  • Extracts LLM cost computation logic into a dedicated compass.utilities.costs module
  • Updates service layer to work with ExtractionContext instead of raw documents
  • Removes deprecated utility functions and consolidates common base classes

Reviewed changes

Copilot reviewed 58 out of 58 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
compass/plugin/ (new) Defines plugin base classes and interfaces for extraction workflows
compass/extraction/context.py (new) Implements ExtractionContext for multi-document support
compass/utilities/costs.py (new) Extracts cost computation utilities from main utilities module
compass/utilities/jurisdictions.py Consolidates jurisdiction utilities (moved from location.py)
compass/extraction/{solar,wind,small_wind,water}/ Refactored to use plugin architecture
compass/services/threaded.py Updated to work with ExtractionContext
tests/python/unit/ Migrated and added tests for new modules
docs/source/conf.py Updated documentation references

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 64.60280% with 303 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.67%. Comparing base (dcbafa7) to head (7edc449).

Files with missing lines Patch % Lines
compass/plugin/interface.py 50.31% 79 Missing and 1 partial ⚠️
compass/scripts/process.py 15.21% 78 Missing ⚠️
compass/extraction/water/plugin.py 31.06% 71 Missing ⚠️
compass/plugin/ordinance.py 65.93% 30 Missing and 1 partial ⚠️
compass/extraction/apply.py 13.63% 19 Missing ⚠️
compass/plugin/base.py 66.66% 5 Missing ⚠️
compass/extraction/small_wind/ordinance.py 87.09% 4 Missing ⚠️
compass/extraction/solar/ordinance.py 86.66% 4 Missing ⚠️
compass/extraction/wind/ordinance.py 86.66% 4 Missing ⚠️
compass/scripts/download.py 33.33% 4 Missing ⚠️
... and 2 more

❌ Your patch status has failed because the patch coverage (64.60%) 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     #376      +/-   ##
==========================================
+ Coverage   53.61%   56.67%   +3.06%     
==========================================
  Files          49       55       +6     
  Lines        4695     4953     +258     
  Branches      416      431      +15     
==========================================
+ Hits         2517     2807     +290     
+ Misses       2149     2119      -30     
+ Partials       29       27       -2     
Flag Coverage Δ
unittests 56.67% <64.60%> (+3.06%) ⬆️

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.

@ppinchuk ppinchuk merged commit 4d5dc4d into main Feb 5, 2026
18 checks passed
@ppinchuk ppinchuk deleted the pp/dev branch February 5, 2026 22:58
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-critical Priority: critical refactor Code improvements that do not change functionality topic-python-general Issues/pull requests related to python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants