2026-07-08 14:50:21 +02:00
|
|
|
## Architecture
|
|
|
|
|
|
2026-07-08 22:39:22 +02:00
|
|
|
Fin-hub extends `hub-core` with financial models and operator surfaces. Generic
|
|
|
|
|
hub primitives (domains, repos, messages, progress) come from hub-core;
|
|
|
|
|
fin-specific models and services live here.
|
|
|
|
|
|
|
|
|
|
### Modules
|
|
|
|
|
|
|
|
|
|
| Module | Role |
|
|
|
|
|
|--------|------|
|
|
|
|
|
| `models/` | Budget, commitment, service cost, burn rate dataclasses |
|
|
|
|
|
| `ingest/` | CSV parsers for cloud, Anthropic billing, HostEurope invoices |
|
|
|
|
|
| `services/runway.py` | Runway projection from balance + monthly burn series |
|
|
|
|
|
| `services/alerts.py` | Threshold evaluation (runway months, budget overrun) |
|
|
|
|
|
| `coupling/` | FOS §9 signals: fin→dev (resource pressure), fin→ops (cost attribution), fin→canon (viability) |
|
2026-07-08 22:44:07 +02:00
|
|
|
| `services/ledger.py` | SQLite cost ledger with monthly rollups |
|
|
|
|
|
| `services/evaluate.py` | Ledger-driven runway evaluation for cron |
|
|
|
|
|
| `services/evidence.py` | Non-secret dogfood evidence generation |
|
2026-07-08 22:39:22 +02:00
|
|
|
| `cli.py` | Operator CLI (`finhub` entrypoint) |
|
|
|
|
|
|
|
|
|
|
### Data flow
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
CSV exports → ingest parsers → cost models → runway/alerts → coupling emit → State Hub progress
|
|
|
|
|
```
|
|
|
|
|
|
2026-07-08 22:44:07 +02:00
|
|
|
v0.1 uses manual CSV import into a local SQLite ledger. HTTP read surface
|
|
|
|
|
remains deferred (`FIN-WP-0001-T06`).
|
2026-07-08 14:50:21 +02:00
|
|
|
|
|
|
|
|
## Quick Reference
|
|
|
|
|
|
2026-07-08 22:39:22 +02:00
|
|
|
`~/state-hub/mcp_server/TOOLS.md` — MCP tool reference
|