Verification Harness
AI-generated programs can return correct results and still miss performance targets. The Runtime Evidence Model links inputs and load to results and internal behavior. The verification harness checks those records against requirements and design criteria before accepting a change.
How This Article Is Organized
The article explains the criteria and the verification loop in Figure 1. The purchase order example applies the loop to code fixes and runtime AI configurations.
Conditions for Accepting a Change
The preceding article, Runtime Evidence Model, links inputs and load to actual behavior. The verification harness compares that record with criteria derived from requirements and design. One run can show both whether the correct line items were retrieved and whether performance met the target under the specified load.
The knowledge harness uses the BoK to check requirements and design. The programming harness constrains implementation with types and API contracts. The verification harness checks runtime behavior.
Table 1 pairs each acceptance criterion with the evidence used to evaluate it.
| What is checked | Acceptance criterion | Evidence |
|---|---|---|
|
Business result |
Produces the expected result for the specified input |
Actual and expected results |
|
Responsibilities and side effects |
Follows API contracts and preserves the specified side effects |
Call hierarchy, results, and state changes |
|
Performance under load |
Meets latency and throughput targets |
Measurements with matched input sizes, request mix, and load |
|
Runtime AI configuration |
Meets output quality, performance, and cost criteria |
Output quality, elapsed time, and AI cost for the same Run |
Why Runtime Verification Matters
An implementation can return the right result while taking an unexpected path or creating unexpected load. Application code can duplicate the retries performed by the runtime platform. Reading line items one at a time can increase I/O as the order grows and push the operation beyond its performance target.
Call sites, call counts, and time spent in each processing interval provide evidence of these problems. Reading them with the execution conditions helps locate expensive code and identify the results and contracts that a fix must preserve.
Teams have long used measurements and tests. We believe many development workflows could do more to connect those measurements with fixes, re-verification under the same conditions, and an acceptance decision. At SimpleModeling, developers examine results and CallTree records to check that output, call counts, and processing time satisfy the acceptance criteria.
Standard Capabilities for Verification
An acceptance decision needs evidence of which implementation ran, under what conditions, and with what result.
CNCF and its shared components provide four capabilities for gathering and using that evidence.
-
Automatic capture. Record results, elapsed time, and call hierarchies.
-
Runtime Evidence Model. Link execution conditions to results and measurements.
-
Corpus. Version the input cases and expected results.
-
Experiment. Compare the conditions, results, and evaluations for each alternative.
Automatic Capture of Execution Data
CNCF automatically captures Operation results and duration, and the hierarchy of operations and I/O calls that go through its internal DSL. A CallTree can show where an operation recurs, helping developers investigate duplicate processing and repeated I/O without adding application-specific tracing.
Linking Execution Evidence in the Runtime Evidence Model
Verification depends on knowing which conditions produced a measurement. The Runtime Evidence Model adds internal call paths, counts, and interval timing to the input, conditions, Arm, Run, result, and evaluation captured by Experiment. The harness checks the output and timing for the same Run against the expected result and performance target. When a target is missed, the record helps locate the slow interval and the calls it contains.
Fixing Conditions with a Versioned Corpus
A Corpus versions the inputs, expected results, and grounds for evaluation. Combining a failure case with representative existing cases lets us run a before-and-after comparison from the same starting point. Performance comparisons also use a request mix that specifies request types, proportions, and input sizes.
The Verification Feedback Loop
The verification harness turns measured problems into fixes and returns changes to production when the evidence shows they meet the criteria.
Production observation and Corpus replay each contribute to the feedback loop.
-
Production observation. Detect anomalies and observe the effects of deployed changes under actual conditions.
-
Failure reproduction with a Corpus. Hold the input and load fixed to reproduce a failure.
-
Acceptance decision. Compare measurements with the criteria and decide whether to accept, revise, or gather more evidence.
-
Re-verification. Confirm the fix and check the effects on existing behavior.
Figure 1 shows how both production and Corpus runs inform investigation and decisions, and how a verified change returns to production.

Figure 1. The production feedback loop and the Corpus-based re-verification loop inside it
Observing Actual Operation
Investigate issues that appear only under real inputs or load using records collected during operation. CNCF captures results, timing, and call hierarchies for each operation. Those records can link an issue to the inputs and load needed to reproduce it. Continue observing under real conditions after deploying an accepted change.
Reproducing Failures with a Corpus
Changes in workload can obscure the effect of a code fix. Holding inputs and load fixed makes it possible to reproduce the failure, investigate the cause, and assess the fix against the same criteria. For performance tuning, use the same request mix to compare latency and throughput.
Conformance and Acceptance Decisions
Accept a change once the runtime evidence shows that it meets the criteria. Send changes that miss a criterion back for revision and re-verification, along with the relevant records and the contracts to preserve. Add test cases or measurements when the existing evidence cannot support an acceptance decision.
Rechecking Fixes and Existing Behavior
A fix can resolve the original issue and still affect inputs that used to work. Include both a case that reproduces the failure and representative existing cases in the Corpus. The first shows whether the issue is resolved. The others show whether results, side effects, and performance still meet the criteria.
Tuning the AI Models Called at Runtime
For a program that calls AI during a business process, changing which model and reasoning settings each stage uses can change output quality, elapsed time, and AI cost. Tuning means adjusting this runtime configuration to reduce AI costs while meeting quality and performance requirements.
Keep business logic fixed and assign each runtime AI configuration to an Experiment Arm. Compare two alternatives in an A/B test or three or more in a multi-arm evaluation, using the same Corpus and scoring criteria. Use measured AI cost to choose among configurations that meet the quality and performance requirements.
Verifying Purchase Order Processing
Purchase order processing illustrates how measured behavior supports an acceptance decision.
The example covers three changes and the evidence each requires.
-
Duplicate retries. Confirm the duplicate calls are gone and normal orders still register correctly.
-
Batch line-item I/O. Reduce calls while preserving retrieved results and side effects.
-
Runtime AI configuration. Compare output quality, performance, and AI cost.
Correcting Duplicate Retries
Suppose the order registration service briefly returns an error, and both the application and the runtime platform retry the same call. Use the call hierarchy to identify the two paths, then delegate retries to the platform. Reproduce the error to confirm the duplicate calls are gone, and check that registration still produces the expected result for normal orders.
Batching Line Item I/O
The Runtime Evidence Model example used a CallTree to show 1,000 I/O calls for 1,000 line items and compared versions before and after batching. The verification harness uses that execution evidence to decide whether to adopt the change. Run both versions with the same Corpus version and request mix. Verify that the retrieved results and side effects are preserved, and check the I/O counts, latency, and throughput against the design criteria.
Comparing Runtime AI Configurations
Purchase order processing extracts fields, interprets and corrects them, and performs a final check. The models used at each stage affect output quality and AI cost. We keep the business logic fixed, take Arms A and B from the Runtime Evidence Model article, and add C, which uses a local LLM at more stages. All three process the same 100 Corpus cases with a maximum concurrency of four.
Each configuration is assessed against the following criteria.
-
Output quality. All required fields are correct in 100 of 100 orders before human correction.
-
AI cost. The cost index for 100 orders is at most 60.
-
Latency. The 95th percentile from receipt to completion is at most 8 seconds.
-
Throughput. At least 40 orders per minute at a maximum concurrency of four.
Table 2 shows the models and reasoning settings the program uses in each configuration.
| Arm | Extraction | Interpretation and correction | Final AI check |
|---|---|---|---|
|
A |
Cloud A |
Cloud A, high reasoning |
Cloud A, high reasoning |
|
B |
Local LLM |
Cloud B, standard reasoning |
Cloud A, standard reasoning |
|
C |
Local LLM |
Local LLM |
Cloud B, lightweight model |
Table 3 compares output quality before human correction, AI cost (A = 100), and performance. Human review effort is recorded separately.
| Arm | Correct before review | AI cost index | p95 | Throughput |
|---|---|---|---|---|
|
A |
100/100 |
100 |
8 |
30/min |
|
B |
100/100 |
45 |
6 |
45/min |
|
C |
98/100 |
30 |
5 |
60/min |
B meets the output quality, cost, and performance criteria. A misses the cost and throughput targets, and C falls short on output quality. The evidence supports adopting B under these conditions.
Summary
The Runtime Evidence Model organizes comparable records of what a program did for a given input and load. The verification harness evaluates those records against acceptance criteria and returns verified changes to production.
Use production observation and Corpus-based re-verification in three ways.
-
Detect abnormal behavior and performance regressions in generated code from measurements.
-
Check the effectiveness and compatibility of a fix using the same Corpus.
-
Compare the costs of runtime AI configurations that meet output quality and performance criteria.
References
Glossary
- Model
-
A Model is an abstraction that represents a subject according to a particular Purpose and Concern so that it can be understood, reasoned about, evaluated, or constructed. It is not the subject itself; it preserves the elements, relationships, and meanings required for its purpose.
- verification
-
Verification is the activity of confirming that an implementation conforms to its specified design or requirements.
- Performance
-
Performance is the quality by which a system satisfies timing requirements such as processing time, response time, Throughput, and capacity under specified conditions and resources.
- BoK (Body of Knowledge)
-
At SimpleModeling, the core knowledge system for contextual sharing is called the BoK (Body of Knowledge). The goal of building a BoK is to enable knowledge sharing, education, AI support, automation, and decision-making assistance.
- Constraint
-
In UML, a Constraint is a condition or restriction expressed in natural language or a machine-readable language to declare part of the Semantics of one or more Model Elements. Its evaluation yields a Boolean value and has no side effects.
- Type
-
Undefined
- State
-
In UML, a State models a situation during which an invariant condition holds. The current State of an Object may determine accepted Events and Operations, applicable Constraints, and possible next Transitions.
- Test
-
A Test is an activity and specification that executes or evaluates a subject under stated conditions and compares observed results with expected results or Constraints to check conformance to requirements or contracts.
- SimpleModeling
-
SimpleModeling is a modeling-centered software development methodology and technology system for constructing a Domain Model from Knowledge, formalizing it in CML, realizing it as executable software through Cozy and AI, and running it on Textus.
- Cloud Native Component Framework (CNCF)
-
Cloud Native Component Framework (CNCF) is a framework for executing cloud application components using a single, consistent execution model. Centered on the structure of Component, Service, and Operation, it enables the same Operation to be reused across different execution forms such as command, server (REST / OpenAPI), client, and script. By centralizing quality attributes required for cloud applications—such as logging, error handling, configuration, and deployment—within the framework, components can focus on implementing domain logic. CNCF is designed as an execution foundation for literate model-driven development and AI-assisted development, separating what is executed from how it is invoked.
- internal DSL
-
An internal DSL is a domain-specific abstraction built within the syntax and type system of a host language. It allows leveraging existing tooling and guarantees type safety, often used in Scala via functions, type classes, macros, and extension methods.
- Operation
-
In UML, an Operation is a Behavioral Feature of a Classifier that specifies the name, type, Parameters, and Constraints for invoking associated Behavior. The Operation specifies an invocation contract, while a Method or another Behavior realizes it.
- observation
-
A recorded result of perceiving/measuring a phenomenon.
- defect
-
An imperfection or deficiency in a work product (designs, specifications, code, etc.). It does not meet requirements or specifications and requires repair or replacement. Defined in ISO/IEC 24765.
- error
-
A generic term used broadly in practice. In software engineering, it is ambiguous and may denote bugs or failures in general. In SimpleModeling, Error is treated as a broad label, with specifics clarified as Mistake, Defect, Fault, Failure, or Deviation.