DEV Community

Cover image for What Should an AI Runtime Remember About an Execution?
Ciroandrea
Ciroandrea

Posted on

What Should an AI Runtime Remember About an Execution?

A while ago, I would have assumed that accurate usage tracking gave me most of what I needed to reason about the economics of an AI product.

If a workflow costs 10 credits, the important engineering problems seemed fairly clear.

Was the customer allowed to run it? Were the 10 credits consumed exactly once? Did retries preserve the intended commercial semantics? Did the final usage record match what actually happened?

Those are difficult problems, especially once concurrency, retries and distributed execution enter the picture. But if the system handled them correctly, I thought the resulting usage data would provide a solid foundation for understanding the business later.

I'm no longer sure that's enough.

Consider a record like this:

customer: customer_123
workflow: research_report
credits_consumed: 10
status: completed
Enter fullscreen mode Exit fullscreen mode

From a commercial perspective, this may be perfectly correct.

The customer had enough credits. The workflow was authorized. Ten credits were consumed exactly once. The report was delivered.

Nothing is obviously wrong.

Now imagine that, a month later, someone asks a different question:

Why did this research workflow become more expensive to run?

The usage record suddenly tells us much less than it appeared to.

It doesn't tell us whether the workflow completed on its first attempt or its third. It doesn't tell us whether a tool failed, whether a fallback model was used, whether an external API was called or whether additional inference happened after a retry.

It tells us the commercial result of the execution.

It may not tell us enough about the execution itself.

I recently explored the conceptual distinction between customer value, commercial consumption and economic execution in the Licenzy Guides:

Your AI Product Has Three Different Units: Value, Commercial and Economic

I won't repeat that framework here. The engineering question I'm interested in now is what that separation means for the runtime underneath it.

The question is no longer only:

What should the system meter?

I'm increasingly interested in another one:

What should the runtime remember after an execution is over?


I Thought Accurate Metering Would Be Enough

There is a good reason to start with metering correctness.

If an AI product uses credits, quotas or another form of usage allowance, the commercial abstraction has to remain trustworthy under conditions that are anything but simple.

Two requests can arrive concurrently. A client can retry after a timeout. A worker can complete even though the caller never receives the response. The same logical operation can appear more than once at different points in a distributed system.

So a large part of the engineering work naturally focuses on preserving commercial correctness:

Commercial State
        ↓
Authorization
        ↓
Execution
        ↓
Consumption
        ↓
Updated Commercial State
Enter fullscreen mode Exit fullscreen mode

If the customer has 10 credits and a workflow requires 10 credits, the system should not accidentally authorize two concurrent executions against the same allowance.

If a network retry occurs, it should not blindly charge the customer twice for what the product considers one logical operation.

This is the same class of problem that makes idempotency so important in distributed APIs: a caller may retry an operation without knowing whether the previous attempt already produced its side effect.

AWS has a useful treatment of this problem in Making retries safe with idempotent APIs.

If consumption succeeds but the response is lost, retrying the request should not silently create a second commercial event.

These are runtime correctness problems, and solving them matters.

But there is a subtle limitation.

Suppose we solve all of them.

The final commercial history might still reduce the entire interaction to something like:

execution_id: exec_42
credits_consumed: 10
result: completed
Enter fullscreen mode Exit fullscreen mode

That record can answer an important question:

Was the commercial rule applied correctly?

What it cannot necessarily answer is:

What actually happened while producing the result?

Those questions looked much closer to me when I first started thinking about usage infrastructure.

The deeper I get into variable AI execution, the less interchangeable they seem.


One Commercial Event Can Hide Several Execution Attempts

Take a research workflow that consumes 10 credits.

On a normal run, the execution might look like this:

Research Request
      ↓
Retrieval
      ↓
Model Call
      ↓
Tool Call
      ↓
Validation
      ↓
Success
Enter fullscreen mode Exit fullscreen mode

The runtime consumes 10 credits and records the workflow as completed.

Now consider another request for exactly the same product operation.

This time the tool call times out.

The runtime retries the work. The second attempt uses a fallback model, performs another retrieval, calls an external API and eventually succeeds.

Research Request
      ↓
Attempt 1
      ↓
Retrieval
      ↓
Model Call
      ↓
Tool Call
      ↓
Timeout
      ↓
Attempt 2
      ↓
Retrieval
      ↓
Fallback Model
      ↓
External API
      ↓
Tool Call
      ↓
Validation
      ↓
Success
Enter fullscreen mode Exit fullscreen mode

Commercially, the product may still want both interactions to mean exactly the same thing:

10 credits consumed
1 research report delivered
Enter fullscreen mode Exit fullscreen mode

That can be the correct product decision.

A retry caused by infrastructure failure does not automatically need to become a second customer charge. A fallback model does not automatically need to become a new pricing concept. An internal routing decision does not necessarily belong in the customer's mental model at all.

But economically, the second execution has a different history.

Some of the work that contributed to its cost happened during an attempt that ultimately failed. Some happened during the successful attempt.

And if we preserve only the final commercial event, that history can disappear behind a perfectly correct number:

10 credits consumed
Enter fullscreen mode Exit fullscreen mode

This is the part I find interesting.

Commercial abstraction is useful precisely because it hides implementation complexity from the customer.

But once we intentionally hide that complexity commercially, we have to decide whether we are also willing to lose it internally.

Those are two very different decisions.


The Runtime Needs an Identity for the Work

Once I started thinking about what information should survive an execution, the first problem was identity.

At first, a request ID seems like an obvious answer.

A request enters the system, receives an identifier, produces some logs and eventually completes. If something goes wrong, we search for that ID and reconstruct the path.

That works reasonably well when one request maps cleanly to one execution.

AI workflows make that assumption much less comfortable.

A single customer operation can cross several boundaries. It may move through an API, a queue and one or more workers. It may pause while waiting for an external service. A failed attempt may be retried by infrastructure rather than by the original caller.

The HTTP request that started the work may disappear long before the work itself is finished.

More importantly, a retry creates an identity question.

Suppose a customer asks for one research report.

The first attempt fails after already consuming model and tool resources. The runtime retries and the second attempt succeeds.

From the product's perspective, this may still be one logical operation:

Customer Intent
      ↓
Generate Research Report
      ↓
10 Credits
      ↓
1 Completed Report
Enter fullscreen mode Exit fullscreen mode

From the execution perspective, however, there were two attempts:

Logical Execution: exec_42
      │
      ├── Attempt: attempt_1
      │      ├── Retrieval
      │      ├── Model Call
      │      ├── Tool Call
      │      └── Timeout
      │
      └── Attempt: attempt_2
             ├── Retrieval
             ├── Fallback Model
             ├── External API
             ├── Tool Call
             └── Success
Enter fullscreen mode Exit fullscreen mode

Collapsing those attempts into a single final state loses information.

Treating them as completely unrelated executions loses something else: the fact that both attempts belong to the same logical piece of work.

That suggests a distinction I now find useful:

The identity of the business operation and the identity of an execution attempt are not necessarily the same thing.

An execution_id can identify the logical work the product intended to perform.

An attempt_id can identify one attempt to perform that work.

The exact naming is less important than preserving the relationship.

execution_id: exec_42

attempt_1
    parent: exec_42
    result: failed

attempt_2
    parent: exec_42
    result: succeeded
Enter fullscreen mode Exit fullscreen mode

Now a model call, tool invocation or external API interaction can be associated not only with the customer or workflow, but with the attempt during which it actually happened.

If I only know that exec_42 completed, I know the final state.

If I know that exec_42 required two attempts, and I can associate meaningful execution events with each one, I have a history.

And those are not the same thing.


What Is Actually Worth Remembering?

This creates another problem.

If preserving execution history is useful, the naive answer is to record everything.

Every prompt. Every response. Every internal state transition. Every network call. Every tool payload. Every retry. Every token count. Every latency measurement. Every provider response.

That quickly becomes both impractical and conceptually messy.

It also turns the problem into generic observability.

That is not what I'm interested in here.

The question is narrower:

Which facts about an execution might still matter when I need to understand its economic behavior later?

For the research workflow, a minimal history might look something like this:

execution.started
      ↓
model.usage.observed
      ↓
tool.invoked
      ↓
tool.failed
      ↓
attempt.failed
      ↓
retry.started
      ↓
model.usage.observed
      ↓
external_api.used
      ↓
execution.completed
      ↓
commercial_consumption.applied
Enter fullscreen mode Exit fullscreen mode

Not every application needs these exact events.

The point is not the taxonomy.

The point is that some execution facts may deserve a different lifecycle from ordinary diagnostic data.

For example, imagine that a model invocation contributes a meaningful variable cost to the workflow.

A durable record might contain something conceptually similar to:

{
  "executionId": "exec_42",
  "attemptId": "attempt_2",
  "type": "model.usage.observed",
  "provider": "example-provider",
  "model": "model-b",
  "inputUnits": 18420,
  "outputUnits": 2310,
  "observedAt": "..."
}
Enter fullscreen mode Exit fullscreen mode

This is deliberately much smaller than the model interaction itself.

I may not need the complete prompt to answer an economic question. I may not need the generated text. I may not even need every piece of diagnostic metadata that was useful while the request was running.

What I may need is enough information to establish that a particular execution attempt consumed a particular measurable resource at a particular point in time.

The same reasoning can apply to a paid external API:

{
  "executionId": "exec_42",
  "attemptId": "attempt_2",
  "type": "external_api.used",
  "service": "example-search-api",
  "quantity": 1,
  "observedAt": "..."
}
Enter fullscreen mode Exit fullscreen mode

Or to a failed attempt:

{
  "executionId": "exec_42",
  "attemptId": "attempt_1",
  "type": "attempt.failed",
  "failureCategory": "tool_timeout",
  "observedAt": "..."
}
Enter fullscreen mode Exit fullscreen mode

Individually, these records do not explain the economics of the workflow.

Together, however, they preserve facts that would otherwise disappear behind the final state.

I don't want an economic system to infer that a retry probably happened because latency increased. If the retry itself matters, I would rather preserve the fact that it happened.

I don't want it to guess that a fallback model was probably responsible for higher cost because provider spend increased. If the runtime knows which model executed, that fact can be recorded when the evidence exists.

This is where I've started thinking less in terms of collecting more metrics and more in terms of preserving evidence.


Logs, Metrics and Evidence Are Not the Same Thing

I'm using the word evidence deliberately, but not as a claim that this is some established industry taxonomy.

It is a distinction that has become useful while reasoning about the architecture.

Logs, metrics and durable execution evidence can overlap in the information they contain, but I increasingly think they serve different questions.

Mechanism Useful Question
Logs What happened inside the system while I debug or operate it?
Metrics How much, how often or how quickly is something happening?
Execution evidence What durable facts would let me reconstruct this specific execution later?

A log line might tell me that a tool call timed out.

A metric might tell me that tool failures increased from 1% to 4% this week.

Both are useful.

But suppose I want to understand why exec_42 had a different economic profile from exec_17.

Now I need to connect specific facts.

Which attempts belonged to each execution? Which model invocations occurred? Which paid tools or APIs were used? Did a failed attempt consume resources before the successful attempt began? Which commercial consumption event ultimately corresponded to the logical operation?

The problem is no longer only observability in the operational sense.

It is reconstruction.

That changes what I care about in the data.

Operational telemetry can be optimized for debugging, aggregation, sampling and retention policies appropriate to the observability system.

Evidence that may later participate in attribution has different requirements.

Distributed tracing already solves an adjacent problem: preserving enough context to correlate work across service boundaries. OpenTelemetry, for example, uses trace and span identities, parent relationships and context propagation to reconstruct related operations across a distributed system.

What I'm exploring here is whether economically meaningful execution facts need a different durability and lifecycle from that operational telemetry.

I may care much more about stable identity. I may care about preserving relationships between records. I may care about knowing when the fact was observed and where it came from.

And for some facts, I may care about retaining the original observation rather than silently replacing it when better information arrives later.

This does not mean every log should become an immutable business record.

That would be the wrong conclusion.

It means the system needs to decide which facts cross that boundary.

High-volume operational telemetry
             │
             │ select economically meaningful facts
             ↓
     Durable execution evidence
             │
             ↓
    Attribution / Reconstruction
Enter fullscreen mode Exit fullscreen mode

The boundary is the interesting part.

Store too little and later analysis becomes guesswork.

Store everything and the evidence layer becomes an expensive copy of the observability stack.

The engineering problem is deciding what deserves to survive.


Retries Make History More Important Than Final State

Retries make this distinction especially visible because they expose the difference between state and history.

At the end of our research workflow, the application may only need to know:

status: COMPLETED
credits_consumed: 10
Enter fullscreen mode Exit fullscreen mode

That is a perfectly useful representation of current state.

But it does not describe how the system reached that state.

The execution history could have been:

Execution exec_42

Attempt 1
    Model inference
    Tool invocation
    Tool timeout
    Result: FAILED

Attempt 2
    Retrieval
    Fallback model inference
    External API
    Tool invocation
    Validation
    Result: SUCCESS

Final commercial state
    10 credits consumed
    Report delivered
Enter fullscreen mode Exit fullscreen mode

Both attempts may have consumed real resources.

Only one produced the final result.

The customer may correctly be charged once.

The commercial state may correctly show one workflow consumption.

Nothing about runtime correctness requires exposing the failed attempt to the customer.

But if I later ask what it cost to produce that report, removing the failed attempt from history would produce an incomplete answer.

This is an important separation:

A failed attempt can be commercially irrelevant while remaining economically relevant.

That does not mean every failure has meaningful cost.

Some fail before any expensive work happens. Some retries are cheap. Some provider operations are not billed when they fail.

The runtime should not manufacture economic significance where none exists.

But when an attempt does consume a measurable resource, the fact that it failed does not make that consumption disappear.

This is one reason I'm becoming increasingly cautious about deriving economic understanding only from final application state.

Final state answers:

Where did the workflow end?

History answers:

What happened on the way there?

For variable-cost execution, those can become very different questions.


But Immutable Doesn't Mean Infallible

Preserving execution history creates another problem.

The information available while a workflow is running is not always the best information the system will ever have.

Suppose exec_42 calls an external provider.

At execution time, the runtime knows that the call happened and can record the measurable usage returned by the provider. But perhaps the exact monetary cost is not available yet. Maybe pricing depends on a rate table maintained elsewhere. Maybe the provider reports final usage asynchronously. Maybe an internal attribution process later discovers that the event was associated with the wrong workflow.

The first record was not necessarily useless.

It represented what the system knew at that point.

But it may need to be corrected.

The obvious implementation is to update the original row:

evidence_id: ev_100
execution_id: exec_42
type: external_api.used
quantity: 1
cost: 0.08
Enter fullscreen mode Exit fullscreen mode

Later:

UPDATE evidence
SET cost = 0.11
WHERE evidence_id = 'ev_100';
Enter fullscreen mode Exit fullscreen mode

The database now contains the latest value.

But something has disappeared.

We no longer know that the system originally believed the cost was 0.08.

That may not matter for every application. For economically meaningful records, however, silently rewriting history can make later reconstruction harder.

An alternative is to preserve the original observation and represent the correction explicitly:

ev_100
execution_id: exec_42
type: external_api.cost
amount: 0.08
status: SUPERSEDED

      ↓ superseded by

ev_143
execution_id: exec_42
type: external_api.cost
amount: 0.11
supersedes: ev_100
status: ACTIVE
Enter fullscreen mode Exit fullscreen mode

Now the current interpretation is still 0.11.

But the system also knows how it got there.

This is the property I care about more than immutability by itself.

The objective is not to pretend that the first observation was perfect.

It is to make corrections visible.

That leads to a useful distinction:

Immutable evidence does not mean immutable interpretation.

New information can arrive. Attribution can improve. A provider can send corrected usage. A bug can be discovered.

The system should be able to incorporate those changes without requiring the historical record to pretend they never happened.

This is also why I would be cautious about describing an append-only evidence layer as a source of "truth."

It can preserve provenance.

It can preserve corrections.

It can make reconstruction more reliable.

It cannot guarantee that every observation entering the system was correct in the first place.

That distinction becomes even more important once we start asking economic questions.


Evidence Still Doesn't Tell Us What Something Cost

There is another boundary that I initially found easy to blur.

Recording resource consumption and determining its monetary value are not necessarily the same operation.

Suppose the runtime preserves this fact:

execution_id: exec_42
attempt_id: attempt_2
provider: model_provider
model: model_b
input_units: 18420
output_units: 2310
observed_at: ...
Enter fullscreen mode Exit fullscreen mode

That is measurement evidence.

It tells us what was consumed.

To answer:

What did this model invocation cost?

we may need additional information.

Observed Usage
      +
Applicable Rate
      ↓
Valuation
Enter fullscreen mode Exit fullscreen mode

The applicable rate may depend on the provider, model, pricing version, contract, timestamp or some other commercial rule.

That means storing:

cost: 0.23
Enter fullscreen mode Exit fullscreen mode

directly on every execution event may be convenient, but it can also collapse two different facts:

What did we observe?
Enter fullscreen mode Exit fullscreen mode

and:

How did we value what we observed?
Enter fullscreen mode Exit fullscreen mode

Keeping those concepts separate can preserve another useful form of lineage.

For example:

Measurement Evidence
input: 18420
output: 2310
      ↓
Rate Policy
model_b / version_7
      ↓
Valuation
amount: 0.23
Enter fullscreen mode Exit fullscreen mode

Now, if a pricing rule changes tomorrow, the original measurement does not have to change.

And if somebody asks why an execution was valued at a particular amount, there is at least a path back to both the observed consumption and the rate used to value it.

Again, this does not mean every AI application needs to build a miniature accounting system.

Depending on the provider and the level of precision a product needs, cost information may already be available directly from provider reporting or existing infrastructure.

In other cases, the product may need to derive valuation from measured usage and the rate that applied when that usage occurred.

The architectural point is narrower:

Measurement, valuation and commercial consumption describe different facts, even when they eventually contribute to the same economic analysis.

For our research workflow, we may now have several related records:

Logical Execution
exec_42
      │
      ├── Commercial Consumption
      │      10 credits
      │
      ├── Attempt 1
      │      ├── Model usage
      │      ├── Tool invocation
      │      └── Failure
      │
      └── Attempt 2
             ├── Model usage
             ├── External API usage
             ├── Tool invocation
             └── Success
Enter fullscreen mode Exit fullscreen mode

Each execution fact can then be connected to whatever valuation information is appropriate.

This is much richer than:

credits_consumed: 10
Enter fullscreen mode Exit fullscreen mode

But notice what it still does not tell us.

It does not tell us whether the workflow was profitable.

It does not tell us whether the customer is healthy.

And it definitely does not tell us why the economics of the product changed.

We have improved the evidence.

We have not yet produced an explanation.


Attribution Is Where the Questions Get Harder

Once execution evidence exists, another deceptively simple question appears:

What does this cost belong to?

Sometimes the answer is obvious.

A model call happens inside attempt_2, which belongs to exec_42, which belongs to one customer workflow.

The relationship can be preserved directly:

Customer
   ↓
Workflow
   ↓
Execution
   ↓
Attempt
   ↓
Model Usage
Enter fullscreen mode Exit fullscreen mode

But real systems do not always stay that clean.

A retrieval service may batch work. A shared cache may serve many customers. A background process may support several executions. An external service may report usage later using its own identifiers.

Infrastructure cost may exist at a level that does not map naturally to one request.

This is where I think it is important not to confuse having evidence with having perfect attribution.

Some costs can be attributed directly.

Some can be attributed later.

Some require an allocation rule.

Some may never be meaningfully attributable at request level.

The system should be able to represent that uncertainty instead of manufacturing precision.

For the parts that can be attributed reliably, preserving relationships early makes later reasoning much easier.

For example:

evidence_id: ev_220
type: external_api.usage
source_ref: provider_event_918

      ↓ attributed to

execution_id: exec_42
attempt_id: attempt_2
Enter fullscreen mode Exit fullscreen mode

The provider event and the attribution are related, but they are not necessarily the same fact.

That matters if the attribution changes later.

Perhaps provider_event_918 was initially associated with exec_42, but a reconciliation process later discovers that it belonged to exec_51.

If the original provider evidence remains intact, the attribution can be corrected without rewriting the source observation itself.

Conceptually:

Source Evidence
provider_event_918
      │
      ├── original attribution → exec_42
      │
      └── corrected attribution → exec_51
Enter fullscreen mode Exit fullscreen mode

This separation starts to create an interesting chain:

Observe
   ↓
Preserve
   ↓
Attribute
   ↓
Value
Enter fullscreen mode Exit fullscreen mode

At each stage, the system adds interpretation.

And at each stage, preserving where that interpretation came from makes the next question easier to investigate.


Evidence Is Not Explanation

At this point it would be tempting to take one more step.

We have execution identity.

We have attempt lineage.

We have resource observations.

We have commercial consumption.

We may have valuation and attribution.

Surely now we can answer:

Why did the economics change?

Not necessarily.

Imagine that the average cost of our research workflow increases by 30% this month.

Execution evidence might reveal several changes:

More retrieval operations
More fallback-model usage
Higher retry frequency
Increased external API usage
Longer model contexts
Enter fullscreen mode Exit fullscreen mode

Those are useful observations.

They may even be strong candidates for explaining the change.

But moving from correlation to explanation requires more care.

Perhaps customers started submitting more complex research tasks. Perhaps a model-routing change altered execution behavior. Perhaps a provider changed pricing. Perhaps the product deliberately introduced a more expensive validation step that significantly improved report quality.

Perhaps several of those things happened at once.

The evidence gives us something much better than a guess.

It gives us a history we can investigate.

But I don't think that justifies jumping directly from:

Metrics changed
Enter fullscreen mode Exit fullscreen mode

to:

Therefore this is why your economics changed.
Enter fullscreen mode Exit fullscreen mode

That shortcut becomes especially tempting when an LLM can inspect a dashboard and generate a plausible explanation.

The explanation may sound convincing.

The harder question is whether the underlying system can show which evidence supports it.

This is where my thinking is still evolving.

The architecture I'm increasingly interested in looks less like:

Metrics
   ↓
LLM
   ↓
Advice
Enter fullscreen mode Exit fullscreen mode

and more like:

Evidence
   ↓
Attribution
   ↓
Explanation
Enter fullscreen mode Exit fullscreen mode

Even that last arrow contains a lot of unresolved questions.

What level of evidence is sufficient? How should conflicting evidence be handled? How much causality can actually be established rather than inferred? How should an explanation communicate uncertainty? Which economic changes can be traced to execution behavior, and which require business context outside the runtime?

I don't think those questions have simple answers.

But I'm becoming more convinced that they are much harder to answer if the execution history was never preserved in the first place.


The Question Arrives After the Request Is Gone

There is a timing problem underneath all of this.

When an AI request is executing, engineering is usually concerned with immediate questions:

Is it authorized?
Is it progressing?
Did the provider respond?
Should we retry?
Did it complete?
Should we consume allowance?
Enter fullscreen mode Exit fullscreen mode

The economic question often arrives much later.

Maybe the workflow takes thirty seconds to complete.

The question about its economics may arrive thirty days later:

Why did this customer's cost-to-serve increase?

Or:

Why did this workflow become more expensive after the last release?

Or simply:

What happened here?

By then, the request is gone.

The worker is gone.

The transient execution context is gone.

Some logs may have expired.

Metrics may have been aggregated.

The provider dashboard may show total consumption without knowing how your application interpreted the work.

At that point, the quality of the answer depends heavily on what the system decided was worth preserving while the execution was still observable.

That is what changed the problem for me.

I started from usage tracking.

Then I started thinking about runtime correctness.

And once commercial consumption became intentionally separate from the complexity underneath it, another requirement appeared:

The runtime may need to preserve enough execution history for economically meaningful behavior to remain reconstructable later.

Not every event.

Not every log.

Not every internal detail.

Enough evidence to connect a commercial operation to the meaningful work that actually occurred.

I'm increasingly thinking of this as an economic observability problem.

Not because observability can tell us whether every execution was good or bad, and not because collecting more telemetry automatically produces economic understanding.

But because before we can ask sophisticated questions about AI economics, we need trustworthy information about what actually happened.


From "What Happened?" to "Why Did It Change?"

This leaves me with a progression that I'm currently investigating:

OBSERVE
   ↓
What happened?

ATTRIBUTE
   ↓
Where did it belong?

EXPLAIN
   ↓
Why did the economics change?
Enter fullscreen mode Exit fullscreen mode

The first question is primarily about evidence.

The second introduces relationships and attribution.

The third is much harder.

And I don't think we should pretend that solving the first two automatically solves the third.

Execution evidence can tell us that retries increased.

Attribution can tell us which workflows incurred the additional work.

Valuation can tell us how much that work contributed to measured cost.

But explaining why the economics changed may require context that does not exist inside the runtime at all: customer behavior, product changes, provider pricing, revenue, retention, quality improvements or strategic decisions.

The runtime sees an important part of the system, not the entire business.

That is why I'm treating the progression toward economic explanation as a research question rather than a solved architecture.

Still, there is an ordering here that increasingly makes sense to me:

Evidence
   ↓
Attribution
   ↓
Explanation
Enter fullscreen mode Exit fullscreen mode

rather than:

Metrics
   ↓
Plausible Explanation
Enter fullscreen mode Exit fullscreen mode

If an explanation eventually influences a recommendation, a simulation or even a runtime decision, being able to trace that explanation back to the underlying evidence seems increasingly important.

But that is further ahead.

The immediate engineering problem is much more concrete.

What should survive the execution?


What Should an AI Runtime Remember?

I don't think the answer is "everything."

The answer probably depends on the product, its cost structure and the questions the team expects to ask later.

But for variable AI workflows, I'm increasingly interested in preserving a small set of relationships:

Logical Execution
      │
      ├── Commercial Context
      │
      ├── Attempt 1
      │      ├── Meaningful Resource Evidence
      │      └── Result
      │
      ├── Attempt 2
      │      ├── Meaningful Resource Evidence
      │      └── Result
      │
      └── Final Outcome
Enter fullscreen mode Exit fullscreen mode

with enough provenance to answer:

What was observed?

During which execution?

During which attempt?

Where did the observation come from?

What commercial operation was it related to?

Was the observation later corrected?

How was measurable consumption eventually valued?
Enter fullscreen mode Exit fullscreen mode

That still does not produce economic truth automatically.

It produces something more modest and, I think, more useful:

a reconstructable history.


Final Thoughts

I started with a fairly simple assumption: if usage was measured correctly, I would have most of the information needed to reason about the economics later.

I don't think that anymore.

Correct usage can tell me that a customer was authorized, that 10 credits were consumed exactly once and that the commercial state remained consistent.

It cannot necessarily tell me what happened underneath that commercial event.

For variable AI execution, that difference matters.

A successful workflow may contain failed attempts. A retry may consume resources without creating another customer charge. A fallback model may change the cost of execution without changing the product outcome. An external provider may report usage after the workflow has already completed.

The final state can be completely correct while much of the economically relevant history has disappeared.

That is why the question I'm increasingly interested in is not simply:

What should we meter?

but:

What facts about an execution should still exist when we need to understand it later?

I don't think the answer is to preserve everything.

It is to preserve enough.

Enough identity to connect work across attempts. Enough provenance to know where an observation came from. Enough history to distinguish what happened from what was later inferred. Enough correction lineage to improve what we know without pretending the original observation never existed.

And enough separation between measurement, valuation and attribution to avoid turning one convenient number into more certainty than the system actually has.

That still doesn't explain why the economics changed.

But perhaps that is exactly the point.

Before a system can explain economic behavior, it needs something trustworthy to reason from.

The progression I'm currently investigating looks increasingly like this:

Evidence
   ↓
Attribution
   ↓
Explanation
Enter fullscreen mode Exit fullscreen mode

There are still difficult questions beyond that last arrow, and I'm not convinced they can all be solved inside the runtime.

But the prerequisite feels much more concrete.

If the execution history disappears, the economic question eventually becomes an inference problem.

If the important facts survive, it becomes an investigation problem.

While building Licenzy, this is one of the assumptions I'm continuing to test as I move from runtime correctness toward economic observability.

An AI execution may last seconds.

The question that matters may arrive weeks later.

By then, your system can only reason from what it chose to remember.

Top comments (0)