Workflow-first MVPDocs Center liveHelp routes reservedProjects & Billing in codeSupply & Marketplace in code

Usage

Usage now carries the Day 4 commercial trace: subscription-funded credits stay visible through reservation, accepted execution, terminal usage, and later settlement holds on one shared control-plane surface.

Ledger Workbench

Usage now traces accepted execution through one commercial ledger

Day 4 makes the relationship explicit: subscription posture funds credits, accepted execution reserves them, usage records the commercial trace, and later settlement must derive from that same ledger instead of a parallel hidden path.

Service boundary: cloudflare-d1

State demoLiveEmptyError
Module 5 Day 4 shipped

Available

200

Reserved

6

Included plan

500

Settlement hold

1

Ledger events

Keep usage, reservations, and future settlement effects in one table.

EventKindAmountBalanceCreated

Accepted execution path

Usage now shows the full Day 4 commercial trace from preview through reservation, terminal usage, and later settlement.

Shared foundation truth

Preview

Run-preview returns a viable path but stays non-billable.

Preview proves the workflow shape and gates without mutating the wallet, usage ledger, or future settlement state.

Credit effect

No reservation; preview remains free.

Usage effect

No usage row is required yet.

Settlement effect

No settlement or payout impact exists.

Accept

Operator turns the approved preview into a real run.

Accepted execution is the first commercial mutation because it bridges project-owned workflow approval into the account-owned wallet and usage ledger.

Credit effect

Reserve estimated credits immediately after permission and ownership checks pass.

Usage effect

Write a reservation row so the ledger already explains the queued run.

Settlement effect

Still outside payout eligibility.

Queued

The accepted run waits for executor pickup or terminal simulation.

Queue state keeps the accepted run commercially visible before the runner does any terminal work.

Credit effect

Reserved balance stays locked and visible.

Usage effect

Reservation remains the active ledger explanation until completion or release.

Settlement effect

No provider hold is released while the run is still queued.

Complete

Executor or control-plane completion writes the terminal receipt.

Completion turns the accepted execution into durable usage truth instead of leaving commercial state implicit inside the run table.

Credit effect

Settle reserved credits into consumed usage, or release the reservation if execution never becomes billable.

Usage effect

Write the durable usage receipt tied to the run, steps, and audit trail.

Settlement effect

Provider-backed supply can now derive later revenue-share math from this usage receipt.

Settlement hold

Provider or marketplace accounting closes around accepted usage.

Settlement belongs downstream of usage so payout logic can never outrun the accepted execution record that created it.

Credit effect

No second customer deduction should happen here; only downstream accounting moves.

Usage effect

Usage remains the source receipt used to reconcile settlement state.

Settlement effect

Write hold, eligible, and release windows after the configured waiting period.