2026-08-15 18:50:23 +02:00
---
id: FIN-WP-0007
type: workplan
title: "AI plan cost, token estimates, and effectiveness"
domain: financials
repo: fin-hub
2026-08-15 19:01:45 +02:00
status: active
2026-08-15 18:50:23 +02:00
owner: grok
topic_slug: financials
created: "2026-08-15"
updated: "2026-08-15"
related:
- FIN-WP-0002
- FIN-WP-0004
2026-08-15 19:01:45 +02:00
- FIN-WP-0006
2026-08-15 18:50:23 +02:00
- STATE-WP-0045
2026-08-15 19:01:45 +02:00
- RESOURCE-WP-0003
2026-08-15 18:50:23 +02:00
- ITC-CAP-0.2.0
origin: assessment
origin_ref: "info-tech-canon 0.3.0 review — AI token data-gap"
2026-08-15 18:51:34 +02:00
state_hub_workstream_id: "88de5e03-a53f-4b62-a0a7-1365756da2d7"
2026-08-15 18:50:23 +02:00
---
# FIN-WP-0007 — AI plan cost, token estimates, and effectiveness
## Goal
Build a provenance-bearing dataset that lets fin-hub compare **what AI
plans cost**, **what token capacity they entitle** , **what was actually
or estimably consumed**, and **what work was delivered** , without treating
missing session usage as zero and without turning estimates into booked
spend.
The motivating failure is operational, not theoretical: most coding-agent
sessions do not emit trustworthy token counts or token costs. The facts
that *do* exist are monthly plan invoices, plan entitlements, occasional
provider or State Hub measurements, and independent work outcomes. Those
must stay distinct and joinable so effectiveness can be watched over
time.
This workplan applies the InfoTechCanon 0.3.0 / ITC-CAP 0.2.0 split
already used for infrastructure in `FIN-WP-0004` : booked euros are not
usage; usage is recorded in native units (`token` for class `I` );
`unknown` is never stored as `0` ; currency is an overlay. It does **not**
wait for a new commerce or intelligence domain model.
## Boundaries
2026-08-15 19:01:45 +02:00
Checked 2026-08-15 against resource-control SCOPE, INTENT, procurement
terms §4.1/§6, their v0.1 ratification, evidence-basis vocabulary, and
the backup capability restatement. Design note:
`docs/ai-plan-token-effectiveness.md` . Contract v0.1 is not silently
amended; the addendum in that note is offered, not assumed.
2026-08-15 18:50:23 +02:00
| Concept | Authoritative writer | Fin-hub role |
| --- | --- | --- |
| Provider invoice / plan subscription charge | fin-hub | Book once as `booked_cost` |
| Recurring plan as a financial commitment | fin-hub | Record cadence and amount; not usage |
| Plan entitlement (included tokens or plan capacity) | fin-hub | Commercial fact, same discipline as engagement prices |
2026-08-15 19:01:45 +02:00
| Intelligence / infrastructure `resource_id` | resource-control | Join when they publish one; never invent |
| Provision-level class `I` usage | resource-control (gap they already own) | Consume via `FIN-WP-0004` when emitted |
| Session token evidence (`measured` / `allocated` / `estimated` / `superseded` ) | State Hub (`STATE-WP-0045` ) | Join as session-token evidence; do not store as `usage_observation` |
| Technical allocation of a portfolio resource | resource-control | Consume `AllocationEvidence` ; do not emit it |
2026-08-15 18:50:23 +02:00
| Work done (tasks, progress, outcomes) | State Hub / domain repos | Join key for effectiveness; not a cost driver |
2026-08-15 19:01:45 +02:00
| Reporting allocation of a plan invoice across work | fin-hub | Local `FIN-WP-0002` -family derivation |
2026-08-15 18:50:23 +02:00
| Implied €/token and work-per-token / work-per-euro | fin-hub | Reporting overlay; never a booked price |
| Vendor parsers, transcripts, model names, list prices | State Hub / llm-connect / operators | Not invented here |
2026-08-15 19:01:45 +02:00
Reuse the *discipline* of contract v0.1 (unknown is not zero, residual
visible, estimates are not booked). Do not impersonate resource-control
record types for agent-session telemetry or work-effectiveness shares.
Founder-private AI plans may be booked for runway. They stay
`resource_id=null` and must not silent-default `financial_entity_id`
until the spend is booked to an entity and, if Railiance-procured, a
resource.
2026-08-15 18:50:23 +02:00
## Non-goals
- Legal invoices, DATEV postings, or payment execution (`FIN-WP-0005` ).
- Completing the Scaleway `platform:audit-storage` booked-cost round trip
(`FIN-WP-0004-T05` ). That is class `S` , not class `I` .
- Owning session parsers or storing transcripts.
2026-08-15 19:01:45 +02:00
- Inventing a `resource_id` or metering tokens against a provision.
- Emitting `usage_observation` or `AllocationEvidence` as if this repo
were resource-control.
2026-08-15 18:50:23 +02:00
- A canonical token↔hour or token↔euro exchange rate (ITC-CAP forbids
asserting one; substitution is observed from the time series).
- A new definition of “work” beyond joining to existing task / progress
outcomes.
- Editing InfoTechCanon inline. Canon pressure is a demand message, not a
kernel patch from this repo.
## Measurement layers
Keep these four quantities in separate records, joined by period,
provider/plan, and optional workplan/repo:
1. **Booked plan cost** — euros for the subscription month.
2. **Entitlement** — included tokens or declared plan capacity.
3. **Consumption of class `I`** — tokens, each row marked
`measured` | `inferred` | `unknown` . Missing is `unknown` , never `0` .
4. **Work done** — tasks or accepted outcomes in the same period.
Derived overlays, never booked facts:
- implied €/token = booked ÷ (measured + estimated + residual)
- effectiveness = work / measured tokens, work / (measured+estimated)
tokens, and work / euro
- coverage = measured / (measured + estimated + residual)
A month with worse coverage must not look more efficient. Changing an
estimator method starts a new series.
## Record the authority and measurement split
```task
id: FIN-WP-0007-T00
2026-08-15 19:01:45 +02:00
status: done
2026-08-15 18:50:23 +02:00
priority: high
2026-08-15 18:51:34 +02:00
state_hub_task_id: "5e9bccfd-569a-43a2-b016-afed760add49"
2026-08-15 18:50:23 +02:00
```
Write a short design note in `docs/` that records the four-layer split,
the authority table above, reuse of the v0.1 exchange envelopes, and
the State Hub join (token aggregates by
`measurement_kind` , period, repo/workplan). Confirm `SCOPE.md` already
covers token-spend models; if the current wording implies session-metered
CSV rows are the only token surface, update it so plan invoices,
entitlements, estimated usage, and effectiveness reports are in scope
while session parsing stays out.
Done when the note is committed, `SCOPE.md` matches the boundary, and
no task below has an ambiguous owner for booked cost, entitlement,
session tokens, or work.
2026-08-15 19:01:45 +02:00
Completed 2026-08-15: boundary-checked against resource-control SCOPE,
INTENT, Terms §4.1/§6, their contract ratification, evidence-basis, and
the backup restatement. They own intelligence *resource* identity and
provision-level class `I` metering (not yet implemented). Session
telemetry and work-effectiveness stay outside that. Note:
`docs/ai-plan-token-effectiveness.md` . `SCOPE.md` and `INTENT.md`
updated. T04/T05 rewritten so fin-hub does not impersonate
`usage_observation` or `AllocationEvidence` . Proposed v0.1 addendum
offered to resource-control; not assumed.
2026-08-15 18:50:23 +02:00
## Stop treating missing tokens as zero
```task
id: FIN-WP-0007-T01
2026-08-15 19:01:45 +02:00
status: done
2026-08-15 18:50:23 +02:00
priority: high
2026-08-15 18:51:34 +02:00
state_hub_task_id: "aefa287e-0e4d-40b1-adf6-a8e6df7caeb2"
2026-08-15 18:50:23 +02:00
```
After T00, fix `TokenSpend` and `parse_anthropic_billing_csv` so absent
token fields are `null` / omitted, not `0` . `0` means measured and none.
Align ledger import: token quantities that are unknown must not become
zero ledger attributes, and a cost-only row must remain a cost-only row.
Add regression tests for missing `input_tokens` / `output_tokens` ,
cost-only provider exports, and the invariant that incomplete months
cannot under-report consumption as zero.
Done when the existing fixture still parses, a missing-token fixture
does not emit zeros, and CAP-R8 (`unknown` never stored as zero) holds
on the token path.
2026-08-15 19:01:45 +02:00
Completed 2026-08-15: `parse_optional_token_count` treats empty as
unknown and `0` as measured none. `TokenSpend.tokens_in/out` are
nullable with no zero default. Ledger import of a cost-only Anthropic
row still books the amount and does not invent token quantities.
2026-08-15 18:50:23 +02:00
## Book AI-plan invoices as facts and commitments
```task
id: FIN-WP-0007-T02
status: todo
priority: high
2026-08-15 18:51:34 +02:00
state_hub_task_id: "216aac44-f712-483c-a402-7db39c5967dd"
2026-08-15 18:50:23 +02:00
```
After T00, ingest monthly AI-plan / subscription charges as
`booked_cost` facts (one current fact per provider-account × plan ×
accounting period) and as recurring `Commitment` rows where the plan is
ongoing. Use the existing financial-fact identity, fingerprint,
correction, and unknown-tax rules from `FIN-WP-0004` .
Do not explode a flat monthly invoice into synthetic per-session costs.
Session-level euros, if shown at all, come from a later allocation
(T05), not from the booked ledger.
Done when a fixture for at least two providers (for example a flat
subscription and a usage-top-up) books exactly once per period,
corrects append-only, and appears on burn/runway like any other
commitment.
## Record plan entitlements
```task
id: FIN-WP-0007-T03
status: todo
priority: high
2026-08-15 18:51:34 +02:00
state_hub_task_id: "51c1b86f-c137-4b5d-9719-cd2ae60fe857"
2026-08-15 18:50:23 +02:00
```
After T02, add an append-only plan-entitlement record: provider, plan
identity, period, entitled quantity, unit (`token` or a declared plan
capacity such as a multiplier), source provenance, and revision link.
Follow the engagement-price discipline from `FIN-WP-0002-T02` : a
revision supersedes, a price or capacity is not an invoice, currency
mismatches cannot silently join.
When entitled tokens are themselves unknown (common for “Max 20× ”
style plans), store `unknown` plus the declared plan label. Do not
invent a token ceiling.
Done when a plan month can be reported as booked euros + entitled
capacity (or explicit unknown) without reading session logs.
2026-08-15 19:01:45 +02:00
## Join State Hub session-token aggregates
2026-08-15 18:50:23 +02:00
```task
id: FIN-WP-0007-T04
status: todo
priority: high
2026-08-15 18:51:34 +02:00
state_hub_task_id: "29f1804f-a5ad-46b6-b9d7-8f074e31b04e"
2026-08-15 18:50:23 +02:00
```
2026-08-15 19:01:45 +02:00
After T00, ingest State Hub token summaries as **fin-hub session-token
evidence**, not as resource-control `usage_observation` . Preserve
`measurement_kind` (`measured` , `allocated` , `estimated` ,
`superseded` ), period, model, repo/workplan association, confidence,
and coverage. Map kinds onto the resource-control evidence-basis
vocabulary (`measured` / `derived` / `estimated` / excluded /
`unknown` ). Do not re-parse Codex, Claude, Cursor, or Grok session
files. Do not invent a `resource_id` .
If resource-control later inventories a Railiance-procured
intelligence resource and emits `usage_observation` for it, consume
that through the existing `FIN-WP-0004` planning-evidence path.
2026-08-15 18:50:23 +02:00
Superseded rows must not enter totals. Estimated and measured must
remain separable. Months with no State Hub events produce an explicit
unknown residual, not a zero-consumption observation.
Done when a recorded fixture of mixed measured/estimated/superseded
2026-08-15 19:01:45 +02:00
aggregates stores as session-token evidence, reconciles by kind, and
cannot be posted as booked spend or as resource-control usage.
2026-08-15 18:50:23 +02:00
2026-08-15 19:01:45 +02:00
## Reporting-allocate booked plan cost across work
2026-08-15 18:50:23 +02:00
```task
id: FIN-WP-0007-T05
status: todo
priority: medium
2026-08-15 18:51:34 +02:00
state_hub_task_id: "db098143-90b7-475c-8846-e4c274e50b4a"
2026-08-15 18:50:23 +02:00
```
After T02 and T04, allocate each AI-plan `financial_fact_id` across
2026-08-15 19:01:45 +02:00
repos/workplans as a **fin-hub reporting allocation** (same family as
`FIN-WP-0002` billing basis). This is not resource-control
`AllocationEvidence` and must not be posted as technical allocation.
Allowed first methods: measured-token share, measured+estimated-token
share, session-count share, even split. Method and estimator version
are part of the record identity. Shares plus residual must equal 1.
Unattributed and unmeasured shares stay visible. Allocation never
writes a new booked fact.
2026-08-15 18:50:23 +02:00
2026-08-15 19:01:45 +02:00
Technical allocation of a portfolio resource remains
resource-control's job and only applies when they have published a
`resource_id` .
2026-08-15 18:50:23 +02:00
Done when a one-plan, two-workplan fixture reconciles to the booked
2026-08-15 19:01:45 +02:00
effective amount, names its method, keeps residual when coverage is
incomplete, and is not stored as `AllocationEvidence` .
2026-08-15 18:50:23 +02:00
## Publish an effectiveness report
```task
id: FIN-WP-0007-T06
status: todo
priority: medium
2026-08-15 18:51:34 +02:00
state_hub_task_id: "cea14702-faca-4024-b6f8-1ad221b70624"
2026-08-15 18:50:23 +02:00
```
After T03– T05, add a period report (CLI and, if cheap, the existing
read API) that emits, per plan and currency:
- booked effective amount
- entitled capacity (or unknown)
- tokens measured / estimated / residual-unknown
- coverage ratio
- implied €/token, labelled inferred
- work joined (task counts or accepted outcomes) for the same period
- work per measured token, work per (measured+estimated) token, work
per euro — three series, not one blend
Refuse to present a single blended “efficiency” number. A month whose
coverage is below a documented threshold is marked unfit for trend
comparison, not interpolated.
Done when two fixture months with different coverage cannot produce a
chart in which the worse-measured month looks cheaper per unit of
work unless that is also true on the measured-only series.
## Send canon feedback
```task
id: FIN-WP-0007-T07
status: todo
priority: low
2026-08-15 18:51:34 +02:00
state_hub_task_id: "42aeae80-4d7c-4f79-b5b3-d42b3d205762"
2026-08-15 18:50:23 +02:00
```
After T00, send a demand signal to `info-tech-canon` (State Hub
message and/or a `demand/` note they can assimilate). Ask for:
- a `measured | inferred | declared | unknown` qualifier on
`CapabilityConsumption` (reuse ITC-DATA lineage states; do not
invent a local dialect);
- enough `commerce.entitlement` / `commerce.metering` structure for
plan capacity and incomplete meters (OQ-5 still open for invoices
and entitlements);
- dropping or re-homing the `cost` quality dimension on
`intelligence.generation` so it does not fight ITC-CAP §4.12.
Do not patch the canon from this repo.
Done when the demand is sent, referenced from this workplan, and
explicitly does not block T01– T06.