Skip to content

Rework natural gas pipelines schema - #546

Merged
ppinchuk merged 12 commits into
mainfrom
natural_gas_update
Oct 27, 2026
Merged

ppinchuk merged 12 commits into
mainfrom
natural_gas_update

Conversation

@bpulluta

@bpulluta bpulluta commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reworks the natural gas pipelines one-shot extraction plugin so its schema captures decomposed, multi-axis requirement rows instead of the previous flat 5-field outputs.

This is an initial cut to continue developing and track changes.

Schema (natural_gas_pipelines_schema.json)

  • Each outputs row is now decomposed on four axes:
    • WHAT — feature, specific_subject, applies_to, requirement_description
    • HOW MUCH — value, value_category, value_interpretation, units, range_low/range_high
    • HOW BINDING — obligation
    • WHEN/WHERE — condition
    • Evidence — source_verbatim, summary, section, notes, explanation
  • Feature enum expanded to 16: added roads / schools / hospitals / community-structures distances and permit_approval; folded day/night into a single noise feature + condition, and rear/side yard into property lines distance + specific_subject.
  • Added $qualitative_features (zoning districts, permit_approval) — previously missing, so every feature routed as quantitative.
  • Added $scope, $core_principles, grouped $definitions, $instructions, $examples, and $qa_checklist following the freshest sibling (oil_gas_wells) house style.

Config (plugin_config.yaml)

  • Lowercased heuristic_keywords keys (house style).
  • Added mixed oil-and-gas / gas-well chapter recall queries and keyword-score tuning for discovery.
  • Rewrote extraction_system_prompt to teach the decomposition model (axes, one-row-per-requirement, most-restrictive rule, siting-focus exclusions).

Validation

  • Live 1-jurisdiction run (Rehoboth, MA, gpt-5.4, full search→download→collect→extract→CSV): produces the 25-column decomposed output; correctly extracted noise 55 dBA (fully decomposed, with notes on the absence of separate day/night limits) and two permit_approval rows (special permit, site plan approval), routed to the quant/qual CSVs correctly. Compared to the old flat output it dropped both false positives (a site-plan filing radius mislabeled as a setback; an exhaust muffler mislabeled as an enclosure).

Copilot AI lite review requested due to automatic review settings August 28, 2026 21:58
@bpulluta
bpulluta marked this pull request as draft August 28, 2026 22:00
@codecov-commenter

codecov-commenter commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.65%. Comparing base (373283e) to head (bc1528e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #546   +/-   ##
=======================================
  Coverage   71.65%   71.65%           
=======================================
  Files          82       82           
  Lines        8507     8507           
  Branches      922      922           
=======================================
  Hits         6096     6096           
  Misses       2237     2237           
  Partials      174      174           
Flag Coverage Δ
unittests 71.65% <ø> (ø)

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.

@bpulluta bpulluta changed the title Rework natural gas pipelines schema into decomposed multi-axis extraction Rework natural gas pipelines schema Aug 28, 2026

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

This PR reworks the natural gas pipelines one-shot extraction plugin to use a decomposed, multi-axis “one row per requirement” schema, expanding the output model to capture richer requirement context while keeping compatibility with COMPASS’s schema-driven one-shot pipeline.

Changes:

  • Updated plugin_config.yaml discovery queries/keywords and rewrote the extraction system prompt to teach the decomposition model and stricter scope rules.
  • Replaced the prior flat outputs schema with a decomposed row schema (WHAT / HOW MUCH / HOW BINDING / WHEN-WHERE + evidence), expanding features and adding richer evidence fields.

Reviewed changes

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

File Description
compass/extraction/natural_gas_pipelines/plugin_config.yaml Broadens discovery inputs and updates the extraction system prompt to align LLM behavior with the decomposed row model and scope rules.
compass/extraction/natural_gas_pipelines/natural_gas_pipelines_schema.json Introduces the decomposed multi-axis output schema, expanded feature enum, and richer evidence/normalization guidance.

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

@ppinchuk ppinchuk left a comment

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.

Cool ideas here! Could you please update to the latest COMPASS version and make sure your schema aligns with the new "ordinance_text" field that Rajendra added recently?

@ppinchuk

Copy link
Copy Markdown
Collaborator

Is this ready for review?

@bpulluta
bpulluta marked this pull request as ready for review October 23, 2026 15:34
@bpulluta

Copy link
Copy Markdown
Collaborator Author

Is this ready for review?

@ppinchuk sorry for the delay, yes it is now ready for review

@bpulluta
bpulluta requested a review from ppinchuk October 23, 2026 17:13
ppinchuk
ppinchuk previously approved these changes Oct 23, 2026

@ppinchuk ppinchuk left a comment

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.

Couple of minor comments but I think we can move this forward if you are seeing good results on your end @bpulluta

Co-authored-by: bpulluta <115118857+bpulluta@users.noreply.github.com>
bpulluta and others added 3 commits October 26, 2026 18:19
Bumps the codeql group with 2 updates: [github/codeql-action/init](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.38.3 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@24c5418...6f2ac81)

Updates `github/codeql-action/analyze` from 4.38.3 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@24c5418...6f2ac81)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: codeql
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the other-actions group with 1 update: [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi).


Updates `prefix-dev/setup-pixi` from 0.11.0 to 0.11.2
- [Release notes](https://github.com/prefix-dev/setup-pixi/releases)
- [Commits](prefix-dev/setup-pixi@9dabb60...ad1da64)

---
updated-dependencies:
- dependency-name: prefix-dev/setup-pixi
  dependency-version: 0.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: other-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@bpulluta

Copy link
Copy Markdown
Collaborator Author

Couple of minor comments but I think we can move this forward if you are seeing good results on your end @bpulluta

@ppinchuk this is ready to merge. I can't merge myself since it requires 2 reviews

@ppinchuk
ppinchuk merged commit b4164e0 into main Oct 27, 2026
69 of 70 checks passed
@ppinchuk
ppinchuk deleted the natural_gas_update branch October 27, 2026 17:07

This branch was successfully deployed

2 active deployments
codecov — bc1528e7 Deployed Oct 26, 2026 by bpulluta via Codecov #573
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.

5 participants