# gat45/harnais-1080 architecture

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

- Interactive diagram: https://gitdiagram.com/gat45/harnais-1080
- Repository: https://github.com/gat45/harnais-1080

## Overview

Harnais-1080 is a local llama.cpp PC harness: a user prompt enters the Python conversation flow, which can retrieve local BM25 context, query the server, and dispatch tool requests. Separate capabilities include guarded dual-agent code repair, hardware monitoring, and a Windows launcher. The main calls are visible in the excerpts; broader launcher options and product capabilities are also documented in the README. The monitor’s internal UI wiring and some integrations are only partially sampled, so uncertain connections are omitted.

Main entry points: [`harness.py`](https://github.com/gat45/harnais-1080/blob/master/harness.py) (Chat harness), [`tools.py`](https://github.com/gat45/harnais-1080/blob/master/tools.py) (Tool parsing and dispatch), [`LamaHarnessLauncher.cs`](https://github.com/gat45/harnais-1080/blob/master/LamaHarnessLauncher.cs) (Windows launcher), [`bm25_reindex.py`](https://github.com/gat45/harnais-1080/blob/master/bm25_reindex.py) (Index rebuild)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Launch and chat"]
  node_launcher["Windows launcher"]
  node_harness["Chat harness<br/>[harness.py]"]
  node_llama["llama.cpp server"]
end

subgraph group_retrieval["Local RAG"]
  node_reindex["Index rebuild<br/>[bm25_reindex.py]"]
  node_bm25["BM25 search and indexing<br/>[bm25.py]"]
  node_ragindex[("BM25 document index")]
end

subgraph group_tools["Workspace tools"]
  node_tool_dispatch["Tool parsing and dispatch<br/>[tools.py]"]
  node_workspace_read["Search and memory reads<br/>[tools.py]"]
  node_workspace_write["Confirmed file writes<br/>[tools.py]"]
  node_git_tools["Git status and diff<br/>[tools.py]"]
  node_skill_tools["Investigation tools<br/>[tools.py]"]
end

subgraph group_repair["Code repair"]
  node_fixer["Dual-agent fixer<br/>[fix_code.py]"]
end

subgraph group_monitoring["Hardware monitor"]
  node_monitor["Hardware monitor and TUI<br/>[omni_monitor.py]"]
end

node_user(("User"))
node_workspace[("Local workspace")]
node_skill_scripts["External skill scripts"]

node_user -->|"asks"| node_harness
node_launcher -->|"starts or checks"| node_llama
node_launcher -->|"launches"| node_harness
node_launcher -->|"launches"| node_monitor
node_launcher -->|"runs"| node_reindex
node_harness -->|"requests completion"| node_llama
node_harness -->|"searches context"| node_bm25
node_harness -->|"reads"| node_ragindex
node_reindex -->|"builds index with"| node_bm25
node_reindex -->|"writes"| node_ragindex
node_harness -->|"parses and dispatches"| node_tool_dispatch
node_tool_dispatch -->|"dispatches"| node_workspace_read
node_tool_dispatch -->|"dispatches"| node_workspace_write
node_tool_dispatch -->|"dispatches"| node_git_tools
node_tool_dispatch -->|"dispatches"| node_skill_tools
node_workspace_read -->|"reads"| node_workspace
node_workspace_write -->|"writes"| node_workspace
node_git_tools -->|"runs git in"| node_workspace
node_skill_tools -->|"invokes"| node_skill_scripts
node_fixer -->|"requests model responses"| node_harness
node_user -.->|"requests code repair"| node_fixer
node_user -.->|"opens supervision"| node_monitor

click node_launcher "https://github.com/gat45/harnais-1080/blob/master/LamaHarnessLauncher.cs"
click node_harness "https://github.com/gat45/harnais-1080/blob/master/harness.py"
click node_reindex "https://github.com/gat45/harnais-1080/blob/master/bm25_reindex.py"
click node_bm25 "https://github.com/gat45/harnais-1080/blob/master/bm25.py"
click node_tool_dispatch "https://github.com/gat45/harnais-1080/blob/master/tools.py"
click node_workspace_read "https://github.com/gat45/harnais-1080/blob/master/tools.py"
click node_workspace_write "https://github.com/gat45/harnais-1080/blob/master/tools.py"
click node_git_tools "https://github.com/gat45/harnais-1080/blob/master/tools.py"
click node_skill_tools "https://github.com/gat45/harnais-1080/blob/master/tools.py"
click node_fixer "https://github.com/gat45/harnais-1080/blob/master/fix_code.py"
click node_monitor "https://github.com/gat45/harnais-1080/blob/master/omni_monitor.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_launcher,node_harness,node_llama,node_user toneBlue
class node_reindex,node_bm25,node_ragindex,node_workspace toneAmber
class node_tool_dispatch,node_workspace_read,node_workspace_write,node_git_tools,node_skill_tools toneMint
class node_fixer toneRose
class node_monitor,node_skill_scripts toneIndigo
```

## Components

### Launch and chat

- [Windows launcher](https://github.com/gat45/harnais-1080/blob/master/LamaHarnessLauncher.cs): `LamaHarnessLauncher.cs`
- [Chat harness](https://github.com/gat45/harnais-1080/blob/master/harness.py): `harness.py`
- **llama.cpp server**

### Local RAG

- [Index rebuild](https://github.com/gat45/harnais-1080/blob/master/bm25_reindex.py): `bm25_reindex.py`
- [BM25 search and indexing](https://github.com/gat45/harnais-1080/blob/master/bm25.py): `bm25.py`
- **BM25 document index**

### Workspace tools

- [Tool parsing and dispatch](https://github.com/gat45/harnais-1080/blob/master/tools.py): `tools.py`
- [Search and memory reads](https://github.com/gat45/harnais-1080/blob/master/tools.py): `tools.py`
- [Confirmed file writes](https://github.com/gat45/harnais-1080/blob/master/tools.py): `tools.py`
- [Git status and diff](https://github.com/gat45/harnais-1080/blob/master/tools.py): `tools.py`
- [Investigation tools](https://github.com/gat45/harnais-1080/blob/master/tools.py): `tools.py`

### Code repair

- [Dual-agent fixer](https://github.com/gat45/harnais-1080/blob/master/fix_code.py): `fix_code.py`

### Hardware monitor

- [Hardware monitor and TUI](https://github.com/gat45/harnais-1080/blob/master/omni_monitor.py): `omni_monitor.py`

### Other components

- **User**
- **Local workspace**
- **External skill scripts**

## Connections

- User → Chat harness: asks (evidence: `README.md`)
- Windows launcher → llama.cpp server: starts or checks (evidence: `LamaHarnessLauncher.cs`)
- Windows launcher → Chat harness: launches (evidence: `LamaHarnessLauncher.cs`)
- Windows launcher → Hardware monitor and TUI: launches (evidence: `LamaHarnessLauncher.cs`)
- Windows launcher → Index rebuild: runs (evidence: `LamaHarnessLauncher.cs`)
- Chat harness → llama.cpp server: requests completion (evidence: `harness.py`)
- Chat harness → BM25 search and indexing: searches context (evidence: `harness.py`)
- Chat harness → BM25 document index: reads (evidence: `harness.py`)
- Index rebuild → BM25 search and indexing: builds index with (evidence: `bm25_reindex.py`)
- Index rebuild → BM25 document index: writes (evidence: `bm25_reindex.py`)
- Chat harness → Tool parsing and dispatch: parses and dispatches (evidence: `harness.py`)
- Tool parsing and dispatch → Search and memory reads: dispatches (evidence: `tools.py`)
- Tool parsing and dispatch → Confirmed file writes: dispatches (evidence: `tools.py`)
- Tool parsing and dispatch → Git status and diff: dispatches (evidence: `tools.py`)
- Tool parsing and dispatch → Investigation tools: dispatches (evidence: `tools.py`)
- Search and memory reads → Local workspace: reads (evidence: `tools.py`)
- Confirmed file writes → Local workspace: writes (evidence: `tools.py`)
- Git status and diff → Local workspace: runs git in (evidence: `tools.py`)
- Investigation tools → External skill scripts: invokes (evidence: `tools.py`)
- Dual-agent fixer → Chat harness: requests model responses (evidence: `fix_code.py`)
- User → Dual-agent fixer: requests code repair (evidence: `README.md`)
- User → Hardware monitor and TUI: opens supervision (evidence: `README.md`)
