# dhruv-techdev/continuum architecture

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

- Interactive diagram: https://gitdiagram.com/dhruv-techdev/continuum
- Repository: https://github.com/dhruv-techdev/continuum

## Overview

Continuum is a local-first platform for preserving AI-work transcripts and carrying their state into a fresh session. Its documented available workflow imports transcripts into canonical events, appends them to a per-session ledger, verifies ledger integrity, extracts evidence-linked working state, and generates layered bootstrap context. The graph also preserves major documented planned capabilities. Source evidence is partial; edges without direct source excerpts rely on the README’s workflow description, and planned integrations are marked optional.

Main entry points: [`packages/cli/src/index.ts`](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/index.ts) (Continuum CLI), [`packages/core/src/ledger/event-ledger.ts`](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/ledger/event-ledger.ts) (Append-only Ledger), [`packages/core/src/state-engine/persistence.ts`](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/persistence.ts) (Working State), [`packages/core/src/dashboard/index.ts`](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/dashboard/index.ts) (Dashboard Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and Workspace"]
  node_cli["Continuum CLI<br/>[index.ts]"]
  node_workspace["Local Workspace<br/>[workspace.ts]"]
  node_projects["Projects and Sessions"]
  node_importcmd["Transcript Import<br/>[import.ts]"]
  node_capturecmd["Capture Command<br/>[capture.ts]"]
  node_statecmd["State Command<br/>[state.ts]"]
end

subgraph group_record["Event Recording"]
  node_parsers["JSON and Markdown Parsers"]
  node_adapters["Provider Adapters"]
  node_events["Canonical Events<br/>[types.ts]"]
  node_ledger[("Append-only Ledger<br/>[event-ledger.ts]")]
  node_integrity["Ledger Integrity<br/>[validation.ts]"]
  node_capture["Live Capture<br/>[ingest.ts]"]
end

subgraph group_state["State and Context"]
  node_stateextract["State Extraction<br/>[extractor.ts]"]
  node_workingstate[("Working State<br/>[persistence.ts]")]
  node_tracking["Tasks, Decisions, Attempts"]
  node_bootstrap["Layered Bootstrap<br/>[bootstrap.ts]"]
  node_context["Context Builder<br/>[builder.ts]"]
end

subgraph group_extensions["Planned Extensions"]
  node_verifycmd["Transfer Verification<br/>[verify.ts]"]
  node_verification["Verification and Repair"]
  node_capsulecmd["Capsule Commands<br/>[capsule.ts]"]
  node_capsules["Portable Capsules"]
  node_search["Search and Retrieval"]
  node_mcp["MCP Tools and Server<br/>[tools.ts]"]
  node_dashboard["Dashboard Data<br/>[index.ts]"]
end

node_user(("Engineer"))
node_freshsession(("Fresh AI Session"))

node_user -->|"runs commands"| node_cli
node_cli -->|"initializes"| node_workspace
node_cli -->|"creates sessions"| node_projects
node_cli -->|"invokes import"| node_importcmd
node_importcmd -->|"parses transcript"| node_parsers
node_parsers -->|"normalizes events"| node_events
node_adapters -.->|"maps provider data"| node_events
node_events -->|"appends events"| node_ledger
node_ledger -->|"verifies events"| node_integrity
node_cli -->|"invokes capture"| node_capturecmd
node_capturecmd -.->|"ingests input"| node_capture
node_capture -->|"appends events"| node_ledger
node_ledger -->|"supplies events"| node_stateextract
node_stateextract -->|"derives state"| node_workingstate
node_cli -->|"invokes state"| node_statecmd
node_statecmd -->|"refreshes state"| node_workingstate
node_workingstate -->|"provides state"| node_bootstrap
node_workingstate -.->|"records work items"| node_tracking
node_statecmd -->|"generates context"| node_bootstrap
node_bootstrap -->|"orients session"| node_freshsession
node_cli -->|"invokes verification"| node_verifycmd
node_verifycmd -.->|"runs checks"| node_verification
node_cli -->|"invokes capsules"| node_capsulecmd
node_capsulecmd -.->|"exports or imports"| node_capsules
node_mcp -->|"builds context"| node_context
node_mcp -->|"queries index"| node_search
node_dashboard -->|"reads events"| node_ledger
node_dashboard -->|"reads state"| node_workingstate
node_dashboard -->|"reads tasks"| node_tracking

click node_cli "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/index.ts"
click node_workspace "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/workspace.ts"
click node_projects "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/projects"
click node_importcmd "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/import.ts"
click node_parsers "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/import"
click node_adapters "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/adapters"
click node_events "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/events/types.ts"
click node_ledger "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/ledger/event-ledger.ts"
click node_integrity "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/events/validation.ts"
click node_capture "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/capture/ingest.ts"
click node_capturecmd "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/capture.ts"
click node_stateextract "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/extractor.ts"
click node_workingstate "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/persistence.ts"
click node_tracking "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/tracking"
click node_bootstrap "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/bootstrap.ts"
click node_context "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/context/builder.ts"
click node_statecmd "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/state.ts"
click node_verifycmd "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/verify.ts"
click node_verification "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/verification"
click node_capsulecmd "https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/capsule.ts"
click node_capsules "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/capsule"
click node_search "https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/db"
click node_mcp "https://github.com/dhruv-techdev/continuum/blob/main/packages/mcp/src/tools.ts"
click node_dashboard "https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/dashboard/index.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_cli,node_workspace,node_projects,node_importcmd,node_capturecmd,node_statecmd toneBlue
class node_parsers,node_adapters,node_events,node_ledger,node_integrity,node_capture toneAmber
class node_stateextract,node_workingstate,node_tracking,node_bootstrap,node_context toneMint
class node_verifycmd,node_verification,node_capsulecmd,node_capsules,node_search,node_mcp,node_dashboard toneRose
class node_user,node_freshsession toneIndigo
```

## Components

### CLI and Workspace

- [Continuum CLI](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/index.ts): `packages/cli/src/index.ts`
- [Local Workspace](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/workspace.ts): `packages/core/src/workspace.ts`
- [Projects and Sessions](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/projects): `packages/core/src/projects`
- [Transcript Import](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/import.ts): `packages/cli/src/commands/import.ts`
- [Capture Command](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/capture.ts): `packages/cli/src/commands/capture.ts`
- [State Command](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/state.ts): `packages/cli/src/commands/state.ts`

### Event Recording

- [JSON and Markdown Parsers](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/import): `packages/core/src/import`
- [Provider Adapters](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/adapters): `packages/core/src/adapters`
- [Canonical Events](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/events/types.ts): `packages/core/src/events/types.ts`
- [Append-only Ledger](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/ledger/event-ledger.ts): `packages/core/src/ledger/event-ledger.ts`
- [Ledger Integrity](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/events/validation.ts): `packages/core/src/events/validation.ts`
- [Live Capture](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/capture/ingest.ts): `packages/core/src/capture/ingest.ts`

### State and Context

- [State Extraction](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/extractor.ts): `packages/core/src/state-engine/extractor.ts`
- [Working State](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/persistence.ts): `packages/core/src/state-engine/persistence.ts`
- [Tasks, Decisions, Attempts](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/tracking): `packages/core/src/tracking`
- [Layered Bootstrap](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/state-engine/bootstrap.ts): `packages/core/src/state-engine/bootstrap.ts`
- [Context Builder](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/context/builder.ts): `packages/core/src/context/builder.ts`

### Planned Extensions

- [Transfer Verification](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/verify.ts): `packages/cli/src/commands/verify.ts`
- [Verification and Repair](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/verification): `packages/core/src/verification`
- [Capsule Commands](https://github.com/dhruv-techdev/continuum/blob/main/packages/cli/src/commands/capsule.ts): `packages/cli/src/commands/capsule.ts`
- [Portable Capsules](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/capsule): `packages/core/src/capsule`
- [Search and Retrieval](https://github.com/dhruv-techdev/continuum/tree/main/packages/core/src/db): `packages/core/src/db`
- [MCP Tools and Server](https://github.com/dhruv-techdev/continuum/blob/main/packages/mcp/src/tools.ts): `packages/mcp/src/tools.ts`
- [Dashboard Data](https://github.com/dhruv-techdev/continuum/blob/main/packages/core/src/dashboard/index.ts): `packages/core/src/dashboard/index.ts`

### Other components

- **Engineer**
- **Fresh AI Session**

## Connections

- Engineer → Continuum CLI: runs commands (evidence: `README.md`)
- Continuum CLI → Local Workspace: initializes (evidence: `README.md`)
- Continuum CLI → Projects and Sessions: creates sessions (evidence: `README.md`)
- Continuum CLI → Transcript Import: invokes import (evidence: `packages/cli/src/index.ts`)
- Transcript Import → JSON and Markdown Parsers: parses transcript (evidence: `README.md`)
- JSON and Markdown Parsers → Canonical Events: normalizes events (evidence: `README.md`)
- Provider Adapters → Canonical Events: maps provider data (evidence: `packages/core/src/adapters/coverage.ts`)
- Canonical Events → Append-only Ledger: appends events (evidence: `README.md`)
- Append-only Ledger → Ledger Integrity: verifies events (evidence: `packages/core/src/ledger/event-ledger.ts`)
- Continuum CLI → Capture Command: invokes capture (evidence: `packages/cli/src/index.ts`)
- Capture Command → Live Capture: ingests input
- Live Capture → Append-only Ledger: appends events (evidence: `packages/core/src/capture/ingest.ts`)
- Append-only Ledger → State Extraction: supplies events (evidence: `README.md`)
- State Extraction → Working State: derives state (evidence: `README.md`)
- Continuum CLI → State Command: invokes state (evidence: `packages/cli/src/index.ts`)
- State Command → Working State: refreshes state (evidence: `README.md`)
- Working State → Layered Bootstrap: provides state (evidence: `README.md`)
- Working State → Tasks, Decisions, Attempts: records work items
- State Command → Layered Bootstrap: generates context (evidence: `README.md`)
- Layered Bootstrap → Fresh AI Session: orients session (evidence: `README.md`)
- Continuum CLI → Transfer Verification: invokes verification (evidence: `packages/cli/src/index.ts`)
- Transfer Verification → Verification and Repair: runs checks
- Continuum CLI → Capsule Commands: invokes capsules (evidence: `packages/cli/src/index.ts`)
- Capsule Commands → Portable Capsules: exports or imports
- MCP Tools and Server → Context Builder: builds context (evidence: `packages/mcp/src/tools.ts`)
- MCP Tools and Server → Search and Retrieval: queries index (evidence: `packages/mcp/src/tools.ts`)
- Dashboard Data → Append-only Ledger: reads events (evidence: `packages/core/src/dashboard/index.ts`)
- Dashboard Data → Working State: reads state (evidence: `packages/core/src/dashboard/index.ts`)
- Dashboard Data → Tasks, Decisions, Attempts: reads tasks (evidence: `packages/core/src/dashboard/index.ts`)
