news: per-article proximate geolocation + GET /api/news/blips #64
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_bc15eb53"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Per-article proximate geolocation for EVERY graded news article + new read-only
GET /api/news/blips(backend lane of card t_bc15eb53; frontend=T2, live deploy=T3).parse_map_scoresnow extractsLocation/Lat/Lon/Confidenceper block (clamp_coords-validated;Unknown-> no geo; coords without a place name are dropped — never invent a place).news/summerizer/data/: cities15000 + admin1 + country->capital, CC-BY 4.0, ~1.9MB). No paid API, no Nominatim. Gazetteer hits are labelledapprox.article_scoresgains nullablelocation_name/lat/lon/location_confidence(alembic 014_article_scores_geo, down_revision=013, single head) + partial bbox index(lon,lat) WHERE lat/lon NOT NULL.ensure_tablesmirrors the DDL idempotently (both start orders proven).GET /api/news/blipsper the FROZEN contract: exact keys, dedup by article id (latest geo wins), finite lat/lon only (NaN explicitly excluded — PG sorts NaN above finite),created_at DESC,bbox(422 on malformed, same semantics as /api/news/map),since(default now-24h),limit(default 1000, max 5000). Public read allowlist like its news siblings.Confidence:line (additive; grading rubric/thresholds untouched).Unchanged (verified by diff + tests)
/api/news/map,select_map,MAP_CAP, critical/high pins, ticker,SUMMARY_MIN_SCORE/TOP_N,dedupe_blocks,app/static/index.html,deploy/.Evidence
test_geofence.py::test_camera_publish_and_insert_do_not_notify— stale monkeypatch ofrun_camera_service.nats, present on master before this PR).alembic upgrade headsclean on TWO fresh DBs (from zero, and summarizer-before-alembic / alembic-before-summarizer orders).NEWS_SUMMARIZE_FORCE=1, production model meituan/longcat-2.5:free) against a TEST DB seeded with 20 live articles: 10 blips, ALL non-critical (scores 15-50), exact contract keys; gazetteerapproxpath + latest-geo-wins regrade demonstrated end-to-end.Notes
app_settings.SUMMARY_MODELis a stale placeholder "x"; the live deployment's configmap env (meituan/longcat-2.5:free) wins — test batch mirrored production. Not a repo issue; no premise corrections needed.prefix_with(works on 2.0 and 2.1;.distinct(col)is deprecated in 2.1,.ext(distinct_on)is 2.1-only).