# momoshub/j.a.r.v.i.s. architecture

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

- Interactive diagram: https://gitdiagram.com/momoshub/j.a.r.v.i.s.
- Repository: https://github.com/momoshub/j.a.r.v.i.s.

## Overview

J.A.R.V.I.S. is a Slack-facing assistant harness: messages and commands enter through Slack, run through role-aware conversations and Claude Code or the Anthropic API, and produce replies while sessions, memory, and work are managed. Its broader product includes scheduled/background workers, GitHub review and self-update workflows, and a local admin dashboard. The graph uses README claims and the shown import/call references; unsampled subsystems are represented only where the README documents them or the source index names them.

Main entry points: [`src/infrastructure/slack/app.ts`](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/slack/app.ts) (Slack app), [`src/application/respond.ts`](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/respond.ts) (Message response), [`src/infrastructure/dashboard/server.ts`](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/dashboard/server.ts) (Dashboard API), [`src/application/autoReview.ts`](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/autoReview.ts) (GitHub reviews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Interaction"]
  node_slack["Slack app<br/>[app.ts]"]
  node_commands["Command dispatch<br/>[commands.ts]"]
end

subgraph group_runtime["Assistant runtime"]
  node_respond["Message response<br/>[respond.ts]"]
  node_policy["Roles and tool policy<br/>[permissions.ts]"]
  node_llm["Claude / Anthropic"]
  node_sessions["Sessions and memory<br/>[threadSession.ts]"]
end

subgraph group_work["Workflows and integrations"]
  node_workers["Background workers<br/>[workerTickets.ts]"]
  node_scheduler["Scheduled work<br/>[schedule.ts]"]
  node_github["GitHub reviews<br/>[autoReview.ts]"]
  node_selfupdate["Self-update<br/>[selfUpdate.ts]"]
end

subgraph group_state["Persistence"]
  node_db[("SQLite state<br/>[client.ts]")]
end

subgraph group_admin["Administration"]
  node_dashboard["Dashboard API<br/>[server.ts]"]
  node_web["Dashboard UI<br/>[router.tsx]"]
end

node_person(("Slack user"))
node_slackapi["Slack service"]
node_githubservice["GitHub service"]

node_person -->|"sends messages"| node_slack
node_slack -->|"dispatches commands"| node_commands
node_slack -.->|"routes messages"| node_respond
node_commands -->|"starts turns"| node_respond
node_respond -.->|"checks access"| node_policy
node_respond -.->|"runs model"| node_llm
node_respond -.->|"resumes sessions"| node_sessions
node_sessions -.->|"persists state"| node_db
node_workers -.->|"runs agents"| node_llm
node_scheduler -.->|"schedules work"| node_workers
node_github -.->|"reviews pull requests"| node_githubservice
node_github -.->|"posts review approvals"| node_slack
node_selfupdate -->|"opens own PRs"| node_githubservice
node_dashboard -->|"serves application"| node_web
node_web -->|"loads and mutates"| node_dashboard
node_dashboard -.->|"reads state"| node_db
node_dashboard -->|"manages presence"| node_slackapi
node_slack -->|"uses Slack API"| node_slackapi

click node_slack "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/slack/app.ts"
click node_commands "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/commands.ts"
click node_respond "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/respond.ts"
click node_policy "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/permissions.ts"
click node_llm "https://github.com/momoshub/j.a.r.v.i.s./tree/main/src/infrastructure/llm"
click node_sessions "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/threadSession.ts"
click node_db "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/db/client.ts"
click node_workers "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/workerTickets.ts"
click node_scheduler "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/commands/schedule.ts"
click node_github "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/autoReview.ts"
click node_selfupdate "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/selfUpdate.ts"
click node_dashboard "https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/dashboard/server.ts"
click node_web "https://github.com/momoshub/j.a.r.v.i.s./blob/main/web/src/routes/router.tsx"

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_slack,node_commands,node_person toneBlue
class node_respond,node_policy,node_llm,node_sessions toneAmber
class node_workers,node_scheduler,node_github,node_selfupdate toneMint
class node_db toneRose
class node_dashboard,node_web,node_slackapi,node_githubservice toneIndigo
```

## Components

### Interaction

- [Slack app](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/slack/app.ts): `src/infrastructure/slack/app.ts`
- [Command dispatch](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/commands.ts): `src/application/commands.ts`

### Assistant runtime

- [Message response](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/respond.ts): `src/application/respond.ts`
- [Roles and tool policy](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/permissions.ts): `src/domain/permissions.ts`
- [Claude / Anthropic](https://github.com/momoshub/j.a.r.v.i.s./tree/main/src/infrastructure/llm): `src/infrastructure/llm`
- [Sessions and memory](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/threadSession.ts): `src/domain/threadSession.ts`

### Workflows and integrations

- [Background workers](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/workerTickets.ts): `src/application/workerTickets.ts`
- [Scheduled work](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/commands/schedule.ts): `src/application/commands/schedule.ts`
- [GitHub reviews](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/application/autoReview.ts): `src/application/autoReview.ts`
- [Self-update](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/domain/selfUpdate.ts): `src/domain/selfUpdate.ts`

### Persistence

- [SQLite state](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/db/client.ts): `src/infrastructure/db/client.ts`

### Administration

- [Dashboard API](https://github.com/momoshub/j.a.r.v.i.s./blob/main/src/infrastructure/dashboard/server.ts): `src/infrastructure/dashboard/server.ts`
- [Dashboard UI](https://github.com/momoshub/j.a.r.v.i.s./blob/main/web/src/routes/router.tsx): `web/src/routes/router.tsx`

### Other components

- **Slack user**
- **Slack service**
- **GitHub service**

## Connections

- Slack user → Slack app: sends messages (evidence: `README.md`)
- Slack app → Command dispatch: dispatches commands (evidence: `src/infrastructure/slack/app.ts`)
- Slack app → Message response: routes messages (evidence: `src/infrastructure/slack/app.ts`)
- Command dispatch → Message response: starts turns
- Message response → Roles and tool policy: checks access
- Message response → Claude / Anthropic: runs model
- Message response → Sessions and memory: resumes sessions
- Sessions and memory → SQLite state: persists state
- Background workers → Claude / Anthropic: runs agents
- Scheduled work → Background workers: schedules work
- GitHub reviews → GitHub service: reviews pull requests (evidence: `README.md`)
- GitHub reviews → Slack app: posts review approvals
- Self-update → GitHub service: opens own PRs (evidence: `README.md`)
- Dashboard API → Dashboard UI: serves application (evidence: `src/infrastructure/dashboard/server.ts`)
- Dashboard UI → Dashboard API: loads and mutates (evidence: `web/src/routes/router.tsx`)
- Dashboard API → SQLite state: reads state
- Dashboard API → Slack service: manages presence (evidence: `src/infrastructure/dashboard/server.ts`)
- Slack app → Slack service: uses Slack API (evidence: `README.md`)
