Evaluating Coding LLMs on Long-Horizon Tasks: Passing Tests Doesn't Mean Production-Ready

    Long-horizon evaluation reveals the real limits of coding LLMs. This article shares hands-on findings from two contrasting tasks—a security-sensitive refactor on a legacy codebase and a from-scratch application build—showing why benchmark scores are insufficient for tool selection, which three capabilities matter most in long-horizon coding, how "all tests green" can still hide a P1 security flaw, and how to divide work between humans and models with a practical acceptance checklist.

    1. The Takeaway Up Front: Capability Ceilings Are Rising, but Delivery Boundaries Still Belong to Humans

    Coding LLMs have iterated rapidly over the past year. But what actually determines whether they can enter production workflows has never been a single benchmark ranking—it’s their stability across long-running tasks and whether they truly understand the boundaries of engineering constraints. Based on observable performance, the latest generation of coding models can already take on the workload of “pushing requirements to a runnable, testable state,” with clear progress over the previous generation, especially in sustained cross-module and cross-file changes. However, they are far from reliable enough for “all tests green means auto-deploy”—permissions, security, and final acceptance must remain under human control.

    This judgment comes from two very different hands-on tasks: one was a security-sensitive incremental change in a legacy codebase with substantial historical baggage; the other was building a complete, fully completable learning application from scratch, given only public learning materials and a requirements document. The former tests how deeply a model understands legacy conventions and security constraints; the latter tests its end-to-end completeness from material analysis to a working product. Both tasks were ultimately completed, and both exposed problems of varying severity during human acceptance review—including a P1-level permission isolation flaw where all functional tests passed but the security boundary was breached.

    2. Why Benchmark Scores Aren’t Enough for Tool Selection

    Public benchmarks mostly evaluate “single-point tasks”: given a function, an error message, or a small repository, can the model produce a correct patch within a limited number of steps? Such evaluations have value, but they diverge from real-world engineering in three ways:

    1. Context length and noise. In real projects, constraints are scattered across commit history, configuration files, type definitions, comments, and existing tests. The model must actively retrieve and distinguish “currently valid conventions” from “legacy patterns,” rather than simply imitating neighboring code.
    2. Order-of-magnitude differences in task duration. Single-point tasks typically converge in a few to a few dozen steps; long-horizon tasks easily involve hundreds of tool calls, with repeated reading, editing, running, and re-checking of results. Any early misjudgment gets amplified by subsequent steps.
    3. Complexity of success criteria. Benchmark criteria are “tests pass”; production criteria are “correct functionality + constraints not violated + rollback possible + operable.” The last three almost never appear in benchmarks.

    So the more sensible way to evaluate whether a coding model is usable is to construct tasks with legacy code, security constraints, and acceptance criteria, and observe its behavior during long-horizon execution—not just whether it can produce code that runs.

    3. How to Design Evaluation Tasks: Two Complementary Long-Horizon Tasks

    3.1 Task A: Security-Sensitive Incremental Change on a Legacy System

    The task can be abstracted as: in a project with substantial accumulated code, add the ability to “securely import user multimedia assets and reference them in frontend animation scenarios.” This chain naturally spans multiple layers—data models and storage conventions, APIs and parameter validation, task state transitions, resource-loading strategy on the rendering side, and audit and quota controls.

    The evaluation focus isn’t “can it be implemented,” but “whether existing constraints are respected during implementation”:

    • Does it read and reuse the project’s existing auth middleware instead of building a new one?
    • Does it understand the storage layer’s directory isolation conventions and normalize paths when concatenating them?
    • Does it distinguish “parameters the client may pass in” from “identity information that can only be derived from the server-side session”?
    • Does it add negative test cases and audit logging alongside new APIs?

    3.2 Task B: End-to-End Build from Materials to a Completable Application

    The other task provides only a set of public technical learning materials and a requirements document, and asks the model to build, from zero, an application that lets users complete the full learning path. There’s no legacy baggage, but it tests completeness: material extraction and structuring, modeling dependencies between knowledge points, interaction flow design, state persistence, and handling of exceptional branches.

    This task’s value lies in observing whether the model “gives up halfway”: many models can build the landing page and main flow, but leave holes in edge paths like “resume from where you left off,” “review wrong answers,” and “progress consistency.” A real product’s usability is precisely determined by these edge paths.

    Together, the two tasks form a reasonably complete evaluation surface: one tests “incremental work under constraints,” the other tests “closing the loop from a blank slate.”

    4. Three Layers of Capability to Observe in Long-Horizon Coding

    4.1 Reading Complex Context and Extracting Constraints

    The first watershed in long tasks is “reading comprehension.” The model must locate relevant files in a large repository and identify which patterns are currently valid and which are deprecated legacy code. Better-performing models start with a structural pass: listing directories, searching keywords, reading interface definitions and tests, and then forming a change plan. Weaker models tend to copy nearby code and propagate legacy patterns as if they were standards.

    An observable signal: does the model proactively point out that “there are two inconsistent patterns here; I’ll follow A because B was replaced in a recent commit”? Raising this kind of judgment shows it’s genuinely reading context, not just pattern matching.

    4.2 Sustaining Progress Across Cross-Module Changes

    The second watershed is “keeping momentum.” Cross-module changes mean a single edit touches type definitions, serialization formats, API contracts, frontend rendering, and test cases. The core of long-horizon capability isn’t the quality of a single generation, but not losing the main thread across multiple iterations: after changing A, remembering to update B’s callers; when tests fail after a contract change, tracing the failure to the contract change rather than blindly editing tests to make them green.

    In hands-on testing, the new generation of models showed the clearest progress here—they can sustain long task continuity in a monorepo with multiple packages, carrying a full frontend-to-backend chain to completion without a human repeatedly “correcting course.”

    4.3 Getting the Task to a Runnable, Testable State

    The third watershed is “closing out.” Running successfully and passing tests is the minimum delivery bar for long-horizon tasks. This requires self-verification: after changes, proactively run the build, execute tests, read failure output, and fix issues. Models lacking this step often produce code that “looks correct” and then stall halfway, waiting for someone to take over.

    5. The Most Overlooked Failure Mode: All Tests Green While Constraints Are Breached

    This is the most cautionary finding from hands-on testing. In Task A, all functional paths passed, yet human acceptance review uncovered a P1 issue: the asset storage path was built by directly concatenating a client-supplied identifier, with only format validation on the server and no ownership check. As a result, a user could craft parameters to read resources under another user’s namespace. Functional tests never covered this branch, because it’s a negative security case.

    A simplified illustration:

    1. # Anti-pattern: the path looks user-isolated, but the user ID comes from
    2. # the request body and can be forged
    3. def save_asset(user_id, filename, data):
    4. key = f"assets/{user_id}/{filename}"
    5. storage.put(key, data)
    6. return key
    7. # Correct pattern: identity is derived from the server-side session, the
    8. # path is normalized, and ownership and quota are validated before writing
    9. def save_asset(session, filename, data):
    10. user_id = session.user_id # only trust the server-side session
    11. safe_name = normalize(filename) # strip path traversal segments like ../
    12. key = f"assets/{user_id}/{safe_name}"
    13. assert session.tenant_id == owner_of(key) # ownership check
    14. assert quota_ok(session.tenant_id, len(data)) # quota check
    15. storage.put(key, data, acl="private") # private by default
    16. audit_log(session, "asset.write", key) # audit trail
    17. return key

    The cause of this class of defect isn’t mysterious: models tend to satisfy “explicit requirements” (upload works, references work, playback works) while lacking proactive probing of “implicit constraints” (who can read, how much, and what’s recorded). Without a prompt, it won’t automatically treat the “permission matrix” as part of the task.

    The conclusion is clear: a model can make functionality runnable, but it cannot define security boundaries on behalf of humans. Anything involving identity, permissions, data ownership, auditing, and quotas must be handled by humans who first write the constraints into an explicit checklist, have the model implement against the checklist, and then verify each item with negative testing.

    6. Where the Capability Leap Comes From: Scaling the Post-Training Stage

    Notably, this generation of coding models’ improvements don’t necessarily come from swapping the base model. A common industry path is: keep the base model unchanged and invest incremental effort in post-training—expanding the number and variety of long-horizon task environments, extending training duration, and letting the model learn “how to push tasks forward” through multi-turn interactions that closely resemble real engineering.

    This approach offers a direct lesson for engineering teams: rather than repeatedly optimizing the quality of single-turn code generation, focus on constructing high-quality task environments. A valuable task environment typically includes:

    • A runnable project skeleton with real commit history;
    • Clear acceptance criteria and negative test cases;
    • Observable execution feedback (build logs, test reports, runtime errors);
    • Rollback-capable version control.

    Training or evaluating in such an environment teaches the model “how to advance tasks,” not just “how to write code.”

    7. Extending from Code Generation to Security Review

    Another trend worth watching: coding models’ capability boundary is extending from “generation” to “review”—white-box code review, vulnerability pattern recognition, and reasoning about dangerous calls. On basic security tasks, these capabilities can already provide valuable assistance—for example, flagging unvalidated external input, missing auth branches, and insecure deserialization paths.

    But on full exploit-chain reasoning, they still lag humans significantly. Exploit reasoning requires joint inference over the system’s global state, deployment topology, and business semantics—information that often doesn’t live in the code. The pragmatic positioning is therefore: use the model as an aid for the first pass of static review, and keep manual penetration testing and security review as the final gate.

    8. Engineering Practice: Human-Machine Division of Labor and an Acceptance Checklist

    Drawing on hands-on experience with both tasks, here’s an actionable set of division-of-labor principles and an acceptance checklist.

    Humans are responsible for:

    • Defining security boundaries: identity sources, permission matrices, data ownership rules, audit requirements;
    • Defining acceptance criteria: covering not only positive functionality but also negative cases and exceptional branches;
    • Defining untouchable red lines: which files must not be modified, which dependencies must not be introduced, which APIs must not change semantics.

    Models are responsible for:

    • Completing cross-module changes within the established constraints;
    • Proactively running builds and tests and driving the task to a runnable state;
    • Producing change notes and a risk list for human review.

    Acceptance checklist (check each item):

    1. Do all functional paths pass, with coverage of major exception branches?
    2. Is the permission matrix verified item by item, including negative cases for privilege escalation and path traversal?
    3. Does identity information come only from trusted server-side sources, with all client parameters treated as untrusted?
    4. Are audit logs complete, including critical write operations?
    5. Are quotas and rate limiting enforced, with over-limit behavior predictable?
    6. Is there a rollback plan and a degradation path?
    7. Do new dependencies comply with license and security baseline requirements?
    8. Is the change covered by existing monitoring and alerting?

    In evaluation and continuous integration, general cloud infrastructure can improve efficiency: use container platforms for isolated execution sandboxes, object storage to archive build artifacts and test reports, log services to aggregate feedback across execution rounds, and monitoring and alerting to track failure rates and latency distributions of long tasks. These are all generic capabilities, not tied to any specific implementation.

    9. Closing Thoughts

    The conclusions boil down to three sentences:

    First, the new generation of coding models is worth testing on real projects—especially long-horizon, cross-module tasks requiring sustained progress. Their performance is already enough to change how teams collaborate.

    Second, evaluation focus should shift from “can it write the code” to “can it finish the work within constraints and verify itself.” The quality of constructed task environments says more than benchmark rankings.

    Third, when it comes to permissions, security, and final acceptance, humans cannot let go. A model can bring code to a runnable, testable state—but the word “deliverable” still requires a human signature.