# bommidenihasini/fuse architecture

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

- Interactive diagram: https://gitdiagram.com/bommidenihasini/fuse
- Repository: https://github.com/bommidenihasini/fuse

## Overview

Fuse is a synthetic MVP that guards autonomous-agent model and tool invocations with a policy gate, prevents disallowed calls from reaching execution, and preserves ordered audit evidence. The main workflow is dashboard request → HTTP API → scenario runner → enforcement and policy evaluation → persistence → run and event views. The dashboard also exposes policy and architecture information. README documents planned AWS components; source excerpts are partial, so those deployment links are shown separately and dashed.

Main entry points: [`infra/lib/fuse-stack.ts`](https://github.com/bommidenihasini/fuse/blob/main/infra/lib/fuse-stack.ts) (AWS stack definition), [`apps/dashboard/src/lib/api.ts`](https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/lib/api.ts) (API client), [`packages/api/src/app.ts`](https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/app.ts) (API router), [`packages/persistence/src/types.ts`](https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/types.ts) (Repository interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_dashboard_api["API client<br/>[api.ts]"]
  node_run_views["Run and audit views<br/>[RunPage.tsx]"]
  node_policy_views["Policy and architecture views<br/>[PoliciesPage.tsx]"]
end

subgraph group_control["API control"]
  node_http_server["HTTP server<br/>[server.ts]"]
  node_api["API router<br/>[app.ts]"]
  node_api_policies["Demo policies<br/>[policies.ts]"]
end

subgraph group_execution["Run enforcement"]
  node_runner["Scenario runner<br/>[runner.ts]"]
  node_synthetic["Synthetic actions<br/>[synthetic.ts]"]
  node_enforcement["Pre-call enforcement<br/>[fuse.ts]"]
  node_policy_engine["Policy evaluation<br/>[evaluate.ts]"]
  node_contracts["Domain contracts<br/>[types.ts]"]
end

subgraph group_state["Persistence"]
  node_repository["Repository interface<br/>[types.ts]"]
  node_memory_store[("In-memory store<br/>[in-memory.ts]")]
  node_dynamo_store[("DynamoDB adapter<br/>[dynamodb.ts]")]
end

subgraph group_cloud["Planned AWS"]
  node_infra["AWS stack definition<br/>[fuse-stack.ts]"]
  node_api_gateway["API Gateway"]
  node_lambda["Lambda"]
  node_dynamodb[("DynamoDB")]
  node_eventbridge["EventBridge"]
  node_cloudwatch[("CloudWatch")]
end

node_operator(("Operator"))

node_operator -->|"starts run"| node_dashboard
node_dashboard -->|"requests data"| node_dashboard_api
node_dashboard_api -->|"sends HTTP"| node_http_server
node_http_server -->|"dispatches request"| node_api
node_api -->|"looks up policy"| node_api_policies
node_api -->|"starts scenario"| node_runner
node_runner -->|"checks invocation"| node_enforcement
node_enforcement -->|"evaluates policy"| node_policy_engine
node_enforcement -->|"reads and records"| node_repository
node_runner -->|"executes allowed action"| node_synthetic
node_repository -->|"stores run and events"| node_memory_store
node_repository -.->|"adapts persistence"| node_dynamo_store
node_api -->|"reads run and events"| node_repository
node_dashboard_api -->|"provides run data"| node_run_views
node_dashboard_api -->|"provides policy data"| node_policy_views
node_run_views -->|"shows audit timeline"| node_operator
node_policy_views -->|"shows controls"| node_operator
node_infra -.->|"configures routes"| node_api_gateway
node_infra -.->|"defines functions"| node_lambda
node_infra -.->|"defines tables"| node_dynamodb
node_infra -.->|"defines event bus"| node_eventbridge
node_infra -.->|"defines logs"| node_cloudwatch

click node_dashboard "https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/App.tsx"
click node_dashboard_api "https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/lib/api.ts"
click node_run_views "https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/pages/RunPage.tsx"
click node_policy_views "https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/pages/PoliciesPage.tsx"
click node_http_server "https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/server.ts"
click node_api "https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/app.ts"
click node_api_policies "https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/policies.ts"
click node_runner "https://github.com/bommidenihasini/fuse/blob/main/packages/runner/src/runner.ts"
click node_synthetic "https://github.com/bommidenihasini/fuse/blob/main/packages/runner/src/synthetic.ts"
click node_enforcement "https://github.com/bommidenihasini/fuse/blob/main/packages/enforcement/src/fuse.ts"
click node_policy_engine "https://github.com/bommidenihasini/fuse/blob/main/packages/policy-engine/src/evaluate.ts"
click node_contracts "https://github.com/bommidenihasini/fuse/blob/main/packages/contracts/src/types.ts"
click node_repository "https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/types.ts"
click node_memory_store "https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/in-memory.ts"
click node_dynamo_store "https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/dynamodb.ts"
click node_infra "https://github.com/bommidenihasini/fuse/blob/main/infra/lib/fuse-stack.ts"

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_dashboard,node_dashboard_api,node_run_views,node_policy_views toneBlue
class node_http_server,node_api,node_api_policies toneAmber
class node_runner,node_synthetic,node_enforcement,node_policy_engine,node_contracts toneMint
class node_repository,node_memory_store,node_dynamo_store toneRose
class node_infra,node_api_gateway,node_lambda,node_dynamodb,node_eventbridge,node_cloudwatch,node_operator toneIndigo
```

## Components

### Dashboard

- [Dashboard](https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/App.tsx): `apps/dashboard/src/App.tsx`
- [API client](https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/lib/api.ts): `apps/dashboard/src/lib/api.ts`
- [Run and audit views](https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/pages/RunPage.tsx): `apps/dashboard/src/pages/RunPage.tsx`
- [Policy and architecture views](https://github.com/bommidenihasini/fuse/blob/main/apps/dashboard/src/pages/PoliciesPage.tsx): `apps/dashboard/src/pages/PoliciesPage.tsx`

### API control

- [HTTP server](https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/server.ts): `packages/api/src/server.ts`
- [API router](https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/app.ts): `packages/api/src/app.ts`
- [Demo policies](https://github.com/bommidenihasini/fuse/blob/main/packages/api/src/policies.ts): `packages/api/src/policies.ts`

### Run enforcement

- [Scenario runner](https://github.com/bommidenihasini/fuse/blob/main/packages/runner/src/runner.ts): `packages/runner/src/runner.ts`
- [Synthetic actions](https://github.com/bommidenihasini/fuse/blob/main/packages/runner/src/synthetic.ts): `packages/runner/src/synthetic.ts`
- [Pre-call enforcement](https://github.com/bommidenihasini/fuse/blob/main/packages/enforcement/src/fuse.ts): `packages/enforcement/src/fuse.ts`
- [Policy evaluation](https://github.com/bommidenihasini/fuse/blob/main/packages/policy-engine/src/evaluate.ts): `packages/policy-engine/src/evaluate.ts`
- [Domain contracts](https://github.com/bommidenihasini/fuse/blob/main/packages/contracts/src/types.ts): `packages/contracts/src/types.ts`

### Persistence

- [Repository interface](https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/types.ts): `packages/persistence/src/types.ts`
- [In-memory store](https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/in-memory.ts): `packages/persistence/src/in-memory.ts`
- [DynamoDB adapter](https://github.com/bommidenihasini/fuse/blob/main/packages/persistence/src/dynamodb.ts): `packages/persistence/src/dynamodb.ts`

### Planned AWS

- [AWS stack definition](https://github.com/bommidenihasini/fuse/blob/main/infra/lib/fuse-stack.ts): `infra/lib/fuse-stack.ts`
- **API Gateway**
- **Lambda**
- **DynamoDB**
- **EventBridge**
- **CloudWatch**

### Other components

- **Operator**

## Connections

- Operator → Dashboard: starts run
- Dashboard → API client: requests data
- API client → HTTP server: sends HTTP
- HTTP server → API router: dispatches request
- API router → Demo policies: looks up policy
- API router → Scenario runner: starts scenario
- Scenario runner → Pre-call enforcement: checks invocation
- Pre-call enforcement → Policy evaluation: evaluates policy
- Pre-call enforcement → Repository interface: reads and records
- Scenario runner → Synthetic actions: executes allowed action
- Repository interface → In-memory store: stores run and events
- Repository interface → DynamoDB adapter: adapts persistence
- API router → Repository interface: reads run and events
- API client → Run and audit views: provides run data
- API client → Policy and architecture views: provides policy data
- Run and audit views → Operator: shows audit timeline
- Policy and architecture views → Operator: shows controls
- AWS stack definition → API Gateway: configures routes
- AWS stack definition → Lambda: defines functions
- AWS stack definition → DynamoDB: defines tables
- AWS stack definition → EventBridge: defines event bus
- AWS stack definition → CloudWatch: defines logs
