Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
==========================================
+ Coverage 43.32% 43.33% +0.01%
==========================================
Files 45 45
Lines 4240 4241 +1
Branches 380 380
==========================================
+ Hits 1837 1838 +1
Misses 2378 2378
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors repeated prompt instruction text by introducing a YES_NO_PROMPT template variable to reduce code duplication and simplify future prompt adjustments across all graph-based extraction and validation modules.
Key Changes:
- Added
_YES_NO_PROMPTconstant incompass/common/base.pycontaining "Please start your response with either 'Yes' or 'No' and briefly explain your answer." - Registered
YES_NO_PROMPTas a graph-level template variable insetup_graph_no_nodes() - Replaced 50+ occurrences of the repeated yes/no instruction text with
{YES_NO_PROMPT}across validation and extraction modules
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| compass/common/base.py | Added _YES_NO_PROMPT constant definition and registered it in the graph setup function; replaced 20+ occurrences in base graph setup functions with the template variable |
| compass/validation/graphs.py | Replaced 20+ occurrences of the repeated yes/no prompt instruction with {YES_NO_PROMPT} across document type and jurisdiction validation prompts |
| compass/extraction/wind/graphs.py | Replaced 10+ occurrences in wind energy system type classification and setback extraction prompts with the template variable |
| compass/extraction/solar/graphs.py | Replaced 6+ occurrences in solar energy farm type classification and setback extraction prompts with the template variable |
| compass/extraction/small_wind/graphs.py | Replaced 10+ occurrences in small wind system type classification and setback extraction prompts with the template variable |
castelao
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
YES_NO_PROMPTto template to reduce code repetition and make it easier to adjust instructions across all prompts.