# z0o0p/0identity architecture

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

- Interactive diagram: https://gitdiagram.com/z0o0p/0identity
- Repository: https://github.com/z0o0p/0identity

## Overview

0identity is a browser-session assessment tool that separately estimates human likelihood and anonymous-subject continuity. Its main workflow collects browser signals, submits live assessments through the Worker, scores them, and stores the result for history and dashboard inspection. A separate simulator creates profile-based sessions; an investigation agent explains stored evidence but does not score or alter results. The graph follows documented capabilities and indexed source references; some UI-to-API wiring and unsampled implementation details are not shown, so those links are omitted or marked unverified.

Main entry points: [`src/api/assess.ts`](https://github.com/z0o0p/0identity/blob/main/src/api/assess.ts) (Assessment API), [`src/worker/index.ts`](https://github.com/z0o0p/0identity/blob/main/src/worker/index.ts) (API Worker), [`src/browser/collector.ts`](https://github.com/z0o0p/0identity/blob/main/src/browser/collector.ts) (Signal collector), [`web/App.tsx`](https://github.com/z0o0p/0identity/blob/main/web/App.tsx) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_app["Web app<br/>[App.tsx]"]
  node_collector["Signal collector<br/>[collector.ts]"]
  node_browser["Browser runtime<br/>[runtime.ts]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_simulator_ui["Simulator UI<br/>[Simulator.tsx]"]
end

subgraph group_signals["Assessment pipeline"]
  node_signal_schema["Signal validation<br/>[schema.ts]"]
  node_normalization["Signal normalization<br/>[normalize.ts]"]
  node_assessment_api["Assessment API<br/>[assess.ts]"]
  node_human_score["Human scoring<br/>[human.ts]"]
end

subgraph group_history["Identity and history"]
  node_identity["Identity matching<br/>[match.ts]"]
  node_repository[("Assessment repository")]
  node_history_service["Durable history"]
end

subgraph group_service["Worker and investigation"]
  node_worker["API Worker<br/>[index.ts]"]
  node_simulation_api["Simulation API<br/>[simulation.ts]"]
  node_investigation["Investigation agent"]
  node_history_api["History API<br/>[history.ts]"]
end

node_user(("Developer"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_simulator_ui
node_collector -->|"uses"| node_browser
node_collector -->|"produces"| node_signal_schema
node_assessment_api -->|"validates"| node_signal_schema
node_assessment_api -->|"normalizes"| node_normalization
node_assessment_api -->|"scores"| node_human_score
node_worker -->|"routes assessment"| node_assessment_api
node_worker -->|"routes simulation"| node_simulation_api
node_worker -->|"persists and reads"| node_history_service
node_history_service -->|"dispatches"| node_repository
node_repository -->|"matches subjects"| node_identity
node_repository -->|"normalizes stored signals"| node_normalization
node_dashboard -->|"reads history"| node_history_api
node_dashboard -.->|"offers evidence chat"| node_investigation
node_investigation -->|"examines evidence"| node_history_api
node_simulator_ui -.->|"submits profiles"| node_simulation_api
node_collector -.->|"submits signals"| node_worker

click node_app "https://github.com/z0o0p/0identity/blob/main/web/App.tsx"
click node_collector "https://github.com/z0o0p/0identity/blob/main/src/browser/collector.ts"
click node_browser "https://github.com/z0o0p/0identity/blob/main/src/browser/runtime.ts"
click node_dashboard "https://github.com/z0o0p/0identity/blob/main/web/components/Dashboard.tsx"
click node_simulator_ui "https://github.com/z0o0p/0identity/blob/main/web/components/Simulator.tsx"
click node_signal_schema "https://github.com/z0o0p/0identity/blob/main/src/signals/schema.ts"
click node_normalization "https://github.com/z0o0p/0identity/blob/main/src/signals/normalize.ts"
click node_assessment_api "https://github.com/z0o0p/0identity/blob/main/src/api/assess.ts"
click node_human_score "https://github.com/z0o0p/0identity/blob/main/src/scoring/human.ts"
click node_identity "https://github.com/z0o0p/0identity/blob/main/src/identity/match.ts"
click node_repository "https://github.com/z0o0p/0identity/blob/main/src/storage/sql-assessment-repository.ts"
click node_history_service "https://github.com/z0o0p/0identity/blob/main/src/storage/durable-history-service.ts"
click node_worker "https://github.com/z0o0p/0identity/blob/main/src/worker/index.ts"
click node_simulation_api "https://github.com/z0o0p/0identity/blob/main/src/api/simulation.ts"
click node_investigation "https://github.com/z0o0p/0identity/blob/main/src/agents/investigation-agent.ts"
click node_history_api "https://github.com/z0o0p/0identity/blob/main/src/api/history.ts"

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_collector,node_browser,node_dashboard,node_simulator_ui toneBlue
class node_signal_schema,node_normalization,node_assessment_api,node_human_score toneAmber
class node_identity,node_repository,node_history_service toneMint
class node_worker,node_simulation_api,node_investigation,node_history_api toneRose
class node_user toneIndigo
```

## Components

### Browser experience

- [Web app](https://github.com/z0o0p/0identity/blob/main/web/App.tsx): `web/App.tsx`
- [Signal collector](https://github.com/z0o0p/0identity/blob/main/src/browser/collector.ts): `src/browser/collector.ts`
- [Browser runtime](https://github.com/z0o0p/0identity/blob/main/src/browser/runtime.ts): `src/browser/runtime.ts`
- [Dashboard](https://github.com/z0o0p/0identity/blob/main/web/components/Dashboard.tsx): `web/components/Dashboard.tsx`
- [Simulator UI](https://github.com/z0o0p/0identity/blob/main/web/components/Simulator.tsx): `web/components/Simulator.tsx`

### Assessment pipeline

- [Signal validation](https://github.com/z0o0p/0identity/blob/main/src/signals/schema.ts): `src/signals/schema.ts`
- [Signal normalization](https://github.com/z0o0p/0identity/blob/main/src/signals/normalize.ts): `src/signals/normalize.ts`
- [Assessment API](https://github.com/z0o0p/0identity/blob/main/src/api/assess.ts): `src/api/assess.ts`
- [Human scoring](https://github.com/z0o0p/0identity/blob/main/src/scoring/human.ts): `src/scoring/human.ts`

### Identity and history

- [Identity matching](https://github.com/z0o0p/0identity/blob/main/src/identity/match.ts): `src/identity/match.ts`
- [Assessment repository](https://github.com/z0o0p/0identity/blob/main/src/storage/sql-assessment-repository.ts): `src/storage/sql-assessment-repository.ts`
- [Durable history](https://github.com/z0o0p/0identity/blob/main/src/storage/durable-history-service.ts): `src/storage/durable-history-service.ts`

### Worker and investigation

- [API Worker](https://github.com/z0o0p/0identity/blob/main/src/worker/index.ts): `src/worker/index.ts`
- [Simulation API](https://github.com/z0o0p/0identity/blob/main/src/api/simulation.ts): `src/api/simulation.ts`
- [Investigation agent](https://github.com/z0o0p/0identity/blob/main/src/agents/investigation-agent.ts): `src/agents/investigation-agent.ts`
- [History API](https://github.com/z0o0p/0identity/blob/main/src/api/history.ts): `src/api/history.ts`

### Other components

- **Developer**

## Connections

- Developer → Web app: uses (evidence: `web/App.tsx`)
- Web app → Dashboard: renders (evidence: `web/App.tsx`)
- Web app → Simulator UI: renders (evidence: `web/App.tsx`)
- Signal collector → Browser runtime: uses (evidence: `src/browser/collector.ts`)
- Signal collector → Signal validation: produces (evidence: `src/browser/collector.ts`)
- Assessment API → Signal validation: validates (evidence: `src/api/assess.ts`)
- Assessment API → Signal normalization: normalizes (evidence: `src/api/assess.ts`)
- Assessment API → Human scoring: scores (evidence: `src/api/assess.ts`)
- API Worker → Assessment API: routes assessment (evidence: `src/worker/index.ts`)
- API Worker → Simulation API: routes simulation (evidence: `src/worker/index.ts`)
- API Worker → Durable history: persists and reads (evidence: `src/worker/index.ts`)
- Durable history → Assessment repository: dispatches (evidence: `src/storage/durable-history-service.ts`)
- Assessment repository → Identity matching: matches subjects (evidence: `src/storage/sql-assessment-repository.ts`)
- Assessment repository → Signal normalization: normalizes stored signals (evidence: `src/storage/sql-assessment-repository.ts`)
- Dashboard → History API: reads history (evidence: `web/components/Dashboard.tsx`)
- Dashboard → Investigation agent: offers evidence chat (evidence: `web/components/Dashboard.tsx`)
- Investigation agent → History API: examines evidence (evidence: `src/agents/investigation-agent.ts`)
- Simulator UI → Simulation API: submits profiles
- Signal collector → API Worker: submits signals
