# madhavan347/project_alfred architecture

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

- Interactive diagram: https://gitdiagram.com/madhavan347/project_alfred
- Repository: https://github.com/madhavan347/project_alfred

## Overview

Alfred is a local workflow orchestrator for configured tasks, command-line agents, Git worktrees, and human review. Operators configure a workspace, create and assign tasks, dispatch or queue runs, observe progress, then review completion reports and merge or archive work. Its CLI and web UI share composed application services; JSON state, Git, tmux, optional Markdown tracking, and knowledge support the lifecycle. The README documents these capabilities; several service implementations and UI routes were not sampled, so their internal links are omitted.

Main entry points: [`src/alfred/bootstrap.py`](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/bootstrap.py) (Service composition), [`src/alfred/application/tasks.py`](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/tasks.py) (Task management), [`src/alfred/application/dispatch.py`](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/dispatch.py) (Agent dispatch), [`src/alfred/adapters/git/worktrees.py`](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/git/worktrees.py) (Git worktrees)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Operator interfaces"]
  node_cli["Alfred CLI<br/>[main.py]"]
  node_webapi["Web API<br/>[app.py]"]
  node_webui["Web interface<br/>[App.vue]"]
  node_snapshot["UI read model<br/>[snapshot.py]"]
  node_actions["UI operations<br/>[actions.py]"]
end

subgraph group_workflow["Task and run workflows"]
  node_taskservice["Task management<br/>[tasks.py]"]
  node_domain["Task lifecycle model<br/>[models.py]"]
  node_runs["Run dispatch<br/>[runs.py]"]
  node_dispatch["Agent dispatch<br/>[dispatch.py]"]
end

subgraph group_runtime["Execution and integrations"]
  node_worktrees["Git worktrees<br/>[worktrees.py]"]
  node_gitcommits["Git commits<br/>[commits.py]"]
  node_tmux["Agent sessions<br/>[tmux.py]"]
  node_process["Process runner<br/>[process.py]"]
end

subgraph group_state["Configuration and state"]
  node_config["Workspace config<br/>[loader.py]"]
  node_bootstrap["Service composition<br/>[bootstrap.py]"]
  node_statejson[("JSON state store<br/>[json_store.py]")]
end

subgraph group_review["Review and support"]
  node_coordinator["Completion coordinator<br/>[coordinator.py]"]
  node_notifications["Human notifications<br/>[notifications.py]"]
  node_knowledge["Project knowledge<br/>[knowledge.py]"]
  node_learner["Knowledge learner<br/>[learner.py]"]
  node_tracker["Markdown tracker sync<br/>[sync.py]"]
end

node_operator(("Operator"))

node_operator -->|"runs commands"| node_cli
node_operator -.->|"uses interface"| node_webui
node_cli -->|"initializes workspace"| node_config
node_cli -->|"builds services"| node_bootstrap
node_bootstrap -->|"loads"| node_config
node_bootstrap -->|"composes"| node_taskservice
node_bootstrap -->|"composes"| node_runs
node_bootstrap -->|"composes"| node_dispatch
node_bootstrap -->|"composes"| node_worktrees
node_bootstrap -->|"composes"| node_gitcommits
node_bootstrap -->|"composes"| node_tmux
node_bootstrap -->|"composes"| node_process
node_bootstrap -->|"initializes"| node_statejson
node_taskservice -->|"persists tasks"| node_statejson
node_taskservice -->|"validates lifecycle"| node_domain
node_runs -.->|"dispatches runs"| node_dispatch
node_dispatch -.->|"starts sessions"| node_tmux
node_dispatch -.->|"uses worktrees"| node_worktrees
node_worktrees -->|"runs Git commands"| node_process
node_gitcommits -->|"operates on"| node_worktrees
node_tmux -->|"runs tmux commands"| node_process
node_webapi -->|"routes operations"| node_actions
node_webapi -.->|"serves read model"| node_snapshot
node_webui -.->|"requests data"| node_webapi
node_actions -->|"uses services"| node_bootstrap
node_snapshot -->|"reads persisted state"| node_statejson
node_snapshot -.->|"joins live sessions"| node_tmux
node_coordinator -.->|"processes completions"| node_notifications
node_learner -.->|"records learnings"| node_knowledge
node_tracker -.->|"reconciles tasks"| node_taskservice

click node_cli "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/cli/main.py"
click node_webapi "https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/app.py"
click node_webui "https://github.com/madhavan347/project_alfred/blob/master/ui/web/src/App.vue"
click node_config "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/config/loader.py"
click node_bootstrap "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/bootstrap.py"
click node_taskservice "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/tasks.py"
click node_domain "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/domain/models.py"
click node_runs "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/runs.py"
click node_dispatch "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/dispatch.py"
click node_worktrees "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/git/worktrees.py"
click node_gitcommits "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/git/commits.py"
click node_tmux "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/tmux.py"
click node_process "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/process.py"
click node_statejson "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/state/json_store.py"
click node_coordinator "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/coordinator.py"
click node_notifications "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/notifications.py"
click node_knowledge "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/knowledge.py"
click node_learner "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/learner.py"
click node_tracker "https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/sync.py"
click node_snapshot "https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/snapshot.py"
click node_actions "https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/actions.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_cli,node_webapi,node_webui,node_snapshot,node_actions toneBlue
class node_taskservice,node_domain,node_runs,node_dispatch toneAmber
class node_worktrees,node_gitcommits,node_tmux,node_process toneMint
class node_config,node_bootstrap,node_statejson toneRose
class node_coordinator,node_notifications,node_knowledge,node_learner,node_tracker,node_operator toneIndigo
```

## Components

### Operator interfaces

- [Alfred CLI](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/cli/main.py): `src/alfred/cli/main.py`
- [Web API](https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/app.py): `ui/src/alfred_ui/app.py`
- [Web interface](https://github.com/madhavan347/project_alfred/blob/master/ui/web/src/App.vue): `ui/web/src/App.vue`
- [UI read model](https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/snapshot.py): `ui/src/alfred_ui/snapshot.py`
- [UI operations](https://github.com/madhavan347/project_alfred/blob/master/ui/src/alfred_ui/actions.py): `ui/src/alfred_ui/actions.py`

### Task and run workflows

- [Task management](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/tasks.py): `src/alfred/application/tasks.py`
- [Task lifecycle model](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/domain/models.py): `src/alfred/domain/models.py`
- [Run dispatch](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/runs.py): `src/alfred/application/runs.py`
- [Agent dispatch](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/dispatch.py): `src/alfred/application/dispatch.py`

### Execution and integrations

- [Git worktrees](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/git/worktrees.py): `src/alfred/adapters/git/worktrees.py`
- [Git commits](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/git/commits.py): `src/alfred/adapters/git/commits.py`
- [Agent sessions](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/tmux.py): `src/alfred/adapters/tmux.py`
- [Process runner](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/process.py): `src/alfred/adapters/process.py`

### Configuration and state

- [Workspace config](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/config/loader.py): `src/alfred/config/loader.py`
- [Service composition](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/bootstrap.py): `src/alfred/bootstrap.py`
- [JSON state store](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/adapters/state/json_store.py): `src/alfred/adapters/state/json_store.py`

### Review and support

- [Completion coordinator](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/coordinator.py): `src/alfred/application/coordinator.py`
- [Human notifications](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/notifications.py): `src/alfred/application/notifications.py`
- [Project knowledge](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/knowledge.py): `src/alfred/application/knowledge.py`
- [Knowledge learner](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/learner.py): `src/alfred/application/learner.py`
- [Markdown tracker sync](https://github.com/madhavan347/project_alfred/blob/master/src/alfred/application/sync.py): `src/alfred/application/sync.py`

### Other components

- **Operator**

## Connections

- Operator → Alfred CLI: runs commands
- Operator → Web interface: uses interface
- Alfred CLI → Workspace config: initializes workspace (evidence: `src/alfred/cli/main.py`)
- Alfred CLI → Service composition: builds services (evidence: `src/alfred/cli/main.py`)
- Service composition → Workspace config: loads (evidence: `src/alfred/bootstrap.py`)
- Service composition → Task management: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Run dispatch: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Agent dispatch: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Git worktrees: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Git commits: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Agent sessions: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → Process runner: composes (evidence: `src/alfred/bootstrap.py`)
- Service composition → JSON state store: initializes (evidence: `src/alfred/bootstrap.py`)
- Task management → JSON state store: persists tasks (evidence: `src/alfred/application/tasks.py`)
- Task management → Task lifecycle model: validates lifecycle (evidence: `src/alfred/application/tasks.py`)
- Run dispatch → Agent dispatch: dispatches runs
- Agent dispatch → Agent sessions: starts sessions
- Agent dispatch → Git worktrees: uses worktrees
- Git worktrees → Process runner: runs Git commands (evidence: `src/alfred/adapters/git/worktrees.py`)
- Git commits → Git worktrees: operates on (evidence: `src/alfred/bootstrap.py`)
- Agent sessions → Process runner: runs tmux commands (evidence: `src/alfred/adapters/tmux.py`)
- Web API → UI operations: routes operations (evidence: `ui/src/alfred_ui/app.py`)
- Web API → UI read model: serves read model (evidence: `ui/src/alfred_ui/app.py`)
- Web interface → Web API: requests data
- UI operations → Service composition: uses services (evidence: `ui/src/alfred_ui/actions.py`)
- UI read model → JSON state store: reads persisted state (evidence: `ui/src/alfred_ui/snapshot.py`)
- UI read model → Agent sessions: joins live sessions
- Completion coordinator → Human notifications: processes completions
- Knowledge learner → Project knowledge: records learnings
- Markdown tracker sync → Task management: reconciles tasks
