fin-hub/.claude/rules/architecture.md
tegwick 7e53c21feb Complete fin-hub repo integration (FIN-WP-0000)
Link the DB-first onboarding workstream to FIN-WP-0000-repo-integration.md,
finish agent orientation (rules stubs, remove first-session), add repo
classification, and close all four custodian onboarding tasks.
2026-07-08 22:39:22 +02:00

1 KiB

Architecture

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)
cli.py Operator CLI (finhub entrypoint)

Data flow

CSV exports → ingest parsers → cost models → runway/alerts → coupling emit → State Hub progress

v0.1 is manual CSV import only. Persistent ledger and HTTP read surface are tracked in FIN-WP-0001.

Quick Reference

~/state-hub/mcp_server/TOOLS.md — MCP tool reference