Evaluating AI Coding Models on Long-Horizon Development Tasks

    Public benchmarks measure short code generation and repair, but they do not show whether a model can work across dozens of files over several hours, preserve existing behavior, and deliver runnable, tested results. This article outlines layered evaluation criteria, common failure modes in long-horizon tasks, test design for legacy systems, security and permission checks, from-scratch project review, and a manual acceptance checklist.

    1. Benchmark Scores Are Not a Substitute for Real Tasks

    Public leaderboards usually measure a model’s code generation and repair ability with fixed problems. These tests can show correctness on short tasks, but they rarely reflect performance in workflows that span dozens of files and last for hours. For development teams, three questions matter more: Can the model understand the existing context? Can it make changes without breaking existing functionality? Can the final result run and pass tests?

    Evaluation should shift from “how many questions were answered correctly” to “how much valid work was completed.” This can be broken down into three levels:

    • Understanding: Can the model locate relevant modules and accurately restate business constraints?
    • Execution: Can it coordinate changes across frontend, backend, data layer, and asynchronous tasks while keeping interfaces consistent?
    • Delivery: After the changes, can it start services, pass tests, and complete validation at the browser or API level?

    2. Sources of Risk in Long-Horizon Tasks

    The main risk in long-horizon tasks is error accumulation. A wrong assumption in the first step can be amplified over the next dozen steps. Common problems include:

    1. Context forgetting: naming conventions or state enums agreed on earlier are rewritten later.
    2. Local optimization: a shared function is modified to pass a single test, causing other callers to fail.
    3. False completion: the model reports “done,” but key branches are not covered.

    During evaluation, require the model to record its decisions and artifacts at each step to form a traceable change log. The model’s plan, modified file list, and test results should be checked line by line against the actual code diff. Do not rely only on self-reported summaries.

    3. Designing Tests in Legacy Code

    The value of an old system lies in the constraints it implies, such as backward compatibility requirements, data formats, deployment methods, and undocumented business rules. When designing tests, prepare three types of samples:

    • Regression samples: cover existing core flows and confirm that original functionality has not degraded.
    • Boundary samples: include null values, oversized input, and malformed files.
    • Constraint samples: for example, certain fields must not be modified, and certain APIs must remain backward compatible.

    Take a feature such as “a user uploads an asset and references it on a page.” The task description should state explicit acceptance criteria: a file type whitelist, a size limit, isolated storage paths, validation and escaping when the asset is referenced, and an error message on failure. Writing these conditions into the task description reduces the room for the model to make its own assumptions and makes it easier to judge afterward whether it followed the constraints.

    4. Security and Permissions Require Manual Acceptance

    Passing tests does not mean the system is secure. Permission isolation problems often appear in scenarios where “the feature works, but access is unauthorized,” and automated test cases are unlikely to cover all of them. It is advisable to split security checks into independent steps:

    1. List resource ownership: determine which user or tenant each type of data belongs to.
    2. For every read, write, delete, and export endpoint, construct unauthorized requests.
    3. Check whether uploaded content could be treated as executable content or injected into a page as a script.
    4. Review logs to confirm that no tokens, keys, or personal information are output.

    Below is an illustrative unauthorized-access test case:

    1. def test_user_cannot_read_others_asset(client, user_a_token, user_b_asset_id):
    2. resp = client.get(
    3. f"/api/assets/{user_b_asset_id}",
    4. headers={"Authorization": f"Bearer {user_a_token}"},
    5. )
    6. assert resp.status_code in (403, 404)

    This case covers only one endpoint. Complete permission validation needs to cover all read, write, delete, and export paths, and it must be repeated for each role.

    For content references that contain HTML, also pay attention to script execution and external resource loading. Common practices include whitelist filtering of user content, rendering in a sandbox, restricting the origins of external resources, and configuring a reasonable Content Security Policy (CSP).

    5. Evaluating From-Scratch Project Builds

    When the task is to build a complete application from materials and requirement documents, the evaluation focus shifts to product delivery. It can be checked from three aspects:

    • Requirement coverage: Does every function in the requirement document have a corresponding implementation?
    • Usability: Can the core flow be completed from start to finish, and are there any blocking points?
    • Content accuracy: Can knowledge points be traced back to the source materials, and are there statements inconsistent with those materials?

    For these projects, it is advisable to write a walkthrough script that requires the executor to follow the steps and record blockers. The number and severity of blockers say more about project completeness than “it can start.”

    6. Manual Acceptance Checklist

    Before AI-generated changes are merged into the main branch, confirm each item below:

    • The change scope matches the task description, with no unrelated files modified.
    • Permissions and data isolation have been specifically tested.
    • Secrets and environment configuration are not hardcoded in the code.
    • Tests cover newly added paths and failure paths.
    • At least one engineer has fully read the diff of key modules.
    • Validation has been completed in a staging environment before deployment.

    7. Conclusion

    AI coding models can already take on substantive work in long-horizon development tasks and are suitable for small-scale pilots in real projects. Evaluation should use runnable results, change traceability, and security boundaries as the main criteria. Permissions, data, and final delivery still require engineer oversight.