feat: book monthly AI-plan invoices as facts and commitments

Add ai-plan ingest that stores one current booked fact per
provider-account × plan × period. Subscriptions become recurring
commitments; usage top-ups do not. Session-level rows are rejected.
This commit is contained in:
tegwick 2026-08-15 19:09:14 +02:00
parent 38d0bf21c9
commit ce4f791a63
11 changed files with 511 additions and 5 deletions

View file

@ -175,7 +175,7 @@ row still books the amount and does not invent token quantities.
```task
id: FIN-WP-0007-T02
status: todo
status: done
priority: high
state_hub_task_id: "216aac44-f712-483c-a402-7db39c5967dd"
```
@ -195,6 +195,14 @@ subscription and a usage-top-up) books exactly once per period,
corrects append-only, and appears on burn/runway like any other
commitment.
Completed 2026-08-15: `import-ai-plan` / `ledger import ai-plan` books
one current fact per provider-account × plan × period. Session-level
columns are rejected. Subscriptions upsert a monthly commitment;
usage top-ups do not. Corrections stay append-only. `booked_cost`
projection keeps `resource_id` null and tax unknown. Booked invoices
drive burn; a commitment-only month can still produce a runway
figure without double-counting the same euros.
## Record plan entitlements
```task