How to Evaluate LLMs' Long-Horizon Coding Capabilities and Delivery Boundaries

    Benchmark scores offer only a partial view of how LLMs handle real engineering work. This article presents a three-layer evaluation framework and three core metrics for long-horizon coding tasks, then covers legacy system modernization, security and permission checks, completeness assessment for building products from source materials, human acceptance, and practical rollout steps. Readers will learn how to measure impact-scope recall, cross-module consistency, first-pass success, repair rounds, human interventions, and security test coverage so that model output is treated as a reviewable change rather than a finished deliverable.

    Why Benchmark Scores Are Not Enough

    Benchmarks typically evaluate models on fixed problems in controlled environments, and they can reflect average performance on a certain class of tasks. Real engineering differs in three clear ways: tasks span multiple files and modules; context includes historical code, implicit conventions, and business constraints; and deliverables must run, pass tests, and undergo human review. Evaluation should therefore shift from “can it answer the question correctly?” to “can it move the task to a deliverable state?”

    Evaluation can be divided into three layers:

    • Understanding layer: Can the model read the context and identify module dependencies and existing conventions?
    • Execution layer: Can the model continuously modify code, keep cross-module changes consistent, and converge over multiple iterations?
    • Delivery layer: Does the result run correctly, pass tests, and meet security and compliance requirements?

    A weakness in any of these layers will surface during final delivery.

    Three Core Metrics for Long-Horizon Tasks

    1. Completeness of Impact-Scope Identification

    The first step in a long task is to find the full affected scope. For example, adding a feature may involve API definitions, database schema, task state machines, background workers, and frontend pages at the same time. If the model misses one of these areas, the problem often appears only at runtime during later testing.

    One evaluation method is to give the model a task involving three to five modules, ask it to output a change plan first, and then compare that plan with a manually prepared impact list to calculate recall:

    1. Impact-scope recall = number of affected files correctly identified by the model / actual number of affected files

    When recall falls below a certain level, the model should be required to complete the plan before it is allowed to modify code.

    2. Consistency of Cross-Module Changes

    The most common problem in cross-module changes is “locally correct, globally broken.” Typical cases include inconsistent API fields between the caller and the service; enum values defined differently in the database and frontend; and a missing intermediate state in a state transition flow.

    Validation should focus on three mechanisms:

    1. Type checking and compilation covering field names, types, and null handling;
    2. API contract tests confirming that request and response structures match the agreed contract;
    3. End-to-end calls that exercise the full path from frontend trigger to data persistence.

    If any of these mechanisms is missing, a “tests passed” conclusion is unreliable.

    3. Closed-Loop Ability to Run and Test

    Evaluating a model should not stop at whether it can write code. It should also examine whether the model can independently run builds and tests and use failure information to locate problems. It is recommended to record the following data for each task so that comparable metrics can be built:

    1. from dataclasses import dataclass, field
    2. @dataclass
    3. class RunRecord:
    4. task_id: str
    5. first_pass_ok: bool # Whether all checks passed in the first round
    6. repair_rounds: int # Number of repair rounds
    7. wall_minutes: float # Total time from start to pass
    8. human_interventions: int # Number of human interventions
    9. failed_checks: list[str] = field(default_factory=list)
    10. def summarize(records: list[RunRecord]) -> dict:
    11. n = len(records)
    12. return {
    13. "first_pass_rate": sum(r.first_pass_ok for r in records) / n,
    14. "avg_repair_rounds": sum(r.repair_rounds for r in records) / n,
    15. "avg_minutes": sum(r.wall_minutes for r in records) / n,
    16. "avg_interventions": sum(r.human_interventions for r in records) / n,
    17. }

    By accumulating this data over time, teams can compare the real effects of different model versions or prompting strategies instead of relying on impressions.

    Legacy System Modernization: Understand First, Then Modify

    The difficulty of older projects is that many constraints are not written in documentation. They are hidden in coding habits, historical patches, and test cases. Letting a model modify code directly can easily break these implicit conventions.

    A safer approach has two steps:

    1. Understanding phase: Ask the model to produce a pre-modification explanation covering module boundaries, main data flows, existing test coverage, and the existing behaviors it believes need protection.
    2. Confirmation phase: Have a developer familiar with the project review the explanation, add missing constraints, and only then move to the modification phase.

    The value of the first step is to expose misunderstandings. If the explanation treats a compatibility field as deprecated, the modification phase may introduce a regression. That problem can be found during the understanding phase instead.

    Security and Permissions: Passing Tests Does Not Mean Correct Permissions

    Permission-related defects have a characteristic: functional tests rarely cover them, because normal user paths do not trigger them. If model-generated code only satisfies “the feature works,” it may leave an opening for unauthorized access.

    Common issues that need focused validation include:

    • Horizontal privilege escalation: User A can read User B’s data by guessing a resource ID;
    • Path traversal: A filename contains parent-directory symbols, causing files outside the storage directory to be read;
    • Missing upload validation: File type is determined only by extension, so executable content is stored as an asset;
    • Uncontrolled external resource references: Animated content references unauthorized external addresses or embeds executable scripts.

    For resource access, a recommended practice is to return “resource not found” and “access denied” uniformly, preventing attackers from probing whether a resource exists through response differences:

    1. def resolve_asset(user_id: str, asset_id: str, repo):
    2. asset = repo.get(asset_id)
    3. if asset is None or asset.owner_id != user_id:
    4. # Return not found uniformly to avoid leaking whether the resource exists
    5. raise NotFound()
    6. return asset

    For embedded animated content, the following combination of measures can be used:

    • Use a content security policy (CSP) to restrict allowed resource origins;
    • Use the iframe sandbox attribute to isolate the script execution environment;
    • Validate referenced addresses against an allowlist, and reject or replace addresses outside the allowlist with placeholder content.

    It is recommended to establish a fixed test matrix for permission scenarios:

    Test scenario Expected result
    A user reads another user’s asset ID Returns not found
    A script file is uploaded disguised as an image Rejects and logs
    A filename contains parent-directory symbols Rejects
    Animated content references an unauthorized external address Rejects or replaces

    Permission defects should generally be classified as high-priority issues. Even if the feature itself runs normally, it cannot be considered accepted.

    From Materials to Product: Evaluating Completeness

    Another type of task starts from learning materials and requirements documents and builds a complete product from scratch. This type of task tests the ability to extract requirements from information, decompose features, and implement them.

    Evaluation can focus on the following dimensions:

    • Requirements coverage: Does every feature in the requirements document have a corresponding implementation?
    • Process completeness: Can the user move from start to finish, for example, can a game be completed from beginning to end?
    • Data consistency: Are progress, score, and state preserved correctly after refresh or interruption?
    • Boundary handling: Are behaviors reasonable for empty input, repeated operations, and abnormal interruption?

    In practice, requirements can first be broken down into numbered acceptance items, and the model can be asked to provide the implementation location and self-test result for each item. For process-oriented goals such as “can the game be completed,” the model should be required to actually walk through the full path and record the result rather than merely claim that the feature is complete.

    Human Acceptance Cannot Be Skipped

    When a model says “done,” it usually means the code has been generated and tests have passed. That is not equivalent to business-level “deliverable.” Business semantics, user experience, and compliance requirements often require human judgment.

    Human acceptance can focus on the following categories:

    1. Whether permissions and data boundaries comply with the organization’s access policies;
    2. Whether business rules match product intent, especially boundary conditions;
    3. Whether code involving secrets, payments, and user data has undergone independent review;
    4. Whether the user interface and interactions meet expectations, not merely whether they run.

    For high-risk paths, mandatory review rules can be established: changes without human approval are not allowed to merge into the main branch.

    Implementation Recommendations

    When introducing models into a real development process, teams can proceed as follows:

    1. Select three to five representative tasks for a pilot, covering long-horizon modification, legacy systems, and from-scratch development.
    2. Record first-pass success rate, repair rounds, time spent, and human interventions for each task to establish a comparable data baseline.
    3. Set security gates for code paths related to permissions, input validation, and external resource references, and require them to pass a fixed test matrix.
    4. Treat model output as a change request awaiting review, not as a finished product ready for release.
    5. Re-run pilot tasks after model version updates, because behavior changes may affect existing acceptance conclusions.

    The value of long-horizon coding capability lies in shortening the path from requirements to a runnable version. Delivery quality still depends on validation methods and human oversight. Making evaluation a repeatable process is more reliable than relying on the impression from a single demonstration.