Implement FIN-WP-0001 ledger, evaluate, and evidence lane (T03–T05)
Add SQLite-backed cost ledger with import/summary CLI, cron-friendly evaluate command with federation emit, and dogfood evidence artefact generation from fixture CSVs.
This commit is contained in:
parent
d6f88cd70a
commit
277c2d05ca
12 changed files with 760 additions and 7 deletions
|
|
@ -13,6 +13,9 @@ fin-specific models and services live here.
|
|||
| `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) |
|
||||
| `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 |
|
||||
| `cli.py` | Operator CLI (`finhub` entrypoint) |
|
||||
|
||||
### Data flow
|
||||
|
|
@ -21,8 +24,8 @@ fin-specific models and services live here.
|
|||
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`.
|
||||
v0.1 uses manual CSV import into a local SQLite ledger. HTTP read surface
|
||||
remains deferred (`FIN-WP-0001-T06`).
|
||||
|
||||
## Quick Reference
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,17 @@ uv run finhub import-cloud tests/fixtures/cloud-costs.csv
|
|||
uv run finhub import-anthropic tests/fixtures/anthropic-billing.csv
|
||||
uv run finhub import-hosteurope tests/fixtures/hosteurope.csv
|
||||
|
||||
# CLI — ledger (SQLite at .fin-hub/ledger.db)
|
||||
uv run finhub ledger set-balance 12000
|
||||
uv run finhub ledger import cloud tests/fixtures/cloud-costs.csv
|
||||
uv run finhub ledger summary
|
||||
|
||||
# CLI — scheduled evaluation (cron/systemd friendly)
|
||||
uv run finhub evaluate --emit
|
||||
|
||||
# CLI — dogfood evidence artefact
|
||||
uv run finhub evidence --seed-fixtures
|
||||
|
||||
# CLI — emit cross-hub signals (requires STATE_HUB_API)
|
||||
uv run finhub runway --balance 12000 --monthly-burn 2100 --emit
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue