AI Coding: Evaluating Long-Horizon Tasks and Delivering Software Safely
Evaluating AI coding requires more than measuring code generation speed. This article examines how long-horizon development tasks reveal architectural understanding, cross-module consistency, and delivery risks. Using secure asset imports and educational games as examples, it outlines practical evaluation criteria, independent testing requirements, and a staged workflow for turning AI-generated implementations into reliable software.
1. Evaluating AI Coding Beyond Code Generation Speed
When AI coding moves into real projects, the evaluation question must shift from “Can it generate a function?” to “Can it complete an engineering task?”
Delivering a feature typically involves understanding the existing architecture, identifying constraints, changing data structures, updating interfaces, handling background jobs, modifying pages, adding tests, and validating deployment. A mistake at any stage can leave code that looks complete but cannot be used reliably.
AI coding capability should therefore be evaluated at three levels:
- Code generation: Can it produce syntactically correct code with sound basic logic?
- Engineering execution: Can it maintain consistency across modules, respond to failures, and produce a working end-to-end feature?
- Delivery assurance: Does the implementation meet authorization, security, compatibility, observability, and operational requirements?
Strong performance at the first two levels does not guarantee the third. In systems involving multiple users, file uploads, and asynchronous processing, a substantial gap can remain between “the feature works” and “the system is safe to release.”
An important lesson from the underlying case is that long-horizon development capability can improve implementation efficiency, yet human acceptance testing may still uncover serious authorization isolation flaws—even after existing tests pass. The useful discussion is not about a particular model’s ranking, but about integrating AI coding into a reliable software engineering process.
2. What Long-Horizon Development Capability Means
A long-horizon task is not simply a longer conversation. It involves interdependent decisions and requires the system to preserve its objectives through repeated changes and validation.
Understand the Existing System Instead of Building a Separate Implementation
Established projects usually have their own module boundaries, error-handling conventions, data-access rules, and task-state mechanisms. New features must follow those conventions rather than introduce isolated pieces of “correct code.”
An asset import feature, for example, may involve:
- Asset metadata and ownership;
- File storage and lifecycle management;
- Upload endpoints and access authorization;
- Asynchronous validation and processing jobs;
- Scene editing and previews;
- The rendering execution environment;
- Logging and failure recovery.
A sound engineering approach starts by mapping existing data flows and trust boundaries, then deciding where changes belong. Without that understanding, generated code may duplicate state management or bypass existing permission checks, producing something that works locally but undermines the system as a whole.
Keep Cross-Module Contracts Consistent
A common source of failure in cross-module changes is that different layers interpret the same field or state differently.
For example, an upload endpoint may treat “upload successful” as meaning the file is ready to use, while the background processing module treats it as meaning the file has entered a validation queue. If the frontend immediately allows a scene to reference that asset, previews may fail, rendering jobs may retry, or error states may become difficult to recover from.
Before implementation, define clear contracts:
- Which states are valid at each stage?
- Which module updates each state?
- Which states allow users to reference the resource?
- Can failed operations be retried?
- How are duplicate requests handled?
- How does deletion affect existing references?
These constraints should appear in data structures, interface behavior, and test assertions—not only in development notes.
Use Feedback to Converge on a Correct Implementation
Another essential capability is revising the implementation in response to compilation errors, runtime logs, test results, and observed interface behavior.
However, a fix should do more than remove the current error. Deleting a failing assertion may make tests pass while violating the requirement. Broad exception handling may prevent a page from crashing while hiding the underlying fault.
An effective fix should explain:
- What caused the failure?
- How does the change address the root cause?
- Does it introduce new risks?
For security-sensitive modules, fixes should also include regression tests to prevent the same class of defect from returning.
3. Case Study: Why Secure Asset Import Is a Valuable Evaluation Task
“Allow users to upload images and reference them in web animation scenes” sounds like an ordinary feature. In practice, it tests file security, identity and authorization, resource management, and rendering isolation.
Define Resource Ownership Before Implementing Uploads
Every asset should have a clearly defined ownership scope, such as a user, organization, or project. Access control must rely on identity information held by the server, not ownership fields submitted by the client.
A common mistake is to confirm that a user is logged in and then retrieve an asset directly by its identifier. This establishes identity, but it does not establish permission to use that asset.
The following pseudocode illustrates the distinction:
function loadAsset(actor, assetId):asset = repository.find(assetId)if asset is null:return notFound()if not authorization.canRead(actor, asset):return denied()if asset.status != READY:return unavailable()return asset
The authorization decision must reflect the actual business relationships. It cannot simply mean “the uploader is the current user.” In collaborative applications, member roles, project ownership, and sharing scope may all affect access.
The same permission rules must cover asset details, previews, downloads, scene saves, job creation, and background rendering. Protecting page-facing endpoints is insufficient if background jobs can read files directly using resource identifiers without authorization.
Validate Files in Layers
Client-side validation improves the user experience, but it is not a security control. The server should at least check file size, actual file type, decodability, and pixel dimensions, with explicit limits on processing resources.
File extensions, client-declared types, and actual content may disagree. A small image file can also consume substantial memory when decoded. Upload size limits therefore do not replace decoding resource limits.
If remote URL imports are supported, the system must also prevent requests that induce the server to access internal resources. Validation should cover the destination address, addresses reached through redirects, and permitted network access—not merely match patterns in the input string. When there is no clear business need, disabling remote imports is often easier to secure than maintaining complex filters.
Treat Rendering as a Separate Trust Boundary
User-submitted page content, asset references, and scripts should not inherit the application service’s runtime privileges.
Rendering jobs should run in a restricted execution environment with explicit limits on network access, filesystem access, execution time, and resource consumption. Asset references should resolve to resources authorized by the server, rather than allowing users to specify arbitrary internal paths.
If assets are accessed through temporary URLs, their validity period and resource scope should be controlled. Temporary URLs reduce long-term exposure, but they do not replace resource authorization. Permission must still be verified before a URL is issued.
Account for Permission Changes and Retries in Asynchronous Jobs
Uploading, validating, converting, and rendering assets often involve asynchronous processing. That raises additional questions:
- What happens if a user’s permission is revoked after a job is created?
- What happens if an asset is deleted while the job is queued?
- What happens if the same message is consumed more than once?
- After a processing failure, are the stored file and resource state still consistent?
These issues require explicit state machines, idempotent processing, and an authorization policy for the execution stage. In applications with revocable permissions, authorization at job creation generally cannot be treated as permanent authorization.
4. Case Study: How Educational Games Test End-to-End Product Capability
When generating an educational game from source material and requirements, the primary question is not whether the interface looks attractive. It is whether the system supports a genuine, stable learning experience that users can complete.
Turn Source Material into Verifiable Learning Objectives
Concepts from source material should not simply be assembled into questions. First identify the learning objectives, then design tasks that assess them.
For example:
- Understanding an agent’s observation, decision, and action loop can be assessed through scenario-based judgments.
- Understanding tool-use boundaries can be assessed through permission-selection and error-handling challenges.
- Understanding execution feedback can be assessed through state changes in multistep tasks.
Each level should include a clear objective, input conditions, operating rules, assessment criteria, and explanatory feedback. Otherwise, the game may merely repackage multiple-choice questions without helping users understand how concepts relate.
Define Completion as State Reachability
A game is not reliably completable just because a developer has manually played through it once. Completion means that users can reach the final state from the initial state by following the rules, without encountering an unrecoverable blockage.
Validation should cover:
- Whether correct actions advance progress;
- Whether incorrect actions receive useful feedback;
- Whether retries produce duplicate rewards;
- Whether refreshing preserves the correct progress;
- Whether progress from older versions remains compatible with new content;
- Whether the final completion state is saved reliably.
For applications with multiple levels, the flow can be treated as a state-transition graph. Check whether critical paths are reachable, whether failure branches can return to a usable state, and whether any states leave users unable to proceed or exit.
Do Not Let Presentation Hide Logic Gaps
Animations, points, and progress bars can increase engagement, but they cannot replace reliable assessment logic.
If answer validation happens entirely on the client, users may modify local state to bypass levels. That may be an acceptable trade-off for a low-risk personal learning application. If completion affects certificates, rewards, or formal assessments, however, critical validation and records should reside on a trusted server.
Engineering evaluation should explicitly identify the application’s risk level rather than impose the same security requirements on every scenario.
5. Why Passing Every Test Can Still Leave Serious Defects
Test results establish only that an implementation satisfies the assertions already written. They do not establish that all requirements have been covered.
This is particularly important for authorization. A test that checks whether an asset owner can access an asset will not detect whether another user can also access it. If test data always contains a single user, cross-user isolation flaws may remain hidden for a long time.
At minimum, use the following validation matrix:
| Validation dimension | Key checks |
|---|---|
| Expected functionality | Authorized users can complete intended operations |
| Unauthorized access | Users outside the ownership scope cannot read, reference, or download resources |
| State restrictions | Resources that have not passed validation, or have been deleted, cannot be used |
| Invalid input | Oversized, corrupted, or incorrectly typed files are rejected appropriately |
| Concurrency and retries | Duplicate requests do not create duplicate resources or incorrect states |
| End-to-end lifecycle | Creation, use, and deletion remain consistent |
| Human acceptance testing | Interface behavior, error messages, and risk boundaries match actual requirements |
Tests themselves also need review. Tests generated during the same implementation process may reproduce the implementation’s mistaken assumptions. A more reliable approach is to define acceptance criteria independently from the requirements, then evaluate the implementation against them.
6. Building a Reusable AI Coding Evaluation Method
Model evaluations should control environmental differences rather than directly compare results produced under different conditions.
Fix the Task and Execution Conditions
Record the starting codebase, requirement text, available permissions, test environment, and external dependency status. For long-horizon tasks, also record whether context was compressed, whether human hints were allowed, and whether objectives changed during execution.
Otherwise, completion time and success rates may reflect environmental differences rather than meaningful capability differences.
Measure Efficiency, Correctness, and Risk Separately
Useful measures include:
- Time to the first runnable version;
- Total time to pass acceptance testing;
- Completeness of cross-module changes;
- Automated test coverage and results;
- Number and severity of defects found by humans;
- Regression results after fixes;
- Maintainability and scope of code changes.
Avoid reducing every result to a single overall score. A fast implementation with an authorization flaw and a slower implementation with clear security boundaries represent different engineering outcomes.
Preserve Process Evidence, Not Just Final Code
Task plans, key decisions, failure logs, change history, and acceptance reports help distinguish genuine problem understanding from an implementation that happened to work after repeated attempts.
Human intervention costs also matter. If developers must continually provide critical constraints, explain the architecture, and repair subtle defects, generating large amounts of code may not reduce the total cost of delivery.
7. A Recommended Workflow for Safe Delivery
Real projects can use a staged collaboration process:
Define requirements and risk. Humans establish the requirements, risk level, and acceptance criteria, with particular attention to resource ownership, permission boundaries, and data lifecycles.
Review the plan before changing code. The AI coding system first produces an impact analysis and implementation plan. Code changes begin after that plan has been checked.
Implement in manageable batches. Update the data, service, job-processing, and interface layers incrementally. Run targeted validation for each batch rather than expanding the change scope all at once.
Perform independent acceptance testing. Focus on unauthorized access, invalid inputs, asynchronous state transitions, and failure recovery—not just the normal path.
Run a controlled trial. Observe error rates, job backlogs, resource consumption, and authorization-denial records, and prepare a rollback plan.
For high-risk features, human review should concentrate on critical boundaries rather than distribute attention equally across every line of code. Authorization decisions, file processing, credential use, external access, and data deletion usually deserve higher priority than interface layout.
8. Conclusion: Integrate Capability into Engineering Without Replacing Accountability
Progress in AI coding is best demonstrated by its ability to understand complex context, coordinate changes across modules, and continue toward a goal using validation feedback. Real projects are well suited to evaluating these capabilities, which may reduce the effort required for prototyping and feature implementation.
But runnable, tested, and ready for delivery are different standards. Security defects often exist outside the normal workflow and cannot be ruled out by one successful demonstration or a passing test suite.
A more reliable division of responsibility is to let AI coding handle implementation, information retrieval, debugging, and repetitive validation while developers retain control over requirements, risk assessment, and final acceptance. Efficiency gains become reliable engineering outcomes only when generated code is governed by explicit contracts, independent tests, and a traceable delivery process.
