2026-07-08 14:50:21 +02:00
|
|
|
## Stack
|
|
|
|
|
|
2026-07-08 22:39:22 +02:00
|
|
|
- **Language:** Python 3.12+
|
|
|
|
|
- **Package manager:** uv
|
|
|
|
|
- **Key deps:** hub-core (generic hub primitives), pydantic, httpx
|
2026-07-08 14:50:21 +02:00
|
|
|
|
|
|
|
|
## Dev Commands
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Install dependencies
|
2026-07-08 22:39:22 +02:00
|
|
|
uv sync
|
2026-07-08 14:50:21 +02:00
|
|
|
|
|
|
|
|
# Run tests
|
2026-07-08 22:39:22 +02:00
|
|
|
uv run pytest
|
|
|
|
|
|
|
|
|
|
# CLI — runway projection
|
|
|
|
|
uv run finhub runway --balance 12000 --monthly-burn 2100,2200,2000
|
2026-07-08 14:50:21 +02:00
|
|
|
|
2026-07-08 22:39:22 +02:00
|
|
|
# CLI — import cost CSVs
|
|
|
|
|
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
|
2026-08-15 19:09:14 +02:00
|
|
|
uv run finhub import-ai-plan tests/fixtures/ai-plans.csv
|
2026-07-08 14:50:21 +02:00
|
|
|
|
2026-07-08 22:44:07 +02:00
|
|
|
# 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
|
2026-08-15 19:09:14 +02:00
|
|
|
uv run finhub ledger import ai-plan tests/fixtures/ai-plans.csv
|
2026-08-15 20:32:55 +02:00
|
|
|
uv run finhub ledger ingest-usage --resource resource:platform:audit-storage --source resource-control:data/actuals/2026-08.json tests/fixtures/platform-audit-storage-usage-2026-08.json
|
|
|
|
|
uv run finhub ledger reconcile-resource --resource resource:platform:audit-storage --period 2026-08
|
2026-08-15 19:09:14 +02:00
|
|
|
uv run finhub ledger commitments
|
2026-08-15 19:15:29 +02:00
|
|
|
uv run finhub ledger set-entitlement --provider anthropic --plan claude-max --period 2026-08 --unit plan --plan-label "Max 20x" --source vendor-plan
|
|
|
|
|
uv run finhub ledger plan-month --period 2026-08
|
2026-08-15 19:21:41 +02:00
|
|
|
uv run finhub ledger ingest-session-tokens tests/fixtures/session-tokens-2026-08.json
|
|
|
|
|
uv run finhub ledger session-tokens --period 2026-08
|
2026-08-15 19:35:43 +02:00
|
|
|
uv run finhub ledger allocate-plan --fact FACT --method measured_token_share
|
|
|
|
|
uv run finhub ledger plan-allocations
|
2026-08-15 19:53:28 +02:00
|
|
|
uv run finhub ledger effectiveness --period 2026-08
|
2026-07-08 22:44:07 +02:00
|
|
|
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
|
|
|
|
|
|
2026-07-08 22:46:24 +02:00
|
|
|
# HTTP read API
|
|
|
|
|
uv run finhub serve
|
|
|
|
|
# GET http://127.0.0.1:8080/runway/summary
|
|
|
|
|
# GET http://127.0.0.1:8080/runway/monthly-burn
|
|
|
|
|
|
2026-07-08 22:39:22 +02:00
|
|
|
# CLI — emit cross-hub signals (requires STATE_HUB_API)
|
|
|
|
|
uv run finhub runway --balance 12000 --monthly-burn 2100 --emit
|
|
|
|
|
```
|