# yasmindiess/bi-ble architecture

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

- Interactive diagram: https://gitdiagram.com/yasmindiess/bi-ble
- Repository: https://github.com/yasmindiess/bi-ble

## Overview

bi-ble is presented as a compositional causal-system editor. The main workflow is to assemble a typed formula graph, edit node properties and connections, then compile it for domain checks; sessions can be saved, undone, and audited. The editor also exposes history, audit, and GitHub repository/revision evidence features. The README gives little architectural detail, and the OCaml runtime files were not sampled, so this map focuses on the evidenced editor and avoids guessing how the runtime connects.

Main entry points: [`apps/editor/src/App.tsx`](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/App.tsx) (Editor workflow), [`apps/editor/src/model/document.ts`](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/document.ts) (Formula document), [`apps/editor/src/model/compiler.ts`](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/compiler.ts) (Formula compiler), [`apps/editor/src/model/history.ts`](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/history.ts) (Undo history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Editor workspace"]
  node_app["Editor workflow<br/>[App.tsx]"]
  node_canvas["Formula canvas<br/>[FormulaCanvas.tsx]"]
  node_property_editor["Node properties"]
  node_history_panel["History panel<br/>[HistoryPanel.tsx]"]
  node_audit_panel["Audit panel<br/>[AuditPanel.tsx]"]
  node_compiler_panel["Compiler results<br/>[CompilerPanel.tsx]"]
end

subgraph group_domain["Graph domain"]
  node_palette["Node palette<br/>[palette.ts]"]
  node_definitions["Port definitions<br/>[definitions.ts]"]
  node_properties["Property schemas<br/>[properties.ts]"]
  node_document["Formula document<br/>[document.ts]"]
  node_connections["Connection rules<br/>[connections.ts]"]
end

subgraph group_analysis["Compilation checks"]
  node_compiler["Formula compiler<br/>[compiler.ts]"]
  node_tribunals["Domain tribunals<br/>[tribunals.ts]"]
  node_ael_policy["AEL policy<br/>[aelPolicy.ts]"]
end

subgraph group_session["Session records"]
  node_operations["Document operations<br/>[operations.ts]"]
  node_history["Undo history<br/>[history.ts]"]
  node_audit["Audit receipts<br/>[audit.ts]"]
  node_storage["Session storage<br/>[storage.ts]"]
end

subgraph group_github["Repository evidence"]
  node_repository_selector["Repository selector"]
  node_revision_selector["Revision selector"]
  node_commit_evidence["Commit evidence"]
  node_github_adapter["GitHub adapter<br/>[github.ts]"]
end

node_user(("Editor user"))
node_github_api["GitHub API routes"]

node_user -->|"edits graph"| node_app
node_app -->|"renders"| node_canvas
node_app -->|"renders"| node_property_editor
node_app -->|"validates links"| node_connections
node_app -->|"creates graph"| node_document
node_app -->|"loads and saves"| node_storage
node_app -->|"commits and undoes"| node_history
node_app -->|"compiles graph"| node_compiler
node_app -->|"renders"| node_history_panel
node_app -->|"renders"| node_audit_panel
node_app -->|"renders"| node_compiler_panel
node_canvas -->|"uses graph model"| node_document
node_property_editor -->|"edits node data"| node_document
node_document -->|"gets port templates"| node_definitions
node_document -->|"gets defaults"| node_properties
node_definitions -->|"uses domains"| node_palette
node_properties -->|"uses domains"| node_palette
node_history -->|"applies operations"| node_operations
node_history -->|"creates receipts"| node_audit
node_storage -->|"builds ports"| node_document
node_storage -->|"restores session"| node_history
node_storage -->|"restores audit"| node_audit
node_history_panel -->|"displays"| node_history
node_audit_panel -->|"displays"| node_audit
node_compiler -->|"reads graph"| node_document
node_compiler -->|"canonicalizes properties"| node_properties
node_compiler -->|"evaluates"| node_tribunals
node_tribunals -->|"evaluates policy"| node_ael_policy
node_compiler_panel -->|"shows results"| node_compiler
node_repository_selector -->|"loads repositories"| node_github_adapter
node_revision_selector -->|"loads revisions"| node_github_adapter
node_commit_evidence -->|"loads evidence"| node_github_adapter
node_commit_evidence -->|"records evidence"| node_document
node_github_adapter -->|"requests data"| node_github_api

click node_app "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/App.tsx"
click node_canvas "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/FormulaCanvas.tsx"
click node_property_editor "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/NodePropertyEditor.tsx"
click node_palette "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/palette.ts"
click node_definitions "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/definitions.ts"
click node_properties "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/properties.ts"
click node_document "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/document.ts"
click node_connections "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/connections.ts"
click node_operations "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/operations.ts"
click node_history "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/history.ts"
click node_audit "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/audit.ts"
click node_storage "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/storage.ts"
click node_history_panel "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/HistoryPanel.tsx"
click node_audit_panel "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/AuditPanel.tsx"
click node_compiler "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/compiler.ts"
click node_tribunals "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/tribunals.ts"
click node_ael_policy "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/aelPolicy.ts"
click node_compiler_panel "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/CompilerPanel.tsx"
click node_repository_selector "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/RepositorySelector.tsx"
click node_revision_selector "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/RevisionSelector.tsx"
click node_commit_evidence "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/CommitEvidencePanel.tsx"
click node_github_adapter "https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/integrations/github.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_app,node_canvas,node_property_editor,node_history_panel,node_audit_panel,node_compiler_panel,node_user toneBlue
class node_palette,node_definitions,node_properties,node_document,node_connections toneAmber
class node_compiler,node_tribunals,node_ael_policy,node_github_api toneMint
class node_operations,node_history,node_audit,node_storage toneRose
class node_repository_selector,node_revision_selector,node_commit_evidence,node_github_adapter toneIndigo
```

## Components

### Editor workspace

- [Editor workflow](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/App.tsx): `apps/editor/src/App.tsx`
- [Formula canvas](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/FormulaCanvas.tsx): `apps/editor/src/components/FormulaCanvas.tsx`
- [Node properties](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/NodePropertyEditor.tsx): `apps/editor/src/components/NodePropertyEditor.tsx`
- [History panel](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/HistoryPanel.tsx): `apps/editor/src/components/HistoryPanel.tsx`
- [Audit panel](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/AuditPanel.tsx): `apps/editor/src/components/AuditPanel.tsx`
- [Compiler results](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/CompilerPanel.tsx): `apps/editor/src/components/CompilerPanel.tsx`

### Graph domain

- [Node palette](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/palette.ts): `apps/editor/src/domain/palette.ts`
- [Port definitions](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/definitions.ts): `apps/editor/src/domain/definitions.ts`
- [Property schemas](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/domain/properties.ts): `apps/editor/src/domain/properties.ts`
- [Formula document](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/document.ts): `apps/editor/src/model/document.ts`
- [Connection rules](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/connections.ts): `apps/editor/src/model/connections.ts`

### Compilation checks

- [Formula compiler](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/compiler.ts): `apps/editor/src/model/compiler.ts`
- [Domain tribunals](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/tribunals.ts): `apps/editor/src/model/tribunals.ts`
- [AEL policy](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/aelPolicy.ts): `apps/editor/src/model/aelPolicy.ts`

### Session records

- [Document operations](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/operations.ts): `apps/editor/src/model/operations.ts`
- [Undo history](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/history.ts): `apps/editor/src/model/history.ts`
- [Audit receipts](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/audit.ts): `apps/editor/src/model/audit.ts`
- [Session storage](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/model/storage.ts): `apps/editor/src/model/storage.ts`

### Repository evidence

- [Repository selector](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/RepositorySelector.tsx): `apps/editor/src/components/RepositorySelector.tsx`
- [Revision selector](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/RevisionSelector.tsx): `apps/editor/src/components/RevisionSelector.tsx`
- [Commit evidence](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/components/CommitEvidencePanel.tsx): `apps/editor/src/components/CommitEvidencePanel.tsx`
- [GitHub adapter](https://github.com/yasmindiess/bi-ble/blob/main/apps/editor/src/integrations/github.ts): `apps/editor/src/integrations/github.ts`

### Other components

- **Editor user**
- **GitHub API routes**

## Connections

- Editor user → Editor workflow: edits graph (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Formula canvas: renders (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Node properties: renders (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Connection rules: validates links (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Formula document: creates graph (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Session storage: loads and saves (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Undo history: commits and undoes (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Formula compiler: compiles graph (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → History panel: renders (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Audit panel: renders (evidence: `apps/editor/src/App.tsx`)
- Editor workflow → Compiler results: renders (evidence: `apps/editor/src/App.tsx`)
- Formula canvas → Formula document: uses graph model (evidence: `apps/editor/src/components/FormulaCanvas.tsx`)
- Node properties → Formula document: edits node data (evidence: `apps/editor/src/components/NodePropertyEditor.tsx`)
- Formula document → Port definitions: gets port templates (evidence: `apps/editor/src/model/document.ts`)
- Formula document → Property schemas: gets defaults (evidence: `apps/editor/src/model/document.ts`)
- Port definitions → Node palette: uses domains (evidence: `apps/editor/src/domain/definitions.ts`)
- Property schemas → Node palette: uses domains (evidence: `apps/editor/src/domain/properties.ts`)
- Undo history → Document operations: applies operations (evidence: `apps/editor/src/model/history.ts`)
- Undo history → Audit receipts: creates receipts (evidence: `apps/editor/src/model/history.ts`)
- Session storage → Formula document: builds ports (evidence: `apps/editor/src/model/storage.ts`)
- Session storage → Undo history: restores session (evidence: `apps/editor/src/model/storage.ts`)
- Session storage → Audit receipts: restores audit (evidence: `apps/editor/src/model/storage.ts`)
- History panel → Undo history: displays (evidence: `apps/editor/src/components/HistoryPanel.tsx`)
- Audit panel → Audit receipts: displays (evidence: `apps/editor/src/components/AuditPanel.tsx`)
- Formula compiler → Formula document: reads graph (evidence: `apps/editor/src/model/compiler.ts`)
- Formula compiler → Property schemas: canonicalizes properties (evidence: `apps/editor/src/model/compiler.ts`)
- Formula compiler → Domain tribunals: evaluates (evidence: `apps/editor/src/model/compiler.ts`)
- Domain tribunals → AEL policy: evaluates policy (evidence: `apps/editor/src/model/tribunals.ts`)
- Compiler results → Formula compiler: shows results (evidence: `apps/editor/src/components/CompilerPanel.tsx`)
- Repository selector → GitHub adapter: loads repositories (evidence: `apps/editor/src/components/RepositorySelector.tsx`)
- Revision selector → GitHub adapter: loads revisions (evidence: `apps/editor/src/components/RevisionSelector.tsx`)
- Commit evidence → GitHub adapter: loads evidence (evidence: `apps/editor/src/components/CommitEvidencePanel.tsx`)
- Commit evidence → Formula document: records evidence (evidence: `apps/editor/src/components/CommitEvidencePanel.tsx`)
- GitHub adapter → GitHub API routes: requests data (evidence: `apps/editor/src/integrations/github.ts`)
