Skip to content

Add data center one-shot extraction plugin - #536

Draft
rajeee wants to merge 2 commits into
mainfrom
add-data-center-extraction-plugin
Draft

Add data center one-shot extraction plugin#536
rajeee wants to merge 2 commits into
mainfrom
add-data-center-extraction-plugin

Conversation

@rajeee

@rajeee rajeee commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Adds the data_centers one-shot plugin (schema + config) and registers the extractor, following the same shape as #522.

The feature set is derived from the COMPASS DC Ordinance Research workbook (2026-08-16), which hand-codes 147 feature rows across 22 jurisdictions in 10 states. All 34 controlled terms from its "Feature List (DC)" tab are carried over as the schema's feature enum, so extracted rows can be compared directly against the hand-coded reference set.

Notes on the schema

  • data_center_type output column. Data center ordinances routinely tier standards by facility size class — Birmingham sets separate residential setbacks for Hyperscale, Medium, and Micro. The schema adds a data_center_type field so tiered rules emit one row per class, recorded in the jurisdiction's own vocabulary rather than a normalized taxonomy, matching how the workbook codes its Data Center Type column.
  • Feature boundaries in $definitions. The workbook's feature descriptions carry explicit disambiguation ("Distinct from X, which…") for pairs a model will otherwise conflate: minimum lot size vs. maximum lot coverage vs. minimum vegetative cover; setback-residential vs. setback-property-line; buffer vs. equipment screening vs. fencing; and the three water features. These are encoded as IGNORE clauses.
  • Compound values. The workbook's Units column carries the measurement basis, not just the unit — dBA day / night at receiving residential property for a value of 55 / 45. The schema requires positional correspondence between compound values and compound units, and instructs the model to keep such provisions in one row.
  • $qualitative_features is limited to prohibitions/moratorium, on-site power technology, and decommissioning. District features are deliberately excluded, following the wind schema, since their value carries the district list.

Verification

  • Plugin registers and passes validate_plugin_configuration() at import; resolve_plugin("data_centers") resolves and yields 14 output columns.
  • Heuristic passes on data center ordinance text and rejects a look-alike decoy — "community center", "recreation center", "data collection", and "database" are in NOT_TECH_WORDS, which KeywordBasedHeuristic strips before counting matches.
  • pytest tests/python/unit: 575 passed, 63 skipped.

Add a schema-driven one-shot plugin covering local data center siting
ordinances, including the extraction schema and plugin config, and
register the extractor so the `data_centers` technology is available in
the plugin registry.

The 34-feature controlled vocabulary, the feature boundary rules, and
the units convention are derived from the COMPASS data center ordinance
research workbook, which hand-codes 147 feature rows across 22
jurisdictions in 10 states.
Copilot AI lite review requested due to automatic review settings August 25, 2026 19:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new schema-driven one-shot extraction plugin for data center ordinances under compass.extraction, wiring it into the existing plugin registration/import flow so it can be resolved and executed like the other one-shot technologies.

Changes:

  • Added a new data_centers one-shot plugin configuration (YAML) and extraction schema (JSON).
  • Registered the new extractor in compass.extraction and re-exported it from the top-level compass package.
  • Added a new compass.extraction.data_centers package initializer that constructs the schema-based plugin via create_schema_based_one_shot_extraction_plugin.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
compass/extraction/data_centers/plugin_config.yaml Defines retrieval/heuristic and extraction-system prompt for the data centers one-shot plugin
compass/extraction/data_centers/data_centers_schema.json Introduces the data centers extraction schema and feature definitions/instructions
compass/extraction/data_centers/init.py Registers the COMPASSDataCentersExtractor via the schema-based plugin factory
compass/extraction/init.py Imports the data centers extractor to ensure plugin registration
compass/init.py Re-exports the data centers extractor from the top-level package

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +246 to +250
"size_tiering": [
"Data center ordinances frequently set different standards for different size classes of facility. When they do, emit one row per class and record the jurisdiction's own class name in data_center_type.",
"Where one standard applies to data centers generally, emit a single row and set data_center_type to the term the ordinance uses for the use, or null when it uses none.",
"Do not merge tiered standards into a single row, and do not map a local class name onto another jurisdiction's taxonomy."
],
@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.98%. Comparing base (b0afba3) to head (9cfad7c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #536   +/-   ##
=======================================
  Coverage   63.98%   63.98%           
=======================================
  Files          78       78           
  Lines        7446     7446           
  Branches      755      755           
=======================================
  Hits         4764     4764           
  Misses       2523     2523           
  Partials      159      159           
Flag Coverage Δ
unittests 63.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

The field description told the model to emit null where an ordinance
sets one standard for data centers generally, while the size_tiering
instructions told it to record the ordinance's own generic term for the
use. Align both on the latter, which matches the reference workbook:
none of its 147 feature rows leave the field blank, and the 17 untiered
jurisdictions record their own generic term ("Data Center", "Large Data
Center"). Null is now reserved for a provision that attaches no term to
the use at all.
@rajeee
rajeee marked this pull request as draft August 25, 2026 21:49
- database

collection_prompts: true
text_extraction_prompts: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you find that including this improved extraction? If not, I would recommend leaving this out so that the extractor has access to unfiltered text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants