Skip to content

feat: per-story HQ-to-exchange geocoding for globe arcs (Phase 1 of #48, sensor-implemented) - #52

Merged
essentialbit merged 2 commits into
mainfrom
agent/claude-48-sensor-20260702
Jul 2, 2026
Merged

feat: per-story HQ-to-exchange geocoding for globe arcs (Phase 1 of #48, sensor-implemented)#52
essentialbit merged 2 commits into
mainfrom
agent/claude-48-sensor-20260702

Conversation

@essentialbit

Copy link
Copy Markdown
Owner

Phase 1 of #48 (consensus 0.63, risk:medium). Sensor-implemented this cycle.

Prerequisite for the globe uplift (joint proposal with Gemini, porting the Google Studio concept's interaction design onto our existing globe.gl globe): /api/news/globe-data only aggregated by RSS source region, no per-story ticker HQ/exchange data, so there was no way to draw the concept's per-story sentiment-colored arcs.

What this adds

New ticker_geo.py — a small explicit HQ/exchange dictionary (~24 major US/ASX/crypto tickers) plus a stable hash-jittered anchor-city fallback for anything not listed, mirroring the concept's own resolveTickerMetadata fallback strategy. /api/news/globe-data now also returns story_arcs: for every news item with a ticker, its HQ and exchange coordinates plus title/sentiment. Additive — existing points aggregation unchanged.

Phase 2 (actually rendering per-story arcs + hotspot clustering on the globe) is a separate follow-up per #48's phased spec — this PR is backend-only.

Test plan

  • Real functional test against live data (not just an import check): registered a test user, hit the live running endpoint, got 148 real story_arcs
  • Confirmed the explicit dictionary resolves correctly (BHP.AX, NVDA)
  • Confirmed the hash fallback correctly handles tickers outside the dictionary (NAB.AX)
  • Confirmed existing points aggregation still works unchanged

Saifodius and others added 2 commits July 2, 2026 13:08
Prerequisite for the globe uplift (#48, joint proposal with Gemini
porting the Google Studio concept's interaction design onto our
existing globe.gl globe): /api/news/globe-data only aggregated news by
RSS SOURCE region (e.g. "Bloomberg" -> a fixed coordinate), with no
per-story ticker HQ/exchange data — so there was no way to draw the
concept's per-story sentiment-colored arcs.

New ticker_geo.py: a small explicit dictionary (~24 major US/ASX/crypto
tickers, mirroring the concept's resolveTickerMetadata) plus a stable
hash-jittered anchor-city fallback for anything not explicitly listed
(same fallback strategy as the concept, reimplemented in Python).

/api/news/globe-data now also returns story_arcs: for every news item
with a ticker, its HQ and exchange coordinates plus title/sentiment —
additive, existing points aggregation unchanged.

Verified with a real functional test against live data (not just an
import check): registered a test user, hit the live endpoint, got 148
real story_arcs. Confirmed the explicit dictionary resolves correctly
(BHP.AX, NVDA) and the hash fallback correctly handles tickers outside
it (NAB.AX).

Phase 2 (per-story arc rendering + hotspot clustering on the actual
globe) is a separate follow-up PR per #48's phased spec.
@essentialbit
essentialbit merged commit 96ca7d4 into main Jul 2, 2026
7 checks passed
@essentialbit
essentialbit deleted the agent/claude-48-sensor-20260702 branch July 2, 2026 17:40
essentialbit added a commit that referenced this pull request Jul 2, 2026
Replaces the dashboard globe's 4 hardcoded decorative "geopolitical
flight path" arcs (always the same 4 hubs -> NY, no real data behind
them at all) with real per-story HQ-to-exchange arcs from Phase 1's
story_arcs data (PR #52, already merged), colored by each story's
actual sentiment score instead of a fixed rainbow palette.

Capped to the 40 most recent stories to keep the globe high-signal per
the new MISSION.md guiding principle #7 (minimalist, high-signal UI) --
uncapped would mean 100+ overlapping arcs on a 24h+ window, which reads
as cluttered, not sophisticated.

Conservative interpretation note: #48's Phase 2 spec bundles both arcs
AND hotspot clustering. Splitting these — this PR is arcs only (the
higher-value, more contained piece); hotspot clustering is a natural
Phase 2b follow-up rather than risking a larger, harder-to-review PR.

Verified with a real functional test: launched the live app, confirmed
/api/news/globe-data still returns real story_arcs (165 for a 24h
window), confirmed the dashboard page serves with the new code intact,
and checked the extracted inline JS with `node --check` (exit 0, no
syntax errors) since a headless browser wasn't available to click
through it directly.

Co-authored-by: Saifodius <penny-suing-henna@duck.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