# farnai/jesteraicompany architecture

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

- Interactive diagram: https://gitdiagram.com/farnai/jesteraicompany
- Repository: https://github.com/farnai/jesteraicompany

## Overview

JesterAICompany is a governed multi-agent company runtime, not the target product it may modify. A founder submits an objective; the CEO proposes a typed work plan, specialists produce bounded deliverables, and deterministic orchestration validates and coordinates them. Engineering work additionally passes through developer planning, a grant-bound isolated worktree, QA and bounded repair, then stops for founder approval before applying changes to the real repository. The frontend presents company state and approval controls. The graph follows documented workflow stages; some backend links rely on the README or source-index references because excerpts are incomplete.

Main entry points: [`jester_ai_company/service.py`](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/service.py) (Company Service), [`jester_ai_company/engineering_pipeline.py`](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/engineering_pipeline.py) (Engineering Pipeline), [`frontend/src/App.tsx`](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/App.tsx) (Company Workspace), [`jester_ai_company/real_repo_apply.py`](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/real_repo_apply.py) (Real Repository Apply)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Founder Workspace"]
  node_workspace["Company Workspace<br/>[App.tsx]"]
  node_statehook["Company State<br/>[useCompanyState.ts]"]
  node_api["Frontend API<br/>[client.ts]"]
  node_approvalui["Approval Gate"]
  node_floor["Company Floor<br/>[CompanyFloor.tsx]"]
  node_domainui["UI Domain Types<br/>[company.ts]"]
end

subgraph group_planning["Planning and Specialists"]
  node_objective["Objective and Plan<br/>[orchestrator.py]"]
  node_dag["DAG Validation<br/>[dag.py]"]
end

subgraph group_runtime["Run Coordination"]
  node_service["Company Service<br/>[service.py]"]
  node_companycore["Company Core<br/>[core.py]"]
  node_context["Run Context<br/>[context.py]"]
end

subgraph group_engineering["Engineering Safeguards"]
  node_engineering["Engineering Pipeline"]
  node_devinputs["Developer Planning Inputs"]
  node_grant["Execution Grant<br/>[execution_grant.py]"]
  node_worktree["Isolated Worktree<br/>[worktree.py]"]
  node_qa["QA Execution<br/>[qa_execution.py]"]
  node_repair["Bounded Repair<br/>[repair.py]"]
  node_authority["Authority Controls<br/>[authority.py]"]
  node_apply["Real Repository Apply<br/>[real_repo_apply.py]"]
end

subgraph group_persistence["State and Evidence"]
  node_project["Project and Repository<br/>[project.py]"]
  node_knowledge["Knowledge Sources<br/>[knowledge.py]"]
  node_materializer["Artifact Materializer<br/>[materializer.py]"]
  node_storage[("Durable Run Storage<br/>[durable_storage.py]")]
end

node_founder(("Human Founder"))

node_founder -->|"sets objectives"| node_workspace
node_workspace -->|"uses state"| node_statehook
node_statehook -->|"requests data"| node_api
node_workspace -->|"opens approval"| node_approvalui
node_workspace -->|"renders"| node_floor
node_api -->|"uses types"| node_domainui
node_founder -->|"defines mission"| node_objective
node_objective -->|"proposes work graph"| node_dag
node_dag -->|"validated plan"| node_service
node_service -->|"executes tasks"| node_companycore
node_service -->|"builds run context"| node_context
node_service -->|"coordinates engineering"| node_engineering
node_engineering -->|"prepares planning inputs"| node_devinputs
node_engineering -->|"requests bounded authority"| node_grant
node_engineering -->|"uses isolation"| node_worktree
node_engineering -->|"runs verification"| node_qa
node_engineering -->|"coordinates repair"| node_repair
node_engineering -->|"checks authority"| node_authority
node_founder -->|"provides approval"| node_authority
node_founder -->|"authorizes apply"| node_apply
node_engineering -->|"proposes repository apply"| node_apply
node_service -->|"uses project records"| node_project
node_service -->|"selects knowledge"| node_knowledge
node_service -->|"materializes artifacts"| node_materializer
node_service -->|"persists run state"| node_storage
node_apply -->|"stores proposals"| node_storage

click node_workspace "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/App.tsx"
click node_statehook "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/hooks/useCompanyState.ts"
click node_api "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/api/client.ts"
click node_approvalui "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/components/FounderApprovalGateModal.tsx"
click node_floor "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/components/CompanyFloor.tsx"
click node_domainui "https://github.com/farnai/jesteraicompany/blob/main/frontend/src/types/company.ts"
click node_objective "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/orchestrator.py"
click node_dag "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/dag.py"
click node_service "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/service.py"
click node_companycore "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/core.py"
click node_context "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/context.py"
click node_engineering "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/engineering_pipeline.py"
click node_devinputs "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/developer_inputs.py"
click node_grant "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/execution_grant.py"
click node_worktree "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/worktree.py"
click node_qa "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/qa_execution.py"
click node_repair "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/repair.py"
click node_authority "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/authority.py"
click node_apply "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/real_repo_apply.py"
click node_project "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/project.py"
click node_knowledge "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/knowledge.py"
click node_materializer "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/materializer.py"
click node_storage "https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/durable_storage.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_workspace,node_statehook,node_api,node_approvalui,node_floor,node_domainui toneBlue
class node_objective,node_dag toneAmber
class node_service,node_companycore,node_context toneMint
class node_engineering,node_devinputs,node_grant,node_worktree,node_qa,node_repair,node_authority,node_apply toneRose
class node_project,node_knowledge,node_materializer,node_storage,node_founder toneIndigo
```

## Components

### Founder Workspace

- [Company Workspace](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Company State](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/hooks/useCompanyState.ts): `frontend/src/hooks/useCompanyState.ts`
- [Frontend API](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Approval Gate](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/components/FounderApprovalGateModal.tsx): `frontend/src/components/FounderApprovalGateModal.tsx`
- [Company Floor](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/components/CompanyFloor.tsx): `frontend/src/components/CompanyFloor.tsx`
- [UI Domain Types](https://github.com/farnai/jesteraicompany/blob/main/frontend/src/types/company.ts): `frontend/src/types/company.ts`

### Planning and Specialists

- [Objective and Plan](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/orchestrator.py): `jester_ai_company/orchestrator.py`
- [DAG Validation](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/dag.py): `jester_ai_company/dag.py`

### Run Coordination

- [Company Service](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/service.py): `jester_ai_company/service.py`
- [Company Core](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/core.py): `jester_ai_company/core.py`
- [Run Context](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/context.py): `jester_ai_company/context.py`

### Engineering Safeguards

- [Engineering Pipeline](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/engineering_pipeline.py): `jester_ai_company/engineering_pipeline.py`
- [Developer Planning Inputs](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/developer_inputs.py): `jester_ai_company/developer_inputs.py`
- [Execution Grant](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/execution_grant.py): `jester_ai_company/execution_grant.py`
- [Isolated Worktree](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/worktree.py): `jester_ai_company/worktree.py`
- [QA Execution](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/qa_execution.py): `jester_ai_company/qa_execution.py`
- [Bounded Repair](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/repair.py): `jester_ai_company/repair.py`
- [Authority Controls](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/authority.py): `jester_ai_company/authority.py`
- [Real Repository Apply](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/real_repo_apply.py): `jester_ai_company/real_repo_apply.py`

### State and Evidence

- [Project and Repository](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/project.py): `jester_ai_company/project.py`
- [Knowledge Sources](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/knowledge.py): `jester_ai_company/knowledge.py`
- [Artifact Materializer](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/materializer.py): `jester_ai_company/materializer.py`
- [Durable Run Storage](https://github.com/farnai/jesteraicompany/blob/main/jester_ai_company/durable_storage.py): `jester_ai_company/durable_storage.py`

### Other components

- **Human Founder**

## Connections

- Human Founder → Company Workspace: sets objectives
- Company Workspace → Company State: uses state (evidence: `frontend/src/App.tsx`)
- Company State → Frontend API: requests data (evidence: `frontend/src/hooks/useCompanyState.ts`)
- Company Workspace → Approval Gate: opens approval (evidence: `frontend/src/App.tsx`)
- Company Workspace → Company Floor: renders (evidence: `frontend/src/App.tsx`)
- Frontend API → UI Domain Types: uses types (evidence: `frontend/src/api/client.ts`)
- Human Founder → Objective and Plan: defines mission
- Objective and Plan → DAG Validation: proposes work graph (evidence: `jester_ai_company/dag.py`)
- DAG Validation → Company Service: validated plan (evidence: `jester_ai_company/dag.py`)
- Company Service → Company Core: executes tasks (evidence: `jester_ai_company/service.py`)
- Company Service → Run Context: builds run context (evidence: `jester_ai_company/context.py`)
- Company Service → Engineering Pipeline: coordinates engineering (evidence: `jester_ai_company/service.py`)
- Engineering Pipeline → Developer Planning Inputs: prepares planning inputs (evidence: `jester_ai_company/engineering_pipeline.py`)
- Engineering Pipeline → Execution Grant: requests bounded authority (evidence: `jester_ai_company/engineering_pipeline.py`)
- Engineering Pipeline → Isolated Worktree: uses isolation (evidence: `jester_ai_company/engineering_pipeline.py`)
- Engineering Pipeline → QA Execution: runs verification (evidence: `jester_ai_company/engineering_pipeline.py`)
- Engineering Pipeline → Bounded Repair: coordinates repair (evidence: `jester_ai_company/engineering_pipeline.py`)
- Engineering Pipeline → Authority Controls: checks authority (evidence: `jester_ai_company/engineering_pipeline.py`)
- Human Founder → Authority Controls: provides approval
- Human Founder → Real Repository Apply: authorizes apply
- Engineering Pipeline → Real Repository Apply: proposes repository apply (evidence: `jester_ai_company/engineering_pipeline.py`)
- Company Service → Project and Repository: uses project records (evidence: `jester_ai_company/service.py`)
- Company Service → Knowledge Sources: selects knowledge (evidence: `jester_ai_company/service.py`)
- Company Service → Artifact Materializer: materializes artifacts (evidence: `jester_ai_company/service.py`)
- Company Service → Durable Run Storage: persists run state (evidence: `jester_ai_company/service.py`)
- Real Repository Apply → Durable Run Storage: stores proposals (evidence: `jester_ai_company/durable_storage.py`)
