Engineering Reliable Coding Agents: Evaluating and Operating the System Around the Model
Abstract
AI coding agents are commonly evaluated as models but deployed as systems. Their reliability depends not only on model capability, but on the harness, execution state, retrieval, memory and state management, permissions, review interfaces, and resource allocation. This monograph examines those boundaries and develops a framework for evaluating and operating coding agents reliably. It synthesizes 164 scholarly works, 100 practitioner records, 29 benchmark records, and 17 author-system case records through a structured multivocal review, targeted update audits, software-engineering coverage analysis, and distributed-systems evidence synthesis. Across this evidence, many apparent model failures originate elsewhere in the system, while improvements at one layer often fail to propagate to end-to-end outcomes. Evaluation and operation are treated as a dependency chain in which weaknesses in task construction, execution environments, retrieval, state management, verification, or observability can invalidate downstream conclusions. The monograph contributes a versioned catalog of 206 reliability records: 193 gated practices, including 56 developed in depth, plus 13 research leads; an evidence ledger; a framework for dependency and repair asymmetry across the agent lifecycle; measurements and failure cases from operated agent systems; runnable evaluation and reliability protocols; and five reusable agent skills with evidence maps. Together, these provide a system-level methodology for distinguishing model capability from infrastructure effects, designing defensible evaluations, and building systems that recover safely when components fail. The review is structured rather than exhaustive, evidence strength varies by topic, and results depend on workload and configuration. The methods record which search lanes were executed, which remain unexecuted, and limits on evidence-grading claims.
Figures & tables
| Review step | Mode | Human decision retained |
|---|---|---|
| Candidate retrieval and ranking | Automated and assisted | I defined each thread question and search boundary, then read the admitted sources. |
| Identity resolution, normalization, and duplicate checks | Automated checks with human resolution | I resolved ambiguous identities and practitioner independence keys. |
| Bounded-claim extraction | Assisted | I checked the source, revised the extracted claim, and accepted or rejected it. |
| Initial evidence-group proposal | Assisted | I assigned the final label to the scoped claim. |
| Challenge pass | Assisted | Automated passes flagged composite claims, contrary findings, duplicate support, and label inconsistencies; I reread the source and adjudicated each change. |
| Practice admission, chapter selection, and prose | Human | I made the selection and writing decisions. |
| Part | Ch | Title |
|---|---|---|
| Part I: Evaluation measurement and experiment design | 1 | Run-to-run variance, statistical power, and paired comparisons |
| 2 | Baselines, ablations, and cost-accuracy tradeoffs | |
| 3 | Benchmark contamination, oracle strength, and workload validity | |
| Part II: Evaluation and grading systems | 4 | Execution-based evaluation, correction gates, and release tests |
| 5 | Calibrating model graders and separating agreement from correctness | |
| 6 | Proxy metric gaming and layered evaluation signals |
| Outcome structure | Comparison to analyze | Test guidance |
|---|---|---|
| Per-item numerical scores whose paired differences plausibly satisfy a normal approximation | Mean of the paired item differences | Paired t-test |
| Metrics computed nonlinearly from aggregate counts, including corpus-level F-score and BLEU | Full metric recomputed on resampled or relabeled item pairs | Paired bootstrap or paired permutation test |
| Pass or fail outcomes on the same items | Discordant pairs in which only one system passes | McNemar’s test |
| Identity | Names |
|---|---|
| work_id | stable logical work; the intent that should happen once logically |
| input_state_id | the repository or repositories, branches, and revisions against which the attempt was planned and executed |
| ownership_epoch | monotonic generation of write authority over that work |
| attempt_id | one execution attempt under a given work and epoch |
| artifact_version | concrete code or state produced by an attempt |
| verification_id | one verification execution, including the artifact, verifier version, environment, and inputs it observed |
| Identity under test | Action attempted | Required result |
|---|---|---|
| Ordinary | The prohibited write | Denied by the enforcing system |
| Escalated | The intended narrow action | Succeeds |
| Escalated | Adjacent destructive actions | Denied |
| Threat category | Preventive control | Detecting control | Capability boundary |
|---|---|---|---|
| Untrusted instructions in retrieved content | Source restrictions and input validation | Injection screening and trace review | Task-specific tool allowlist |
| Sensitive-output disclosure | Read-scope restriction and output policy | Secret and policy scanning | No access to unrelated sensitive data |
| Unauthorized tool selection | Gateway-enforced allowlist | Tool-request audit | Unavailable tools cannot be invoked |
| High-impact external effects | Typed proposal and approval | Read-back and audit log | Narrow, expiring execution identity |
| Term | Meaning |
|---|---|
| Logical work | The user or operator intent that should happen once logically, under a stable work identity. |
| Attempt | One execution of that work; a retry is a new attempt at the same logical work (contract I4, retries preserve logical identity). |
| Delivery | The assignment or redelivery of an attempt to a worker by the runtime. |
| Runtime commit | A result durably recorded inside the orchestration boundary. |
| External commit | A world-changing effect accepted outside that boundary, such as a merge, deployment, or payment. |
| Idempotency | The contract under which a repeated external commit is indistinguishable from a single one (contract I5, effects are safe under redelivery or explicitly uncertain). |
| Fault | Contract | Expected observable behavior |
|---|---|---|
| Response lost after external commit | I5 | The runtime treats the call as uncertain, reconciles against external state before re-sending, and records the reconciliation outcome; no blind re-send. |
| Delayed response delivered after the retry has started | I5 | The late response and the retry resolve to one logical effect; the effect ledger shows one committed effect_id or an explicit unknown_external_state , never two commits. |
| Worker loses its lease but continues running | I2 | The protected mutation boundary rejects the superseded worker’s writes by ownership_epoch ; the rejection appears in the trace as a fencing event, not a silent success. |
| Old worker’s completion arrives after the new worker has succeeded | I3 | The stale completion is rejected by generation and attempt identity; logical state reflects the new attempt only, and the rejection is recorded. |
| Repository state changes between validation and publication | I6 | Publication fails closed: the runtime detects that the validated version is no longer the head, refuses to publish against changed state, and routes to re-validation or reconciliation. |
| Condition | Question for the running gate | Observation to collect | Failure implication |
|---|---|---|---|
| Causal power | Can the person stop or alter this exact action? | Rejection, cancellation, edit, and timeout traces | The click records assent but does not control execution |
| Epistemic access | Can the person inspect the relevant inputs, artifact, target, and consequences before deciding? | Missing context, inaccessible logs, and reconstruction errors | Approval rests on incomplete state |
| Self-control | Can the person decide without a forced default or impossible queue constraint? | Default acceptance, time pressure, and override use | The workflow substitutes acquiescence for judgment |
| Fitting intentions | Is the role expected and prepared to inspect the named risk? | Review actions, escalation behavior, and interviews | The role is ceremonial or aimed at another risk |
| Stage | Fields |
|---|---|
| Observed events | Arrival time, priority, claim and release events, observed duration, completion or failure outcome, and review verdict. |
| Serving observations | Per call: endpoint or route selected, model and serving configuration version, input and output token counts, cached input share where the provider reports it, time to first token, total call latency, observed queueing, and retry count. Record which of these the provider does not expose. |
| Decision state | Available capacity, eligible execution pools, work already running, leases or locks, deadlines, model or tool compatibility, reviewer availability, and constraints that excluded an otherwise eligible item. |
| Policy estimates | Predicted cost, predicted task performance, routing uncertainty, expected duration, solver objective value, and optimality gap. |
| Code-estate state | Campaign identity, repository, base revision, host or workspace, affected entities, artifact version, code index version, conflict evidence, and publication state. |
| Decision | Personal starting point | What changes it |
|---|---|---|
| Repeated evaluation | Use paired runs per item for inexpensive screening, but do not promote from that screen alone. Size release comparisons from a pilot and the smallest decision-relevant effect. | Higher variance, clustered tasks, or smaller meaningful effects require more runs. |
| Reliability reporting | Report both , where any attempt succeeds, and , where every attempt succeeds, with printed beside the result. Begin with . | The deployed retry policy and the cost of intermittent failure determine the useful . |
| Human-label agreement | Treat Cohen’s or Fleiss’s kappa below 0.60 as a rubric-debugging trigger. A value above 0.60 is not a correctness gate. Promotion still depends on class-specific errors against expert adjudication. | Class imbalance, ambiguous labels, and high-consequence mistakes make the confusion matrix more informative than kappa alone. |
| Promotion threshold | Before execution, require either a three-percentage-point absolute success gain at no material cost increase or a ten-percent cost reduction at no success loss. Treat smaller effects as uncredited until a decision justifies them. | Task value, baseline success rate, and operating cost should replace these round numbers. |
| Failure review | Read twenty stratified failures after a material model, evaluation apparatus, or policy change. Preserve an abstain category when the trace cannot support attribution. | Rare high-consequence failure classes should be oversampled regardless of frequency. |
| Context restart | Restart or consolidate at 60 percent of the shortest context length at which the weakest required task shows material degradation in a local sweep. | New models, tools, instruction files, or task mixtures require another sweep. |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Identifier | Practice | Ch. | Treatment |
|---|---|---|---|
| ERCA-001 | Strengthen weak test oracles before trusting pass rates | 3 | developed |
| ERCA-002 | Run memorization probes before attributing benchmark gains to capability | 3 | companion |
| ERCA-003 | Pair every public benchmark score with a matched private control and measure the gap | 3 | developed |
| ERCA-004 | Evaluate on post-cutoff tasks via temporal holdouts and live pipelines | 3 | developed |
| ERCA-005 | Measure train-test overlap with semantic matching, not just n-grams | 3 | companion |
| ERCA-006 | Measure contamination by estimated score benefit, not binary flags | 3 | companion |