Evaluating Long-Horizon AI Coding: From Running Code to Deliverable Software
Long-horizon AI coding is shifting from code completion to completing complex software engineering tasks. This article examines how to evaluate agentic coding systems across three levels—running, meeting requirements, and being deliverable—using two complementary task types: retrofitting existing projects and building applications from scratch. It covers cross-module consistency, security across the full data pipeline, why passing tests can still leave serious vulnerabilities, and a practical human-AI collaboration workflow for reliable delivery.
Evaluating Long-Horizon AI Coding: From Running Code to Deliverable Software
1. Evaluation Should Shift from “Writing Code” to “Closing the Engineering Loop”
AI coding is evolving from local code completion toward the sustained handling of complex software tasks. Given a real requirement, a system must not only generate functions—it must understand the existing architecture, identify module boundaries, modify data structures, adjust interfaces, add tests, and keep locating and fixing issues after runtime failures.
The key evaluation question has therefore changed. It is no longer “is this code correct?” but rather “can it stay aligned with the goal across a long chain of work and ultimately deliver a verifiable result?”
That said, three levels must be distinguished:
- Runs: the main flow can start and execute.
- Meets requirements: the functional behavior complies with explicitly agreed business rules.
- Deliverable: beyond functional correctness, it satisfies requirements for authorization, security, reliability, maintainability, and operations.
These levels are not equivalent. A feature can demo smoothly and pass automated tests while still allowing users to access resources that don’t belong to them. In that case, the problem isn’t that the program “doesn’t run”—it’s that the system failed to maintain business boundaries correctly.
From this perspective, the value of long-horizon AI coding should be tested against real engineering tasks. But whether something is truly deliverable should still be decided by an independent acceptance process.
2. Use Two Complementary Task Types to Build an Evaluation Perspective
Evaluating coding ability with a single task type tends to produce one-sided conclusions. A better approach is to choose tasks with clearly different constraint structures.
1. Legacy project modification: testing comprehension and constraint preservation
The first task type is adding functionality to an existing system—for example, introducing user-uploaded image assets into a motion-graphics generation workflow, and allowing scenes to reference those assets.
The difficulty here is usually not the file upload itself, but making the new capability integrate correctly with the legacy system:
- Whether data entities need owner and status fields;
- Whether APIs follow the existing authentication approach;
- Whether background jobs can safely access the assets;
- How the UI displays upload-failed, processing, and deleted states;
- Whether historical records can still be read normally;
- Whether failed retries produce duplicate assets or orphaned files.
This tests whether the system can first understand constraints and then execute cross-module changes, rather than building a parallel implementation detached from the original system to serve a local requirement.
2. Building a learning game from scratch: testing requirement completeness
The second task type is implementing a knowledge-learning game—based on learning materials and a requirements document—in which all levels can be completed.
This kind of task carries little legacy baggage but contains many product rules that need clarification:
- How learning objectives map to levels;
- Which answers demonstrate genuine understanding rather than a lucky guess;
- How feedback is given after failure;
- How progress is saved;
- How refreshes, duplicate submissions, and mid-session exits are handled;
- Whether the completion criteria are explicit and achievable.
The key here is not the number of pages, but whether the rules form a closed loop. A game that looks complete but contains an unreachable next level, or a final level with no terminal-state handling, still doesn’t count as finished.
Combining both task types lets you observe both “respecting existing constraints” and “completing the rules of a new system.”
3. Where Long-Horizon Tasks Are Actually Hard
1. Context understanding must translate into enforceable constraints
Reading a lot of code does not mean understanding the system. Effective understanding should show up in concrete outputs: module relationships, data flows, key invariants, and the locations that need changes.
Take asset referencing as an example. One important invariant is:
Any asset a scene can use must belong to the current user, or have an explicit and valid sharing authorization.
This condition cannot live only in the requirements document—it must hold across every path: upload, association, preview, rendering, and download.
Before starting changes, it’s advisable to require the AI coding system to output:
- Which modules a request passes through from entry point to execution;
- How user identity is propagated;
- Which locations read or write assets;
- Which security constraints must always hold;
- Which changes could affect existing functionality.
These outputs help humans catch incorrect assumptions early and reduce rework later.
2. Cross-module changes need contract consistency
Long-horizon tasks often span request structures, data storage, business services, asynchronous jobs, and page interactions. Changing only part of this creates desynchronized API fields, inconsistent state semantics, or gaps in error handling.
The safer approach is to define contracts first, then implement layer by layer along the call chain. For example, define asset identifiers, processing states, failure reasons, and referencable conditions, then implement them separately on the server and the UI.
In particular, avoid implementations that “temporarily wire things together with strings.” It runs quickly in the short term, but over time it makes state transitions and exception handling untraceable.
3. Continuous activity is not effective progress
An AI coding system may execute a large number of consecutive changes, but the volume of changes does not prove the task is close to completion.
Each phase should produce checkable artifacts:
- Research phase: architecture and risk notes;
- Design phase: data models and interface contracts;
- Implementation phase: changes with a clear scope;
- Verification phase: test results and reproduction steps;
- Delivery phase: known limitations, rollback methods, and open questions.
This phase structure reduces the “endless changes that never reach acceptance” scenario.
4. The Asset Import Scenario: Security Must Span the Full Data Pipeline
User file import looks like a routine feature, but it actually involves input validation, resource ownership, storage access, and execution environment isolation all at once.
1. File checks cannot rely on extensions alone
A server must not treat a file as trusted input just because its name looks like an image. Reasonable defenses typically include:
- Limiting upload size;
- Verifying the actual file type;
- Reading images through a controlled decoding process;
- Limiting image dimensions and post-decode resource consumption;
- Using server-generated storage identifiers;
- Avoiding user-supplied filenames as path components;
- Re-encoding when business needs require it, stripping unnecessary metadata.
These measures address different problems and cannot substitute for one another. Passing a type check doesn’t mean file processing won’t consume excessive memory.
2. An unguessable identifier is not an authorization
A common mistake is assuming that if resource identifiers are random enough, ownership checks can be skipped. Random identifiers only reduce enumeration probability; they do not prove the current request is authorized to access the resource.
When reading an asset, consider all of the following:
Who is the current userWho owns the target assetWhether the asset is in a usable stateWhether the current operation is allowed to use this asset
For example, querying with both the asset identifier and the current user’s scope as conditions is less likely to miss authorization logic than querying any asset first and relying on the caller to check.
If the system supports sharing, an explicit authorization model is also required—“knowing the identifier” must never default to “having permission.”
3. Asynchronous executors need authorization too
Another subtle issue: permissions are checked when the task is created, but the background worker reads the asset directly by identifier when it executes.
Tasks may execute with a delay. During that window, the asset may be deleted, sharing permissions may be revoked, and related business states may change. Background executors should therefore carry explicit business-subject information and re-confirm the necessary conditions before using any resource.
How permission changes during execution are handled should be determined by explicit business rules—not left to implementation accident.
4. Motion-graphics rendering should be treated as an independent trust boundary
If the system renders user-provided or auto-generated page content, it must not be treated as ordinary static data.
The rendering environment should be isolated according to risk: restrict network access, control readable resources, set execution-time and resource limits, and avoid exposing long-lived credentials to the rendered content. Asset access should also be scoped as narrowly as possible to what the current task needs.
The goal of isolation is not to guarantee the content never misbehaves, but to ensure that even if it does, the blast radius stays small.
5. Why All Tests Passing Can Still Leave Serious Vulnerabilities
Passing tests only prove that the inputs and assertions covered by the current tests found no problems. They do not prove that all requirements were correctly expressed.
For example, a test suite might verify that “a user can read their own images” without verifying that “a user cannot read other users’ images.” The happy path is complete, yet the authorization vulnerability remains.
Tests should therefore cover at least these dimensions:
| Dimension | What to verify |
|---|---|
| Normal functionality | Upload, reference, preview, and execution flows behave as expected |
| Permission boundaries | No cross-user or cross-ownership access is possible |
| Malformed input | Corrupted files, invalid identifiers, and oversized requests are handled correctly |
| State changes | Behavior stays consistent after deletion, revocation, and failed retries |
| Concurrency consistency | Duplicate requests don’t cause out-of-scope associations or duplicate side effects |
| Backward compatibility | Existing data and flows are not broken by new features |
Notably, add “negative tests”: deliberately use other users’ resource identifiers, expired credentials, or invalid states, and confirm the system explicitly rejects the operation.
Security acceptance should not check a single endpoint—it should be verified segment by segment along the resource lifecycle.
6. Learning Game Development: “Can Be Completed” Validates the Product Loop
Generating a learning game from materials tends to produce a particular failure mode: plenty of content and UI, but loosely defined rules.
1. Establish knowledge objectives before designing interactions
Every level should answer three questions:
- What should the learner master?
- What behavior demonstrates mastery?
- What targeted feedback follows a failed assessment?
For example, around an AI agent’s tool-use capability, a level could ask the learner to decide when to call an external tool, how to handle tool failures, and how to validate tool results. This is closer to real application than memorizing terminology.
2. Use a state machine to constrain level flow
Levels can be abstracted into states—locked, challengeable, in progress, completed—with explicit legal transitions.
For example, “submit an answer” should not be equivalent to “complete the level”; it should pass through answer validation and result adjudication. Duplicate submissions should behave consistently, and refreshing the page should not accidentally skip required steps.
Completion should be determined by explicit criteria—such as all required levels finished—not by whether some button was clicked.
3. Acceptance should cover the full user journey
Final testing cannot stop at “the homepage opens and buttons are clickable.” Testing should start from a new user’s entry and walk the complete journey: learning, answering, failing and retrying, restoring progress, and finally completing the game.
Error paths must also be verified: can restrictions be bypassed without finishing prerequisite levels? Do duplicate reward claims cause anomalies? Are learning materials consistent with answer adjudication?
Full-journey testing like this is often far better than component-level testing at exposing gaps in the product loop.
7. Build a Reproducible Evaluation Method, Not Impression-Based Judgments
When comparing AI coding capabilities, control the task scope, initial code, execution environment, and level of human intervention as much as possible. Otherwise, results may mainly reflect task difficulty or prompt differences.
Track the following metrics:
- Completion rate: how many acceptance items actually pass;
- Degree of human intervention: whether key design decisions or core bug hunting must be supplied manually;
- Change quality: whether unrelated refactoring and unnecessary dependencies appear;
- Verification thoroughness: whether failure paths and permission boundaries are covered;
- Fix quality: when a problem is pointed out, does the fix address the class of issue or just patch one instance;
- Maintainability: do structure, logs, documentation, and tests support future handover.
Time metrics should also be broken out separately. Time to the first runnable version and total delivery time after security hardening and regression verification represent different capabilities.
With only a small number of cases, conclusions should be limited to the corresponding task scope—you cannot generalize from them to claims of universal superiority or wholesale replacement of human engineers.
8. A Recommended Human-AI Collaboration Delivery Workflow
A more robust collaboration workflow has six steps:
Step 1: Define acceptance criteria.
Write down functional goals, security constraints, compatibility requirements, and what is explicitly out of scope.
Step 2: Review the plan before writing code.
Confirm the data model, permission boundaries, and key state transitions first, to avoid rapidly piling up implementation on a flawed design.
Step 3: Small incremental changes with continuous verification.
Advance module by module in independently checkable units, catching contract inconsistencies and regressions early.
Step 4: Add adversarial checks.
Actively attempt privilege escalation, malformed input, duplicate requests, and state races—don’t only walk the happy path.
Step 5: Accept from an independent perspective.
Humans or a separate verification mechanism should validate results against the requirements, not merely repeat the implementer’s completion report.
Step 6: Prepare for release and rollback.
Changes involving databases and storage structures need explicit compatibility strategies, failure handling, monitoring signals, and rollback conditions.
Conclusion: Treat AI Coding as an Engineering Collaborator, Not a Delivery Guarantee
The real value of long-horizon AI coding is taking on more implementation, debugging, and verification work in complex contexts—reducing repetitive toil for developers and shortening the distance from requirement to runnable version.
But the stronger the generation capability, the more important clear engineering constraints become. Growing code volume should not lower review standards, and passing automated tests should not replace permission verification and business acceptance.
A mature evaluation approach doesn’t just ask “can it build the feature?” It keeps asking: Are constraints preserved? Are risks surfaced? Are results reproducible and auditable? Can the system recover from failure? Only by folding these questions into the same closed loop can AI coding outputs move from “works in a demo” to “reliably deliverable.”
