Verification and Readback: What Tests, CI, and Production Each Prove
From local tests to production readback, every layer of evidence must be bound to an explicit scope of conclusion, and none can substitute for another.
On this page · 19 sections
In an engineering task, “done” is not a feeling. It is a claim that has to be backed by evidence. The mistake an Agent makes most easily is not skipping verification altogether, but getting a green result at one layer and then stretching the conclusion to layers it never observed:
- local tests pass, so the feature is declared complete;
- CI is green, so it is declared live;
- the deployment job finishes, so users are declared able to use it normally.
A mature Verification & Readback mechanism has to answer two questions: what conclusion does the current evidence actually support, and what evidence is still missing for the next layer.
The Short Version
- “Done” is a claim that has to be backed by evidence; a usable piece of evidence states at least its claim, scope, time, source, and freshness.
- Each layer of the evidence ladder proves only itself: local tests, CI, deployment, and runtime readback cannot substitute for one another.
- The strength of verification is decided jointly by blast radius, unknowns, and irreversibility, not by the number of files.
- An external Provider operation has to complete Preview, Execute, Readback, and Reconcile; the only final states are
verified,mismatch, andunknown, andunknownis not success.
First, define the minimal structure of a piece of evidence
A usable piece of engineering evidence contains at least five fields:
Evidence = {
claim, // the proposition to be proven
scope, // repository, branch, service, environment, user path, or data range
time, // when the observation took place
source, // command, Provider API, pipeline, logs, or the real entry point
freshness // whether the observation is later than this change, release, or state transition
}
“Tests passed,” for example, is not complete evidence. A more accurate statement is: “In the local working tree at commit A, unit:test was run at time T, covering the relevant assertions for the target module, with exit code 0.” It still cannot prove that production is healthy, but it has made the boundary of the conclusion clear.
freshness matters especially. Yesterday's successful pipeline, a screenshot taken before the change, or a health check from after the previous release cannot prove this change, even when the source is genuine. Evidence must be tied to the current goal through a commit SHA, build ID, artifact digest (that is, the content hash of the build output), deployment ID, or time of occurrence.
The evidence ladder: each layer proves only itself
The table below lists the evidence layer by layer. The column to watch is the last one: what each layer cannot replace.
| Layer | Direct observation | Conclusion it can support | What it cannot replace |
|---|---|---|---|
| 1. Local test | Tests, type checks, and build results in a specified working tree | The current code satisfies these assertions in the current environment | The full scope of the change, remote state, deployment state |
| 2. Diff | The difference in the working tree, the staging area, or between two commits | Which files and content were actually changed | Correct behavior, a successful commit |
| 3. Commit | Readback of HEAD, the commit tree, and the target files |
Local history already contains the intended change | The remote having received that commit |
| 4. Remote | The SHA of the branch ref on the Provider | The target remote branch points to the expected commit | The PR being created or merged, CI having passed |
| 5. PR / Merge | PR state, base/head, merge commit | The object under review and the merge result are as expected | A successful build, a successful deployment |
| 6. CI | The result of a workflow, job, or check suite for a specific SHA | Automated checks passed for that revision | The artifact being published, the runtime environment having switched over |
| 7. Deploy | The binding between a deployment or release and an artifact/commit | The specified artifact was deployed to the specified environment | Traffic actually using it, correct business behavior |
| 8. Runtime readback | The real entry point, a version endpoint, metrics, logs, or a business query | The specified environment showed the expected state at the time of observation | Long-term stability, unobserved paths being equally correct |
This is not a ranking in which “lower is more advanced.” It is a causal chain. The layer above answers “what was the input,” and the layer below answers “did that input really arrive at the new boundary.” Git's official documentation likewise defines git diff as a display of the differences between endpoints; it is evidence of scope, not proof of correctness.
So the following substitutions between kinds of evidence are not allowed:
- Test results cannot replace the diff, because the tests may not cover an unintended change;
- a commit hash cannot replace remote readback, because the push may have failed or gone to the wrong remote;
- a PR page cannot replace merge readback, because the PR may still be open;
- green CI cannot replace a deployment, because build and release are different events;
- deployment success cannot replace runtime readback, because the release may not have shifted traffic, may be reading an old cache, or may have updated only some instances.
Risk-proportionate verification: not every change runs the same checklist
The strength of verification should be decided jointly by “blast radius, unknowns, and irreversibility,” not by the number of files. A tiny permission change can carry more risk than a large block of purely presentational code. In the table below, the left column is the type of change, the middle one is the minimum verification surface, and the right one is the verification to add as risk rises.
| Type of change | Minimum verification surface | Additional risk verification needed |
|---|---|---|
| Documentation and static content | Links, formatting, build, diff | Navigation reachability and real page rendering |
| Pure functions or local logic | Focused unit tests, type checks, diff | Boundary values, abnormal input, regression cases |
| Cross-module contracts | Tests on both ends, build, schema/diff | Forward compatibility, backward compatibility, old data |
| Asynchronous or event-driven paths | Producer and consumer tests | Retries, duplicates, out-of-order delivery, idempotency, dead letters |
| Data migrations or permission changes | dry-run, exact scope, plan | Rollback, least privilege, batching, result readback |
| Releases or external writes | Binding of revision to artifact | Environment protection, deployment receipt, runtime readback |
The point of high-risk verification is not to “run a few more commands,” but to add mutually independent surfaces of observation:
- the happy path proves the main route;
- boundary cases prove the edges;
- negative cases prove that bad input is rejected;
- retry/idempotency proves that repeated execution does not amplify side effects;
- compatibility proves that things still work when old and new versions are interleaved.
If one category of check cannot be run, another category cannot fill in for it. When the integration environment is unavailable, for example, unit tests still have value, but the final conclusion can only be “verified at the local layer, not verified at the integration layer.” It cannot be rewritten as “coverage is already sufficient.”
Provider operations must form a closed loop
Git platforms, cloud platforms, deployment systems, ticketing systems, and third-party APIs share one problem: a successful command says only that the client received a result, not necessarily that the target system has reached the expected state. For these external Providers, verification follows a four-phase protocol:
1. Preview: pin down the facts about what is about to happen
A preview must establish at least the target Provider, the account or organization, the repository/service, the branch or environment, the action, the key parameters, the prior state, the expected result, and how to recover. For actions with side effects, it should also produce a comparable payload digest. A preview is not proof of execution, but it gives the later readback an explicit expected state.
2. Execute: record only the request the Provider actually accepted
The execution result should be bound to the request ID, target, time, and revision or payload digest. An HTTP 200 or a CLI exit code of 0 proves only that the call phase did not fail explicitly; when an asynchronous Provider returns queued, pending, or an operation ID, the status is still “accepted,” not “completed.”
3. Readback: read again from the authoritative boundary
Readback has to bypass local inference and get the result from the Provider responsible for the persisted state:
- after a push, read the remote ref;
- after creating a PR, read the PR's base/head/state;
- after a deployment, read the artifact and environment the deployment corresponds to.
Where user-visible behavior is involved, the version and the business response must also be observed from the real entry point; reading the deployment console alone is not enough.
4. Reconcile: compare expected with observed
There are only three final states:
verified: the target, version, scope, and expected result all match;mismatch: the Provider has a result, but it differs from what was expected;unknown: the request timed out, readback was unavailable, or the evidence cannot be tied to this operation.
unknown is not a euphemism for success. It means stop widening the conclusion, keep the operation ID, and continue reconciling through an idempotent query or a manual check. Reading back before retrying a write avoids the case where “the first attempt actually succeeded and the second ran it again,” which causes duplicate releases, duplicate messages, or duplicate charges.
How one deployment strings the whole evidence chain together
Suppose the goal is to release commit A to production. The complete chain should be able to answer:
- Were the local diff and tests based on the content corresponding to
A; - does the remote target branch really point to
A; - which revision
Mdid the PR finally merge into; - did CI build against
Mand produce artifact digestD; - did the deployment release
Dtoproduction, and not to staging; - does the runtime version report
DorM, and do the key business paths show the expected behavior.
GitHub's deployment documentation separates workflow, environment, protection rules, and deployment history into different control surfaces, which is exactly the point: “the pipeline job finished” and “the target environment has received the release” are not the same fact.
SLSA's artifact verification goes further and stresses that consumers should compare provenance (that is, the record of where an artifact came from) against their own expectations for the package and its source. What I borrow here is the principle that “artifact identity must be bound to an expectation”; it does not mean a project already conforms to SLSA merely by recording a SHA.
The most common forms of distortion
Stale evidence
The test or page really did succeed once, but before this change was made. The fix is to bind evidence to a revision and record the observation time.
Reading the wrong target
The command looked at local main, but the conclusion was written as origin/main; staging was read, but the conclusion was written as production. The fix is to state the target explicitly in every piece of evidence instead of relying on the current context.
Caches that create false positives
A CDN, browser, service cache, or eventually consistent store (that is, a store where a write takes a while to become readable) may return an old value. This calls for a version endpoint, cache-busting, readback from the authoritative store, or a wait window, along with an explicit statement of the consistency model.
Partial success written up as total success
Only part of a multi-region, multi-instance, or batch operation succeeded. The Provider's overall status, the failed items, and the coverage ratio all have to be read back; picking out only the first green result is not acceptable.
Asynchronous states closed out too early
queued, accepted, and in_progress are all intermediate states. Either poll until a terminal state, or honestly report “triggered, completion not yet confirmed.”
Retrying after failure without idempotency
A timeout does not mean the request had no effect. A retry without an idempotency key (that is, a request identifier that makes a repeated request take effect only once) or a prior readback can turn an unknown state into a duplicated side effect.
Honest reporting is itself a verification protocol
The final report should use sentences that match the evidence layer:
- “Modified; verification not yet run”;
- “Local tests and diff checked; not committed”;
- “Committed to local commit
A; not yet pushed”; - “Remote branch read back as
A; PR status not verified”; - “CI is green for revision
M; no deployment evidence found”; - “The deployment shows success, but the real entry point has not been read back”;
- “Production passed readback of version and business path; observed at time
T.”
When permission, network, or environment limits make a layer unverifiable, report unknown, the reason for the block, and the evidence that does exist. Do not use “should,” “looks like,” or “most likely” to package an unobserved fact as done.
Implementation checklist
Each time, before writing “done,” go through these one by one:
- What is my claim, and are the scope and target explicit?
- Which authoritative source does the evidence come from, and at what time did it occur?
- Is it later than this change, and can it be bound to a revision, artifact, or operation?
- Which layer does this evidence support, and only that layer? Have I inferred across layers?
- Did the external operation complete Preview, Execute, Readback, and Reconcile?
- Are the unverified, failed, and unknown states written out explicitly?
The core of this mechanism is not producing more reports, but making every conclusion traceable to the appropriate boundary of observation. OpenAI's Harness Engineering practice likewise treats fast feedback, mechanized constraints, and verifiable knowledge inside the repository as the foundation for making Agents more reliable. Reliable delivery is not “the Agent says it is finished”; it is that both people and systems can point to which version, in what scope, was proven by which authoritative source, at what time, to have reached which step.
Related notes
Making Agent Output Verifiable: Specs, Context, and Checks
Three words separate one person writing code with AI from enterprise-grade delivery: reliable, efficient, sustainable. This piece covers spec-driven development, context engineering, verifiers, and Skill assets, and how the engineering center of gravity has moved from Prompt to Harness.
How My AI Development Workflow Changed: From a Harness to Lightweight Prompts to Enterprise Agents
First a self-built Harness to make up for what models could not do, then a cut down to lightweight Prompts and four gates after Codex 5.6, then the same principles applied to enterprise Agents. What each step removed and kept.
Working on something similar?
I'm always happy to compare notes on distributed systems, delivery, and applied AI.
[email protected]