diff --git a/compass/extraction/__init__.py b/compass/extraction/__init__.py index e86d8f6d7..427a37fdf 100644 --- a/compass/extraction/__init__.py +++ b/compass/extraction/__init__.py @@ -15,5 +15,6 @@ from .rmp import COMPASSGeoRMPExtractor from .small_wind import COMPASSSmallWindExtractor from .solar import COMPASSSolarExtractor +from .transmission import COMPASSTransmissionExtractor from .water import TexasWaterRightsExtractor from .wind import COMPASSWindExtractor diff --git a/compass/extraction/transmission/__init__.py b/compass/extraction/transmission/__init__.py new file mode 100644 index 000000000..c2579dc37 --- /dev/null +++ b/compass/extraction/transmission/__init__.py @@ -0,0 +1,12 @@ +"""COMPASS high-voltage transmission extraction plugin""" + +import importlib.resources + +from compass.plugin import create_schema_based_one_shot_extraction_plugin + + +COMPASSTransmissionExtractor = create_schema_based_one_shot_extraction_plugin( + importlib.resources.files("compass.extraction.transmission") + / "plugin_config.yaml", + tech="transmission", +) diff --git a/compass/extraction/transmission/plugin_config.yaml b/compass/extraction/transmission/plugin_config.yaml new file mode 100644 index 000000000..a1ccb8ade --- /dev/null +++ b/compass/extraction/transmission/plugin_config.yaml @@ -0,0 +1,173 @@ +schema: ./transmission_schema.json5 + +data_type_short_desc: high-voltage transmission lines ordinance + +doc_selection_method: "multi doc mixed" + +query_templates: + - 'site:municode.com {jurisdiction} electrical transmission line' + - 'site:codelibrary.amlegal.com {jurisdiction} electrical transmission line' + - '"{jurisdiction}" zoning code electric transmission line setback' + - '"{jurisdiction}" high voltage transmission line ordinance' + - '"{jurisdiction}" overhead electric utility line zoning' + - '"{jurisdiction}" power line' + - 'filetype:pdf "{jurisdiction}" electric transmission line ordinance' + - 'Where can I find the legal text for electric transmission line zoning ordinances in "{jurisdiction}"?' + - '"{jurisdiction}" electric utility franchise ordinance' + - '"{jurisdiction}" code of ordinances electric franchise' + - 'filetype:pdf "{jurisdiction}" electric franchise agreement' + +website_keywords: + pdf: 92160 + transmission: 46080 + ordinance: 23040 + zoning: 11520 + utility: 5760 + electric: 5760 + franchise: 5760 + code: 2880 + right-of-way: 1440 + easement: 1440 + siting: 1440 + franchise agreement: 1440 + overhead: 720 + substation: 720 + permit: 720 + land use: 720 + planning: 720 + grantee: 720 + municipal: 360 + county: 360 + code of ordinances: 360 + ordinance code: 360 + land use code: 360 + use table: 360 + conditional use permit: 180 + special use permit: 180 + chapter: 180 + article: 180 + title: 180 + statute: 180 + administrative code: 180 + government: 180 + +heuristic_keywords: + good_tech_acronyms: + - "kv" + - "hvdc" + - "ehv" + - "uhv" + - "cpcn" # Certificate of Public Convenience and Necessity + - "hv" + - "kva" + good_tech_keywords: + - "transmission" + - "kilovolt" + - "powerline" + - "franchise" + - "grantee" + - "substation" + - "pole" + - "overhead" + - "right-of-way" + - "right of way" + - "rights-of-way" + - "utility line" + good_tech_phrases: + - "certificate of public convenience and necessity" + - "high voltage" + - "extra high voltage" + - "bulk electric" + - "bulk transmission" + - "electric franchise" + - "electric utility franchise" + - "electric transmission" + - "69 kv" + - "115 kv" + - "138 kv" + - "161 kv" + - "230 kv" + - "345 kv" + - "500 kv" + - "765 kv" + - "transmission line" + - "transmission pole" + - "electric line" + - "utility easement" + - "transmission or distribution" + - "electric transmission facilities" + - "overhead line" + - "overhead electric" + - "aerial line" + - "high-voltage line" + - "overhead electric line" + - "overhead transmission" + - "overhead power line" + - "transmission tower" + - "transmission facility" + - "utility transmission" + - "transmission corridor" + - "transmission right-of-way" + - "transmission right of way" + - "transmission easement" + - "transmission structure" + - "transmission infrastructure" + - "electric power line" + - "power line" + - "electric utility" + not_tech_words: + - "local distribution" + - "transmission fluid" + - "auto transmission" + - "automatic transmission" + - "communication transmission" + - "manual transmission" + - "data transmission" + - "radio transmission" + - "wireless transmission" + - "telephone line" + - "disease transmission" + - "virus transmission" + - "heat transmission" + - "natural gas transmission" + - "gas transmission" + - "oil transmission" + +collection_prompts: true + +extraction_system_prompt: |- + You are a legal scholar extracting structured data from + ordinance documents. A document may contain two kinds of + content, which can appear separately or together in the same + document: + (1) high-voltage electric transmission line requirements, and + (2) an electric utility franchise that grants a named company + the right to operate electric infrastructure in this + jurisdiction. + + For transmission-line content (1), be focused and literal: + extract only enacted, explicit, in-scope requirements that + apply to high-voltage (typically 69 kV or higher) electric + transmission lines, towers, poles, substations, and their + rights-of-way. Do not extract requirements that apply only to + local electric distribution, telecommunications, gas or oil + pipelines, or low-voltage service lines. + + For franchise content (2), the "franchise" feature is the + primary output: name every explicitly named grantee company + using its verbatim legal name and quote the granting clause. + Do not extract non-electric franchises (water, gas, cable, + telecom). If the same document also contains transmission-line + content (1), extract those features as well under the rules + above, including provisions that apply to the grantee's + electric infrastructure generally and, by encompassment, would + apply to its high-voltage transmission lines. + + Be thorough and complete: review all relevant sections, + including tables and lists, so no explicitly stated in-scope + feature is missed. Before finalizing, perform a feature-coverage + check against the schema and ensure each explicitly supported + feature is captured exactly once. + Pay extra attention to any descriptions, instructions, examples, + and definitions in the schema, and follow all schema + instructions carefully. diff --git a/compass/extraction/transmission/transmission_schema.json5 b/compass/extraction/transmission/transmission_schema.json5 new file mode 100644 index 000000000..e96580f3a --- /dev/null +++ b/compass/extraction/transmission/transmission_schema.json5 @@ -0,0 +1,344 @@ +{ + "title": "Transmission Ordinance Extraction Schema", + "description": "Single-shot structured extraction schema for energy transmission ordinances. This schema guides an LLM to extract all relevant features in one call and returns an outputs array where each object represents one row in the extracted long-form table.", + "version": "0.1.0", + "type": "object", + "required": ["outputs"], + "additionalProperties": false, + "properties": { + "outputs": { + "type": "array", + "description": "Sparse long-form extraction table. Include only features with an enacted, explicit requirement and emit **at most one row per feature**. Never infer, imply, or guess a requirement from related context.", + "items": { + "type": "object", + "required": [ + "feature", + "value", + "units", + "section", + "summary", + "explanation", + "aggregated" + ], + "additionalProperties": false, + "properties": { + "feature": { + "type": "string", + "description": "The ordinance feature being extracted. Must be one of the enumerated feature IDs. Do not invent aliases, prefixes, or synonym variants.", + "enum": [ + // -- Setbacks -- + // Do I need to include participating and non-participating + "structures distance", + // Occupied Dwellings or Residential Buildings + "residential buildings distance", + "property lines distance", + // Roads of freeways + "roads distance", + // Heliports and Airport Runways + "airport distance", + // Ordinary High Water Mark (OHWM) + "OHWM distance", + "railroads distance", + + // -- Definitions -- + // Definition /voltage threshold to qualify as a "transmission line" + "voltage threshold", + + // -- Numerical Restrictions -- + // Electric Fields Strength at Property Line + "electric field", + // Maximum allowed height for transmission towers, poles, + // or monopoles that carry high-voltage conductors. + "maximum tower height", + // Maximum allowed height for accessory or support + // structures (substations, control buildings, etc.). + "maximum structure height", + "noise", + + // -- Operational -- + // Bond Requirement + "bond", + // Decommissioning or Remediation Requirements + "decommissioning", + // Conditional Use or Special Use Permit Requirement + "permit", + // Compliance with Federal Aviation Administration and local approvals near airports + "FAA", + + // -- Prohibited or limited-use districts -- + "district use restriction", + // -- Exclusions -- + "historic site", + "critical species habitat", + "wetland", + "floodplain", + "residence", + "hospital", + "school", + // Daycare centers + "daycare", + // institutions of higher education + "higher education", + + // -- Qualitative -- + "color", + "fencing", + // Fire Prevention or Fire Protection + "fire prevention", + "lighting", + // Identification or Signage ("Danger", "No Trespassing",etc.) + "signage", + // Traffic Disruption + "traffic disruption", + // Vegetation Protection or Landscaping Requirements + "vegetation", + + // -- Administrative -- + // Electric utility franchise granted to a named company + "franchise", + ] + }, + "value": { + "description": "The extracted ordinance value. For numerical distance thresholds and limits, use a number. For categorical outcomes, use a string. For fields that list multiple named items, use an array of strings. Use null only for qualitative features, and only when an enacted, explicit, enforceable ordinance requirement for that feature is present. Null must never be used to indicate absence. If a feature has no enacted, explicit requirement in the ordinance text, omit that feature from outputs.", + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + { + "type": "array", + "items": {"type": "string"}, + "additionalProperties": false + }, + {"type": "null"} + ] + }, + "units": { + "type": ["string", "null"], + "description": "Units for the extracted value. Use canonical units for interoperability. For distance and height features, use 'feet' or 'meters' when possible. For noise, normalize A-weighted variants such as 'dB(A)' or 'dBA' to 'dBA'; keep plain 'dB' only when the text is explicitly not A-weighted. Preserve verbatim ordinance wording in summary while keeping units standardized in this field. Use null for permit lists and qualitative requirements without measurable units." + + }, + "section": { + "type": ["string", "null"], + "description": "The section title or number from the ordinance where this requirement appears. Include numerical labels if provided. Null if no section identifier is available." + }, + "summary": { + "type": "string", + "description": "A short summary of the relevant ordinance requirements." + }, + "explanation": { + "type": "string", + "description": "Brief rationale explaining why this row matches the selected feature under this schema. Reference the specific evidence in summary and how it supports the extracted value and units or, for qualitative features, the inclusion criteria. Must be a non-null, non-empty string and must not use absence placeholders." + }, + "aggregated": { + "type": "boolean", + "description": "True when this row's value was selected from multiple competing explicit values for the same feature, keeping the most restrictive one per $core_principles.numeric_prioritization (most restrictive is the largest value for setbacks, the smallest value for noise and height limits, and so on depending on the feature). False when the value comes from a single explicit value with no competing values to reconcile." + } + } + } + } + }, + "$scope": "Definitions for 'electric transmission line', 'transmission right-of-way', 'transmission easement', 'transmission tower', 'transmission substation', 'high-voltage line', or similar terms **OR** any legally enacted requirements, prohibitions, or permitting conditions that apply to high-voltage electric transmission lines, towers, poles, substations, or their rights-of-way/easements, **OR** any electric-utility franchise ordinance granting a named company the right to operate electric infrastructure in this jurisdiction. Provisions that by silence or by general wording (for example 'all public utilities', 'all utility lines and easements', 'all subdivision improvements', or a building-setback table tiered by voltage that includes any tier at or above 69 kV) would apply to electric transmission are IN SCOPE. **OUT OF SCOPE**: provisions explicitly and exclusively limited to electric distribution, service drops, secondary lines, or sub-transmission lines with no HV applicability; provisions scoped solely to non-electric utilities (water, gas, sewer, storm, telecom, cable); rules for other energy technologies (geothermal, solar PV, wind, hydro) unless the same clause also governs electric transmission. Proposed, future, draft, or contingent requirements that are not currently effective as written are also out of scope.", + "$core_principles": { + "scope_context": { + "description": "Only extract features that apply to high-voltage electric transmission lines and related infrastructure. Provisions scoped only to other energy systems (geothermal, solar PV, wind turbines) or only to lower-voltage electric infrastructure (distribution lines, service lines, service drops, secondary lines, sub-transmission) are out of scope unless the ordinance explicitly extends them to transmission. Encompassment rule: provisions that regulate a broader class which includes high-voltage transmission — for example 'all development', 'all construction activity', 'all public utilities', 'all utility infrastructure', 'all subdivision improvements', or 'electric utility lines' without a voltage qualifier — are in scope. If the ordinance defines 'transmission line' by a minimum voltage, treat that threshold as the cutoff: provisions explicitly restricted to voltages at or below it are out of scope even when phrased as electric utility infrastructure." + }, + "strict_evidence_gate": { + "description": "Extract a feature only when the ordinance text explicitly states a requirement, definition, or prohibition for that same feature. Never infer, assume, extrapolate, or guess from related context, implications, headings, or nearby provisions. If the ordinance points to an outside document or standard without restating the controlling requirement in the ordinance text itself, do not import missing values from that outside source." + }, + "data_omission": { + "description": "Emit only positively matched features. If a feature is not explicitly present, omit it entirely rather than returning placeholder text. For qualitative features, use value=null and units=null only when an enacted, explicit requirement or definition for that same feature is present. For numeric features, extract only when an explicit numeric threshold is stated in the ordinance text; otherwise omit the feature instead of returning null, empty, or qualitative-only values. Never emit absence placeholders such as 'not found', 'no explicit requirement', 'none', or similar text in any field." + }, + "numeric_prioritization": { + "description": "When multiple numeric values apply to the same (feature, subarea) pair, keep one row for that pair and select the controlling most restrictive value. Restrictiveness rules: setbacks -> choose the largest minimum separation distance; maximum tower height and maximum structure height -> choose the lowest limit within each feature independently, never combine tower limits with accessory-structure limits; noise -> choose the lowest allowed noise limit. When the ordinance explicitly states different numeric limits per zoning district for the same feature (for example a noise table with distinct limits for residential vs commercial districts), emit one row per district using the appropriate `subarea` value and apply restrictiveness within each row. Keep condition-specific alternatives in summary only when the ordinance text explicitly shows they all apply to the same (feature, subarea) pair for electric transmission systems." + }, + "definition_v_rule_test": { + "description": "Apply a primary-purpose routing test before classifying a clause as a definition. If the excerpt's main function is to state what a term means and it does not impose an enforceable obligation, extract it as a definition feature with value=null and units=null. If the excerpt imposes standards, applicability limits, permitting conditions, performance requirements, or prohibitions, classify it under the relevant operational or prohibition feature instead, even if the clause also names or restates a term." + } + }, + "$definitions": { + "setback_features": { + "description": "Setback features for electrical transmission lines and related infrastructure. Treat each setback feature independently and do not cross-apply a setback unless the ordinance text explicitly states that it applies to multiple target types. When a single clause explicitly lists multiple target types and one shared numeric setback, emit one row per explicitly listed feature using the same numeric value and units and cite the same clause in summary. Apply the shared numeric prioritization rules in $core_principles when multiple numeric values explicitly apply to the same feature.", + "properties": { + "structures distance": { + "description": "Minimum required separation from structures and buildings that do not match the definition of 'residential buildings distance'. Includes generic 'building setback line' clauses tied to a transmission-line easement, right-of-way, or centerline when the ordinance does not explicitly qualify the building as residential (for example 'residential', 'dwelling', 'home', 'residence')." + }, + "residential buildings distance": { + "description": "Minimum required separation from residential buildings, occupied dwellings, occupied buildings, residences, homes, residential receptors, or residential uses. Do not classify a generic unqualified 'building setback line' from a transmission-line easement as residential; that belongs under 'structures distance'." + }, + "property lines distance": { + "description": "Minimum required separation from property lines, lot lines, parcel boundaries, or lease boundaries when the ordinance explicitly states the distance is measured from that boundary. Do not remap property-line distances to roads or residential zones unless the text explicitly makes them equivalent for that requirement. Distances to official plan lines or specific plan lines for public highways do not belong here unless the ordinance expressly defines those lines as property boundaries for the same requirement." + }, + "roads distance": { + "description": "Minimum required separation from public road rights-of-way, including freeways. Property-line setbacks do NOT count for this feature unless the ordinance text explicitly states that the property line is the road right-of-way or otherwise makes them the same boundary for that requirement. IGNORE: Do not respond based on setbacks from other kinds of right-of-way such as utility easements, etc." + }, + "airport distance": { + "description":"Minimum required separation from airport runways and heliports." + }, + "OHWM distance": { + "description":"Minimum required separation from Ordinary High Water Mark (OHWM)." + }, + "railroads distance": { + "description": "Minimum required separation from railroads, railroad rights-of-way, rail corridors, or active rail lines. Extract only when rail infrastructure is explicitly named." + } + } + }, + "numerical_features": { + "description": "Non-setback numerical restriction features. Only extract if numerical values are explicitly given in the text.", + "properties": { + "electric field": { + "description": "Extract maximum electric field strength allowed at a property line." + }, + "maximum tower height": { + "description": "Extract the maximum allowed height for transmission towers, poles, monopoles, or other vertical structures that carry high-voltage conductors. Do not conflate with accessory structures such as substations, switchyards, control buildings, or equipment enclosures; those belong under 'maximum structure height'. If the ordinance states a single maximum height that applies to all transmission-related vertical elements without distinguishing towers from accessory structures, emit only 'maximum tower height'." + }, + "maximum structure height": { + "description": "Extract the maximum allowed height for accessory or support structures related to transmission infrastructure that do not carry conductors, including substations, switchyards, control buildings, equipment enclosures, and similar auxiliary facilities. Do not conflate with the towers, poles, or monopoles carrying the conductors; those belong under 'maximum tower height'. Extract only when the ordinance explicitly states a height limit for such accessory structures separate from the tower limit." + }, + "noise": { + "description": "Extract maximum allowable operational noise for electric transmission lines and related facilities only when an explicit numeric limit is stated. Normalize A-weighted units to 'dBA' in units and preserve verbatim wording in summary. If the ordinance only references compliance with external standards or provides no numeric noise limit, omit this feature entirely." + }, + "maximum-height": { + "description": "Extract maximum structure height allowed." + } + } + }, + "operational_features": { + "description": "Operational, licensing, permitting, inspection, and abandonment requirements. These features require text extraction only.", + "properties": { + "bond": { + "description": "Extract requirements for bonds, sureties, or financial assurance instruments related to construction, operation, maintenance, or decommissioning of electric transmission lines and related infrastructure. Include any specific conditions, amounts, or criteria for bond release when explicitly stated. Also includes bond, surety, or financial-assurance provisions covering subdivision-scale utility-infrastructure completion when the provision does not carve out electric infrastructure and is not restricted to lower-voltage electric infrastructure only (distribution, service, secondary, sub-transmission lines). A numeric amount is not required; qualitative bond rows (for example 'sufficiency determined by the utility agency') are permitted when the provision imposes an enforceable obligation." + }, + "decommissioning": { + "description": "Extract requirements for abandonment, removal, and site restoration when systems are retired, fail, or towers are abandoned, including obligations to remove facilities and restore the site upon termination, forfeiture, or expiration of a franchise or grant, with responsible party and timeline details when explicitly stated." + }, + "permit": { + "description": "Extract requirements to obtain approval or authorization before constructing, installing, or working on electric transmission lines and related infrastructure, including conditional use permits, special use permits, or other discretionary land-use approvals, as well as street-opening, road-cut, right-of-way, or encroachment permits issued by a road or public-works authority. Per $instructions.encompassment_scope, also extract a permit governing a broader class that would include transmission (for example 'all development', 'all utilities', or any work within public streets or rights-of-way), even when transmission is not named. Include any specific conditions or criteria for approval when explicitly stated." + }, + "FAA": { + "description": "Extract requirements for compliance with Federal Aviation Administration (FAA) regulations and local approvals for transmission lines and related infrastructure near airports. Include any specific FAA standards or local approval processes when explicitly stated." + }, + "traffic disruption": { + "description": "Extract requirements for how transmission infrastructure and related work affect public travel ways, temporarily or permanently: construction-period obligations not to obstruct traffic and to restore the right-of-way after excavation, road cuts, or street openings; and permanent effects of new construction such as line or crossing clearances over roadways, sight-distance at intersections and driveways, and limits on obstruction of the traveled way. Include timing and responsible-party details when explicitly stated." + } + } + }, + "prohibition_features": { + "description": "Prohibitions, bans, moratoria, or explicit siting restrictions on building, installing, or otherwise deploying electric transmission lines and related infrastructure within a specific zoning district. Use the `subarea` field to identify the district. Extract only when the ordinance explicitly states that the restriction applies to transmission lines or related infrastructure. These features require text extraction only.", + "properties": { + "district use restriction": { + "description": "Extract prohibitions, bans, moratoria, or explicit siting restrictions on electric transmission lines and related infrastructure within a specific zoning district. Set `subarea` to the district being restricted (for example 'residential', 'commercial', 'agricultural'). Use subarea='other' when the ordinance names a district that does not match the enumerated categories. Do not emit subarea='all' for this feature; if the restriction is jurisdiction-wide, it is not a district use restriction and should be captured under a different feature. Emit one row per explicitly restricted district. Include the verbatim ordinance language in summary and cite the restricting clause." + } + } + }, + "excluded_lands": { + "description": "Lands excluded from transmission line siting. Do not extract as prohibitions or setbacks. Only extract when the ordinance explicitly states that transmission lines and related infrastructure are prohibited from being sited, built, or installed in these areas.", + "properties": { + "historic site": { + "description": "Extract exclusions for historic sites, landmarks, or districts." + }, + "critical species habitat": { + "description": "Extract exclusions for critical species habitat, protected wildlife areas, or similar conservation lands." + }, + "wetland": { + "description": "Extract exclusions for wetlands, marshes, swamps, or similar aquatic habitats." + }, + "floodplain": { + "description": "Extract exclusions for floodplains, flood zones, or similar areas prone to flooding." + }, + "residence": { + "description": "Extract exclusions for residences, homes, occupied dwellings, or similar occupied buildings." + }, + "hospital": { + "description": "Extract exclusions for hospitals, medical centers, healthcare facilities, or similar critical community facilities." + }, + "school": { + "description": "Extract exclusions for schools, educational institutions, daycare centers, institutions of higher education, or similar educational facilities." + }, + "daycare": { + "description": "Extract exclusions for daycare centers, childcare facilities, or similar child-focused facilities." + }, + "higher education": { + "description": "Extract exclusions for institutions of higher education, colleges, universities, or similar post-secondary educational facilities." + } + } + }, + "administrative_features": { + "description": "Administrative or legal grants recorded in the ordinance code that do not impose a physical or numeric requirement on transmission infrastructure. Extract only when the ordinance text explicitly names the grant and its holder(s).", + "properties": { + "franchise": { + "description": "Electric utility franchise granted by this jurisdiction to a named company or companies. Extract when the ordinance explicitly grants (or renews, extends, or amends) an electric franchise, right, or privilege to operate electric infrastructure, or when a codified list of franchises names one or more electric utilities as grantees under an electric-franchise heading, even if the full granting-clause text is omitted; treat such an electric-franchise listing as substantive content to collect and extract, not a citation-only index. In summary, name every electric grantee using its verbatim legal name and quote the granting clause or list entry. Do not extract water, gas, cable, telecom, or other non-electric franchises, even when listed alongside the electric ones. Do not infer a franchise from operational references to a utility elsewhere in the code. Emit at most one row per jurisdiction, listing all electric grantees in the same summary." + } + } + } + }, + "$examples": [ + { + "feature": "noise", + "value": 50, + "units": "dBA", + "section": "SECTION 1308 – Performance / Construction Standards", + "summary": "The transmission line and or facility shall not generate noise in excess of Fifty (50) decibel levels at ground level to the property lines or at the nearest residence. Such measurements shall be signed by a qualified engineer, stating that noise levels are being met, per ordinance.", + "explanation": "Ordinance sets a single numeric noise limit that applies to the transmission line jurisdiction-wide, so a single noise row is emitted.", + "aggregated": false + }, + { + "feature": "district use restriction", + "value": null, + "units": null, + "section": "Sec. 12.04.A – Prohibited Uses in Residential Districts", + "summary": "Overhead electric transmission lines rated above 69 kV are prohibited in all residential districts (R-1, R-2, R-3).", + "explanation": "Ordinance explicitly bans transmission lines from residential districts.", + "aggregated": false + }, + { + "feature": "structures distance", + "value": 75, + "units": "feet", + "section": "5.2.6.2 Building Setback Lines", + "summary": "In the case of electric transmission lines where easement widths are not definitely established, there shall be a minimum building setback line from the center of the transmission line as follows: Voltage of Line / Minimum Building Setback — 46 KV: 37½ ft; 69 KV: 50 ft; 161 KV & over: 75 ft.", + "explanation": "Generic 'building setback line' measured from the transmission-line centerline, not qualified as residential, so classified as 'structures distance' rather than 'residential buildings distance'. Ordinance lists three voltage tiers (37½, 50, 75 feet); per numeric_prioritization for setbacks, the largest tier (75 feet) is selected as the row value while the full table is quoted verbatim in summary.", + "aggregated": true + }, + { + "feature": "franchise", + "value": ["Dixie Electric Membership Corporation", "Louisiana Power and Light Company"], + "units": null, + "section": "Ch. 8 Franchises — List of Franchises", + "summary": "Under the 'Electric Franchises' heading of the codified list of franchises: Dixie Electric Membership Corporation (99 years), Ordinance of May 10, 1939; Louisiana Power and Light Company (no time limit), Ordinance of February 10, 1937. The code omits the full text of these franchise ordinances and preserves only this listing of grantees, durations, and originating ordinances.", + "explanation": "The codification records the electric franchises only as a list naming the grantees, their durations, and the originating ordinances; this electric-franchise listing is substantive franchise data even though the full granting clause was omitted. Only entries under the 'Electric Franchises' heading are extracted; cable, gas, and pipeline entries in the same list are excluded.", + "aggregated": false + } + ], + "$instructions": { + "general": [ + "Use direct text excerpts and quotes in summary whenever possible.", + ], + "setbacks": [ + "Setbacks should be extracted as minimum separation distances.", + "Prefer numeric values with units ('feet', 'meters').", + "Setback rows must contain numeric value and non-null units; never emit qualitative-only setback rows.", + "Treat property-line, lot-line, and parcel-boundary setbacks as 'property lines' when the ordinance measures the setback from that boundary.", + ], + "subarea": [ + "Set subarea='all' when the ordinance states a single requirement that applies jurisdiction-wide with no zone-specific variation.", + "Set subarea to a named zoning category only when the ordinance text explicitly binds the requirement to that district (for example a table of limits per district, or a clause 'in residential districts, ...').", + "Set subarea='other' when the ordinance names a specific district that does not match any enumerated category (for example PUD, aviation overlay, conservation-2).", + "Do not invent subareas from section headings, chapter titles, or nearby context that does not explicitly bind the requirement to that district.", + "When the same feature has different requirements in different districts, emit one row per district; do not merge them into a single row.", + "For the 'district use restriction' feature, subarea must be a specific district (never 'all'); emit one row per explicitly restricted district.", + ], + }, + "$qualitative_features": [ + "bond", + "color", + "decommissioning", + "fencing", + "fire prevention", + "franchise", + "lighting", + "permit", + "signage", + "traffic disruption", + "vegetation", + "FAA" + ] +} diff --git a/compass/plugin/one_shot/components.py b/compass/plugin/one_shot/components.py index 23b7dbdb4..ce016611d 100644 --- a/compass/plugin/one_shot/components.py +++ b/compass/plugin/one_shot/components.py @@ -16,6 +16,7 @@ logger = logging.getLogger(__name__) + _DEFAULT_TEXT_SCOPE_SYSTEM_PROMPT = """\ You are a structured extraction scope validator. Given a text chunk, \ determine whether the chunk is within the given extraction scope. \ diff --git a/tests/python/unit/plugin/test_plugin_one_shot.py b/tests/python/unit/plugin/test_plugin_one_shot.py index 67610291c..bd5997d56 100644 --- a/tests/python/unit/plugin/test_plugin_one_shot.py +++ b/tests/python/unit/plugin/test_plugin_one_shot.py @@ -5,7 +5,9 @@ import pytest from compass.exceptions import COMPASSPluginConfigurationError -from compass.plugin.one_shot.base import _normalize_heuristic_keywords +from compass.plugin.one_shot.base import ( + _normalize_heuristic_keywords, +) from compass.plugin.one_shot.components import SchemaBasedTextCollector from compass.validation.content import ParseChunksWithMemory from compass.warn import COMPASSPluginConfigurationWarning