# vsspowerlifting/indopacificrecord architecture

> Architecture diagram of the GitHub repository vsspowerlifting/indopacificrecord, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vsspowerlifting/indopacificrecord
- Repository: https://github.com/vsspowerlifting/indopacificrecord

## Overview

Indo-Pacific Record monitors public Indo-Pacific defense and security sources, preserves source material, produces assisted analysis, and publishes a structured web record. The documented daily workflow runs collection, filtering, analysis, storage, and site rendering; regional desks and human-reviewed Briefs extend that core product. The README describes the workflow, while sampled code and the source index support several internal calls. Some desk, Briefs, and publication internals were not sampled, so those connections are shown only where documented or marked unverified.

Main entry points: [`pipeline.py`](https://github.com/vsspowerlifting/indopacificrecord/blob/main/pipeline.py) (Daily runner), [`analysis/analyzer.py`](https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/analyzer.py) (LLM analysis), [`storage/db.py`](https://github.com/vsspowerlifting/indopacificrecord/blob/main/storage/db.py) (SQLite corpus), [`scraper/sources`](https://github.com/vsspowerlifting/indopacificrecord/tree/main/scraper/sources) (Source adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_pipeline["Daily runner<br/>[pipeline.py]"]
  node_scrapers["Source adapters"]
  node_contract["Adapter contract<br/>[contract.py]"]
end

subgraph group_processing["Processing and analysis"]
  node_screening["Screening and dedup<br/>[screening.py]"]
  node_analyzer["LLM analysis<br/>[analyzer.py]"]
  node_prompts["Analysis prompts<br/>[prompts.py]"]
  node_usage["Usage telemetry<br/>[usage.py]"]
end

subgraph group_governance["Evidence and desks"]
  node_database[("SQLite corpus<br/>[db.py]")]
  node_evidence["Evidence custody"]
  node_desk_registry["Desk registry<br/>[desk_registry.py]"]
  node_korea_bridge["Korea corpus bridge"]
end

subgraph group_publication["Editorial and publication"]
  node_briefs["Reviewed Briefs"]
  node_viewmodel["Publication view model<br/>[viewmodel.py]"]
  node_renderer["Site renderer<br/>[render.py]"]
  node_site_output["Static site"]
end

node_analyst(("Analyst"))
node_public(("Site reader"))
node_publishers(("Public publishers"))
node_anthropic{{"Anthropic API"}}

node_publishers -->|"provide material"| node_scrapers
node_pipeline -->|"runs collection"| node_scrapers
node_pipeline -.->|"uses adapter contract"| node_contract
node_scrapers -->|"implement contract"| node_contract
node_pipeline -->|"filters records"| node_screening
node_pipeline -->|"stores records"| node_database
node_pipeline -->|"runs analysis"| node_analyzer
node_analyzer -->|"uses prompts"| node_prompts
node_analyzer -->|"requests analysis"| node_anthropic
node_analyzer -->|"records usage"| node_usage
node_database -->|"custody support"| node_evidence
node_korea_bridge -->|"writes admitted records"| node_database
node_desk_registry -->|"supplies desk data"| node_viewmodel
node_database -.->|"provides corpus"| node_viewmodel
node_viewmodel -->|"feeds publication"| node_renderer
node_analyst -.->|"reviews analysis"| node_briefs
node_briefs -.->|"publishes Briefs"| node_renderer
node_renderer -->|"renders pages"| node_site_output
node_site_output -->|"presents record"| node_public

click node_pipeline "https://github.com/vsspowerlifting/indopacificrecord/blob/main/pipeline.py"
click node_scrapers "https://github.com/vsspowerlifting/indopacificrecord/tree/main/scraper/sources"
click node_contract "https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/collection/contract.py"
click node_screening "https://github.com/vsspowerlifting/indopacificrecord/blob/main/processing/screening.py"
click node_analyzer "https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/analyzer.py"
click node_prompts "https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/prompts.py"
click node_usage "https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/usage.py"
click node_database "https://github.com/vsspowerlifting/indopacificrecord/blob/main/storage/db.py"
click node_evidence "https://github.com/vsspowerlifting/indopacificrecord/blob/main/storage/evidence_custody.py"
click node_desk_registry "https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/desk_registry.py"
click node_korea_bridge "https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/korea_corpus_bridge.py"
click node_briefs "https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/brief_collection.py"
click node_viewmodel "https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/viewmodel.py"
click node_renderer "https://github.com/vsspowerlifting/indopacificrecord/blob/main/site/render.py"
click node_site_output "https://github.com/vsspowerlifting/indopacificrecord/tree/main/output"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pipeline,node_scrapers,node_contract toneBlue
class node_screening,node_analyzer,node_prompts,node_usage toneAmber
class node_database,node_evidence,node_desk_registry,node_korea_bridge,node_anthropic toneMint
class node_briefs,node_viewmodel,node_renderer,node_site_output toneRose
class node_analyst,node_public,node_publishers toneIndigo
```

## Components

### Collection

- [Daily runner](https://github.com/vsspowerlifting/indopacificrecord/blob/main/pipeline.py): `pipeline.py`
- [Source adapters](https://github.com/vsspowerlifting/indopacificrecord/tree/main/scraper/sources): `scraper/sources`
- [Adapter contract](https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/collection/contract.py): `core/collection/contract.py`

### Processing and analysis

- [Screening and dedup](https://github.com/vsspowerlifting/indopacificrecord/blob/main/processing/screening.py): `processing/screening.py`
- [LLM analysis](https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/analyzer.py): `analysis/analyzer.py`
- [Analysis prompts](https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/prompts.py): `analysis/prompts.py`
- [Usage telemetry](https://github.com/vsspowerlifting/indopacificrecord/blob/main/analysis/usage.py): `analysis/usage.py`

### Evidence and desks

- [SQLite corpus](https://github.com/vsspowerlifting/indopacificrecord/blob/main/storage/db.py): `storage/db.py`
- [Evidence custody](https://github.com/vsspowerlifting/indopacificrecord/blob/main/storage/evidence_custody.py): `storage/evidence_custody.py`
- [Desk registry](https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/desk_registry.py): `core/desk_registry.py`
- [Korea corpus bridge](https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/korea_corpus_bridge.py): `core/korea_corpus_bridge.py`

### Editorial and publication

- [Reviewed Briefs](https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/brief_collection.py): `core/brief_collection.py`
- [Publication view model](https://github.com/vsspowerlifting/indopacificrecord/blob/main/core/viewmodel.py): `core/viewmodel.py`
- [Site renderer](https://github.com/vsspowerlifting/indopacificrecord/blob/main/site/render.py): `site/render.py`
- [Static site](https://github.com/vsspowerlifting/indopacificrecord/tree/main/output): `output`

### Other components

- **Analyst**
- **Site reader**
- **Public publishers**
- **Anthropic API**

## Connections

- Public publishers → Source adapters: provide material (evidence: `README.md`)
- Daily runner → Source adapters: runs collection (evidence: `README.md`)
- Daily runner → Adapter contract: uses adapter contract (evidence: `pipeline.py`)
- Source adapters → Adapter contract: implement contract (evidence: `core/collection/contract.py`)
- Daily runner → Screening and dedup: filters records (evidence: `pipeline.py`)
- Daily runner → SQLite corpus: stores records (evidence: `pipeline.py`)
- Daily runner → LLM analysis: runs analysis (evidence: `pipeline.py`)
- LLM analysis → Analysis prompts: uses prompts (evidence: `analysis/analyzer.py`)
- LLM analysis → Anthropic API: requests analysis (evidence: `analysis/analyzer.py`)
- LLM analysis → Usage telemetry: records usage (evidence: `analysis/analyzer.py`)
- SQLite corpus → Evidence custody: custody support (evidence: `storage/evidence_custody.py`)
- Korea corpus bridge → SQLite corpus: writes admitted records (evidence: `core/korea_corpus_bridge.py`)
- Desk registry → Publication view model: supplies desk data (evidence: `core/viewmodel.py`)
- SQLite corpus → Publication view model: provides corpus
- Publication view model → Site renderer: feeds publication (evidence: `site/render.py`)
- Analyst → Reviewed Briefs: reviews analysis
- Reviewed Briefs → Site renderer: publishes Briefs
- Site renderer → Static site: renders pages (evidence: `README.md`)
- Static site → Site reader: presents record (evidence: `README.md`)
