Skip to content
/ DR Public

Sovereign infrastructure intelligence platform monitoring Dominican Republic convergence across mining, energy, logistics, telecom, and capital flows.

Notifications You must be signed in to change notification settings

FTHTrading/DR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Node Python PostgreSQL Vector License


🌐 DICS β€” DR Intelligence Command System

Sovereign Infrastructure Intelligence Platform

A compliance-first, public-source intelligence architecture monitoring strategic infrastructure convergence within the Dominican Republic across mining, energy, connectivity, logistics, telecom, and capital flows.


🎨 Domain Architecture Legend

Domain Description
🟑 Mining & Resource Intelligence Rare earths, concessions, geological signals
🟒 Energy Infrastructure Solar, BESS, grid, generation, PPAs
πŸ”΅ Connectivity & Telecom Subsea cables, data centers, IXPs, spectrum
🟠 Logistics & Trade Corridors Ports, airports, free zones, cargo flows
🟣 Capital Structuring SPVs, project finance, institutional modeling
πŸ”΄ Risk & Regulatory Intelligence Political, ESG, FX, compliance friction
⚫ Governance & Audit Integrity Chain-of-custody, append-only logs
🧠 Agentic RAG Intelligence Layer Vector retrieval, claim citation, anti-hallucination enforcement

πŸ“– Executive Overview

DICS (DR Intelligence Command System) is a structured intelligence platform designed to detect, score, and prioritize strategic infrastructure signals across the Dominican Republic.

The system operates across three integrated layers:

  1. Intelligence Acquisition
  2. Structured Extraction & Scoring
  3. Capital-Ready Output & Governance

Every claim is traceable. Every document is hashed. Every alert is justified.

This is not commentary.

It is executable intelligence.


🧠 I. Intelligence Acquisition Layer

The platform continuously monitors 18 public sources across Tier 1–4 classifications.

Capabilities

  • Source Registry & Tiered Credibility Model
  • Conditional Fetching (ETag / Last-Modified)
  • SHA-256 Deduplication
  • robots.txt Enforcement
  • Denial Logging to audit_log

This layer ensures:

  • Legal compliance
  • Conditional network efficiency
  • Chain-of-custody integrity
config/sources.yaml  (18 public sources, Tiers 1–4)
          β”‚
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   ETag / Last-Modified
β”‚   Collector        β”‚ ◄─────────────────────── source_cache
β”‚   Node/TypeScript  β”‚
β”‚   axios-retry      β”‚
β”‚   + robots.txt     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚  SHA-256 hash + raw + clean text
          β–Ό
    PostgreSQL 16 / pgvector

πŸ”Ž II. Structured Extraction & Signal Modeling

Documents are processed through a Python 3.12 NLP pipeline.

Extraction Components

  • Named Entity Recognition (spaCy)
  • Event Classification Engine
  • Atomic Claim Detection
  • Numerical Signal Extraction (USD, MW, Tons, KM)
  • Sentence-Transformer Embeddings (vector(384))

All claims are stored in PostgreSQL 16 + pgvector.

Every extracted claim is linked to:

  • document.id
  • source URL
  • tier classification
  • composite score

πŸ“Š III. Composite Scoring Model

Each claim is scored across five weighted dimensions:

Score =
  (0.30 Γ— Credibility)
+ (0.25 Γ— Materiality)
+ (0.15 Γ— Recency)
+ (0.20 Γ— Opportunity)
βˆ’ (0.10 Γ— Risk)
Dimension Weight Driver
Credibility 30% Tier Γ— corroboration
Materiality 25% USD + strategic density
Recency 15% Freshness decay
Opportunity 20% Expansion / tender signals
Risk βˆ’10% Friction penalties

Claims β‰₯ 0.65 are promoted to the alert pipeline.


🟒 IV. Infrastructure Convergence Domains

DICS monitors cross-sector acceleration across:

🟑 Mining

Concessions Β· Rare earth claims Β· Beneficiation signals

🟒 Energy

Solar buildouts Β· BESS installations Β· Grid expansions

πŸ”΅ Connectivity

Submarine cable landings Β· Data centers Β· Telecom spectrum

🟠 Logistics

Port expansion Β· Air cargo growth Β· Free zone activity

🟣 Capital

DFI financing Β· Project finance stack Β· SPV structuring


πŸ”΄ V. Risk & Regulatory Intelligence

A five-dimensional risk radar tracks:

Risk Category Low Medium High Primary Mitigation
Political 🟒 🟑 πŸ”΄ DFI co-finance + political risk insurance
Regulatory 🟒 🟑 πŸ”΄ Local counsel + compliance buffer period
ESG 🟒 🟑 πŸ”΄ Independent environmental audit
FX Exposure 🟒 🟑 πŸ”΄ USD-denominated contract structures
Execution 🟒 🟑 πŸ”΄ EPC guarantees + milestone escrow

Mitigation pathways are embedded in the capital modeling layer.


⚫ VI. Governance & Audit Integrity

DICS enforces:

  • Append-only audit_log
  • Append-only proof_registry
  • SHA-256 document hashing
  • Blockchain-ready anchoring
  • Source traceability on every claim

No UPDATE or DELETE allowed at the database rule level.

Institutional integrity is enforced at schema level.


🧠 VII. Agentic RAG Intelligence Layer

User Query
    β”‚
    β–Ό
Embedding Model (all-MiniLM-L6-v2)
    β”‚
    β–Ό
pgvector cosine similarity search
    β”‚
    β–Ό
Top 10 relevant claims
    β”‚ filtered: credibility β‰₯ 0.70
    β–Ό
Response with claim_id + document_id citations

Anti-hallucination policy: If evidence is insufficient, DICS explicitly states missing evidence types.


πŸ”— VIII. Blockchain Anchoring

Every promoted intelligence report can be cryptographically anchored.

Column Purpose
document_hash SHA-256 of clean content
chain_id Target chain: polygon Β· ethereum Β· xrpl Β· private
chain_tx_hash On-chain transaction reference
block_number Immutable block reference
anchored_at Timestamp of on-chain confirmation
Document β†’ SHA-256 Hash β†’ proof_registry β†’ Web3 Anchor β†’ On-chain Tx Reference

Table is append-only β€” UPDATE and DELETE are blocked at the database rule level.


πŸ“Š IX. Observability & Metrics

Prometheus endpoint:

GET :9091/metrics
Metric Description
collector_fetch_total All fetch attempts
collector_fetch_ok Successful (2xx/3xx) fetches
collector_fetch_fail Network or server errors
collector_robots_denied URLs blocked by robots.txt
collector_dedupe_skipped Duplicate content skipped
collector_documents_saved New documents persisted
extractor_claims_generated Claims extracted and scored
alerts_sent Cloudflare webhook dispatches

Health check:

GET :9091/health β†’ { "status": "ok", "ts": "…" }

🧭 X. Operational Philosophy

DICS does not speculate.

It does not scrape behind authentication.

It does not bypass paywalls.

It operates strictly within:

  • Public-source intelligence boundaries
  • robots.txt compliance
  • Append-only governance
  • Structured, traceable scoring

The output is defensible.


πŸ“‹ XI. Source Tiers

Tier Type Confidence Examples
1 Official government/regulators 1.0 MEM, INDOTEL, APORDOM, Banco Central
2 Multilateral & data agencies 0.9 World Bank, IDB, USGS, ITU
3 Industry trade publications 0.7 DatacenterDynamics, PV Magazine, JOC
4 Corporate press rooms 0.6 Google Blog, Amazon Newsroom, AES
5 Community / social signals 0.4 Chambers, verified accounts

All 18 configured sources are in config/sources.yaml.


🌎 XII. Demographic Intelligence Overlay

Province-level operational context derived from World Bank, IDB, and ONE.

Province Population Workforce Primary Sector Infra Readiness Risk Score
Santo Domingo High High Services / Trade Advanced Medium
Santiago High Medium Manufacturing Growing Low
La Altagracia Medium Medium Tourism High Medium
San Pedro de MacorΓ­s Medium Medium Free Zones Established Low
Pedernales Low Low Mining (emerging) Developing High
MonseΓ±or Nouel Low Low Mining / Forestry Underdeveloped High

βš™οΈ XIII. Quick Start

Prerequisites

  • Docker Desktop (Postgres + Redis)
  • Node.js 20+
  • Python 3.12+

1. Environment

cp .env.example .env
# Edit .env β€” set POSTGRES_PASSWORD at minimum

2. Infrastructure

docker compose up postgres redis -d

3. Collector (dev mode)

cd collector
npm install
npm run dev          # metrics at http://localhost:9091/metrics

4. Extractor (dev mode)

cd extractor
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python -m spacy download en_core_web_sm
cd src && python main.py

5. Full stack via Docker

docker compose up --build

6. Alert Worker

cd alerts
npm install
wrangler secret put WEBHOOK_SECRET
wrangler secret put SLACK_WEBHOOK_URL
npm run deploy

πŸ—‚οΈ XIV. Repository Structure

β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ copilot-instructions.md
β”‚   └── workflows/deploy.yml       GitHub Actions β†’ Netlify CI/CD
β”œβ”€β”€ alerts/                         Cloudflare Worker β€” HMAC webhook β†’ Slack
β”‚   β”œβ”€β”€ src/index.ts
β”‚   β”œβ”€β”€ package.json
β”‚   └── wrangler.toml
β”œβ”€β”€ collector/                      Node 20 / TypeScript fetch pipeline
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.ts                Entrypoint β€” scheduler + metrics server
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   β”œβ”€β”€ logger.ts           Structured pino logging
β”‚   β”‚   β”‚   └── metrics.ts          Prometheus /metrics endpoint
β”‚   β”‚   β”œβ”€β”€ scheduler/              CronJob + p-queue orchestration
β”‚   β”‚   β”œβ”€β”€ fetcher/                axios-retry + robots.txt guard
β”‚   β”‚   β”œβ”€β”€ normalizer/             @mozilla/readability HTML β†’ clean text
β”‚   β”‚   β”œβ”€β”€ deduper/                SHA-256 duplicate detection
β”‚   β”‚   β”œβ”€β”€ storage/                PostgreSQL persistence + audit log
β”‚   β”‚   └── config/                 sources.yaml loader
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ dashboard/                      Next.js 14 live intelligence console
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx            Executive overview dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx          Dark theme + sidebar navigation
β”‚   β”‚   β”‚   └── api/                8 serverless API routes
β”‚   β”‚   β”œβ”€β”€ components/             8 intelligence components
β”‚   β”‚   └── lib/
β”‚   β”‚       β”œβ”€β”€ db.ts               Serverless-safe PostgreSQL pool
β”‚   β”‚       └── types.ts            13 TypeScript interfaces
β”‚   β”œβ”€β”€ netlify.toml
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
β”œβ”€β”€ extractor/                      Python 3.12 NLP pipeline
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.py                 Poll loop + orchestration
β”‚   β”‚   β”œβ”€β”€ ner/extractor.py        spaCy entity/event/claim extraction
β”‚   β”‚   β”œβ”€β”€ scoring/scorer.py       5-dimension claim scoring
β”‚   β”‚   β”œβ”€β”€ embeddings/embedder.py  sentence-transformers β†’ pgvector
β”‚   β”‚   └── storage/db.py           psycopg2 + pgvector persistence
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── requirements.txt
β”œβ”€β”€ shared/
β”‚   β”œβ”€β”€ db/001_init.sql             Full schema + pgvector + proof_registry
β”‚   └── schemas/                    8 JSON Schema definitions
β”œβ”€β”€ config/
β”‚   └── sources.yaml                18 monitored sources, Tier 1–4
β”œβ”€β”€ docker-compose.yml              pgvector/pg16 + Redis 7 + services
β”œβ”€β”€ .env.example
└── README.md

πŸ“ XV. Data Model

Table Purpose
documents Raw + clean text, SHA-256 hash, dedup key, tier, tags
entities Named entities: ORG, GPE, PERSON, ASSET, PERMIT, AGENCY
events Typed events: ConcessionAward, TenderRelease, CapexAnnouncement
claims Scored atomic statements with vector(384) embeddings
relationships Entity graph edges with typed relations
audit_log Append-only event log β€” UPDATE/DELETE blocked at DB level
source_cache ETag / Last-Modified per source for conditional GETs
proof_registry Blockchain anchoring registry β€” append-only

Entity Graph

[Government Agency]
        β”‚ issues
        β–Ό
[Concession Permit]
        β”‚ enables
        β–Ό
[Mining Project] ◄──── finances ──── [DFI / Infra Fund]
        β”‚
        β”‚ secured by
        β–Ό
[SPV Vehicle]
        β”‚ generates
        β–Ό
[Revenue Streams]

Relationship types: finances Β· owns Β· operates Β· regulates Β· partners_with Β· awards_to


πŸ› XVI. System Architecture

config/sources.yaml
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     raw docs      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Collector     β”‚ ──────────────►  β”‚   PostgreSQL 16  β”‚
β”‚  Node/TypeScriptβ”‚                  β”‚  + pgvector      β”‚
β”‚  β€’ Scheduler    β”‚ ◄── ETag cache ─  β”‚  β€’ documents     β”‚
β”‚  β€’ Fetcher      β”‚                  β”‚  β€’ entities      β”‚
β”‚  β€’ Normalizer   β”‚                  β”‚  β€’ events        β”‚
β”‚  β€’ Deduper      β”‚                  β”‚  β€’ claims        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚  β€’ relationships β”‚
                                     β”‚  β€’ audit_log     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     extracts to  β”‚  β€’ proof_registryβ”‚
β”‚   Extractor     β”‚ ──────────────►  β”‚                  β”‚
β”‚  Python 3.12    β”‚                  β”‚  (pgvector for   β”‚
β”‚  β€’ spaCy NER    β”‚                  β”‚   RAG retrieval) β”‚
β”‚  β€’ Scorer       β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚  β€’ Embedder     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚                   β”‚  Cloudflare Worker    β”‚
         └── high score ───► β”‚  Alert Webhook        β”‚
                             β”‚  β†’ Slack notification β”‚
                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Dashboard     β”‚ ◄──── PostgreSQL queries
β”‚  Next.js 14     β”‚
β”‚  β€’ 8 API routes β”‚
β”‚  β€’ 8 components β”‚
β”‚  β€’ Convergence  β”‚
β”‚  β€’ Trend Engine β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
  https://dics-dr-intelligence.netlify.app

βš–οΈ XVII. Legal & Operational Policy

  • Only public sources are fetched β€” no paywall bypass, no login bypass, no CAPTCHA circumvention
  • robots.txt is respected on every run; denials are recorded in audit_log
  • Every claim traces to a document.id + source URL
  • audit_log and proof_registry are append-only at the database rule level
  • SHA-256 content hash is stored on every document for chain-of-custody
  • High-impact claims require corroboration β‰₯ 2 sources before alert dispatch

πŸ› Closing Statement

DICS is designed to support:

  • Institutional capital committees
  • Infrastructure allocators
  • Strategic advisory firms
  • Sovereign development analysis

It transforms fragmented public signals into structured, capital-grade intelligence.


Live Dashboard: dics-dr-intelligence.netlify.app

Repository: github.com/FTHTrading/DR

About

Sovereign infrastructure intelligence platform monitoring Dominican Republic convergence across mining, energy, logistics, telecom, and capital flows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors