Skip to content

feat(research): import reviewed administrative boundaries - #186

Merged
p3t3r67x0 merged 1 commit into
mainfrom
feat/research-administrative-area-import
Oct 4, 2026
Merged

p3t3r67x0 merged 1 commit into
mainfrom
feat/research-administrative-area-import

Conversation

@p3t3r67x0

Copy link
Copy Markdown
Collaborator

Research's persistent area store could not resolve reviewed districts/states imported by an operator: existing importers are municipality-only, and the database constraint did not allow state.

Add python -m app.research.administrative_areas plan|apply manifest.json. The separate workflow reuses the existing Manifest, Geocoder boundary resolver and operator privilege checks. It validates the whole batch before an atomic upsert, rejects municipality roles and conflicting stored identities, and rejects positive-area overlaps only within the same level. Plan runs read-only. Existing municipality importers and Research resolution/execution remain unchanged.

The current Geocoder does not expose the storage-required region code and raw OSM admin level; these are explicit reviewed manifest fields, never classification heuristics. Examples contain verified Schleswig-Holstein and eleven rural-district relation identities. Municipality keys/population remain null. Completeness metadata is not promoted into a persistent inventory guarantee.

Migration 0019 adds state to the existing check constraint. No backfill, source changes or new grants. Downgrade refuses existing state rows. Pydantic/Zod/OpenAPI area enums agree. Operator docs include exact protected-environment plan/apply commands; no deployment/runtime auto-import.

Validation:

  • Backend Ruff and format checks pass.
  • Mypy: 275 source files, no issues.
  • Frontend typecheck and changed-file ESLint pass.
  • Changed frontend/docs/manifests Prettier check passes.
  • OpenAPI regenerated from FastAPI using isolated test configuration.
  • git diff --check passes.
  • Importer and PostGIS regression tests added, explicitly NOT RUN at user request.
  • No Docker, deployment, database migration/import or merge performed. GitHub CI not waited on.

Base: 5f5beb3.

@p3t3r67x0
p3t3r67x0 merged commit cf9985a into main Oct 4, 2026
20 checks passed
@p3t3r67x0
p3t3r67x0 deleted the feat/research-administrative-area-import branch October 4, 2026 06:17
@p3t3r67x0 p3t3r67x0 self-assigned this Oct 4, 2026
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