# jonhill90/agent-estate architecture

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

- Interactive diagram: https://gitdiagram.com/jonhill90/agent-estate
- Repository: https://github.com/jonhill90/agent-estate

## Overview

agent-estate combines a Go supervisor that gates and records coding-agent turns with a Go terminal application for operating the resulting estate. The main workflow is an operator dispatching work: host pressure is checked, an agent subprocess runs, and its outcome is recorded for task-state queries; the TUI reads supervisor state for live views. A separate knowledge workflow turns corpus evidence and binding vault facts into a regenerable query index. The README documents these stages and the TUI excerpt confirms its MCP connection; internal call details are not inferred where source was not sampled.

Main entry points: [`src/estate/main.go`](https://github.com/jonhill90/agent-estate/blob/main/src/estate/main.go) (Estate CLI), [`src/estate/internal/tick/tick.go`](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/tick/tick.go) (Turn dispatch), [`src/estate/internal/knowledge/knowledge.go`](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/knowledge.go) (Compiled index), [`src/tui/cmd/estate/main.go`](https://github.com/jonhill90/agent-estate/blob/main/src/tui/cmd/estate/main.go) (Estate TUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dispatch["Dispatch and supervision"]
  node_estate_cli["Estate CLI<br/>[main.go]"]
  node_pressure_gate["Pressure gate<br/>[pressure.go]"]
  node_dispatch_engine["Turn dispatch<br/>[tick.go]"]
  node_append_ledger[("Append-only ledger<br/>[ledger.go]")]
  node_task_queries["Task state queries<br/>[knowledge.go]"]
end

subgraph group_knowledge["Knowledge lifecycle"]
  node_corpus[("Evidence corpus<br/>[corpus.go]")]
  node_vault_facts[("Vault facts<br/>[vault.go]")]
  node_knowledge_index[("Compiled index<br/>[knowledge.go]")]
  node_knowledge_query["Knowledge query<br/>[query.go]"]
  node_distilled_rules["Distilled rules<br/>[distill.go]"]
end

subgraph group_operator["Operator interface"]
  node_tui_app["Estate TUI<br/>[main.go]"]
  node_mcp_client["MCP client<br/>[client.go]"]
end

subgraph group_support["Supporting services"]
  node_issue_mining["Issue mining<br/>[main.go]"]
  node_telegram_notify["Telegram notifier<br/>[main.go]"]
  node_progress_report["Progress reporting<br/>[main.go]"]
end

node_operator_user(("Operator"))
node_agent_process["Agent subprocess"]
node_supervisor_mcp["Supervisor MCP"]

node_operator_user -->|"dispatches work"| node_estate_cli
node_estate_cli -->|"checks capacity"| node_pressure_gate
node_estate_cli -->|"starts turn"| node_dispatch_engine
node_dispatch_engine -->|"runs subprocess"| node_agent_process
node_dispatch_engine -->|"records outcome"| node_append_ledger
node_estate_cli -->|"queries tasks"| node_task_queries
node_operator_user -->|"operates estate"| node_tui_app
node_tui_app -->|"creates client"| node_mcp_client
node_mcp_client -->|"calls tools"| node_supervisor_mcp
node_corpus -->|"evidence for"| node_knowledge_index
node_vault_facts -->|"binds facts"| node_knowledge_index
node_knowledge_index -->|"serves queries"| node_knowledge_query
node_operator_user -->|"asks question"| node_knowledge_query
node_issue_mining -->|"mines closed issues"| node_distilled_rules
node_operator_user -->|"receives messages"| node_telegram_notify
node_progress_report -.->|"reports progress"| node_operator_user

click node_estate_cli "https://github.com/jonhill90/agent-estate/blob/main/src/estate/main.go"
click node_pressure_gate "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/pressure/pressure.go"
click node_dispatch_engine "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/tick/tick.go"
click node_append_ledger "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/ledger/ledger.go"
click node_task_queries "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/knowledge.go"
click node_tui_app "https://github.com/jonhill90/agent-estate/blob/main/src/tui/cmd/estate/main.go"
click node_mcp_client "https://github.com/jonhill90/agent-estate/blob/main/src/tui/internal/mcp/client.go"
click node_corpus "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/corpus/corpus.go"
click node_vault_facts "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/vault.go"
click node_knowledge_index "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/knowledge.go"
click node_knowledge_query "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/query.go"
click node_distilled_rules "https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/distill/distill.go"
click node_issue_mining "https://github.com/jonhill90/agent-estate/blob/main/src/issuemine/main.go"
click node_telegram_notify "https://github.com/jonhill90/agent-estate/blob/main/src/notify/main.go"
click node_progress_report "https://github.com/jonhill90/agent-estate/blob/main/src/progress/main.go"

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_estate_cli,node_pressure_gate,node_dispatch_engine,node_append_ledger,node_task_queries toneBlue
class node_corpus,node_vault_facts,node_knowledge_index,node_knowledge_query,node_distilled_rules toneAmber
class node_tui_app,node_mcp_client toneMint
class node_issue_mining,node_telegram_notify,node_progress_report toneRose
class node_operator_user,node_agent_process,node_supervisor_mcp toneIndigo
```

## Components

### Dispatch and supervision

- [Estate CLI](https://github.com/jonhill90/agent-estate/blob/main/src/estate/main.go): `src/estate/main.go`
- [Pressure gate](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/pressure/pressure.go): `src/estate/internal/pressure/pressure.go`
- [Turn dispatch](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/tick/tick.go): `src/estate/internal/tick/tick.go`
- [Append-only ledger](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/ledger/ledger.go): `src/estate/internal/ledger/ledger.go`
- [Task state queries](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/knowledge.go): `src/estate/internal/knowledge/knowledge.go`

### Knowledge lifecycle

- [Evidence corpus](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/corpus/corpus.go): `src/estate/internal/corpus/corpus.go`
- [Vault facts](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/vault.go): `src/estate/internal/knowledge/vault.go`
- [Compiled index](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/knowledge.go): `src/estate/internal/knowledge/knowledge.go`
- [Knowledge query](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/knowledge/query.go): `src/estate/internal/knowledge/query.go`
- [Distilled rules](https://github.com/jonhill90/agent-estate/blob/main/src/estate/internal/distill/distill.go): `src/estate/internal/distill/distill.go`

### Operator interface

- [Estate TUI](https://github.com/jonhill90/agent-estate/blob/main/src/tui/cmd/estate/main.go): `src/tui/cmd/estate/main.go`
- [MCP client](https://github.com/jonhill90/agent-estate/blob/main/src/tui/internal/mcp/client.go): `src/tui/internal/mcp/client.go`

### Supporting services

- [Issue mining](https://github.com/jonhill90/agent-estate/blob/main/src/issuemine/main.go): `src/issuemine/main.go`
- [Telegram notifier](https://github.com/jonhill90/agent-estate/blob/main/src/notify/main.go): `src/notify/main.go`
- [Progress reporting](https://github.com/jonhill90/agent-estate/blob/main/src/progress/main.go): `src/progress/main.go`

### Other components

- **Operator**
- **Agent subprocess**
- **Supervisor MCP**

## Connections

- Operator → Estate CLI: dispatches work (evidence: `README.md`)
- Estate CLI → Pressure gate: checks capacity (evidence: `README.md`)
- Estate CLI → Turn dispatch: starts turn (evidence: `README.md`)
- Turn dispatch → Agent subprocess: runs subprocess (evidence: `README.md`)
- Turn dispatch → Append-only ledger: records outcome (evidence: `README.md`)
- Estate CLI → Task state queries: queries tasks (evidence: `README.md`)
- Operator → Estate TUI: operates estate (evidence: `README.md`)
- Estate TUI → MCP client: creates client (evidence: `src/tui/cmd/estate/main.go`)
- MCP client → Supervisor MCP: calls tools
- Evidence corpus → Compiled index: evidence for (evidence: `README.md`)
- Vault facts → Compiled index: binds facts (evidence: `README.md`)
- Compiled index → Knowledge query: serves queries (evidence: `README.md`)
- Operator → Knowledge query: asks question (evidence: `README.md`)
- Issue mining → Distilled rules: mines closed issues (evidence: `README.md`)
- Operator → Telegram notifier: receives messages (evidence: `README.md`)
- Progress reporting → Operator: reports progress
