Evaluating Long-Horizon Coding Ability in LLMs: How Far from "It Runs" to "It Ships"

    LLM coding benchmarks tell only part of the story. This article evaluates large language models on real-world, long-horizon programming tasks—modifying a legacy codebase with security constraints and building a learning game from scratch—and finds that while models can now sustain multi-file, cross-module work reliably, they still miss P1-level security issues like permission isolation that automated tests don't catch. It concludes with a reusable evaluation framework for teams adopting AI coding tools.

    Why We Need to Rethink How We Evaluate “Coding Ability”

    In recent years, code generation capabilities of large language models have improved dramatically, yet a persistent gap remains between benchmark scores and real-world engineering usability. Many models excel at single-file, single-function completion tasks, but once they enter a real project—with legacy baggage, security constraints, cross-module dependencies, and long-horizon task context—their weaknesses surface.

    So, judging whether a model can actually “do the job” requires rebuilding the evaluation system around three dimensions:

    1. Long-horizon task persistence: Can the model stay on target across dozens of interaction rounds and multi-file, multi-module changes without drifting or forgetting early constraints?
    2. Complex context comprehension: Can it read an existing system with legacy code, implicit conventions, and security boundaries—rather than making assumptions based on surface patterns?
    3. Delivery completeness: Can it push a task to a runnable, testable state, and diagnose and fix problems on its own when they arise?

    Together, these three points form the dividing line between “demo” and “delivery.”

    Two Complementary Real-World Task Designs

    To thoroughly test these capabilities, I designed two very different hands-on tasks, covering two typical engineering scenarios: modifying an old system and building a new one.

    Task 1: Adding Security-Sensitive Features to a Legacy Project

    In a project with a substantial amount of legacy code, add support for “user image asset import” and “HTML animation scene referencing.” The key challenge lies not in the features themselves, but in:

    • Legacy code comprehension: The project already has established layering, error handling, and data flow conventions. New capabilities must integrate into the existing system rather than reinvent it.
    • Security constraint propagation: Image import involves file type validation, size limits, and storage path control; HTML referencing involves resource loading boundaries. Any oversight in these areas can escalate into a permission isolation problem.

    Tasks like this are the best litmus test for a model’s “engineering judgment”: getting the feature working is relatively easy, but whether the security boundaries are airtight everywhere only becomes apparent through deep review.

    Task 2: Building a Completable Learning Game from Scratch

    The second task provides only a set of learning materials and a product requirements document (PRD), asking the model to build a knowledge-learning game that can be fully completed from start to finish. This task tests:

    • Requirements-to-architecture translation: Extracting core gameplay, knowledge structure, and interaction flows from the PRD, and designing a sensible module breakdown.
    • Self-driven iteration: With no existing code to reference, the model must autonomously implement a complete loop—state management, level logic, rule validation, and completion flow.
    • Quality self-review: Can it proactively run the implementation, find defects, and fix them—rather than handing a half-finished product to the user?

    Findings: The Ceiling Has Clearly Risen, but “Green Tests” ≠ “Safe to Ship”

    Combining the observed performance on both tasks leads to a fairly objective conclusion:

    The long-horizon coding ceiling of LLMs has genuinely been raised. In terms of complex context comprehension and sustained cross-module progress, current-generation models can now work stably in real projects and push tasks to a runnable, testable state. That deserves recognition.

    But there is still a clear gap before “all tests green means safe to ship.” In the first task, although the features ran smoothly, manual acceptance review uncovered a P1-level permission isolation issue. The danger of this class of defects lies in the following:

    • Automated tests typically cover only functional paths, while security properties such as permissions, unauthorized access, and resource isolation are inherently hard to exhaust with conventional test cases.
    • Models tend to reuse “common patterns” when generating code. When the legacy system has a special security model, the model may unknowingly bypass isolation boundaries.
    • Such defects work perfectly fine at runtime—they only surface during threat modeling and permission matrix review.

    Therefore, a pragmatic conclusion is: current models are already worth deploying for long-horizon coding collaboration in real projects, especially for cross-module feature development and iteration; but for anything involving permissions, security, data isolation, and final delivery acceptance, humans must remain the final gatekeepers.

    How to Design Your Own Evaluation Tasks

    Based on this hands-on evaluation, I’ve summarized a reusable methodology for teams selecting and rolling out AI coding tools.

    1. Use “dual-extreme” tasks to cover the capability spectrum

    • Legacy system modification: tests context comprehension, constraint adherence, and security awareness.
    • Zero-to-product build: tests architecture design, autonomous planning, and completeness.

    Testing only one type makes it easy to overestimate or underestimate model capability.

    2. Embed non-functional constraints into the tasks

    For example:

    1. Example constraints:
    2. 1. All uploaded files must pass whitelist validation; never trust file extensions directly.
    3. 2. Asset access must go through the permission service; bypassing the unified auth layer is forbidden.
    4. 3. New capabilities must reuse the existing error code system; do not introduce a separate one.

    Constraints like these effectively test whether the model truly “understands the system,” rather than mechanically completing the task description.

    3. Focus the manual acceptance checklist on security and isolation

    At minimum, include:

    • Permission boundaries: unauthorized access scenarios, both horizontal and vertical privilege escalation.
    • Data isolation: whether multi-tenant or multi-user data could cross-contaminate.
    • Resource security: type, size, and path validation along the upload/import pipeline.
    • Compatibility: whether the new capability breaks existing behavior.

    Conclusion

    Evaluating the long-horizon coding ability of large language models is not about “can it write code,” but “can it keep pushing a task forward—consistently and securely—under the complexity and constraints of real engineering.” Hands-on testing shows that current models have significantly raised their long-horizon coding ceiling, enough to handle the bulk of cross-module development in real projects; but security, permissions, and final acceptance still require deep human involvement. The right way to adopt these tools is to treat the model as a highly capable engineering collaborator who still needs code review—empower it fully on long-horizon tasks, while using rigorous manual acceptance to hold the security line.