v0.10.2: monitoring-area bbox enforced at supervisor publish (was archive-only) (#PR_NUMBER_PLACEHOLDER)

Closes #86

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
malice 2026-06-05 20:34:10 -06:00 committed by GitHub
commit 1bebf2570b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 590 additions and 145 deletions

View file

@ -14,7 +14,7 @@ from central.adapters.firms import (
SATELLITE_SHORT,
_pixel_polygon,
)
from central.archive import _build_geom_sql
from central.monitoring_area import build_geom_json
from central.config_models import AdapterConfig
from central.models import Event, Geo
@ -553,7 +553,7 @@ class TestPixelPolygon:
class TestGeoGeometryRoundTripsThroughArchive:
"""Regression guard: FIRMS geo.geometry must reach _build_geom_sql as Polygon."""
"""Regression guard: FIRMS geo.geometry must reach build_geom_json as Polygon."""
@pytest.mark.asyncio
async def test_geo_geometry_round_trips_through_archive_path(
@ -572,7 +572,7 @@ class TestGeoGeometryRoundTripsThroughArchive:
# Simulate what archive does: serialize geo to dict and run it through
# the same helper that produces the PostGIS geom clause.
geo_dict = event.geo.model_dump()
sql_clause = _build_geom_sql(geo_dict)
sql_clause = build_geom_json(geo_dict)
assert sql_clause is not None
decoded = json.loads(sql_clause)
assert decoded["type"] == "Polygon"
@ -600,6 +600,6 @@ class TestGeoGeometryRoundTripsThroughArchive:
assert event.geo.geometry is None
geo_dict = event.geo.model_dump()
sql_clause = _build_geom_sql(geo_dict)
sql_clause = build_geom_json(geo_dict)
assert sql_clause is not None
assert json.loads(sql_clause)["type"] == "Point"