Skip to content

Remove obsolete enrichment snapshot contract#221

Merged
texture-fleet-agent[bot] merged 1 commit intomainfrom
meridian/remove-enrichment-snapshot-contract
May 8, 2026
Merged

Remove obsolete enrichment snapshot contract#221
texture-fleet-agent[bot] merged 1 commit intomainfrom
meridian/remove-enrichment-snapshot-contract

Conversation

@texture-fleet-agent
Copy link
Copy Markdown
Contributor

Summary

Removes the short-lived utility-enrichment snapshot contract that landed before the architecture pivot to direct REST API consumption.

Consumers should call CommonGrid's public APIs directly with caching. CommonGrid should not mirror its utility facts through a database view for downstream private systems.

What this does

Adds migration 0011_drop_enrichment_snapshot_contract.sql, which idempotently removes:

  • commongrid.v_crm_org_enrichment
  • commongrid.v_utility_enrichment
  • commongrid.v_utilities_enriched
  • commongrid.enrichment_schema

It intentionally keeps:

  • commongrid schema — generic namespace for server-to-server contract objects
  • internal_api_consumer role — scoped role for those contract objects
  • utility resolver/cache objects — generic matching primitives that remain useful

Also scrubs obsolete private-spec references from public SQL/test comments.

Verification

Applied the migration to Neon successfully:

\dt commongrid.*  -- none
\dv commongrid.*  -- none
\df commongrid.*  -- none

Local gates:

  • npm run build
  • npm run openapi:check

Follow-up

Next PRs add public REST/API capabilities instead of database snapshots:

  • /api/v1/utilities/by-eia-id/{eia_id}
  • numeric filters on /api/v1/utilities
  • cache headers for utility endpoints

Drops the short-lived commongrid enrichment snapshot objects that were
introduced before the architecture pivot to direct REST consumption.
Consumers should call CommonGrid's public APIs directly with caching;
CommonGrid should not mirror its utility facts through a database view for
private downstream systems.

This migration idempotently removes:
- commongrid.v_crm_org_enrichment
- commongrid.v_utility_enrichment
- commongrid.v_utilities_enriched
- commongrid.enrichment_schema

It intentionally keeps the commongrid schema and internal_api_consumer
role, which remain useful as the generic server-to-server contract
namespace for utility-name resolution and lifecycle signals.

Also scrubs obsolete private-spec references from public SQL/test comments.

Validation:
- Applied migration against Neon successfully; commongrid has no tables,
  views, or functions after cleanup
- npm run build passes
- npm run openapi:check passes
@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commongrid Ready Ready Preview, Comment May 8, 2026 3:04pm

Request Review

Copy link
Copy Markdown

@victor-agent-talos victor-agent-talos Bot left a comment

Choose a reason for hiding this comment

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

LGTM — corrective cleanup is the right shape.

  • 0008/0009 comment scrubs remove the private-spec URL references while keeping the generic fn_resolve_utility_by_name / utility_resolver_cache / utility_name_manual_overrides functionality — good public/private separation.
  • 0010 rename v_crm_org_enrichmentv_utility_enrichment in case any intermediate env still has the old name.
  • 0011 drops the whole snapshot contract idempotently (IF EXISTS on DROP, REVOKE ALL first). Leaves commongrid schema + internal_api_consumer role intact for M3/M4 resolver work. Matches Victor's no-replication ruling.

Approving.

@texture-fleet-agent texture-fleet-agent Bot merged commit c5e32e3 into main May 8, 2026
8 checks passed
@texture-fleet-agent texture-fleet-agent Bot deleted the meridian/remove-enrichment-snapshot-contract branch May 8, 2026 15:10
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.

1 participant