# vsspowerlifting/china-mil-watch architecture

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

- Interactive diagram: https://gitdiagram.com/vsspowerlifting/china-mil-watch
- Repository: https://github.com/vsspowerlifting/china-mil-watch

## Overview

Indo-Pacific Record is a public-source monitoring and analysis product: collection feeds a daily pipeline that filters, analyzes, and stores records, then publishes a static reader-facing site. The China Desk is mature; Singapore is live, Japan is evaluated privately, and the US reference desk is access-blocked. The graph preserves the documented brief/editorial, desk-registry, and shadow-evaluation capabilities as separate branches. Source excerpts establish key calls, while some desk and site behavior is represented only by README documentation; uncertain wiring is omitted.

Main entry points: [`pipeline.py`](https://github.com/vsspowerlifting/china-mil-watch/blob/main/pipeline.py) (Daily Pipeline), [`analysis/analyzer.py`](https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/analyzer.py) (Translation & Analysis), [`core/desk_registry.py`](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/desk_registry.py) (Desk Definitions), [`site/render.py`](https://github.com/vsspowerlifting/china-mil-watch/blob/main/site/render.py) (Production Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_scrapers["Source Adapters"]
  node_adapter_contract["Collection Contract<br/>[contract.py]"]
  node_collection_status["Collection Outcomes<br/>[status.py]"]
  node_pipeline["Daily Pipeline<br/>[pipeline.py]"]
end

subgraph group_analysis["Processing &amp; Analysis"]
  node_dedup["Deduplication<br/>[dedup.py]"]
  node_screening["Relevance Screening<br/>[screening.py]"]
  node_analyzer["Translation &amp; Analysis<br/>[analyzer.py]"]
  node_prompts["Analysis Prompts<br/>[prompts.py]"]
  node_usage["LLM Usage Ledger<br/>[usage.py]"]
  node_processing_state["Retry State"]
end

subgraph group_domain["Desk &amp; Editorial"]
  node_registry["Desk Registry<br/>[registry.py]"]
  node_desk_registry["Desk Definitions<br/>[desk_registry.py]"]
  node_manifests["Desk Manifests<br/>[manifests.py]"]
  node_briefs["Brief Collection"]
  node_brief_contract["Brief Contract<br/>[brief_contract.py]"]
  node_shadow["Shadow Evaluation<br/>[shadow_schedule.py]"]
end

subgraph group_publishing["Publication"]
  node_viewmodel["Public View Model<br/>[viewmodel.py]"]
  node_renderer["Production Renderer<br/>[render.py]"]
  node_legacy_renderer["Legacy Renderer<br/>[generator.py]"]
  node_static_site["Static Website"]
end

subgraph group_state["Persistence"]
  node_database[("SQLite Records<br/>[db.py]")]
end

node_operator(("Daily Run"))
node_sources(("Official Sources"))
node_anthropic{{"Anthropic API"}}
node_readers(("Researchers &amp; Readers"))

node_operator -->|"starts run"| node_pipeline
node_sources -->|"publish material"| node_scrapers
node_scrapers -->|"implement contract"| node_adapter_contract
node_pipeline -->|"resolves sources"| node_registry
node_pipeline -->|"collects through"| node_adapter_contract
node_pipeline -->|"records outcomes"| node_collection_status
node_pipeline -->|"deduplicates"| node_dedup
node_pipeline -->|"screens records"| node_screening
node_pipeline -->|"analyzes articles"| node_analyzer
node_screening -->|"requests scoring"| node_analyzer
node_analyzer -->|"builds prompts"| node_prompts
node_analyzer -->|"calls API"| node_anthropic
node_analyzer -->|"tracks usage"| node_usage
node_pipeline -->|"classifies retries"| node_processing_state
node_pipeline -->|"stores records"| node_database
node_pipeline -->|"renders site"| node_renderer
node_registry -->|"uses desk definitions"| node_desk_registry
node_desk_registry -->|"loads manifests"| node_manifests
node_database -->|"supplies records"| node_viewmodel
node_desk_registry -->|"governs public claims"| node_viewmodel
node_renderer -->|"renders views"| node_viewmodel
node_renderer -->|"generates pages"| node_static_site
node_readers -->|"browse records"| node_static_site
node_briefs -->|"follows contract"| node_brief_contract
node_shadow -.->|"evaluates desk declarations"| node_desk_registry
node_legacy_renderer -->|"reads articles"| node_database

click node_scrapers "https://github.com/vsspowerlifting/china-mil-watch/tree/main/scraper/sources"
click node_adapter_contract "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/collection/contract.py"
click node_registry "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/registry.py"
click node_collection_status "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/collection/status.py"
click node_pipeline "https://github.com/vsspowerlifting/china-mil-watch/blob/main/pipeline.py"
click node_dedup "https://github.com/vsspowerlifting/china-mil-watch/blob/main/processing/dedup.py"
click node_screening "https://github.com/vsspowerlifting/china-mil-watch/blob/main/processing/screening.py"
click node_analyzer "https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/analyzer.py"
click node_prompts "https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/prompts.py"
click node_usage "https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/usage.py"
click node_processing_state "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/processing_state.py"
click node_desk_registry "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/desk_registry.py"
click node_manifests "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/manifests.py"
click node_briefs "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/brief_collection.py"
click node_brief_contract "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/brief_contract.py"
click node_shadow "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/shadow_schedule.py"
click node_database "https://github.com/vsspowerlifting/china-mil-watch/blob/main/storage/db.py"
click node_viewmodel "https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/viewmodel.py"
click node_renderer "https://github.com/vsspowerlifting/china-mil-watch/blob/main/site/render.py"
click node_legacy_renderer "https://github.com/vsspowerlifting/china-mil-watch/blob/main/site/generator.py"
click node_static_site "https://github.com/vsspowerlifting/china-mil-watch/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_scrapers,node_adapter_contract,node_collection_status,node_pipeline toneBlue
class node_dedup,node_screening,node_analyzer,node_prompts,node_usage,node_processing_state toneAmber
class node_registry,node_desk_registry,node_manifests,node_briefs,node_brief_contract,node_shadow,node_anthropic toneMint
class node_viewmodel,node_renderer,node_legacy_renderer,node_static_site toneRose
class node_database,node_operator,node_sources,node_readers toneIndigo
```

## Components

### Collection

- [Source Adapters](https://github.com/vsspowerlifting/china-mil-watch/tree/main/scraper/sources): `scraper/sources`
- [Collection Contract](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/collection/contract.py): `core/collection/contract.py`
- [Collection Outcomes](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/collection/status.py): `core/collection/status.py`
- [Daily Pipeline](https://github.com/vsspowerlifting/china-mil-watch/blob/main/pipeline.py): `pipeline.py`

### Processing & Analysis

- [Deduplication](https://github.com/vsspowerlifting/china-mil-watch/blob/main/processing/dedup.py): `processing/dedup.py`
- [Relevance Screening](https://github.com/vsspowerlifting/china-mil-watch/blob/main/processing/screening.py): `processing/screening.py`
- [Translation & Analysis](https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/analyzer.py): `analysis/analyzer.py`
- [Analysis Prompts](https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/prompts.py): `analysis/prompts.py`
- [LLM Usage Ledger](https://github.com/vsspowerlifting/china-mil-watch/blob/main/analysis/usage.py): `analysis/usage.py`
- [Retry State](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/processing_state.py): `core/processing_state.py`

### Desk & Editorial

- [Desk Registry](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/registry.py): `core/registry.py`
- [Desk Definitions](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/desk_registry.py): `core/desk_registry.py`
- [Desk Manifests](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/manifests.py): `core/manifests.py`
- [Brief Collection](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/brief_collection.py): `core/brief_collection.py`
- [Brief Contract](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/brief_contract.py): `core/brief_contract.py`
- [Shadow Evaluation](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/shadow_schedule.py): `core/shadow_schedule.py`

### Publication

- [Public View Model](https://github.com/vsspowerlifting/china-mil-watch/blob/main/core/viewmodel.py): `core/viewmodel.py`
- [Production Renderer](https://github.com/vsspowerlifting/china-mil-watch/blob/main/site/render.py): `site/render.py`
- [Legacy Renderer](https://github.com/vsspowerlifting/china-mil-watch/blob/main/site/generator.py): `site/generator.py`
- [Static Website](https://github.com/vsspowerlifting/china-mil-watch/tree/main/output): `output`

### Persistence

- [SQLite Records](https://github.com/vsspowerlifting/china-mil-watch/blob/main/storage/db.py): `storage/db.py`

### Other components

- **Daily Run**
- **Official Sources**
- **Anthropic API**
- **Researchers & Readers**

## Connections

- Daily Run → Daily Pipeline: starts run (evidence: `README.md`)
- Official Sources → Source Adapters: publish material (evidence: `README.md`)
- Source Adapters → Collection Contract: implement contract (evidence: `core/collection/contract.py`)
- Daily Pipeline → Desk Registry: resolves sources (evidence: `pipeline.py`)
- Daily Pipeline → Collection Contract: collects through (evidence: `pipeline.py`)
- Daily Pipeline → Collection Outcomes: records outcomes (evidence: `pipeline.py`)
- Daily Pipeline → Deduplication: deduplicates (evidence: `pipeline.py`)
- Daily Pipeline → Relevance Screening: screens records (evidence: `pipeline.py`)
- Daily Pipeline → Translation & Analysis: analyzes articles (evidence: `pipeline.py`)
- Relevance Screening → Translation & Analysis: requests scoring (evidence: `processing/relevance.py`)
- Translation & Analysis → Analysis Prompts: builds prompts (evidence: `analysis/analyzer.py`)
- Translation & Analysis → Anthropic API: calls API (evidence: `analysis/analyzer.py`)
- Translation & Analysis → LLM Usage Ledger: tracks usage (evidence: `analysis/analyzer.py`)
- Daily Pipeline → Retry State: classifies retries (evidence: `pipeline.py`)
- Daily Pipeline → SQLite Records: stores records (evidence: `pipeline.py`)
- Daily Pipeline → Production Renderer: renders site (evidence: `README.md`)
- Desk Registry → Desk Definitions: uses desk definitions (evidence: `core/registry.py`)
- Desk Definitions → Desk Manifests: loads manifests (evidence: `core/desk_registry.py`)
- SQLite Records → Public View Model: supplies records (evidence: `core/viewmodel.py`)
- Desk Definitions → Public View Model: governs public claims (evidence: `core/viewmodel.py`)
- Production Renderer → Public View Model: renders views (evidence: `site/render.py`)
- Production Renderer → Static Website: generates pages (evidence: `README.md`)
- Researchers & Readers → Static Website: browse records (evidence: `README.md`)
- Brief Collection → Brief Contract: follows contract (evidence: `core/brief_collection.py`)
- Shadow Evaluation → Desk Definitions: evaluates desk declarations
- Legacy Renderer → SQLite Records: reads articles (evidence: `site/generator.py`)
