# pattty847/copenet architecture

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

- Interactive diagram: https://gitdiagram.com/pattty847/copenet
- Repository: https://github.com/pattty847/copenet

## Overview

CopeNet is a local operator workspace for persistent agent sessions, market research, and inspection of runtime evidence. The main workflow runs from an operator’s chat or workspace action through the UI and RPC host into orchestration, which coordinates provider calls and tools, then streams results while retaining session history and run evidence. Separate branches support market monitoring, fleet research, media ingestion, messaging, and repeatable workflow surfaces. The README documents these capabilities; sampled source confirms selected runtime behaviors, but not every subsystem’s wiring, so uncertain connections are omitted.

Main entry points: [`src/copenet/core/orchestrator/runtime.py`](https://github.com/pattty847/copenet/blob/main/src/copenet/core/orchestrator/runtime.py) (Run orchestrator), [`src/copenet/host/rpc_routes.py`](https://github.com/pattty847/copenet/blob/main/src/copenet/host/rpc_routes.py) (RPC host), [`src/copenet/core/market/runtime.py`](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/runtime.py) (Market services), [`src/copenet/core/harness/tool_loop.py`](https://github.com/pattty847/copenet/blob/main/src/copenet/core/harness/tool_loop.py) (Provider harness)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator_ui["Operator interface"]
  node_frontend["Workspace UI<br/>[App.tsx]"]
  node_rpc_host["RPC host<br/>[rpc_routes.py]"]
  node_client["WebSocket client<br/>[client.py]"]
end

subgraph group_agent_runtime["Agent runtime"]
  node_orchestrator["Run orchestrator<br/>[runtime.py]"]
  node_harness["Provider harness<br/>[tool_loop.py]"]
  node_tools["Tool registry<br/>[registry.py]"]
end

subgraph group_continuity["Continuity and control"]
  node_sessions[("Session history")]
  node_run_evidence[("Run evidence<br/>[store.py]")]
  node_persona["Persona context<br/>[service.py]"]
  node_permissions[("Access control<br/>[store.py]")]
  node_memory["User memory<br/>[service.py]"]
end

subgraph group_market["Market research"]
  node_market_runtime["Market services<br/>[runtime.py]"]
  node_market_data["Market data<br/>[data_sources.py]"]
  node_market_brief["Market brief<br/>[brief.py]"]
  node_forecasts[("Forecast ledger<br/>[ledger.py]")]
  node_alerts["Price alerts<br/>[alert_engine.py]"]
end

subgraph group_integrations["Product capabilities"]
  node_fleet["Fleet rooms<br/>[coordinator.py]"]
  node_media["Media ingestion<br/>[service.py]"]
  node_messaging["Message delivery"]
  node_meme["Meme Lab"]
  node_workspace_intel["Workspace intelligence<br/>[service.py]"]
end

node_operator(("Operator"))
node_providers["Model providers"]
node_market_integrations["Market integrations"]

node_operator -->|"uses"| node_frontend
node_frontend -->|"sends RPC"| node_rpc_host
node_client -->|"sends RPC"| node_rpc_host
node_rpc_host -->|"dispatches runs"| node_orchestrator
node_orchestrator -->|"runs turns"| node_harness
node_harness -->|"requests completion"| node_providers
node_harness -->|"dispatches tools"| node_tools
node_orchestrator -->|"persists transcripts"| node_sessions
node_orchestrator -->|"records runs"| node_run_evidence
node_orchestrator -->|"resolves context"| node_persona
node_orchestrator -->|"checks access"| node_permissions
node_rpc_host -->|"dispatches fleet actions"| node_fleet
node_rpc_host -->|"dispatches market actions"| node_market_runtime
node_market_runtime -->|"loads market data"| node_market_data
node_market_runtime -->|"builds brief"| node_market_brief
node_market_runtime -->|"records forecasts"| node_forecasts
node_market_runtime -->|"evaluates alerts"| node_alerts
node_market_data -.->|"fetches prices"| node_market_integrations
node_rpc_host -->|"dispatches imports"| node_media
node_rpc_host -->|"dispatches delivery"| node_messaging
node_rpc_host -->|"dispatches ideation"| node_meme
node_orchestrator -->|"uses memory"| node_memory
node_orchestrator -->|"uses workspace context"| node_workspace_intel

click node_frontend "https://github.com/pattty847/copenet/blob/main/src/copenet/host/frontend/src/App.tsx"
click node_rpc_host "https://github.com/pattty847/copenet/blob/main/src/copenet/host/rpc_routes.py"
click node_client "https://github.com/pattty847/copenet/blob/main/src/copenet/client.py"
click node_orchestrator "https://github.com/pattty847/copenet/blob/main/src/copenet/core/orchestrator/runtime.py"
click node_harness "https://github.com/pattty847/copenet/blob/main/src/copenet/core/harness/tool_loop.py"
click node_tools "https://github.com/pattty847/copenet/blob/main/src/copenet/core/tools/registry.py"
click node_sessions "https://github.com/pattty847/copenet/blob/main/src/copenet/core/sessions/transcript_store.py"
click node_run_evidence "https://github.com/pattty847/copenet/blob/main/src/copenet/core/observability/store.py"
click node_persona "https://github.com/pattty847/copenet/blob/main/src/copenet/core/persona/service.py"
click node_permissions "https://github.com/pattty847/copenet/blob/main/src/copenet/core/permissions/store.py"
click node_fleet "https://github.com/pattty847/copenet/blob/main/src/copenet/core/fleet/coordinator.py"
click node_market_runtime "https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/runtime.py"
click node_market_data "https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/data_sources.py"
click node_market_brief "https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/brief.py"
click node_forecasts "https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/forecasts/ledger.py"
click node_alerts "https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/alert_engine.py"
click node_media "https://github.com/pattty847/copenet/blob/main/src/copenet/core/media/service.py"
click node_messaging "https://github.com/pattty847/copenet/blob/main/src/copenet/core/messaging/telegram_delivery.py"
click node_meme "https://github.com/pattty847/copenet/blob/main/src/copenet/core/meme_ideation_runtime.py"
click node_memory "https://github.com/pattty847/copenet/blob/main/src/copenet/core/memory/service.py"
click node_workspace_intel "https://github.com/pattty847/copenet/blob/main/src/copenet/core/workspace_intel/service.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_frontend,node_rpc_host,node_client toneBlue
class node_orchestrator,node_harness,node_tools toneAmber
class node_sessions,node_run_evidence,node_persona,node_permissions,node_memory toneMint
class node_market_runtime,node_market_data,node_market_brief,node_forecasts,node_alerts toneRose
class node_fleet,node_media,node_messaging,node_meme,node_workspace_intel,node_operator,node_providers,node_market_integrations toneIndigo
```

## Components

### Operator interface

- [Workspace UI](https://github.com/pattty847/copenet/blob/main/src/copenet/host/frontend/src/App.tsx): `src/copenet/host/frontend/src/App.tsx`
- [RPC host](https://github.com/pattty847/copenet/blob/main/src/copenet/host/rpc_routes.py): `src/copenet/host/rpc_routes.py`
- [WebSocket client](https://github.com/pattty847/copenet/blob/main/src/copenet/client.py): `src/copenet/client.py`

### Agent runtime

- [Run orchestrator](https://github.com/pattty847/copenet/blob/main/src/copenet/core/orchestrator/runtime.py): `src/copenet/core/orchestrator/runtime.py`
- [Provider harness](https://github.com/pattty847/copenet/blob/main/src/copenet/core/harness/tool_loop.py): `src/copenet/core/harness/tool_loop.py`
- [Tool registry](https://github.com/pattty847/copenet/blob/main/src/copenet/core/tools/registry.py): `src/copenet/core/tools/registry.py`

### Continuity and control

- [Session history](https://github.com/pattty847/copenet/blob/main/src/copenet/core/sessions/transcript_store.py): `src/copenet/core/sessions/transcript_store.py`
- [Run evidence](https://github.com/pattty847/copenet/blob/main/src/copenet/core/observability/store.py): `src/copenet/core/observability/store.py`
- [Persona context](https://github.com/pattty847/copenet/blob/main/src/copenet/core/persona/service.py): `src/copenet/core/persona/service.py`
- [Access control](https://github.com/pattty847/copenet/blob/main/src/copenet/core/permissions/store.py): `src/copenet/core/permissions/store.py`
- [User memory](https://github.com/pattty847/copenet/blob/main/src/copenet/core/memory/service.py): `src/copenet/core/memory/service.py`

### Market research

- [Market services](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/runtime.py): `src/copenet/core/market/runtime.py`
- [Market data](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/data_sources.py): `src/copenet/core/market/data_sources.py`
- [Market brief](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/brief.py): `src/copenet/core/market/brief.py`
- [Forecast ledger](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/forecasts/ledger.py): `src/copenet/core/market/forecasts/ledger.py`
- [Price alerts](https://github.com/pattty847/copenet/blob/main/src/copenet/core/market/alert_engine.py): `src/copenet/core/market/alert_engine.py`

### Product capabilities

- [Fleet rooms](https://github.com/pattty847/copenet/blob/main/src/copenet/core/fleet/coordinator.py): `src/copenet/core/fleet/coordinator.py`
- [Media ingestion](https://github.com/pattty847/copenet/blob/main/src/copenet/core/media/service.py): `src/copenet/core/media/service.py`
- [Message delivery](https://github.com/pattty847/copenet/blob/main/src/copenet/core/messaging/telegram_delivery.py): `src/copenet/core/messaging/telegram_delivery.py`
- [Meme Lab](https://github.com/pattty847/copenet/blob/main/src/copenet/core/meme_ideation_runtime.py): `src/copenet/core/meme_ideation_runtime.py`
- [Workspace intelligence](https://github.com/pattty847/copenet/blob/main/src/copenet/core/workspace_intel/service.py): `src/copenet/core/workspace_intel/service.py`

### Other components

- **Operator**
- **Model providers**
- **Market integrations**

## Connections

- Operator → Workspace UI: uses
- Workspace UI → RPC host: sends RPC
- WebSocket client → RPC host: sends RPC
- RPC host → Run orchestrator: dispatches runs
- Run orchestrator → Provider harness: runs turns
- Provider harness → Model providers: requests completion
- Provider harness → Tool registry: dispatches tools
- Run orchestrator → Session history: persists transcripts
- Run orchestrator → Run evidence: records runs
- Run orchestrator → Persona context: resolves context
- Run orchestrator → Access control: checks access
- RPC host → Fleet rooms: dispatches fleet actions
- RPC host → Market services: dispatches market actions
- Market services → Market data: loads market data
- Market services → Market brief: builds brief
- Market services → Forecast ledger: records forecasts
- Market services → Price alerts: evaluates alerts
- Market data → Market integrations: fetches prices
- RPC host → Media ingestion: dispatches imports
- RPC host → Message delivery: dispatches delivery
- RPC host → Meme Lab: dispatches ideation
- Run orchestrator → User memory: uses memory
- Run orchestrator → Workspace intelligence: uses workspace context
