Adapted from an article by the Zof Reliability Team, originally published on Zof Engineering.
Consider a release that requires two checks. One passes; the other never starts. The verification service returns zero failures.
A controller that treats failure_count == 0 as permission can now proceed without the evidence it requested. An empty results array creates the same problem: it contains no failures because it contains no findings at all.
A useful result contract must account for the work requested as well as the results available. Its permission rule should require explicit passing evidence for every required check, tied to the accepted request, from an attempt that completed normally. Missing evidence withholds permission. It does not, by itself, establish a software defect.
The contract below is a teaching proposal, not a shipped API specification. Its existing Python example uses only the standard library and exercises the consumer with synthetic messages. You can inspect and run it without connecting to a service.
Separate execution from findings
Transport success, execution progress, and check outcomes answer different questions. RFC 9110 defines HTTP 202 Accepted as intentionally noncommittal: processing has not completed. A successful response from a status endpoint can likewise describe unsuccessful verification.
The GitHub Checks API separates a run’s status from its conclusion. That is useful precedent for separating concepts; its semantics are not this proposal’s specification.
Here, execution has seven states:
queuedandrunning: nonterminal snapshots.completed: the coordinator declares normal completion, with a terminal result for every requested check.partial: the attempt ended without normal completion. Reported results are retained, even if they happen to account for every check; the gate remains closed.timed_out,cancelled, anderror: the attempt ended because its budget expired, cancellation was acknowledged, or execution failed.
Each check separately reports pass, fail, or unknown. An unknown outcome requires a reason: unsupported, timeout, cancelled, error, or—only in a nonterminal snapshot—pending.
A completed run can contain a failed or unsupported check. The coordinator has finished accounting for the work, but the required passing evidence is absent. A timed-out run can retain passing results and still be ineligible. Completion and findings must remain independently visible.
Fix the inventory before interpreting results
Persist the accepted request separately from the response. It needs a run identity, a subject, a policy revision, and a nonempty inventory of distinct check IDs. The required inventory comes from the policy the caller authorized. Each ID represents one execution obligation; parameterized cases need distinct identities.
Every inventory entry is required in this small proposal. Optional diagnostics belong in a separate run. A larger design can support optional checks, provided their requirement levels are fixed before execution. A producer must not quietly turn an unsupported requirement into an advisory result.
The returned bindings are compared with the trusted request. Otherwise, a producer could accidentally omit a check from both the inventory and the results, making incomplete work appear complete.
These comparisons have limits. The teaching validator checks short strings for equality. The system accepting a request must resolve them to immutable artifacts, versioned check definitions, and the relevant environment and configuration. A mutable branch name is insufficient. Echoing the right identifiers also does not authenticate the producer.
Derive accounting from validated results:
- Expected: distinct checks in the accepted inventory.
- Reported: inventory members with a result record.
- Passed, failed, unknown: the reported outcomes.
- Missing: expected minus reported.
Two reported results out of two expected checks means complete accounting, even if one is unknown. It does not mean complete passing evidence. A producer-supplied coverage: 100 cannot substitute for this reconciliation.
Validate the message before calculating permission
This is the example’s proposed wire shape, not a formal JSON Schema document:
{
"contract_version": "1.0",
"run_id": "run-17",
"subject": "sha256:example-artifact-17",
"policy": "release-policy@3",
"inventory": ["api-contract@1", "authorization@2"],
"execution": {"status": "completed"},
"results": [
{"check_id": "api-contract@1", "outcome": "pass", "reason": null},
{"check_id": "authorization@2", "outcome": "unknown", "reason": "unsupported"}
]
}The subject is a visibly synthetic placeholder, not a computed digest. This response accounts for both checks but cannot satisfy the gate: the authorization check lacks passing evidence.
Every displayed field is required. This deliberately strict v1.0 example rejects unknown fields, versions, enum values, and unexpected check IDs. Pass and fail require a null reason; unknown requires a recognized reason. A completed run cannot omit an inventory member or contain a pending result.
Keep results as an array until uniqueness has been validated. Converting them immediately to a dictionary keyed by check ID can overwrite an earlier failure with a later pass. Reject duplicate IDs even when their outcomes agree; they make the snapshot ambiguous.
Reject duplicate JSON object members during parsing, too. RFC 8259 says member names should be unique and describes inconsistent behavior across parsers when they are not. This proposal deliberately imposes the stricter rule. Checking result IDs after a parser has discarded duplicate outcome members is too late.
Give interruption states useful meanings
Unsupported work requires a capable verifier or an explicit policy change. A timeout calls for investigation of the budget, dependencies, and execution state. Cancellation calls for a decision about whether the work is still wanted. None automatically means the software violated a requirement.
A caller-side timeout is particularly easy to misinterpret. gRPC documents that DEADLINE_EXCEEDED can occur after a state-changing operation completed successfully, when its response arrives too late. Withhold permission and reconcile the known attempt through the service’s status mechanism. Do not manufacture a terminal server result or blindly resubmit potentially side-effecting work.
Requesting cancellation is not evidence that workers stopped. The gRPC cancellation guide explains that an application handler may continue working after cancellation notification. The service must define acknowledgment, retain any permitted late evidence, and persist the authoritative terminal state so a late pass cannot reopen a cancelled attempt. The example’s stateless validator does not enforce that lifecycle.
Calculate permission in the consumer
A producer-defined success flag should not compete with the detailed evidence. After parsing, structural validation, binding checks, and inventory reconciliation, the example’s predicate is small:
allow = (
state == "completed"
and counts["passed"] == counts["expected"]
)Its preconditions do the essential work. The accepted inventory is nonempty; each result belongs to it; duplicate IDs are forbidden; outcomes are recognized; and a completed snapshot accounts for every obligation. Under those conditions, the expected number of passes means each required check has exactly one passing result. Without those conditions, an empty inventory or duplicate passes can make a short predicate misleading.
This function evaluates one snapshot, not a run’s history. Before calling it, the surrounding system must authenticate an approved producer, select the authoritative attempt, and enforce lifecycle and freshness rules. The fixture does not remember an earlier cancellation or reject a later attempt that reuses its identity. Persisting terminal state and preventing invalid overwrites are responsibilities of the orchestrator.
Do not assemble permission from a passing check in yesterday’s attempt and another in today’s. Each externally visible attempt needs an unambiguous identity and authoritative result selection. A run ID alone does not enforce that separation.
The deployment controller should proceed only on the exact decision allow. Parsing failures, evaluator exceptions, lost responses, and unknown decisions must stop the protected action. An error-handling fallback must not accidentally grant the permission the normal path withheld.
Eight responses a consumer should distinguish
1. Completed, every required check passed. Allow this verification gate. Any remaining release-authorization policy still applies; the response does not establish that deployment is safe in every respect.
2. Completed, one explicit failure. Deny and inspect the finding. A required check ran and reported failure.
3. Completed, a required check unsupported. Deny. Accounting is complete, but passing evidence is incomplete. Supply a capable verifier or revise the policy explicitly.
4. Partial, one pass and one missing result. Deny and reconcile the attempt. Even a partial snapshot reporting all passes remains ineligible because normal completion is required.
5. Timed out, zero failures and zero results. Deny. No failures were observed, but no passing evidence was reported. Even surviving passes for every check would not satisfy this proposal’s completion rule.
6. Running, all reported results pass. Deny for now. A nonterminal snapshot does not authorize the action.
7. Completed, a missing or duplicate check. Reject the response. Its accounting is contradictory or ambiguous; repair the producer or aggregation logic.
8. Wrong subject, policy, or contract version. Reject. Obtain a result matching the trusted request and a supported contract.
Here, deny means an accepted snapshot cannot satisfy the gate. Reject means the response cannot be accepted as a valid contract instance. Both prevent action, but they identify different work for the operator.
Run the example—and read its limits
Extract the published example, read its README, and run this command from the extracted directory:
python3 -B fixture.pyThe fixture generates synthetic JSON messages and compares decisions and selected counts with explicit expectations. It matched all 32 expectations when rerun for this edition. Cases include missing checks, duplicate results, unsupported checks, timeouts, cancellation, pending snapshots, changed request bindings, unknown versions, duplicate JSON members, and empty inventories.
The packaged receipt records expected and actual decisions, the interpreter, a timestamp, and hashes of the executable fixture and generated inputs. These checks demonstrate behavior for those cases. They do not execute an application, establish producer authenticity, exercise a deployment integration, or demonstrate a product’s verification capabilities.
The example accepts exactly v1.0 and rejects unknown fields. That simplifies review but makes additive evolution disruptive. A production contract could permit namespaced extensions while keeping authorization-relevant fields closed. Contract version, policy revision, and check revision remain separate: each changes a different part of what a result means.
The validator limits responses to 64 KiB and inventories to 100 checks. A real service also needs bounded reads before buffering, authenticated transport, durable state transitions, evidence retention, deadlines, and resource isolation. The validator cannot detect a producer that reports work it never performed.
A complete pass records passing outcomes for the checks selected by the policy, on the identified subject and under the represented conditions. It does not establish the absence of defects. Selecting sufficient checks remains an engineering responsibility.
The contract preserves a narrower distinction that release automation needs: work reported as passed, work reported as failed, and work whose outcome has not been established. The consumer can then require the evidence it requested instead of granting permission from the absence of failures.

