Transmission MVP - #463
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (68.18%) 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 #463 +/- ##
==========================================
+ Coverage 63.30% 63.34% +0.04%
==========================================
Files 78 78
Lines 7211 7233 +22
Branches 725 729 +4
==========================================
+ Hits 4565 4582 +17
- Misses 2505 2510 +5
Partials 141 141
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a new “transmission” one-shot extraction plugin and introduces a standardized scope field (with sentinel values) across schema validation and output finalization.
Changes:
- Added a new transmission extraction schema + plugin configuration and registered the extractor.
- Introduced
scopesupport: injectsall/othersentinels into schema enums and applies defaultscopevalues in plugin output. - Updated finalization column sets and added unit tests around scope-sentinel injection.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/python/unit/plugin/test_plugin_one_shot.py | Adds unit tests for _inject_scope_sentinels behavior and legacy no-op behavior. |
| compass/utilities/finalize.py | Adds scope to parsed/output column definitions. |
| compass/plugin/one_shot/components.py | Applies default scope values and includes scope in output column candidates. |
| compass/plugin/one_shot/base.py | Injects all/other scope sentinels into the configured schema’s scope.enum. |
| compass/extraction/transmission/transmission_schema.json5 | Introduces the transmission extraction schema used by the new plugin. |
| compass/extraction/transmission/plugin_config.yaml | Provides transmission plugin config (schema path, queries, keywords, heuristics). |
| compass/extraction/transmission/init.py | Instantiates and exposes COMPASSTransmissionExtractor. |
| compass/extraction/init.py | Registers the transmission extractor in the package exports. |
5f5b3a2 to
915ffb8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (2)
compass/extraction/transmission/transmission_schema.json5:215
$definitions.numerical_featuresdocuments a"maximum-height"feature, but that feature ID does not exist in the schema'sfeature.enum. Keeping a non-existent feature name in the schema guidance can lead the model to output invalid feature values; remove this entry (the existingmaximum tower height/maximum structure heightentries already cover the intent).
"maximum-height": {
"description": "Extract maximum structure height allowed."
}
compass/utilities/finalize.py:41
QUAL_OUT_COLSis derived via slicing_PARSED_COLS, which is brittle (any insert/remove in_PARSED_COLSchanges qualitative outputs implicitly and requires re-counting indices, as with the:6→:7update here). Defining the qualitative columns explicitly by name makes future column evolution safer and more readable.
QUAL_OUT_COLS = _PARSED_COLS[:7] + _PARSED_COLS[-5:-1]
e569497 to
2e3d43a
Compare
|
@ppinchuk , I would like to merge this one and start a following PR with fine-tuning transmission. Let me know if you have anything against merging this MVP as it is. |
ppinchuk
left a comment
There was a problem hiding this comment.
Couple of questions, everything else looks good!
ppinchuk
left a comment
There was a problem hiding this comment.
OK, after discussion, everything looks good. I just highly recommend adding a blurb about the "subarea" column, and especially explain to the users that "all" and :"other" categories will be added, so they don't nee to use other things like "any" or "undefined"
COMPASS/compass/plugin/one_shot/base.py
Lines 68 to 71 in 4bb2507
Current name is _inject_subarea_sentinels().
When moving to subarea, left behind this _schema_with_scope.
Following the pattern used in GHP.
We already use scope in another context, so let's avoid confusion here.
Ordering good_tech_acronyms definition to match previous techs.
It gets more complex but the overall collection is more efficient if we combine the regular ordinances with franchise in a single run.
Left this one behind when I transitioned from scope to subarea.
…tion - Tighten 'structures distance' description to explicitly include generic 'building setback line' clauses tied to a transmission-line easement, right-of-way, or centerline when the building is not qualified as residential. - Tighten 'residential buildings distance' description with an exclusion redirecting generic unqualified building setback lines to 'structures distance'. - Add a $examples entry demonstrating a voltage-tiered building setback table (Roane County TN 5.2.6.2 pattern), routing it to 'structures distance' with subarea='all' and applying numeric prioritization to select the largest tier (75 ft). - Uncomment definition_v_rule_test in $core_principles.
- Extend 'bond' description to include subdivision-scale utility-infrastructure completion bonds when the provision does not carve out electric infrastructure and is not restricted to lower-voltage electric infrastructure only (distribution, service, secondary, sub-transmission). - Clarify that qualitative bond rows are permitted; a numeric amount is not required when the provision imposes an enforceable obligation.
Introduce first-class $scope key consumed by COMPASS's dedicated per-chunk scope-check step (see compass/plugin/one_shot/components.py). This gate renders only the $scope string (not the full schema) into its prompt and admits chunks with inclusive-by-default framing, so mixed-voltage setback tables that include HV tiers pass through to the content-relevance filter instead of being rejected wholesale.
Using double quotes to define jurisdiction context, then using single quotes as overall query. It used to cause errors using the single quotes.
The site:municode.com and site:codelibrary.amlegal.com queries were returning zero results for jurisdictions where the publisher indexes under an alternate name than `full_name` (e.g., 'Evangeline Parish Police Jury, LA' on municode vs. 'Evangeline Parish, Louisiana' in COMPASS). The phrase-lock is retained on free-form queries where it prevents cross-state noise (Humphreys TN was previously polluted by Moab UT before quoting was introduced). On site:-scoped queries the domain restriction already bounds the result set to a legitimate ordinance publisher, so phrase-locking adds no protection and blocks legitimate matches whenever the publisher's title differs from full_name.
…sment Treat transmission-line and franchise content as two kinds of content that may appear separately or together in one document, rather than as two distinct document types. Keep franchise as the primary output with its verbatim-name and granting-clause guidance, and allow content-(1) features to be extracted from a franchise document when provisions apply to the grantee's electric infrastructure and, by encompassment, would apply to its high-voltage transmission lines.
Extend the decommissioning feature to cover obligations to remove facilities and restore the site upon termination, forfeiture, or expiration of a franchise or grant, in addition to abandonment on retirement or failure. The global encompassment_scope rules supply the voltage floor.
Define the traffic disruption feature under operational_features. This closes the gap that caused the feature to be missed on franchise documents.
Extend the permit feature beyond discretionary land-use approvals to also cover street-opening, road-cut, right-of-way, and encroachment permits issued by a road or public-works authority. The global encompassment_scope rules supply the voltage floor.
Broaden the transmission schema 'franchise' feature so a codified 'List of Franchises' index that names electric utilities as grantees (grantee, duration, originating-ordinance reference) is treated as substantive content to collect and extract, rather than being dropped by the content gate as a citation-only index. Add a matching $examples row modeled on the St. Helena Parish electric-franchise list so the collection gate has a positive exemplar.
Implementing high-voltage tansmission lines.