Skip to content

feat: zone provenance + NOTAM validity fields end-to-end (M1) - #9

Open
tomassasovsky wants to merge 1 commit into
docs/zone-completeness-accuracyfrom
feat/zone-provenance-validity-fields
Open

feat: zone provenance + NOTAM validity fields end-to-end (M1)#9
tomassasovsky wants to merge 1 commit into
docs/zone-completeness-accuracyfrom
feat/zone-provenance-validity-fields

Conversation

@tomassasovsky

Copy link
Copy Markdown
Owner

Summary

  • Threads typed provenance (source + nullable confirmedBy) and NOTAM validity (nullable UTC activeFrom/activeTo) through the zone pipeline end-to-end — the foundation milestone (M1) every later milestone of the authoritative-zone-coverage plan reasons about.
  • The data DTO stays primitive: ZoneData.source is a plain string id (like categoryId), resolved to a typed ZoneSource enum in the repository (_toFlyZone). ZoneDeduplicator priority and MapZoneDisplay's OpenAIP/MADHEL checks migrate off id-prefix heuristics onto the typed source.
  • Every live source mapper now declares its provenance (madhel→madhel, openaip→openaip, AIP→aip); feed readers parse the new properties with an id-prefix fallback for older feeds. The backend ingest now parses the AIP file via the shared AipGeoJsonReader, removing a duplicate parser and fixing a pre-existing UTF-8 name mojibake bug.

Plan

feat: complete, authoritative airspace zone coverageMilestone M1 (provenance + validity fields, the foundation PR).

Test plan

  • zones_api_client: dart test — 37 passing (model defaults/equality, fromIdPrefix, parseUtcDateTime, AIP reader incl. source + mojibake repair, remote reader source/validity round-trip + prefix fallback, madhel source).
  • flight_rules_repository: dart test — 49 passing (ZoneSource.fromId, _toFlyZone provenance mapping, dedup priority incl. AIP + active-NOTAM-wins regression).
  • backend_zones_api_client: flutter test — 5 passing (feed round-trip of source/confirmedBy/validity + prefix fallback).
  • Root app: flutter test test/map_zone_display_test.dart test/map_zone_overlay_builder_test.dart test/zone_detail_card_test.dart — all passing.
  • dart analyze clean on all changed files; dart format clean.
  • Reviewer: confirm provenance round-trips through a real backend ingest run (write side _toFeature has no isolated test — private + needs DB; covered indirectly by the reader round-trip tests).

Deferred / follow-ups (out of M1 scope)

  • openAipOnly = true debug flag in map_zone_display.dart (ships the map showing only OpenAIP zones) — the plan assigns its deletion to M4. Unchanged by M1.
  • _parsePolygon/_parseCenter duplication across the 4 GeoJSON readers — pre-existing; candidate for a shared geometry helper in a later cleanup.
  • Presentation→data-layer imports (zone_sync, zone_stale_banner) — pre-existing architectural debt.
  • confirmedBy/activeFrom/activeTo are wired but not yet produced (populated by M2/M5).

🤖 Generated with Claude Code

Implements milestone M1 of the authoritative zone coverage plan: the
foundation every later milestone reasons about.

- ZoneData (data DTO) gains a primitive `source` id (default bundled),
  nullable `confirmedBy`, and nullable UTC `activeFrom`/`activeTo`.
- New `ZoneSourceIds` constants + `fromIdPrefix` fallback and a
  `parseUtcDateTime` helper in zones_api_client.
- Source set explicitly by every producer (madhel/openaip/aip readers);
  remote + backend feed readers parse source/confirmedBy/validity, with
  an id-prefix fallback for feeds that predate the property.
- Backend ingest writes the new properties; the AIP file is now parsed
  via the shared AipGeoJsonReader (removes a duplicate parser and fixes
  UTF-8 name mojibake).
- New typed `ZoneSource` enum + `fromId` in the repository; FlyZone
  carries source/confirmedBy/activeFrom/activeTo, mapped in _toFlyZone.
- ZoneDeduplicator priority and MapZoneDisplay openaip/madhel checks
  migrate from id-prefix heuristics to the typed source (active NOTAM
  outranks permanent sources for safety).
- Tests: model defaults/equality/round-trip, source resolution, dedup
  priority (incl. AIP + NOTAM), reader parsing, mojibake repair.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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