Evaluating Long-Horizon AI Coding: Bridging the Gap from Demo to Delivery

    Public benchmark scores are often used to judge whether an AI coding model can handle real work, but they mainly reflect single-point problem solving rather than the sustained execution required in production. This article introduces a general evaluation framework based on two contrasting tasks: extending a legacy project under security constraints, and building a complete learning game from scratch using only reference material and requirements. It defines four capability layers of long-horizon coding, six acceptance dimensions, and the engineering loops needed to move from a working demo to a deliverable system. The key takeaway is that passing functional tests is not enough—permission isolation, security defaults, and human sign-off remain essential.

    1. Why Benchmark Scores Are Not Enough

    As AI coding tools iterate quickly, many teams still rely on public evaluation scores to decide whether a model can “get the job done.” However, real development environments differ significantly from evaluation settings. Real projects carry legacy code, implicit conventions, and security boundaries, and they require the final output to be runnable, testable, and deliverable. Benchmark scores mostly reflect single-point problem-solving ability, whereas long-horizon coding is about sustained progress: understanding complex context, staying consistent across multiple modules, and driving a task to an acceptance-ready state.

    This article does not evaluate any specific product. Instead, it abstracts a general evaluation framework using two very different tasks. One is incremental capability expansion in a legacy project with existing code and security constraints. The other is implementing a knowledge-learning game from scratch, given only learning material and a requirements document, with the goal of a fully playable end-to-end experience. The first examines legacy system understanding and constraint handling; the second examines the full path from material analysis to product delivery.

    2. Capability Baseline: What Makes Coding “Long-Horizon”

    Long-horizon coding is not about writing more code. It is about continuing to do the right thing. It can be broken down into four layers:

    1. Context understanding: identifying project structure, module boundaries, existing conventions, and data flows instead of focusing only on the current file.
    2. Cross-module consistency: keeping naming, error handling, and state transitions consistent when changes touch contracts, storage, task state, APIs, background execution, frontend, and rendering.
    3. Runnable progress: making each step land in a state that can be started, invoked, and observed, rather than producing many fragments that only look complete.
    4. Test-driven convergence: proactively adding tests and verification paths to move from “implementation complete” to “verification passed.”

    These four layers determine whether a tool can take on long tasks in real projects rather than only performing local completion.

    3. Evaluation Design: Two Complementary Tasks

    To stay close to engineering reality, the two tasks are deliberately different:

    • Task A (incremental change): In a project with substantial legacy code, add the ability to “safely import user image assets and reference them in HTML animation scenarios.” The focus is not the feature itself, but how to make a minimally invasive extension under existing constraints.
    • Task B (build from scratch): Given only one learning material and one requirements document, build a knowledge-learning game that can truly be completed from start to finish. The focus is material structuring, a closed gameplay loop, and the complete implementation of state machines and judgment logic.

    Task A tests “reading a legacy system” and “respecting boundaries.” Task B tests “building a new product” and “closed-loop delivery.” Together, they expose weaknesses in long-horizon capability more effectively.

    4. Observation Dimensions: Six Metrics for Acceptance

    1. Requirement clarification quality: whether ambiguities are identified proactively, such as asset size limits, format whitelists, reference methods, and loading timing in animation scenarios.
    2. Architecture consistency: whether new modules follow existing layering and dependency directions, avoiding “horizontal holes.”
    3. Secure defaults: whether least privilege, default deny, input validation, and path normalization are applied by default.
    4. Runnability: whether the system starts successfully on the first attempt and whether key paths include logs and error codes.
    5. Test coverage: whether boundary conditions and failure paths are covered, not just the happy path.
    6. Delivery boundaries: whether uncovered items, risks, and manual acceptance points are clearly listed.

    5. Key Finding: Passing Tests Does Not Mean Safe Delivery

    In Task A, both projects ran successfully, but manual acceptance revealed a P1-level permission isolation issue. Such issues often do not surface in functional testing, because functional tests focus on “whether it works,” while permission isolation focuses on “whether it can be used beyond boundaries.” Common root causes include:

    • Predictable resource identifiers that enable unauthorized access;
    • Validation only at the entry point, without a second constraint at the data access layer;
    • Overly broad permissions on temporary files and intermediate artifacts;
    • Missing ownership checks in the reference chain, leading to cross-user references.

    The following illustrative acceptance code (pseudocode) can turn permission checks into a fixed process:

    1. on request(resourceId, userId):
    2. resource = load(resourceId)
    3. if resource.ownerId != userId and not hasSharedPermission(resource, userId):
    4. return 403
    5. return serve(resource)

    These checks should appear at the API layer, the task layer, and the storage access layer to form defense in depth.

    6. From Demo to Delivery: Engineering Loops That Must Be Closed

    To bring long-horizon coding output closer to deliverable quality, at least four loops need to be closed:

    1. Contract loop: clear inputs, outputs, error codes, and state machine definitions, avoiding “implementation by chance.”
    2. Data loop: clear storage structures, migration strategies, and rollback plans, avoiding one-off scripts.
    3. Observability loop: complete logging, metrics, and tracing to help locate issues in long chains.
    4. Security loop: default deny, least privilege, input validation, and audit trails.

    The following checklist can be used for pre-delivery self-inspection:

    • Are there resource access paths without authentication?
    • Are there data visibility risks across users or tenants?
    • Are failure retries idempotent?
    • Do key states have audit logs?
    • Are there hard-coded secrets or weak random identifiers?

    7. Conclusion and Recommendations: Treat the Model as a Long-Task Executor and Keep Humans at the Acceptance Line

    Overall, long-horizon AI coding has made clear progress in cross-module advancement and runnable delivery. It is suitable for driving long tasks in real projects, especially for incremental changes in legacy systems and building prototypes from scratch, where it can significantly improve efficiency. However, humans must not step back on permissions, security, and final acceptance. Teams are advised to adopt a dual-track approach: AI tools handle implementation and initial verification, while humans handle security review, permission matrix checks, and delivery sign-off. This captures the efficiency benefits of long-horizon coding while keeping risk within an acceptable range.