← All Posts

The quirq calculus

Every calculation in quirq accounting: scoring, the mint, the all-in cost model, unit and portfolio metrics, the time axis, and the energy bridge.

July 22, 2026·5 min read

Snapshot before, snapshot after, score against weighted checks, mint against the budget, meter everything. Every number an operator needs falls out of one ledger.

Scoring: how completion is computed

A unit of work is a triple:

u = (S₀, G, B)

S₀  the snapshot of world state when the unit is created
G   the definition of done: weighted checks {(g₁,w₁), …, (gₙ,wₙ)}
B   the budget: what reaching the end state is worth, set by the owner

When the agent reports done, the environment captures the after-snapshot S₁ and computes:

         Σᵢ wᵢ · gᵢ(S₁)
V(u) = ─────────────────  ∈ [0, 1]      completion score
            Σᵢ wᵢ

done(u) = V(u) ≥ τ                      acceptance, typically τ = 1

Every check runs against S₁, the state the environment captured, never the agent's account of what it did. The score is a property of the world, not of a report.

Worked: a support ticket carries three checks: status closed (w = 0.5), reply sent (w = 0.3), KB article linked (w = 0.2). The after-snapshot passes the first two: V = 0.8.

The mint

Q(u) = V(u) · B(u)              divisible settlement (pay per delivered share)
Q(u) = B(u) · [V(u) ≥ τ]        atomic settlement (all or nothing)

The owner declares the regime at creation: atomic when partial completion is worthless (a half-merged change), divisible when it is not (four of five report sections). Quirqs inherit the budget's currency, so quirq totals compare directly to payroll, vendor spend, and revenue.

The all-in cost of an outcome

The token bill is one line of the true cost. The environment meters all of them:

C_total(u) =  Σ tokensₘ · priceₘ           inference, per model
           +  t_cpu·r_cpu + t_gpu·r_gpu    metered compute
           +  Σ calls_j · price_j          external API calls
           +  storage · r_store            storage
           +  F / N_units                  environment amortization
           +  h · r_human                  human intervention time

The last term matters most and is most often omitted: a program whose outputs each require twenty minutes of senior review pays its largest cost in a currency the token bill never sees. Under quirq accounting it cannot hide, because interventions are exactly the V < τ events the scoring rule already counts.

Worked: the ticket above, resolved with 38k tokens at $2/M plus 4k at $0.25/M (inference $0.077), 90 CPU-seconds ($0.001), two CRM calls ($0.02), amortization ($0.03), no intervention: C_total = $0.128.

Unit metrics

cost per quirq   c_q = C_total / Q         price of a dollar of verified work
quirq margin     μ   = Q − C_total         surplus on the unit
multiple         x   = Q / C_total         the reciprocal view

Worked: at B = $4.00 and V = 1.0: Q = 4.00, c_q = 0.032, margin $3.87, multiple 31x. Had it settled divisibly at V = 0.8: Q = 3.2 and c_q = 0.040. Incomplete work is automatically more expensive per quirq: the incentive points the right way.

Portfolio metrics

Over the units in an accounting window T:

QER(T)  =  Σ Q(u) / Σ C_total(u)          quirq efficiency ratio (the headline)
QV(T)   =  Σ Q(u) / |T|                   quirq velocity (throughput in value)
IR(T)   =  |{u : V(u) < τ}| / N           intervention rate (the trust signal)

QER is dimensionless and currency-independent: comparable across teams, vendors, and models. It is what "AI ROI" should have meant. IR is measured for free by the same machinery, and because failures localize to named checks, it arrives with its diagnosis attached.

The time axis

Two dynamics move the trajectory in opposite directions, and both must be read.

Tenure pushes cost per quirq down. Every unit's token bill hides two costs: doing the work, and figuring out what the work is (reading the codebase, rediscovering conventions, inferring what this owner means by done):

C(uₜ) = c_exec + k · H(intent | Mₜ)

c_exec   the execution floor (irreducible)
H(·|Mₜ)  residual intent uncertainty, given environment memory Mₜ
k        tokens burned per unit of uncertainty resolved

A persistent environment deposits every completed unit into memory (files touched, accepted definitions of done, corrections that survived review), so residual uncertainty and cost fall monotonically toward the floor; a fresh context pays cold start every time. It is what every manager knows about contractors: the tenth job is cheaper than the first because they stop asking questions they know the answers to. The environment is what gives an agent tenure.

Tokens per similar unit of work
without an environmentwith a persistent environment
unit 1 (cold start: both pay full intent cost)unit 50 (environment pays only the execution floor)

Extending the worked micro-benchmark to 50 sequential similar units (cold-start intent cost 2,600 tokens over a 3,000-token floor, decaying as memory accumulates):

Unit 1Unit 10Unit 25Unit 50Total
Fresh context5,6005,6005,6005,600308,000
Persistent environment5,6003,6533,3773,250181,260
Savings0%35%40%42%41%

Unit 1 costs the same either way, so the benefit is invisible in a demo and decisive in production, and it is durable because it comes from eliminated uncertainty, not a better model. This inverts procurement logic: the asset is not the agent you rent but the environment you own, because the environment is where the cost curve lives.

Goodhart drift pushes measured value up, falsely. Agents find the shortest path to green. The observable is the audit gap A(T): re-verify a random sample against gold checks held outside the production environment. The honest headline is audit-corrected:

QER*(T) = QER(T) · (1 − A(T))       report the trend, not the level

When QER* rises while IR falls, AI is genuinely compounding in the company. When QER rises but QER* stalls, the checks are being farmed. When both stall while token volume grows, the company has bought an electricity bill.

The bridge to energy

Because the cost model retains token counts, physical accounting composes with value accounting:

quirqs / kWh        with E ≈ Σ tokens · e_tok
quirqs / tonne CO₂  via grid carbon intensity

Illustrative: a month at 2.1B tokens with e_tok = 1.5 J/token is ~875 kWh; if the month minted 148,000 quirqs, the plant runs at ~169 quirqs/kWh. Not "we used less AI" but "we delivered more verified value per unit of energy."

Next: the dashboard, where these numbers become a company ledger.