chore(canary-phase13): GeoIP integration complete

Phase 13 deliverables (audited PASS):
- internal/geoip: nil-safe Service over oschwald/geoip2-golang v2
  with NopService factory; Open/Close/Lookup contract; cityReader
  interface for fixture-free unit testing; extractLookup +
  firstSubdivisionName helpers fully covered.
- internal/event: AttachGeoIP(geoip.Lookup) on *Event with empty-
  collapses-to-nil overwrite semantics; Service.enrichGeo runs
  before repo.Insert so geo_* columns persist in the same row;
  ServiceConfig.GeoIP plumbed through; 5 new service tests +
  7 entity tests + 2 real-Postgres integration tests.
- config: GeoIPConfig{Path}, GEOLITE_PATH env binding matching
  compose.yml, default /data/GeoLite2-City.mmdb.
- cmd/canary/main: openGeoIP wires the mmdb with NopService
  fallback on any open failure; close-on-shutdown deferred.

Audited: superpowers:code-reviewer + general-purpose spec
adherence — PASS on first dispatch. One non-blocking nit (direct
unit coverage for firstSubdivisionName) fixed in 32e9c0a3 per
fix-in-phase discipline.

13 of 18 phases closed.
This commit is contained in:
CarterPerez-dev 2026-05-17 05:30:47 -04:00
parent 32e9c0a30e
commit 4d0d151569

Diff Content Not Available