feat: reporting-allocate AI-plan cost across work
Split a booked AI-plan fact across workplans or repos using measured tokens, measured+estimated tokens, session counts, or an even split. Unmeasured remainder stays a residual. The record is not resource-control AllocationEvidence and does not create booked spend.
This commit is contained in:
parent
8916f3c4d0
commit
efd1b31001
10 changed files with 646 additions and 3 deletions
47
tests/fixtures/session-tokens-two-workplans.json
vendored
Normal file
47
tests/fixtures/session-tokens-two-workplans.json
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"schema_version": "0.1",
|
||||
"record_type": "session_token_evidence",
|
||||
"record_id": "session-tokens:state-hub:2026-08:two-workplans",
|
||||
"revision_of": null,
|
||||
"source_system": "state-hub",
|
||||
"period_start": "2026-08-01",
|
||||
"period_end": "2026-08-31",
|
||||
"captured_at": "2026-08-15T12:00:00Z",
|
||||
"source_evidence": [
|
||||
"state-hub:/token-events/aggregate/?month=2026-08"
|
||||
],
|
||||
"totals": {
|
||||
"measured": {
|
||||
"tokens_in": 200,
|
||||
"tokens_out": 0,
|
||||
"event_count": 3,
|
||||
"confidence": "1.0"
|
||||
},
|
||||
"estimated": {
|
||||
"tokens_in": 50,
|
||||
"tokens_out": 0,
|
||||
"event_count": 1,
|
||||
"confidence": "0.35"
|
||||
}
|
||||
},
|
||||
"associations": [
|
||||
{
|
||||
"scope": "workplan",
|
||||
"scope_id": "workplan-a",
|
||||
"label": "WP-A",
|
||||
"measurement_kind": "measured",
|
||||
"tokens_in": 100,
|
||||
"tokens_out": 0,
|
||||
"event_count": 1
|
||||
},
|
||||
{
|
||||
"scope": "workplan",
|
||||
"scope_id": "workplan-b",
|
||||
"label": "WP-B",
|
||||
"measurement_kind": "measured",
|
||||
"tokens_in": 50,
|
||||
"tokens_out": 0,
|
||||
"event_count": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue