Skip to content

Map flash cues for location-tagged RSS items#25

Merged
koala73 merged 2 commits into
mainfrom
codex/add-visual-cue-for-location-based-rss-feeds
Jan 23, 2026
Merged

Map flash cues for location-tagged RSS items#25
koala73 merged 2 commits into
mainfrom
codex/add-visual-cue-for-location-based-rss-feeds

Conversation

@koala73

@koala73 koala73 commented Jan 23, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide an immediate visual cue on the global map when an incoming RSS item appears to reference a known location so users can quickly spot activity on the map.

Description

  • Added MapComponent.flashLocation(lat, lon, durationMs) to src/components/Map.ts to render a temporary animated overlay at projected coordinates and removed after the duration.
  • Added CSS animation rules for .map-flash to src/styles/main.css to create a pulsing ring effect and make duration configurable via --flash-duration.
  • Implemented lightweight keyword-based location detection in src/App.ts with findFlashLocation to score hotspot/conflict keywords and flashMapForNews to trigger flashes for batches of RSS/Intel items, including per-item cooldown using mapFlashCache and MAP_FLASH_COOLDOWN_MS to avoid repeated flashing.
  • Wired the detection to RSS processing by calling flashMapForNews from the fetchCategoryFeeds batch callback and after the intel fetch so flashes occur as items are ingested.

Testing

  • Started the dev server with npm run dev which reported Vite ready and served the app successfully (UI loaded despite some proxy network errors reported by the environment). - Playwright script visited http://127.0.0.1:4173/, injected a .map-flash overlay and captured a screenshot saved to browser:/tmp/codex_browser_invocations/.../artifacts/map-flash.png, demonstrating the visual cue rendering.
  • No unit/integration test suite was run.

Codex Task

@vercel

vercel Bot commented Jan 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
worldmonitor Ready Ready Preview, Comment Jan 23, 2026 8:42am
worldmonitor-startup Ready Ready Preview, Comment Jan 23, 2026 8:42am

Request Review

@koala73
koala73 merged commit f4943eb into main Jan 23, 2026
1 of 3 checks passed
@koala73
koala73 deleted the codex/add-visual-cue-for-location-based-rss-feeds branch January 23, 2026 08:42
@SebastienMelki SebastienMelki added area: map Map, globe, DeckGL visualization area: feeds RSS feeds, news aggregation labels Feb 17, 2026
facusturla pushed a commit to facusturla/worldmonitor that referenced this pull request Feb 27, 2026
* Add map flash cue for location news

* Fix TypeScript closure type narrowing issue in findFlashLocation
koala73 added a commit that referenced this pull request Mar 25, 2026
Security (P1 #18):
- sanitizeForPrompt() applied to all entity/seed fields interpolated into
  Round 1 prompt (entityId, class, stance, seedId, type, timing)
- sanitizeForPrompt() applied to actorId and entityIds in Round 2 prompt
- sanitizeForPrompt() + length caps applied to all LLM array fields written
  to R2 (dominantReactions, stabilizers, invalidators, keyActors, timingMarkers)

Validation (P1 #19):
- Added validateRunId() regex guard
- Applied in enqueueSimulationTask() and processNextSimulationTask() loop

Type safety (P1 #20):
- Added isOutcomePointer() and isPackagePointer() type guards in TS handlers
- Replaced unsafe as-casts with runtime-validated guards in both handlers

Correctness (P2 #22):
- Log warning when pkgPointer.runId does not match task runId

Architecture (P2 #24):
- isMaritimeChokeEnergyCandidate() accepts both flat and nested topBucketId
- Call site simplified to pass theater directly

Performance (P2 #25):
- SIMULATION_ROUND1_MAX_TOKENS raised 1800 to 2200
- Added max 3 initialReactions instruction to Round 1 prompt

Maintainability (P2 #26):
- Simulation pointer keys exported from server/_shared/cache-keys.ts
- Both TS handlers import from shared location

Documentation (P2 #27):
- Strengthened runId no-op description in proto and OpenAPI spec
koala73 added a commit that referenced this pull request Mar 25, 2026
Security (P1 #18):
- sanitizeForPrompt() applied to all entity/seed fields interpolated into
  Round 1 prompt (entityId, class, stance, seedId, type, timing)
- sanitizeForPrompt() applied to actorId and entityIds in Round 2 prompt
- sanitizeForPrompt() + length caps applied to all LLM array fields written
  to R2 (dominantReactions, stabilizers, invalidators, keyActors, timingMarkers)

Validation (P1 #19):
- Added validateRunId() regex guard
- Applied in enqueueSimulationTask() and processNextSimulationTask() loop

Type safety (P1 #20):
- Added isOutcomePointer() and isPackagePointer() type guards in TS handlers
- Replaced unsafe as-casts with runtime-validated guards in both handlers

Correctness (P2 #22):
- Log warning when pkgPointer.runId does not match task runId

Architecture (P2 #24):
- isMaritimeChokeEnergyCandidate() accepts both flat and nested topBucketId
- Call site simplified to pass theater directly

Performance (P2 #25):
- SIMULATION_ROUND1_MAX_TOKENS raised 1800 to 2200
- Added max 3 initialReactions instruction to Round 1 prompt

Maintainability (P2 #26):
- Simulation pointer keys exported from server/_shared/cache-keys.ts
- Both TS handlers import from shared location

Documentation (P2 #27):
- Strengthened runId no-op description in proto and OpenAPI spec
koala73 added a commit that referenced this pull request Mar 25, 2026
#2220)

* feat(simulation): MiroFish Phase 2 — theater-limited simulation runner

Adds the simulation execution layer that consumes simulation-package.json
and produces simulation-outcome.json for maritime chokepoint + energy/logistics
theaters, closing the WorldMonitor → MiroFish handoff loop.

Changes:
- scripts/seed-forecasts.mjs: 2-round LLM simulation runner (prompt builders,
  JSON extractor, runTheaterSimulation, writeSimulationOutcome, task queue
  with NX dedup lock, runSimulationWorker poll loop)
- scripts/process-simulation-tasks.mjs: standalone worker entry point
- proto: GetSimulationOutcome RPC + make generate
- server/worldmonitor/forecast/v1/get-simulation-outcome.ts: RPC handler
- server/gateway.ts: slow tier for get-simulation-outcome
- api/health.js: simulationOutcomeLatest in STANDALONE + ON_DEMAND keys
- tests: 14 new tests for simulation runner functions

* fix(simulation): address P1/P2 code review findings from PR #2220

Security (P1 #18):
- sanitizeForPrompt() applied to all entity/seed fields interpolated into
  Round 1 prompt (entityId, class, stance, seedId, type, timing)
- sanitizeForPrompt() applied to actorId and entityIds in Round 2 prompt
- sanitizeForPrompt() + length caps applied to all LLM array fields written
  to R2 (dominantReactions, stabilizers, invalidators, keyActors, timingMarkers)

Validation (P1 #19):
- Added validateRunId() regex guard
- Applied in enqueueSimulationTask() and processNextSimulationTask() loop

Type safety (P1 #20):
- Added isOutcomePointer() and isPackagePointer() type guards in TS handlers
- Replaced unsafe as-casts with runtime-validated guards in both handlers

Correctness (P2 #22):
- Log warning when pkgPointer.runId does not match task runId

Architecture (P2 #24):
- isMaritimeChokeEnergyCandidate() accepts both flat and nested topBucketId
- Call site simplified to pass theater directly

Performance (P2 #25):
- SIMULATION_ROUND1_MAX_TOKENS raised 1800 to 2200
- Added max 3 initialReactions instruction to Round 1 prompt

Maintainability (P2 #26):
- Simulation pointer keys exported from server/_shared/cache-keys.ts
- Both TS handlers import from shared location

Documentation (P2 #27):
- Strengthened runId no-op description in proto and OpenAPI spec

* fix(todos): add blank lines around lists in markdown todo files

* style(api): reformat openapi yaml to match linter output

* test(simulation): add flat-shape filter test + getSimulationOutcome handler coverage

Two tests identified as missing during PR #2220 review:

1. isMaritimeChokeEnergyCandidate flat-shape tests — covers the || candidate.topBucketId
   normalization added in the P1/P2 review pass. The existing tests only used the nested
   marketContext.topBucketId shape; this adds the flat root-field shape that arrives from
   the simulation-package.json JSON (selectedTheaters entries have topBucketId at root).

2. getSimulationOutcome handler structural tests — verifies the isOutcomePointer guard,
   found:false NOT_FOUND return, found:true success path, note population on runId mismatch,
   and redis_unavailable error string. Follows the readSrc static-analysis pattern used
   elsewhere in server-handlers.test.mjs (handler imports Redis so full integration test
   would require a test Redis instance).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: feeds RSS feeds, news aggregation area: map Map, globe, DeckGL visualization codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants