# peacekiller/stoned_hermine architecture

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

- Interactive diagram: https://gitdiagram.com/peacekiller/stoned_hermine
- Repository: https://github.com/peacekiller/stoned_hermine

## Overview

Stoned Hermine polls Stein.App assets, compares each result with a local SQLite snapshot, persists new or changed records, and posts a Hermine channel message for selected changes. The main script owns polling, comparison, persistence, formatting, and notification decisions; SteinAPI and StashCat.py implement the external clients, while Diff.py represents field changes. The README documents the product workflow; sampled source confirms the main call paths and client behavior.

Main entry points: [`StonedHermine.py`](https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py) (Polling and orchestration), [`steinapi.py`](https://github.com/peacekiller/stoned_hermine/blob/master/steinapi.py) (Stein.App client), [`Stashcat.py`](https://github.com/peacekiller/stoned_hermine/blob/master/Stashcat.py) (Stashcat client), [`Diff.py`](https://github.com/peacekiller/stoned_hermine/blob/master/Diff.py) (Field change record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_polling["Asset monitoring"]
  node_app["Polling and orchestration<br/>[StonedHermine.py]"]
  node_stein["Stein.App client<br/>[steinapi.py]"]
  node_comparison["Asset comparison<br/>[StonedHermine.py]"]
  node_diff["Field change record<br/>[Diff.py]"]
end

subgraph group_state["Local state"]
  node_store[("Asset snapshot<br/>[StonedHermine.py]")]
  node_schema[("Database schema")]
end

subgraph group_messaging["Hermine messaging"]
  node_notify["Change filtering and formatting<br/>[StonedHermine.py]"]
  node_stashcat["Stashcat client<br/>[Stashcat.py]"]
end

node_operator(("Operator"))
node_steinservice{{"Stein.App service"}}
node_hermine{{"Hermine service"}}

node_operator -->|"starts"| node_app
node_app -->|"polls assets"| node_stein
node_stein -->|"requests assets"| node_steinservice
node_app -->|"reads and writes"| node_store
node_app -->|"compares records"| node_comparison
node_comparison -->|"creates changes"| node_diff
node_app -->|"formats selected changes"| node_notify
node_app -->|"sends message"| node_stashcat
node_stashcat -->|"posts channel message"| node_hermine
node_app -->|"applies migrations"| node_schema

click node_app "https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py"
click node_stein "https://github.com/peacekiller/stoned_hermine/blob/master/steinapi.py"
click node_comparison "https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py"
click node_diff "https://github.com/peacekiller/stoned_hermine/blob/master/Diff.py"
click node_store "https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py"
click node_schema "https://github.com/peacekiller/stoned_hermine/tree/master/changelogs"
click node_notify "https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py"
click node_stashcat "https://github.com/peacekiller/stoned_hermine/blob/master/Stashcat.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_app,node_stein,node_comparison,node_diff toneBlue
class node_store,node_schema toneAmber
class node_notify,node_stashcat toneMint
class node_operator,node_steinservice,node_hermine toneIndigo
```

## Components

### Asset monitoring

- [Polling and orchestration](https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py): `StonedHermine.py`
- [Stein.App client](https://github.com/peacekiller/stoned_hermine/blob/master/steinapi.py): `steinapi.py`
- [Asset comparison](https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py): `StonedHermine.py`
- [Field change record](https://github.com/peacekiller/stoned_hermine/blob/master/Diff.py): `Diff.py`

### Local state

- [Asset snapshot](https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py): `StonedHermine.py`
- [Database schema](https://github.com/peacekiller/stoned_hermine/tree/master/changelogs): `changelogs`

### Hermine messaging

- [Change filtering and formatting](https://github.com/peacekiller/stoned_hermine/blob/master/StonedHermine.py): `StonedHermine.py`
- [Stashcat client](https://github.com/peacekiller/stoned_hermine/blob/master/Stashcat.py): `Stashcat.py`

### Other components

- **Operator**
- **Stein.App service**
- **Hermine service**

## Connections

- Operator → Polling and orchestration: starts (evidence: `README.md`)
- Polling and orchestration → Stein.App client: polls assets (evidence: `StonedHermine.py`)
- Stein.App client → Stein.App service: requests assets (evidence: `steinapi.py`)
- Polling and orchestration → Asset snapshot: reads and writes (evidence: `StonedHermine.py`)
- Polling and orchestration → Asset comparison: compares records (evidence: `StonedHermine.py`)
- Asset comparison → Field change record: creates changes (evidence: `StonedHermine.py`)
- Polling and orchestration → Change filtering and formatting: formats selected changes (evidence: `StonedHermine.py`)
- Polling and orchestration → Stashcat client: sends message (evidence: `StonedHermine.py`)
- Stashcat client → Hermine service: posts channel message (evidence: `Stashcat.py`)
- Polling and orchestration → Database schema: applies migrations (evidence: `StonedHermine.py`)
