# adityaaa89/codekavach-synthetic-pipeline architecture

> Architecture diagram of the GitHub repository adityaaa89/codekavach-synthetic-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityaaa89/codekavach-synthetic-pipeline
- Repository: https://github.com/adityaaa89/codekavach-synthetic-pipeline

## Overview

CodeKavach is a synthetic cybercrime data pipeline: it calibrates simulation parameters from defaults and reference data, generates relational fraud cases and cash-outs, derives task-specific ML datasets, and validates the generated outputs. The main workflow is explicit in `main.py`; sampled generator and dataset-builder code supports the principal data transformations. Generation internals and some output wiring are summarized because the generator excerpt is incomplete.

Main entry points: [`src/generate_dataset.py`](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py) (Cybercrime Generator), [`data/ml_ready`](https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/ml_ready) (ML Training Data), [`main.py`](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/main.py) (Pipeline Runner), [`src/validate_dataset.py`](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/validate_dataset.py) (Statistical Validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline"]
  node_main["Pipeline Runner<br/>[main.py]"]
end

subgraph group_calibration["Calibration"]
  node_defaults["Simulation Defaults<br/>[defaults.json]"]
  node_reference["Reference Data"]
  node_calibrate["Parameter Calibration<br/>[calibrate.py]"]
  node_calibration_config["Calibrated Settings"]
end

subgraph group_simulation["Fraud Simulation"]
  node_generator["Cybercrime Generator"]
  node_complaints["Victim Complaints"]
  node_rings_accounts["Rings and Mules"]
  node_fund_flows["Split-Converge Flows"]
  node_cashout["Cash-out Events"]
end

subgraph group_outputs["Data Products"]
  node_generated["Relational Case Data"]
  node_ml_builder["ML Dataset Builder"]
  node_ml_ready["ML Training Data"]
  node_anomaly["Anomaly Detection"]
  node_terminal["Terminal Node Model"]
  node_channel["Channel Model"]
  node_location["Location Model"]
  node_timing["Withdrawal Time Model"]
end

subgraph group_assessment["Validation"]
  node_validator["Statistical Validator"]
  node_report["Validation Report"]
end

node_user(("Pipeline User"))

node_user -->|"runs"| node_main
node_main -->|"invokes"| node_calibrate
node_main -->|"invokes"| node_generator
node_main -->|"invokes"| node_ml_builder
node_main -->|"invokes"| node_validator
node_calibrate -->|"reads"| node_defaults
node_calibrate -->|"reads"| node_reference
node_calibrate -->|"writes"| node_calibration_config
node_generator -->|"reads"| node_calibration_config
node_generator -->|"reads locations"| node_reference
node_generator -->|"simulates"| node_complaints
node_generator -->|"constructs"| node_rings_accounts
node_generator -->|"generates"| node_fund_flows
node_generator -->|"generates"| node_cashout
node_generator -->|"writes"| node_generated
node_generated -->|"reads"| node_ml_builder
node_ml_builder -->|"writes"| node_ml_ready
node_ml_ready -->|"includes"| node_anomaly
node_ml_ready -->|"includes"| node_terminal
node_ml_ready -->|"includes"| node_channel
node_ml_ready -->|"includes"| node_location
node_ml_ready -->|"includes"| node_timing
node_validator -->|"reads"| node_generated
node_validator -->|"reads"| node_calibration_config
node_validator -->|"checks against"| node_reference
node_validator -->|"writes"| node_report

click node_main "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/main.py"
click node_defaults "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/config/defaults.json"
click node_reference "https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/reference"
click node_calibrate "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/calibrate.py"
click node_calibration_config "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/config/calibration_config.json"
click node_generator "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py"
click node_generated "https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/generated"
click node_complaints "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py"
click node_rings_accounts "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py"
click node_fund_flows "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py"
click node_cashout "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py"
click node_ml_builder "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/build_ml_datasets.py"
click node_ml_ready "https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/ml_ready"
click node_anomaly "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/anomaly_detection.csv"
click node_terminal "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/terminal_node_training.csv"
click node_channel "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_channel_training.csv"
click node_location "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_location_training.csv"
click node_timing "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_time_training.csv"
click node_validator "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/validate_dataset.py"
click node_report "https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/reports/validation_report.json"

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_main,node_user toneBlue
class node_defaults,node_reference,node_calibrate,node_calibration_config toneAmber
class node_generator,node_complaints,node_rings_accounts,node_fund_flows,node_cashout toneMint
class node_generated,node_ml_builder,node_ml_ready,node_anomaly,node_terminal,node_channel,node_location,node_timing toneRose
class node_validator,node_report toneIndigo
```

## Components

### Pipeline

- [Pipeline Runner](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/main.py): `main.py`

### Calibration

- [Simulation Defaults](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/config/defaults.json): `config/defaults.json`
- [Reference Data](https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/reference): `data/reference`
- [Parameter Calibration](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/calibrate.py): `src/calibrate.py`
- [Calibrated Settings](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/config/calibration_config.json): `config/calibration_config.json`

### Fraud Simulation

- [Cybercrime Generator](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py): `src/generate_dataset.py`
- [Victim Complaints](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py): `src/generate_dataset.py`
- [Rings and Mules](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py): `src/generate_dataset.py`
- [Split-Converge Flows](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py): `src/generate_dataset.py`
- [Cash-out Events](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/generate_dataset.py): `src/generate_dataset.py`

### Data Products

- [Relational Case Data](https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/generated): `data/generated`
- [ML Dataset Builder](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/build_ml_datasets.py): `src/build_ml_datasets.py`
- [ML Training Data](https://github.com/adityaaa89/codekavach-synthetic-pipeline/tree/main/data/ml_ready): `data/ml_ready`
- [Anomaly Detection](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/anomaly_detection.csv): `data/ml_ready/anomaly_detection.csv`
- [Terminal Node Model](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/terminal_node_training.csv): `data/ml_ready/terminal_node_training.csv`
- [Channel Model](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_channel_training.csv): `data/ml_ready/withdrawal_channel_training.csv`
- [Location Model](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_location_training.csv): `data/ml_ready/withdrawal_location_training.csv`
- [Withdrawal Time Model](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/data/ml_ready/withdrawal_time_training.csv): `data/ml_ready/withdrawal_time_training.csv`

### Validation

- [Statistical Validator](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/src/validate_dataset.py): `src/validate_dataset.py`
- [Validation Report](https://github.com/adityaaa89/codekavach-synthetic-pipeline/blob/main/reports/validation_report.json): `reports/validation_report.json`

### Other components

- **Pipeline User**

## Connections

- Pipeline User → Pipeline Runner: runs
- Pipeline Runner → Parameter Calibration: invokes
- Pipeline Runner → Cybercrime Generator: invokes
- Pipeline Runner → ML Dataset Builder: invokes
- Pipeline Runner → Statistical Validator: invokes
- Parameter Calibration → Simulation Defaults: reads
- Parameter Calibration → Reference Data: reads
- Parameter Calibration → Calibrated Settings: writes
- Cybercrime Generator → Calibrated Settings: reads
- Cybercrime Generator → Reference Data: reads locations
- Cybercrime Generator → Victim Complaints: simulates
- Cybercrime Generator → Rings and Mules: constructs
- Cybercrime Generator → Split-Converge Flows: generates
- Cybercrime Generator → Cash-out Events: generates
- Cybercrime Generator → Relational Case Data: writes
- Relational Case Data → ML Dataset Builder: reads
- ML Dataset Builder → ML Training Data: writes
- ML Training Data → Anomaly Detection: includes
- ML Training Data → Terminal Node Model: includes
- ML Training Data → Channel Model: includes
- ML Training Data → Location Model: includes
- ML Training Data → Withdrawal Time Model: includes
- Statistical Validator → Relational Case Data: reads
- Statistical Validator → Calibrated Settings: reads
- Statistical Validator → Reference Data: checks against
- Statistical Validator → Validation Report: writes
