Skip to the content.

Can the Software Explain What Happened?

In regulated systems, correctness includes the ability to reconstruct, reconcile, and repair what happened—not merely produce the right result.

Portrait of Suma Manjunath
Author: Suma Manjunath
Published on: August 24, 2026

A payment is marked complete. The customer says it happened twice.

The database contains one current status. The API returned success. The logs show several requests close together, but one came through a retrying worker and another through a recovery job. The provider has its own identifier. The bank has a trace number. Nobody can yet say whether money moved once or twice.

At this point, “the endpoint worked” is not a useful answer.

In many software products, correctness means producing the expected result. In a regulated system, that is only the beginning. The system may also need to show who authorized the action, which version of the data was used, what crossed an external boundary, what changed afterward, and how an error was corrected without erasing the original event.

The software has to do the work.

Then it has to explain itself.

The Current State Cannot Tell the Whole Story

A row in its final state is efficient. It is also forgetful.

Consider a payment that moves from pending to submitted to settled. If the application stores only settled, it has preserved the answer and discarded the path. That may be enough to render a screen. It is weak material for investigating a duplicate, proving an authorization, reconciling with a bank, or understanding whether a manual repair bypassed the normal workflow.

Regulated systems care about the path because the path carries responsibility.

Who initiated the change? Under which authority? What did the system know at that moment? Which service accepted it next? Was the record later corrected? Did the correction preserve the earlier value?

This does not mean every database needs to become an event-sourced system. Append-only ledgers, event streams, versioned records, and conventional audit tables all have different costs and failure modes. The important design choice comes before the technology: decide which transitions must remain reconstructable.

That boundary should be drawn around consequences, not around whatever happens to be easy to log.

Authorization Is Domain Data

Applications often treat authorization as a gate: check a permission, allow an action, move on.

In consequential systems, authorization may need a longer life than the request that consumed it.

An ACH debit is not explained merely by showing that an authenticated user clicked a button. The organization may need to connect the transaction to the authorization that permitted it and reproduce that proof later. A clinical record may need a trustworthy history of who created or changed information and when. Card-payment environments require audit records for important access and administrative activity.

The exact obligations differ across domains. The design lesson is broader: when authority matters after execution, preserve it as part of the business event.

That may include the actor, the authority they exercised, the terms or version they accepted, the time, the affected resource, and the source from which the decision originated. A user ID without this surrounding context can identify a person while still failing to explain the action.

The question is not simply, Was access allowed?

It is, What will we need in order to defend this action later?

Retries Are Business Decisions in Disguise

Distributed systems make uncertainty routine. A request times out, and the caller cannot tell whether the remote system rejected it, accepted it, or completed it before the response disappeared.

For a read, trying again may be harmless. For a payment, prescription, benefits decision, or identity change, trying again can repeat the consequence.

Engineering teams reach for idempotency keys, unique constraints, deduplication windows, and state machines. Those patterns matter, but none can answer the most important question alone:

What does “the same action” mean in this domain?

Two identical payloads may represent one repeated request or two legitimate actions. A client-generated key may prevent duplication at one API boundary and disappear when a batch file reaches a partner. A timeout may leave the local system uncertain while the external system has already committed.

Idempotency is therefore more than middleware. It is an agreement about identity that must survive every consequential boundary.

The design needs a durable business identifier, a clear owner for its creation, and a policy for what happens when two systems disagree. Without that agreement, a retry policy is quietly making financial or legal decisions on behalf of the business.

Correction Is Not Deletion

When ordinary application data is wrong, an update can make the screen right again. In a regulated workflow, overwriting the mistake may destroy the evidence needed to understand it.

A correction has two jobs: restore the intended outcome and preserve the fact that something changed.

That is why payment systems distinguish reversals, returns, and compensating transactions from deleting history. The terms are specific to the payment rail, and their permitted use is constrained. The broader design principle is that consequential actions often need consequential corrections.

The repair path deserves the same care as the happy path:

  • Which failures are reversible?
  • Who may initiate the correction?
  • Can the correction itself be repeated safely?
  • What happens after an external cutoff has passed?
  • How will the customer see both the error and the repair?
  • Which record remains authoritative while systems disagree?

A system that can execute an action but cannot repair it has implemented only half of the domain.

Reconciliation Is a Second Source of Truth

Observability tells us what our system believes it did. Reconciliation asks whether another source agrees.

That distinction matters whenever the consequence crosses an organizational boundary. A local settled status is a claim. A processor report, bank file, or ledger entry may confirm it—or expose the gap.

Teams sometimes treat reconciliation as back-office cleanup performed after “real engineering” is finished. In regulated systems, it is part of the correctness model. It detects the class of failure that a single system cannot observe about itself.

Good reconciliation needs stable identifiers, expected timing, explicit mismatch states, and an owner for unresolved differences. It also needs restraint. Automatically forcing one system to match another can turn a detectable discrepancy into a synchronized error.

Sometimes the safest state is not success or failure.

It is unknown, under investigation.

That state may feel uncomfortable in a product interface, but false certainty is more expensive.

The Human Operator Is Inside the Architecture

Regulated systems accumulate manual steps for understandable reasons. An unusual transaction needs review. A partner sends a malformed file. A customer disputes an authorization. An incident crosses a threshold that requires judgment.

These moments are often hidden under the label “operations,” as though they happen outside the system.

They do not.

If an operator can change a status, replay a job, upload a replacement file, grant temporary access, or initiate a correction, that capability is part of the production architecture. It needs bounded permissions, recorded intent, safe defaults, and a way to review what happened.

The answer is not to remove every human decision. Automation can repeat a misunderstanding faster than a person can. The goal is to make human intervention deliberate rather than invisible.

A useful operational action says what it will change before it runs. It identifies the object and scope. It distinguishes simulation from execution. It records the actor and reason. For high-consequence actions, it may require a second person or a time-limited elevation of access.

The admin tool is not a side project.

It is one of the system’s most powerful interfaces.

Explanation Has a Cost

Traceability is not free. More history means more data to protect, retain, retrieve, and eventually dispose of. More logs can improve investigation while expanding the surface where sensitive information may leak. A richer audit trail is useful only if its integrity can be trusted and someone can interpret it.

There is no universal instruction to record everything forever.

The right history follows the obligation and the consequence. Preserve the events that establish authority, change a material state, cross a trust boundary, or repair an earlier action. Keep enough context to reconstruct them. Protect that record from casual modification. Set retention from actual requirements rather than institutional anxiety.

This is where architecture meets governance. The system should make the important story recoverable without turning every internal detail into permanent regulated data.

Trust Begins After the Happy Path

Regulated software is sometimes described as ordinary software with stricter reviews. That misses what makes the work difficult.

The system participates in decisions that outlive a request. Money moves. Records influence care. Access reveals private information. An error may need to be explained to a customer, partner, auditor, or regulator long after the engineer who wrote the code has moved on.

Trust does not come from pretending those systems will never fail.

It comes from knowing that when they do, the organization can reconstruct the event, contain the consequence, make a legitimate correction, and explain the result without inventing the story afterward.

Correctness produces the outcome.

Accountability preserves the path.


Companion Essays

Further Reading

Join the conversation

Share a thought, ask a question, or add what your experience has taught you. No account is required.