How to Evaluate Long-Horizon Tasks and Safe Delivery in Intelligent Coding

    Evaluating intelligent coding is not the same as checking whether code runs. This article separates runnable results, requirement-complete features, and deliverable systems, then outlines how to assess long-horizon consistency, security in legacy-project work, learning-game completeness, and a credible acceptance process with human gates.

    Distinguish “it runs” from “it ships”

    Intelligent coding is no longer only about completing functions or generating pages. For real software engineering, the harder questions are whether a system can understand an existing codebase, stay consistent across modules, handle failures during execution, and produce work that can be reproduced, verified, and maintained.

    Three levels must not be mixed:

    • Code executes: the project starts, and a given path does not throw.
    • Features meet requirements: business rules, exception branches, and state changes match the spec.
    • The system is deliverable: permissions, security, data consistency, observability, and rollback meet the bar.

    These levels do not substitute for one another. A feature that passes existing automated tests can still have untested authorization bypasses, resource leaks, or race conditions.

    Two reference tasks illustrate the gap: extending a legacy project and building a learning game from scratch both produced runnable results, but human acceptance of the former still found a serious permission-isolation defect. That does not prove the overall security of any model class. It does show that delivery quality is bounded by the acceptance system: all-green tests only prove the checks that ran, not that every risk is gone.

    This article does not score a specific model. It abstracts both tasks into a general software-engineering evaluation method.

    What long-horizon capability actually means

    A long-horizon task is not merely “long runtime” or “lots of generated code.” It is whether the system keeps goals and constraints aligned across many steps, complex dependencies, and multiple rounds of feedback.

    1. Understanding complex context

    Rules in a legacy project are often scattered across data structures, APIs, schedulers, UI logic, and tests. The system must tell current conventions from leftover patterns.

    For example, a user id on an asset record may mean the uploader or the owning principal. Reusing it without clarifying semantics can break authorization.

    High-quality context analysis should produce artifacts: module dependencies, main data flows, permission boundaries, and open questions—not a vague “the project is understood.”

    2. Cross-module consistency

    New capability usually touches API contracts, storage, background jobs, and the UI. A miss in any layer can leave the system locally correct and globally broken.

    Examples: the backend adds a failure state, but the frontend still treats every non-success as “in progress,” so users wait forever; storage adds an ownership field, but read paths never use it, so the security boundary still does not exist.

    Evaluate whether field definitions are unified, state transitions complete, errors explainable, and old behavior unaffected.

    3. Correcting from feedback

    Real development is rarely one-shot. Environment setup, historical dependencies, thin tests, and browser differences surface new issues.

    Watch whether the system uses error evidence to narrow the problem, re-verifies after a fix, and checks other paths. Repeated code edits without updating the diagnosis is not real progress.

    Scenario 1: Safely importing image assets into a legacy project

    Image import looks like upload. It actually crosses ownership, file safety, storage lifecycle, page references, and job execution identity.

    1. Threat model before API design

    Answer at least:

    • Which user or tenant owns the asset?
    • Who can read, reference, or delete it?
    • Under what identity do render jobs fetch it?
    • Is cross-project sharing allowed?
    • What happens to existing scenes after delete?
    • If remote URL import is supported, which targets may the server fetch?

    Remote import enlarges the attack surface. The server must resist internal services, restricted addresses, and unsafe redirects, and constrain connect time, download size, and response type. If the product does not need this, prefer local upload.

    2. File safety is not an extension check

    Upload should check size, actual content type, and decode results, and cap pixel dimensions so malformed files cannot burn memory or CPU.

    Formats that may carry active content should be disabled or isolated and converted. Filenames are display data; they must not define storage paths or act as authentication.

    Unpredictable storage ids reduce enumeration risk; they do not replace server-side authorization.

    3. Isolation across the asset lifecycle

    A common miss: authorize on upload, then later read and render by asset id alone.

    A sound path is: request principal → target project → ownership or sharing → current operation.

    Jobs must follow the same path. Access to storage is not access to every user’s assets. The job context should carry authorization and re-check business permission when loading assets.

    Conceptual order (names are not the point):

    1. function attach_asset(actor, project_id, asset_id):
    2. project = load_project(project_id)
    3. require_project_edit_permission(actor, project)
    4. asset = load_asset(asset_id)
    5. require_asset_reference_permission(actor, project, asset)
    6. require_asset_available(asset)
    7. save_project_asset_relation(project, asset)

    “May edit the project” and “may reference the asset” are separate rules.

    4. Independent protection for pages and rendering

    Do not splice unprocessed text into page structure. User uploads must not be treated as executable page content.

    If rendering runs page scripts, isolate the environment: restrict network, files, and resource use, and do not inject production credentials. Short-lived authorized URLs need clear TTL, scope, and revocation.

    5. Negative security tests

    Functional tests show a legitimate user can succeed. Security tests show an illegitimate user cannot.

    Cover at least: user A cannot read B’s private assets; a user without project access cannot bypass via the attach API; jobs cannot reference assets outside the target project’s grant; revoked, deleted, or expired assets cannot be used with old rights; retries and concurrency do not create wrong associations.

    Run these on the real authorization path, not a standalone helper.

    Scenario 2: Building a completable learning game from source material

    Greenfield work shows a full artifact, but it is easy to ship a rich UI with a broken learning loop. Score knowledge quality, interaction, and engineering completeness together.

    1. Turn material into verifiable learning goals

    Source text is not game content. Split topics and state what each level should teach.

    One level might ask for a sound response after a tool call fails; another might distinguish planning from execution. Each goal needs items, scoring rules, and feedback. Mark inferences that go beyond the source so they are not presented as facts.

    2. Define “cleared” with a state machine

    Track states such as not started, in progress, awaiting feedback, and complete. Define retry, resume after exit, skip, and duplicate submit.

    A completion banner on the last page is not a full clear. Clear conditions should combine level completion state and required learning checks, not a page jump alone.

    3. Accept UX and knowledge separately

    Product acceptance: flow, understandable errors, reliable progress.

    Knowledge acceptance: accurate answers, unambiguous items, explanations, and handling of multiple valid answers.

    If feedback is generative, treat uncertainty explicitly. Gate critical clear conditions on reviewable rules; open-ended feedback can help learning but should not be the only correctness judge.

    4. Close the loop under failure

    Besides a happy path, check refresh, network loss, duplicate submit, empty input, and resume.

    If progress is stored, the server must validate legal transitions—not trust a client “completed” flag. Minimize personal data and define retention and deletion.

    A credible evaluation process

    1. Freeze acceptance criteria first

    Before implementation, fix scope, done conditions, security constraints, environment, and forbidden change areas. Otherwise the system can “succeed” by shrinking the problem.

    Record the starting code version, allowed helpers, and human intervention so runs are comparable.

    2. Keep evidence during the run

    Require a change plan, key design decisions, execution logs, test results, and open issues. Distinguish suggested tests, tests actually run, tests that passed, and tests skipped due to environment.

    “Verified” without execution evidence does not count.

    3. Independent acceptance, no self-proof

    If the same agent writes implementation and tests, they may share the same misunderstanding.

    Prefer human-provided critical cases and independent review after implementation. High-risk paths—authz, payments, personal data, external resource access—need explicit human approval.

    4. Score cost and quality, not only speed

    Useful signals: requirement coverage, defect severity, regressions, human interventions, and time to fix.

    Interpret them with task difficulty. Few interventions may mean issues were not found; a faster first pass may not lower total delivery cost.

    Human–machine split and delivery gates

    Intelligent coding fits retrieval, module mapping, first-pass implementation, extra tests, fault localization, and docs. As long-horizon ability grows, it can take larger cross-module edits.

    Security policy, critical business rules, and residual risk acceptance still need a named owner. Authorization models must be constraints from the team, not invented while generating code.

    Four gates before ship:

    1. Requirements: features and exception paths match the spec.
    2. Engineering: build, tests, and needed regression pass.
    3. Security: high-risk APIs and permission boundaries get independent review.
    4. Operations: logging, monitoring, migration, and rollback are usable.

    The most useful evaluation question is not how much code it writes, but how much constraint it can work under while leaving enough verification evidence.

    When generation, verification, and accountability sit in the process, intelligent coding can move from a fast implementation tool to a controllable software-engineering collaborator.