# marvel-kabego-dev/docproof architecture

> Architecture diagram of the GitHub repository marvel-kabego-dev/docproof, 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/marvel-kabego-dev/docproof
- Repository: https://github.com/marvel-kabego-dev/docproof

## Overview

DocProof checks whether documentation claims match repository evidence, then presents contracts, evidence, fixes, approval/rejection, re-verification, and trust scores. The README describes the current frontend as deterministic mock data, while the tree also contains a FastAPI backend and the frontend API client is prepared for it. The backend pipeline excerpt supports the verification-to-fix-to-reverification flow; unsampled API-handler wiring is therefore not inferred.

Main entry points: [`backend/app/orchestration/pipeline.py`](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/pipeline.py) (Full pipeline), [`backend/app/verification/verification_pipeline.py`](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/verification_pipeline.py) (Config verifier), [`backend/app/main.py`](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/main.py) (FastAPI app), [`frontend/src/App.tsx`](https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/App.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App routes<br/>[App.tsx]"]
  node_contracts_ctx["Contracts state"]
  node_api_client["API client<br/>[client.ts]"]
  node_contract_pages["Review pages"]
end

subgraph group_backend["Backend API"]
  node_backend_app["FastAPI app<br/>[main.py]"]
  node_api_routes["API routers"]
end

subgraph group_verification["Verification pipeline"]
  node_pipeline["Full pipeline<br/>[pipeline.py]"]
  node_agents["Verification agents"]
  node_config_pipeline["Config verifier"]
  node_doc_parser["Claim parser<br/>[doc_parser.py]"]
  node_config_verifier["Config checks<br/>[config_verifier.py]"]
  node_evidence["Contract evidence"]
  node_fix_agent["Fix generation<br/>[fix_agent.py]"]
  node_reverify_agent["Reverification"]
end

subgraph group_state["State and reporting"]
  node_trust["Trust scoring<br/>[trust_score.py]"]
  node_repository["Storage facade<br/>[repository.py]"]
  node_memory_db[("In-memory store<br/>[db.py]")]
  node_history_db[("History store<br/>[history_db.py]")]
end

node_user(("Developer"))
node_target_repo["Analysed repository"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_contract_pages
node_contract_pages -->|"reads state"| node_contracts_ctx
node_contracts_ctx -->|"requests data"| node_api_client
node_api_client -.->|"HTTP requests"| node_backend_app
node_backend_app -->|"mounts routers"| node_api_routes
node_pipeline -->|"runs checks"| node_agents
node_pipeline -->|"generates fixes"| node_fix_agent
node_pipeline -->|"re-runs checks"| node_reverify_agent
node_pipeline -->|"scores results"| node_trust
node_config_pipeline -->|"extracts claims"| node_doc_parser
node_config_pipeline -->|"checks claims"| node_config_verifier
node_config_pipeline -->|"builds contracts"| node_evidence
node_config_pipeline -->|"scores contracts"| node_trust
node_agents -->|"checks evidence"| node_target_repo
node_repository -->|"reads and writes"| node_memory_db
node_backend_app -->|"resets on startup"| node_memory_db

click node_app "https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/App.tsx"
click node_contracts_ctx "https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/context/ContractsContext.tsx"
click node_api_client "https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/api/client.ts"
click node_contract_pages "https://github.com/marvel-kabego-dev/docproof/tree/main/frontend/src/pages"
click node_backend_app "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/main.py"
click node_api_routes "https://github.com/marvel-kabego-dev/docproof/tree/main/backend/app/api"
click node_pipeline "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/pipeline.py"
click node_agents "https://github.com/marvel-kabego-dev/docproof/tree/main/backend/app/orchestration/subagents"
click node_config_pipeline "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/verification_pipeline.py"
click node_doc_parser "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/doc_parser.py"
click node_config_verifier "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/config_verifier.py"
click node_evidence "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/evidence_builder.py"
click node_fix_agent "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/subagents/fix_agent.py"
click node_reverify_agent "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/subagents/reverification_agent.py"
click node_trust "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/trust_score.py"
click node_repository "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/repository.py"
click node_memory_db "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/db.py"
click node_history_db "https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/history_db.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_app,node_contracts_ctx,node_api_client,node_contract_pages toneBlue
class node_backend_app,node_api_routes toneAmber
class node_pipeline,node_agents,node_config_pipeline,node_doc_parser,node_config_verifier,node_evidence,node_fix_agent,node_reverify_agent toneMint
class node_trust,node_repository,node_memory_db,node_history_db toneRose
class node_user,node_target_repo toneIndigo
```

## Components

### Frontend experience

- [App routes](https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Contracts state](https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/context/ContractsContext.tsx): `frontend/src/context/ContractsContext.tsx`
- [API client](https://github.com/marvel-kabego-dev/docproof/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Review pages](https://github.com/marvel-kabego-dev/docproof/tree/main/frontend/src/pages): `frontend/src/pages`

### Backend API

- [FastAPI app](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routers](https://github.com/marvel-kabego-dev/docproof/tree/main/backend/app/api): `backend/app/api`

### Verification pipeline

- [Full pipeline](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/pipeline.py): `backend/app/orchestration/pipeline.py`
- [Verification agents](https://github.com/marvel-kabego-dev/docproof/tree/main/backend/app/orchestration/subagents): `backend/app/orchestration/subagents`
- [Config verifier](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/verification_pipeline.py): `backend/app/verification/verification_pipeline.py`
- [Claim parser](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/doc_parser.py): `backend/app/verification/doc_parser.py`
- [Config checks](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/config_verifier.py): `backend/app/verification/config_verifier.py`
- [Contract evidence](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/evidence_builder.py): `backend/app/verification/evidence_builder.py`
- [Fix generation](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/subagents/fix_agent.py): `backend/app/orchestration/subagents/fix_agent.py`
- [Reverification](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/orchestration/subagents/reverification_agent.py): `backend/app/orchestration/subagents/reverification_agent.py`

### State and reporting

- [Trust scoring](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/verification/trust_score.py): `backend/app/verification/trust_score.py`
- [Storage facade](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/repository.py): `backend/app/storage/repository.py`
- [In-memory store](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/db.py): `backend/app/storage/db.py`
- [History store](https://github.com/marvel-kabego-dev/docproof/blob/main/backend/app/storage/history_db.py): `backend/app/storage/history_db.py`

### Other components

- **Developer**
- **Analysed repository**

## Connections

- Developer → App routes: uses
- App routes → Review pages: routes to
- Review pages → Contracts state: reads state
- Contracts state → API client: requests data
- API client → FastAPI app: HTTP requests
- FastAPI app → API routers: mounts routers
- Full pipeline → Verification agents: runs checks
- Full pipeline → Fix generation: generates fixes
- Full pipeline → Reverification: re-runs checks
- Full pipeline → Trust scoring: scores results
- Config verifier → Claim parser: extracts claims
- Config verifier → Config checks: checks claims
- Config verifier → Contract evidence: builds contracts
- Config verifier → Trust scoring: scores contracts
- Verification agents → Analysed repository: checks evidence
- Storage facade → In-memory store: reads and writes
- FastAPI app → In-memory store: resets on startup
