Evaluating AI Coding for Merge-Ready Delivery, Not Just Correct Code
AI coding evaluation is shifting from solving isolated problems to producing changes that maintainers can accept. This article explains how to design repository-based tasks, combine automated checks with maintainer review, interpret merge rates, and assess multi-model setups, cost, latency, and pilot results as engineering evidence.
1. Why Coding Evaluation Should Care About Mergeability
Evaluating AI coding ability is moving from “Can the system solve a problem?” to “Can it complete a real software change?” The two goals look similar, but they impose different engineering requirements.
In standalone programming tasks, inputs, outputs, and pass conditions are usually well defined. A model can score well simply by generating a program that satisfies the tests. In a real repository, a change must also fit the existing architecture, follow interface conventions, preserve historical behavior, and limit its impact on other modules. A new feature that runs is not necessarily a change a maintainer is willing to merge.
The core question is whether a generated change has reached a quality level that can enter a normal engineering delivery process.
Mergeability is not the same as syntactic correctness, nor is it another name for test pass rate. It is a judgment of the change as a whole, typically covering:
- Requirement fit: whether the change solves the stated problem rather than only its surface symptoms.
- Behavioral correctness: whether the new logic is correct and existing functionality has not regressed.
- Architectural consistency: whether the change follows the repository’s layering, dependency direction, and extension patterns.
- Maintenance cost: whether the code is clear, necessary, and easy to modify later.
- Verification coverage: whether tests and other evidence match the risk of the change.
- Safety and compatibility: whether the change introduces risks around permissions, data handling, or interface compatibility.
A mergeability evaluation measures delivery quality under a specific task set and runtime conditions. It should not be treated as a success rate for every production scenario.
2. Designing Tasks That Reflect Real Development
Start from an existing codebase
Real software work rarely begins with an empty file. Developers locate a problem in an existing system, understand call relationships, and then make a local change. Evaluation tasks should therefore preserve the necessary code context instead of offering only an isolated function signature.
Suitable tasks include bug fixes, small feature extensions, edge-case handling, local refactoring, and compatibility corrections. Each task should state the expected behavior and explicit constraints without revealing the implementation path.
For example, a task involving duplicate requests should not only check whether a duplicate is rejected. It should also observe whether the first request executes normally, whether retries after failure follow the agreed behavior, whether concurrent requests remain consistent, and whether distinct business requests are incorrectly treated as the same operation. These checks reflect the real-world pattern of a local change under global constraints.
Control difficulty and task mix
A set dominated by simple string handling or local syntax fixes will not represent complex engineering ability. Conversely, a set that requires large architectural changes for every task may not match how teams actually use AI coding systems.
A more useful approach is to stratify tasks: by scope, such as single-file, cross-file, and cross-module changes; by work type, such as bug fixes, feature implementation, and refactoring; and by verification difficulty, such as ordinary logic, concurrent behavior, and performance-sensitive paths.
Report performance by category as well as overall. Systems with similar total scores may be strong at local fixes but weak at cross-module changes. Selection should favor tasks that match the team’s workload rather than leaderboard position alone.
Define inclusion and exclusion rules in advance
How the task set is built strongly affects the conclusion. Before evaluation, specify which tasks qualify—for example, those with stable reproduction conditions, independent verification, and sufficient context.
Tasks whose environments cannot be restored, whose external dependencies are inaccessible, or whose requirements are clearly ambiguous should be marked separately and handled under rules agreed in advance. Removing unfavorable tasks or changing the criteria after seeing model results undermines credibility.
3. Combine Automated Verification with Maintainer Review
Use automated tests for verifiable failures
Automated tests are suited to deterministic behavior: functional output, error handling, boundary conditions, and regression risk. Static checks can catch some issues involving types, formatting, dependencies, and potential defects.
Passing tests does not mean a change is mergeable. A model may hard-code behavior for a limited set of examples, or bypass an existing permission check in order to fix one problem. Such a change can satisfy some tests while violating the real requirement.
Do not rely only on tests added by the model. Existing tests, independently designed cases, and necessary isolation tests should form the evidence chain. Also check whether the model manufactured a pass by deleting assertions, weakening checks, or changing expected results.
Use human review for engineering judgment
Maintainer review should cover what automated tools cannot judge well: whether the scope is appropriate, whether logic is duplicated, whether abstractions are excessive, and whether the implementation matches project conventions.
To reduce subjective variation, review rules can use three levels:
- Must reject: the requirement is unfinished, or there is a critical defect, security risk, or clear regression.
- Changes required: the implementation is basically sound, but tests, compatibility, or structure still have clear gaps.
- Non-blocking suggestions: naming, comments, or local expression could improve, but they do not block acceptance.
State explicitly whether “changes required” counts as failure. For evaluations of autonomous delivery, separating those results from directly acceptable changes is usually more informative. Otherwise, minor edits and major rework can be conflated.
Keep a complete process record
An evaluation should retain more than the final diff. Record the task input, runtime environment, execution trace, test output, error logs, and review conclusion.
These records show whether failure came from coding ability, missing context, an environment fault, or resource exhaustion. Without them, a team only knows that the run failed and cannot target improvements.
4. How to Read Evaluation Scores
Confirm the metric definition first
A common mergeability statistic is:
Merge rate = number of tasks meeting the predefined merge criteria ÷ number of valid evaluation tasks × 100%.
The formula is simple, but the denominator and success conditions must be explicit. How timeouts, environments that fail to start, and missing valid changes are handled will change the score. Fix those rules before the evaluation and publish them with the results.
Separate percentage points from relative change
When comparing percentages, distinguish an absolute difference from a relative change. Subtracting two success rates yields a difference in percentage points. A relative change uses one of those rates as the baseline.
In technical writing and selection reports, prefer an explicit percentage-point statement. Do not describe “several percentage points higher” as an equivalent relative improvement.
Do not splice results from different sources
The same method can produce different scores across organizations or runtime setups. That is not necessarily a contradiction. Task versions, context settings, retry limits, resource budgets, decision rules, or reporting precision may differ.
Before comparing, at least check whether both runs used:
- the same task set and code version;
- the same number of retries;
- the same context and execution budget;
- the same supporting components;
- the same success criteria;
- the same handling of environment failures.
Unaligned scores are background only. They do not prove that one configuration has a stable advantage.
Treat close scores with statistical uncertainty
When two configurations are close, ranking can depend on sample size and run-to-run randomness. Interpret results with the number of valid tasks, repeated runs, and statistical uncertainty in mind.
If several configurations are evaluated on the same tasks, analyze paired outcomes: which tasks both succeeded on, which both failed, and which only one configuration solved. That view often reveals capability differences better than a single total score, and it can show where configurations complement each other.
5. Evaluate Multi-Model Collaboration as a System Configuration
An AI coding system does not have to use one model for every step. Some setups let a primary model plan and make critical edits, while an auxiliary model handles retrieval, summarization, local checks, or other relatively independent work.
This can improve cost or latency, but context handoff, task splitting, and repeated verification can also add overhead. A cheaper auxiliary model does not by itself make the whole system more economical.
Evaluation should separate:
- Single-model ability: performance when one model solves tasks independently under fixed conditions.
- System-configuration ability: the result produced jointly by models, task routing, the execution environment, and verification.
- Net benefit of collaboration: whether quality gains offset added coordination cost and failure risk.
Auxiliary models should not make high-risk judgments beyond their limits. Changes involving permissions, security, data consistency, or core business logic still need independent verification and human review.
6. Measure Quality, Cost, and Latency Together
Measure cost per accepted delivery
A cheap single call does not mean a lower cost to finish a task. Retries, repeated context reads, failed executions, and human rework can all raise the real spend.
A more useful metric is cost per acceptable delivery: under a consistent definition, relate total evaluation or trial spend to the number of acceptable results. Total spend can include model calls, compute, review, and repair.
State how human cost is estimated. If only model-call spend is counted, say so, so a partial cost is not presented as the full delivery cost.
Measure latency across the whole task
Developers care when a usable result arrives, not only how fast the first reply appears. Measure time from task submission to an acceptable change, and look at the distribution of slower tasks.
Parallel models can shorten waiting time for independent work. When code changes depend on each other, serial confirmation and repeated integration can slow the process. Optimize the actual bottleneck rather than adding parallelism by default.
Set acceptance rules that match business risk
Low-risk documentation edits, ordinary bug fixes, and changes to core business code should not share one acceptance bar. Teams can set different quality thresholds, budget caps, and human approval requirements by task risk.
The goal is not necessarily the highest total score. It is more stable delivery efficiency within an acceptable level of risk.
7. Putting Evaluation into Practice
Build a representative internal task set
Select completed, reproducible work from past development, covering the languages, module sizes, and defect types the team actually sees. Remove sensitive information, and check that task descriptions, comments, and context do not leak the answer.
Refresh the set periodically so systems do not overfit a fixed sample. Keep tasks used for tuning reasonably separate from tasks used for final acceptance.
Fix runtime conditions and isolate execution
Record model configuration, task version, resource budget, retry rules, and environment dependencies. Run generated code and its tests in a controlled environment, and limit unnecessary network access, credential access, and write permissions.
Isolation helps reproduction and reduces the risk of executing generated code. Tasks that involve sensitive data should also follow the organization’s data-use and audit requirements.
Calibrate on a small set before scaling
Before a formal evaluation, use a small batch to check whether the process is sound, especially whether different reviewers understand the criteria the same way.
Calibration is not a search for the highest-scoring configuration. It is a way to find ambiguous tasks, environment problems, and rule gaps. Revise the rules, then run the formal evaluation. Do not change the standard while testing.
Improve from failure types
Group failures into categories such as misunderstood requirements, wrong edit location, missing context, implementation defects, insufficient verification, compatibility problems, and environment faults.
Each type points to a different response: poor localization may need better context retrieval; weak verification may need stronger test execution; repeated regressions may need tighter control of change scope. Switching models alone will not fix every problem.
Confirm real benefit in a pilot
After an offline evaluation, move a limited set of lower-risk tasks into a pilot. Keep human review and a rollback path, and continue to watch acceptance rate, rework time, defects, and developer experience.
Offline scores help narrow options. Only a real workflow shows whether the system reduces net work, rather than trading coding time for longer review time.
8. From Leaderboard Scores to Engineering Evidence
The value of mergeability evaluation is that it connects AI coding ability with real software maintenance. Code generation is only one step in delivery. A reliable change must also meet the requirement, pass verification, respect the architecture, and control risk.
A credible evaluation system has to answer three questions: whether the tasks represent actual work, whether the judgment is rigorous enough, and whether the results can be reproduced and explained. Cost, latency, and the amount of human intervention then turn those results into a useful selection basis.
Rather than chasing a ranking detached from its conditions, build a complete evidence chain: test capability on representative tasks, check correctness with independent verification, judge acceptability through maintainer review, and confirm the benefit in a real pilot. That is what turns AI coding ability into steady engineering output.
