Skip to content

Better multi doc handling#418

Merged
ppinchuk merged 16 commits intomainfrom
pp/better_multi_doc_handling
May 8, 2026
Merged

Better multi doc handling#418
ppinchuk merged 16 commits intomainfrom
pp/better_multi_doc_handling

Conversation

@ppinchuk
Copy link
Copy Markdown
Collaborator

@ppinchuk ppinchuk commented May 6, 2026

More flexible handling for multiple retrieved documents

@ppinchuk ppinchuk self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 23:48
@ppinchuk ppinchuk requested a review from castelao as a code owner May 6, 2026 23:48
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements new computation Update that adds a new computation method topic-python-general Issues/pull requests related to python p-high Priority: high labels May 6, 2026
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a configurable document-selection strategy for ordinance extraction to better support handling multiple retrieved documents, including new “concat all” and “merge features” behaviors.

Changes:

  • Added DocSelectionMethod enum and updated OrdinanceExtractionPlugin.parse_docs_for_structured_data() to dispatch among multiple multi-doc extraction modes.
  • Implemented multi-doc “concat” and “merge” paths (including prohibition-aware merging and prioritization logic).
  • Updated one-shot config/docs and added extensive unit tests covering the new multi-doc behaviors and helper utilities.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/python/unit/plugin/test_plugin_ordinances.py Adds unit tests for selection-method dispatch plus merge/priority/source-filling helpers.
examples/water_rights_demo/one-shot/plugin_config.yaml Updates example config to use the new doc_selection_method option.
compass/scripts/download.py Adjusts ordinance-doc logging and tweaks sorting fallback date tuple.
compass/plugin/ordinance.py Introduces DocSelectionMethod, new multi-doc parse modes, and merge/prioritization helpers.
compass/plugin/one_shot/base.py Replaces allow_multi_doc_extraction with doc_selection_method config parsing and docs.
compass/plugin/init.py Re-exports DocSelectionMethod.

Comment thread tests/python/unit/plugin/test_plugin_ordinances.py
Comment thread compass/plugin/ordinance.py
Comment thread compass/scripts/download.py
Comment thread compass/plugin/one_shot/base.py Outdated
Comment thread compass/plugin/ordinance.py
Comment thread compass/plugin/ordinance.py
Comment thread compass/plugin/ordinance.py
Comment thread compass/plugin/ordinance.py Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

❌ Patch coverage is 56.71642% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.74%. Comparing base (e0575ac) to head (4890b00).

Files with missing lines Patch % Lines
compass/plugin/ordinance.py 56.48% 47 Missing and 10 partials ⚠️
compass/scripts/download.py 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (56.71%) 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     #418      +/-   ##
==========================================
+ Coverage   54.99%   55.74%   +0.74%     
==========================================
  Files          62       62              
  Lines        5870     5983     +113     
  Branches      546      568      +22     
==========================================
+ Hits         3228     3335     +107     
+ Misses       2593     2589       -4     
- Partials       49       59      +10     
Flag Coverage Δ
unittests 55.74% <56.71%> (+0.74%) ⬆️

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 4c24764 into main May 8, 2026
21 checks passed
@ppinchuk ppinchuk deleted the pp/better_multi_doc_handling branch May 8, 2026 00:18
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 new computation Update that adds a new computation method 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