Evaluating Long-Horizon Coding Ability: A Practical LLM Evaluation Methodology

    This article presents a practical methodology for evaluating the long-horizon coding ability of large language models using two real projects: an incremental upgrade to a legacy codebase and a from-scratch product build. It explains why benchmark scores are insufficient, examines post-training scaling trends, analyzes a P1-level permission isolation defect exposed late in manual acceptance, and shows how decidable acceptance criteria affect long-horizon completion. The article concludes with an evaluation matrix and practical recommendations for task splitting, security gating, and human-machine division of labor.

    The conclusion first: current top-tier open-source code models have advanced the line on sustained long-task execution, but there is still a clear gap before “all tests green” can mean “safe to deliver.” The evaluation method below comes from hands-on testing on two real projects: one was an incremental capability expansion in an older project with a large amount of historical code and security constraints; the other was a from-scratch implementation of a learning app that could actually be completed. Both projects eventually ran end to end, but the first exposed a P1-level permission isolation defect during manual acceptance. That result is more informative than any score.

    1. Why Leaderboard Scores Are Not Enough to Judge Coding Ability

    Public evaluation sets are mostly made up of short tasks with clear boundaries: given a function signature and test cases, the model outputs an implementation that can be independently verified. These tasks measure “local correctness,” while the hard part of real engineering is precisely not local.

    The cost structure of long-horizon coding tasks is completely different. It contains at least four layers of progressive difficulty:

    • Context understanding: locate the real source of constraints across tens of thousands of lines of historical code, rather than implementing the requirements document literally.
    • Cross-module advancement: a single change often spans data contracts, the persistence layer, task state, the API layer, background execution units, and frontend rendering. Missing any one link breaks the chain.
    • State convergence: the task does not end when the code is written; it must be advanced to a runnable, testable, and reproducible state.
    • Constraint satisfaction: non-functional constraints such as security, permissions, compatibility, and historical baggage are often found to be violated only during acceptance.

    Therefore, when evaluating a model’s coding ability, the observation point should not be “one-shot correctness rate,” but “effective progress per task” and “the point at which defects are exposed.” The earlier a defect is exposed, the higher the model’s engineering value. If a defect is exposed only during manual acceptance, its self-check loop is incomplete.

    2. The General Pattern of Upgrade Paths: Same Base Model, Post-Training Expansion

    One notable industry trend is that many capability jumps in this generation of models do not come from expanding the base parameter scale, but from scaled expansion in the post-training stage. The base model remains unchanged, and changes are concentrated in three observable dimensions:

    1. Larger environment scale: the number of interactive task environments used for training and reinforcement is increased by more than an order of magnitude.
    2. Diversified environment types: expansion from pure code completion to terminal operations, multi-file refactoring, and engineering tasks with external dependencies.
    3. Longer training duration: allowing the model to perform more rounds of trial and error and self-correction within a single trajectory.

    The engineering implication of this path is clear: improvements in stability for “multi-turn tool calling + long-context maintenance” are often more significant than improvements in single-turn generation quality. Evaluation should therefore weight long-trajectory tasks more heavily.

    Capability differentiation also unfolds along three lines: coding (long-horizon and production-grade software engineering), security (extending from generated code to white-box review and vulnerability reasoning; basic security tasks are close to the frontier closed-source level, but full exploit chains still lag), and agent behavior (tool selection, plan revision, and failure recovery). The three do not advance in sync, and security capability is usually the lagging link.

    3. Test Design: Two Differentiated Tasks

    A single task cannot cover the capability spectrum, so I deliberately chose two tasks in orthogonal directions.

    Task A: Incremental modification of an old project. In a project with a substantial amount of historical code, add “secure import of user image assets + reference in HTML motion scenes.” This tests three things at once: understanding the implicit conventions of the old system, designing an implementation under security constraints, and completing an end-to-end cross-module chain.

    Task B: Build a complete product from scratch. Provide only a public learning resource and a requirements document, and require the implementation of a knowledge-learning app that can actually be completed. This tests material parsing, gameplay design, state-machine completeness, and the hard acceptance condition of being “completable.”

    As a control baseline, there was a previous development experience of similar intensity: adding a complete video generation pipeline to the motion generation subsystem, involving contract definition, database, task state, API, background execution unit, web client, and renderer. The first-round implementation took about 1 hour 11 minutes, and subsequent browser validation and fixes took about another 1 hour 04 minutes. The new model’s performance must be compared against this baseline, not against an “ideal model.”

    4. Task A’s Key Defect: Permission Isolation Was Exposed Late

    Task A’s chain itself had high completion: contracts, persistence, state transitions, APIs, upload handling, and frontend references were all connected, and it ran end to end. The problem appeared during acceptance: asset access control had a possible unauthorized read, which was P1-level.

    The root cause is typical: the model understood “path security” as “prevent directory traversal,” implemented normalization and root-directory prefix validation, but did not place “resource ownership validation” before returning content. These are problems at different layers: the former prevents filesystem escape, while the latter prevents horizontal privilege escalation.

    1. // Negative example: IO first, ownership check later—there is an unauthorized read window
    2. public byte[] readAsset(String userId, String assetId) {
    3. Path p = Paths.get(rootDir, assetId + ".png").normalize();
    4. if (!p.startsWith(rootDir)) throw new ForbiddenException();
    5. return Files.readAllBytes(p); // Actual read has already occurred
    6. // Ownership check is missing or misplaced
    7. }
    8. // Positive example: authorization first; path normalization and ownership check before IO
    9. public byte[] readAsset(String userId, String assetId) {
    10. AssetMeta meta = assetRepo.findById(assetId)
    11. .orElseThrow(NotFoundException::new);
    12. if (!meta.ownerId().equals(userId)) {
    13. throw new ForbiddenException(); // Horizontal privilege escalation stops here
    14. }
    15. Path p = resolveUnderRoot(meta.storageKey()); // Normalization + root constraint
    16. return Files.readAllBytes(p);
    17. }

    The timing of this defect’s exposure shows that the model’s security reasoning leans toward “single-point vulnerability pattern matching,” and lacks the habit of “mapping every non-functional constraint to a verifiable assertion.” All tests green only proves that it implemented the constraints it understood.

    5. Task B’s Lesson: Long-Horizon Completion Depends on Whether Acceptance Conditions Are Decidable

    Task B passed on the first attempt. The key reason is that “can be fully completed” is a decidable hard condition: the model can run it itself, reach the ending, find blockers, and fix them, forming a closed loop. In Task A, “security” is a soft condition that is difficult to self-prove, so the loop is naturally missing.

    This gives a general rule: the more decidable the acceptance conditions given to the model, the higher its long-horizon completion. In engineering practice, soft constraints should be proactively translated into hard assertions. For example, permission requirements can be written as a set of test cases where unauthorized access must return 403:

    1. Acceptance assertion example (pseudocode)
    2. for each asset in fixtures where asset.owner != currentUser:
    3. assert GET /assets/{asset.id} == 403
    4. assert response.body does not contain any file content snippet

    6. Evaluation Conclusions and Practical Recommendations

    Combining the two projects, the following judgment matrix can be given:

    Dimension Performance Usage Recommendation
    Cross-module long-horizon advancement Strong Safe to let the model lead
    Context understanding Relatively strong Human confirmation of constraint sources required
    Runnable/testable convergence Strong Pair with automated validation
    Permissions and security Insufficient Mandatory human review + dedicated test cases
    Final acceptance Insufficient Humans cannot let go

    For implementation, three principles are recommended. First, split tasks based on verifiability, breaking a large requirement into segments where each subgoal has a clear pass condition. Second, move security and non-functional constraints forward as acceptance cases and include them in continuous integration gates, rather than leaving them for manual review. Third, clarify the human-machine division of labor: the model handles long-horizon implementation and self-repair, while humans handle threat modeling, permission model confirmation, and final sign-off.

    Overall, these models are already worth stress-testing with real projects, especially in long-horizon coding scenarios; but when it comes to permissions, security, and final acceptance, humans cannot let go. The focus of evaluation should also shift from “score level” to “where defects are exposed in the process.”