# lazydeveloper9/dpdp architecture

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

- Interactive diagram: https://gitdiagram.com/lazydeveloper9/dpdp
- Repository: https://github.com/lazydeveloper9/dpdp

## Overview

CS-01 is a local-first DPDP compliance auditor. A user supplies a repository and scan configuration through the CLI or desktop GUI; the shared runner ingests and parses it, detects personal data and capabilities, evaluates statutory rules, classifies findings, and produces reports and evidence. The graph preserves the documented data-flow visualization, RoPA, consent, DAST, patch, and AI capabilities. Some implementations were not sampled, so their connections are shown only where documented or indexed.

Main entry points: [`cs01/cs01/pipeline/runner.py`](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/runner.py) (Pipeline Runner), [`cs01/cs01/pipeline/stage6_report/reporter.py`](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/reporter.py) (Report Generation), [`cs01/cs01/cli/main.py`](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/cli/main.py) (CLI), [`cs01/cs01/gui/main_window.py`](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/gui/main_window.py) (Desktop GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Entry"]
  node_cli["CLI<br/>[main.py]"]
  node_desktop["Desktop GUI<br/>[main_window.py]"]
  node_worker["Scan Worker<br/>[scan_worker.py]"]
end

subgraph group_audit["Audit Pipeline"]
  node_runner["Pipeline Runner<br/>[runner.py]"]
  node_ingest["Repository Ingest<br/>[ingestor.py]"]
  node_git["Git Ingest<br/>[git_ingest.py]"]
  node_parse["Polyglot Parsing<br/>[parser.py]"]
  node_detect["PII Detection<br/>[pii_detector.py]"]
  node_capability["Capability Inventory"]
  node_evaluate["Rule Evaluation<br/>[evaluator.py]"]
  node_rules["Rule Loading<br/>[rule_loader.py]"]
  node_classify["Finding Classification<br/>[classifier.py]"]
end

subgraph group_models["Audit Data"]
  node_config["Scan Config<br/>[scan_config.py]"]
  node_findings["Scored Findings<br/>[scored_finding.py]"]
  node_flowmodels["Flow Models<br/>[flow_graph.py]"]
  node_graphmodels["Graph Models<br/>[graph.py]"]
end

subgraph group_outputs["Reports and Evidence"]
  node_reporter["Report Generation<br/>[reporter.py]"]
  node_graphbuilder["Flow Graph Builder<br/>[graph_builder.py]"]
  node_visualizer["Flow Visualizer<br/>[template.py]"]
  node_evidence["Evidence Locker<br/>[evidence_locker.py]"]
  node_exports["Report Exporters"]
end

subgraph group_extensions["Optional Capabilities"]
  node_consent["Consent Auditor<br/>[auditor.py]"]
  node_dast["DAST Probe<br/>[prober.py]"]
  node_patch["Patch Generator<br/>[patcher.py]"]
  node_ai["Local AI<br/>[client.py]"]
end

node_user(("Auditor"))

node_user -->|"runs scan"| node_cli
node_user -->|"starts audit"| node_desktop
node_cli -->|"invokes"| node_runner
node_desktop -->|"starts worker"| node_worker
node_worker -->|"runs pipeline"| node_runner
node_runner -->|"uses config"| node_config
node_runner -->|"runs stage"| node_ingest
node_cli -->|"ingests remote"| node_git
node_runner -->|"runs stage"| node_parse
node_parse -->|"reads manifest"| node_ingest
node_runner -->|"runs detection"| node_detect
node_runner -->|"builds inventory"| node_capability
node_runner -->|"runs stage"| node_evaluate
node_evaluate -->|"loads rules"| node_rules
node_runner -->|"runs stage"| node_classify
node_classify -->|"produces bundle"| node_findings
node_detect -->|"produces flows"| node_flowmodels
node_runner -->|"generates reports"| node_reporter
node_reporter -->|"builds flow graph"| node_graphbuilder
node_graphbuilder -->|"creates graph"| node_graphmodels
node_reporter -->|"renders visualization"| node_visualizer
node_visualizer -->|"renders graph data"| node_graphmodels
node_reporter -->|"locks evidence"| node_evidence
node_reporter -->|"writes formats"| node_exports
node_reporter -.->|"audits consent"| node_consent
node_reporter -.->|"drafts patches"| node_patch
node_runner -.->|"optional probing"| node_dast
node_runner -.->|"optional triage"| node_ai

click node_cli "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/cli/main.py"
click node_desktop "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/gui/main_window.py"
click node_worker "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/gui/async_runner/scan_worker.py"
click node_config "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/scan_config.py"
click node_runner "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/runner.py"
click node_ingest "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage1_ingest/ingestor.py"
click node_git "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/utils/git_ingest.py"
click node_parse "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage2_parse/parser.py"
click node_detect "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage3_detect/pii_detector.py"
click node_capability "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage3_detect/capability_detector.py"
click node_evaluate "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage4_evaluate/evaluator.py"
click node_rules "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage4_evaluate/rule_loader.py"
click node_classify "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage5_classify/classifier.py"
click node_findings "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/scored_finding.py"
click node_flowmodels "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/flow_graph.py"
click node_graphmodels "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/graph.py"
click node_reporter "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/reporter.py"
click node_graphbuilder "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/graph_builder.py"
click node_visualizer "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/visualizer/template.py"
click node_evidence "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/evidence_locker.py"
click node_exports "https://github.com/lazydeveloper9/dpdp/tree/main/cs01/cs01/pipeline/stage6_report"
click node_consent "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/consent_auditor/auditor.py"
click node_dast "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/dast_prober/prober.py"
click node_patch "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/patch_generator/patcher.py"
click node_ai "https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/ai/client.py"

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_cli,node_desktop,node_worker toneBlue
class node_runner,node_ingest,node_git,node_parse,node_detect,node_capability,node_evaluate,node_rules,node_classify toneAmber
class node_config,node_findings,node_flowmodels,node_graphmodels toneMint
class node_reporter,node_graphbuilder,node_visualizer,node_evidence,node_exports toneRose
class node_consent,node_dast,node_patch,node_ai,node_user toneIndigo
```

## Components

### User Entry

- [CLI](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/cli/main.py): `cs01/cs01/cli/main.py`
- [Desktop GUI](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/gui/main_window.py): `cs01/cs01/gui/main_window.py`
- [Scan Worker](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/gui/async_runner/scan_worker.py): `cs01/cs01/gui/async_runner/scan_worker.py`

### Audit Pipeline

- [Pipeline Runner](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/runner.py): `cs01/cs01/pipeline/runner.py`
- [Repository Ingest](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage1_ingest/ingestor.py): `cs01/cs01/pipeline/stage1_ingest/ingestor.py`
- [Git Ingest](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/utils/git_ingest.py): `cs01/cs01/utils/git_ingest.py`
- [Polyglot Parsing](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage2_parse/parser.py): `cs01/cs01/pipeline/stage2_parse/parser.py`
- [PII Detection](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage3_detect/pii_detector.py): `cs01/cs01/pipeline/stage3_detect/pii_detector.py`
- [Capability Inventory](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage3_detect/capability_detector.py): `cs01/cs01/pipeline/stage3_detect/capability_detector.py`
- [Rule Evaluation](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage4_evaluate/evaluator.py): `cs01/cs01/pipeline/stage4_evaluate/evaluator.py`
- [Rule Loading](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage4_evaluate/rule_loader.py): `cs01/cs01/pipeline/stage4_evaluate/rule_loader.py`
- [Finding Classification](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage5_classify/classifier.py): `cs01/cs01/pipeline/stage5_classify/classifier.py`

### Audit Data

- [Scan Config](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/scan_config.py): `cs01/cs01/models/scan_config.py`
- [Scored Findings](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/scored_finding.py): `cs01/cs01/models/scored_finding.py`
- [Flow Models](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/flow_graph.py): `cs01/cs01/models/flow_graph.py`
- [Graph Models](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/models/graph.py): `cs01/cs01/models/graph.py`

### Reports and Evidence

- [Report Generation](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/reporter.py): `cs01/cs01/pipeline/stage6_report/reporter.py`
- [Flow Graph Builder](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/graph_builder.py): `cs01/cs01/pipeline/stage6_report/graph_builder.py`
- [Flow Visualizer](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/visualizer/template.py): `cs01/cs01/pipeline/stage6_report/visualizer/template.py`
- [Evidence Locker](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/pipeline/stage6_report/evidence_locker.py): `cs01/cs01/pipeline/stage6_report/evidence_locker.py`
- [Report Exporters](https://github.com/lazydeveloper9/dpdp/tree/main/cs01/cs01/pipeline/stage6_report): `cs01/cs01/pipeline/stage6_report`

### Optional Capabilities

- [Consent Auditor](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/consent_auditor/auditor.py): `cs01/cs01/bonus/consent_auditor/auditor.py`
- [DAST Probe](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/dast_prober/prober.py): `cs01/cs01/bonus/dast_prober/prober.py`
- [Patch Generator](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/bonus/patch_generator/patcher.py): `cs01/cs01/bonus/patch_generator/patcher.py`
- [Local AI](https://github.com/lazydeveloper9/dpdp/blob/main/cs01/cs01/ai/client.py): `cs01/cs01/ai/client.py`

### Other components

- **Auditor**

## Connections

- Auditor → CLI: runs scan
- Auditor → Desktop GUI: starts audit
- CLI → Pipeline Runner: invokes (evidence: `cs01/cs01/cli/main.py`)
- Desktop GUI → Scan Worker: starts worker (evidence: `cs01/cs01/gui/async_runner/scan_worker.py`)
- Scan Worker → Pipeline Runner: runs pipeline (evidence: `cs01/cs01/pipeline/runner.py`)
- Pipeline Runner → Scan Config: uses config (evidence: `cs01/cs01/pipeline/runner.py`)
- Pipeline Runner → Repository Ingest: runs stage (evidence: `cs01/cs01/pipeline/runner.py`)
- CLI → Git Ingest: ingests remote (evidence: `cs01/cs01/cli/main.py`)
- Pipeline Runner → Polyglot Parsing: runs stage (evidence: `cs01/cs01/pipeline/runner.py`)
- Polyglot Parsing → Repository Ingest: reads manifest (evidence: `cs01/cs01/pipeline/stage2_parse/parser.py`)
- Pipeline Runner → PII Detection: runs detection (evidence: `cs01/cs01/pipeline/runner.py`)
- Pipeline Runner → Capability Inventory: builds inventory (evidence: `cs01/cs01/pipeline/runner.py`)
- Pipeline Runner → Rule Evaluation: runs stage (evidence: `cs01/cs01/pipeline/runner.py`)
- Rule Evaluation → Rule Loading: loads rules (evidence: `cs01/cs01/pipeline/stage4_evaluate/evaluator.py`)
- Pipeline Runner → Finding Classification: runs stage (evidence: `cs01/cs01/pipeline/runner.py`)
- Finding Classification → Scored Findings: produces bundle (evidence: `cs01/cs01/pipeline/stage5_classify/classifier.py`)
- PII Detection → Flow Models: produces flows
- Pipeline Runner → Report Generation: generates reports (evidence: `cs01/cs01/pipeline/runner.py`)
- Report Generation → Flow Graph Builder: builds flow graph (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Flow Graph Builder → Graph Models: creates graph (evidence: `cs01/cs01/pipeline/stage6_report/graph_builder.py`)
- Report Generation → Flow Visualizer: renders visualization (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Flow Visualizer → Graph Models: renders graph data (evidence: `cs01/cs01/pipeline/stage6_report/visualizer/template.py`)
- Report Generation → Evidence Locker: locks evidence (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Report Generation → Report Exporters: writes formats (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Report Generation → Consent Auditor: audits consent (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Report Generation → Patch Generator: drafts patches (evidence: `cs01/cs01/pipeline/stage6_report/reporter.py`)
- Pipeline Runner → DAST Probe: optional probing
- Pipeline Runner → Local AI: optional triage
