Skip to content

Transform World Monitor to Tech/AI Dashboard#24

Closed
fai9al wants to merge 10 commits into
koala73:mainfrom
fai9al:claude/understand-codebase-L8wwx
Closed

Transform World Monitor to Tech/AI Dashboard#24
fai9al wants to merge 10 commits into
koala73:mainfrom
fai9al:claude/understand-codebase-L8wwx

Conversation

@fai9al

@fai9al fai9al commented Jan 21, 2026

Copy link
Copy Markdown

No description provided.

Major changes:
- Add tech/AI data configuration files (tech companies, AI labs, startup ecosystems)
- Create new API endpoints for ArXiv papers, GitHub trending, and Hacker News
- Add service modules for fetching tech/AI data
- Update feeds configuration to focus on tech/AI news (80+ feeds across 10 categories)
- Update MapLayers type to remove military/geopolitical layers
- Add new type definitions for TechCompany, AIResearchLab, StartupEcosystem

New Files:
- src/config/tech-companies.ts - 50+ tech company locations
- src/config/ai-research-labs.ts - 40+ AI research institutions
- src/config/startup-ecosystems.ts - 30+ global tech hubs
- api/arxiv.js - ArXiv AI/ML paper endpoint
- api/github-trending.js - GitHub trending repos endpoint
- api/hackernews.js - Hacker News stories endpoint
- src/services/arxiv.ts - ArXiv data service
- src/services/github-trending.ts - GitHub trending service
- src/services/hackernews.ts - Hacker News service

Modified:
- src/config/feeds.ts - Complete rewrite for tech/AI focus
- src/config/index.ts - Added new config exports and API URLs
- src/types/index.ts - Added tech/AI types, updated MapLayers

Next phase: Update Map.ts, App.ts, and panels for tech/AI visualizations
- Replace geopolitical panels with tech/AI panels (AI/ML, Tech, Startups, Security, Policy, etc.)
- Update DEFAULT_MAP_LAYERS to use new tech/AI layers (techCompanies, aiLabs, startupEcosystems)
- Remove military/geopolitical layers (conflicts, bases, nuclear, hotspots, etc.)
- Keep infrastructure layers (cables, outages) relevant to tech operations
- Update mobile defaults for better tech/AI usability
- Add renderTechCompanies() method to display tech company markers
- Add renderAILabs() method to display AI research lab markers
- Add renderStartupEcosystems() method to display startup hub markers
- Integrate rendering calls into main render() function with layer toggles
- Add imports for TECH_COMPANIES, AI_RESEARCH_LABS, STARTUP_ECOSYSTEMS
- Each marker type has click handlers for popup integration
- Add TechCompany, AIResearchLab, StartupEcosystem to type imports
- Update PopupType to include 'tech-company', 'ai-lab', 'startup-ecosystem'
- Add renderTechCompanyPopup() with company details, products, valuation
- Add renderAILabPopup() with research areas, publications, notable work
- Add renderStartupEcosystemPopup() with funding, unicorns, VCs, sectors
- All popups follow existing design patterns with proper styling
- Add .tech-company-marker with sector-specific colors (AI Research, Cloud/AI, AI Chips, etc.)
- Add .ai-lab-marker with type-specific colors (academic, industry, research institute)
- Add .startup-ecosystem-marker with tier-based sizing and colors (tier1, tier2, tier3)
- Add hover states and labels for all marker types
- Add popup header styles for each marker type
- Add .tech-products and .vc-tag styles for popup content
- All markers follow existing design patterns with proper z-index and animations
- Remove INTEL_SOURCES import and usage from App.ts (no longer needed for tech focus)
- Rename TECH_COMPANIES to TECH_COMPANY_NAMES in feeds.ts to avoid naming conflict with tech-companies.ts
- Add getSourcePropagandaRisk stub function for backward compatibility (returns 'low' for all tech sources)

Fixes build errors that prevented dev server from running properly.
- Replace military/geopolitical search sources (hotspots, conflicts, bases, nuclear, pipelines, irradiators) with tech/AI sources (tech companies, AI labs, startup ecosystems)
- Update search result handlers to handle new tech/AI marker types
- Remove pipeline, base, and nuclear from related assets handler
- Add tech-company, ai-lab, and startup-ecosystem to related assets

This fixes runtime errors caused by missing geopolitical data imports.
- Add triggerTechCompanyClick method to show tech company popups
- Add triggerAILabClick method to show AI research lab popups
- Add triggerStartupEcosystemClick method to show startup ecosystem popups

These methods are called by App.ts search and related assets functionality.
@vercel

vercel Bot commented Jan 21, 2026

Copy link
Copy Markdown

@claude is attempting to deploy a commit to the eliehabib projects Team on Vercel.

A member of the Team first needs to authorize it.

Type System Updates:
- Update MapLayers type to only include tech/AI layers (removed geopolitical)
- Update SearchResultType to include tech-company, ai-lab, startup-ecosystem
- Update AssetType to include tech/AI types (removed pipeline, base, nuclear)

App.ts Cleanup:
- Remove all references to geopolitical layers (ais, protests, flights, military)
- Remove unused imports for military/geopolitical services
- Remove data loading for removed layers
- Remove layer toggle handlers for removed layers

Map.ts Cleanup:
- Remove geopolitical layer rendering (conflicts, hotspots, bases, nuclear, etc.)
- Remove trigger methods for geopolitical features
- Update layer toggles array to only include tech/AI layers
- Remove unused imports and data properties

Component Updates:
- SearchModal: Update icons for new tech/AI search result types
- Fix urlState.ts layer mappings to match new MapLayers type

Service Updates:
- related-assets.ts: Update to work with tech/AI assets instead of geopolitical
- Update inferOrigin to use tech companies and AI labs
- Remove pipeline, base, nuclear asset handling

Minor Fixes:
- Fix ByteDance sector type (AI/Social → Social/AI)
- Fix unused parameter warning in getSourcePropagandaRisk

Build now compiles successfully with 0 errors!
Implements comprehensive AI regulation tracking and compliance dashboard with 4 views:
1. Timeline of regulatory actions (12-month history)
2. Upcoming compliance deadlines with countdown
3. Major regulations by country (active & proposed)
4. Country-by-country regulatory stance overview

## New Features

### Data Layer
- 12 major AI regulations (EU AI Act, US EO, China rules, UK framework, etc.)
- 7+ regulatory action entries with timeline
- 11 country regulatory profiles with stance classification
- Helper functions: getUpcomingDeadlines(), getRecentActions(), etc.

### UI Components
- RegulationPanel: 4-tab interface (Timeline, Deadlines, Regulations, Countries)
- Timeline view: Chronological actions with impact levels & source attribution
- Deadlines view: Countdown timers, urgency indicators, penalty warnings
- Regulations view: Filterable cards with key provisions & scope tags
- Countries view: Color-coded stance map (strict/moderate/permissive/undefined)

### Styling
- Complete CSS styling for all regulation panel components
- Stance-based color coding (red=strict, yellow=moderate, green=permissive)
- Urgency indicators for deadlines (<90 days = urgent, <180 = warning)
- Responsive grid layouts for cards
- Hover effects and smooth transitions

### Integration
- Added to DEFAULT_PANELS configuration
- Integrated into App.ts panel initialization
- Exported from components/index.ts
- New panel order: prioritizes AI/tech panels first

## Technical Details

**New Files:**
- src/types/index.ts: AIRegulation, RegulatoryAction, CountryRegulationProfile types
- src/config/ai-regulations.ts: 440+ lines of regulation data
- src/components/RegulationPanel.ts: 380+ lines panel component
- src/styles/main.css: 550+ lines of CSS (appended)

**Modified Files:**
- src/App.ts: Added RegulationPanel initialization, updated panel order
- src/config/index.ts: Export ai-regulations
- src/config/panels.ts: Added 'regulation' panel config
- src/components/index.ts: Export RegulationPanel

## Coverage

**Regions:** EU, US, UK, China, Canada, Singapore, Brazil, Japan, South Korea, India, Australia

**Regulation Types:** Comprehensive, Sectoral, Voluntary, Proposed

**Key Regulations:**
- EU AI Act (active, compliance deadline: Aug 2026)
- US Executive Order 14110 (active)
- China Generative AI Rules (active)
- UK Pro-Innovation Framework (active)
- Canada AIDA (proposed)
- And 7 more...

Build: ✅ Successful (no errors, 0 warnings)
@koala73

koala73 commented Jan 23, 2026

Copy link
Copy Markdown
Owner

Working on it, thank you @fai9al

@koala73

koala73 commented Jan 23, 2026

Copy link
Copy Markdown
Owner

Work completed and merged to main via incremental commits

@koala73 koala73 closed this Jan 23, 2026
@koala73

koala73 commented Jan 23, 2026

Copy link
Copy Markdown
Owner

I made plenty of changes to make everything fit properly, it's on https://tech.worldmonitor.app/

@SebastienMelki SebastienMelki added the refactor Code restructuring, architecture label Feb 17, 2026
EleCor79 added a commit to EleCor79/BehavioralHealthPulse that referenced this pull request Mar 2, 2026
Distribute all 32 feeds from feeds-health-italy-eu.csv into the FEEDS
config consumed by loadNews() / fetchCategoryFeeds():

- ministero-salute: +MinSalute News Specifiche (CSV koala73#18)
- iss-epicentro:    +ISS Notizie (CSV koala73#3), +Epicentro Coronavirus (CSV koala73#17)
- aifa-tracker:     +AIFA Feed (CSV koala73#5), +EMA News (CSV koala73#8), +FDA (CSV koala73#12)
- agenas-ospedali:  +AGENAS RSS (CSV koala73#4), +PNRR (CSV koala73#6/koala73#19),
                    +Lombardia (CSV koala73#20), +Lazio (CSV koala73#21)
- ema-europa:       +EMA Clinical Trials (CSV koala73#22)
- ecdc-sorveglianza:+ECDC Weekly Threats (CSV koala73#23), +WHO DON (CSV koala73#9),
                    +ProMED (CSV koala73#10)
- live-news:        +Sanitainformazione (CSV koala73#24), +Humanitas (CSV koala73#26)
- europe:           +EU Core Health Indicators (CSV koala73#31),
                    +GLOBSEC HRI (CSV koala73#32), +ISTAT (CSV koala73#13),
                    +EIN Health Europe (CSV koala73#29)
- rare-diseases:    NEW category — EURORDIS (CSV koala73#14), Orphanet IT (CSV koala73#15),
                    Telethon (CSV koala73#16), CDC FluView (CSV koala73#11)
                    Panel disabled by default, available in settings

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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

refactor Code restructuring, architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants