Model Gaps and AI Coding: From Wishing to Verifiable Agents

    Explore the evolution of AI coding from "wishing" and "commanding" styles to Agentic Coding. This article breaks down the five essential engineering capabilities required to implement verifiable AI agents, including task decomposition, context management, tool invocation, test design, and rollback isolation, helping developers transition to higher levels of human-AI collaboration.

    1. Model Gaps Depend on Usage

    A single model can perform drastically differently depending on how it is used. Therefore, before asking “which model is stronger,” we must clarify “how it is being used.” Currently, AI coding generally falls into two common approaches.

    1.1 The Wishing Style: Providing Vague Goals for the Model to Complete Independently

    The wishing style involves describing a general goal, such as “build a user management backend,” and letting the model decide the architecture, file structure, dependencies, and implementation details. The output quality fluctuates significantly. The model has to make numerous unspoken decisions for the developer, often leading to results that deviate from expectations, are hard to reproduce, and are difficult to evaluate.

    1.2 The Command Style: Breaking Down Tasks into Specific Actions for the Model to Fill In

    The command style breaks a problem down into a series of explicit instructions, such as “add a function to a specific file with these two parameters, returning a list, and handling null inputs.” Under this approach, most models can complete the task stably, and sometimes even smaller models yield usable results.

    The command style is stable because humans have already decomposed the problem and made key judgments; the model only needs to execute the final implementation. The gap between models is compressed here, leading developers to conclude that “there isn’t much difference between models.” The reality is that the task is sliced fine enough that the model doesn’t need to understand the overall problem.

    2. The Third State: Completing Verifiable Work Within Boundaries

    Between the wishing and command styles lies a more valuable collaboration method, known as Agentic Coding. Its core characteristics are:

    • Clear Boundaries: The agent knows which files it can modify, which tools it can invoke, and which operations are forbidden.
    • Verifiable Goals: Task completion is judged by tests, check scripts, or clear acceptance criteria, rather than by the developer reading line-by-line based on intuition.
    • Controllable Process: Each round of changes can be recorded, isolated, and rolled back.

    In this mode, the human role shifts from “an operator issuing instructions line-by-line” to “an engineer designing the work environment and acceptance criteria.” Developers still make key decisions but no longer need to complete every implementation step for the model. The capability differences between models re-emerge in this scenario because the task requires the model to understand context, plan steps, and handle failure feedback.

    3. A Tiered Perspective on Human-AI Collaboration

    Some researchers have proposed a framework dividing the human-AI collaboration relationship into six levels, referencing autonomous driving classifications. The value of this framework lies in helping developers locate their working state, rather than providing precise capability standards.

    From practical experience, most developers currently remain at lower levels: using AI to generate code snippets, frequently modifying prompts, and needing to review changes line-by-line. Even if prompts are used frequently every day, if the workflow remains “generate, copy, paste, check diff,” the collaboration mode is still at a lower tier.

    The real watershed occurs when developers start treating AI as an executor capable of independently completing a segment of work, and build constraints and acceptance mechanisms around it. Crossing this line shifts the focus from “how to write a good prompt” to “how to make an agent stably complete a verifiable task.”

    4. Five Capabilities Required for Agentic Coding

    Agentic coding does not rely on a specific tool but on a set of general engineering capabilities. Here is the breakdown:

    4.1 Task Decomposition: Defining Verifiable Minimal Units

    The goal of task decomposition is to translate requirements into units that can be verified upon completion. A qualified task unit usually includes:

    • Clear inputs and outputs, such as request formats and response structures of an interface;
    • Modifiable scope, such as only allowing changes to a specific module;
    • Completion criteria, such as specific tests all passing.

    If decomposed too coarsely, the agent easily deviates from the goal; if too fine, it reverts to the command style, increasing the developer’s burden. The appropriate granularity is usually “a single change can be completely reviewed and covered by automated checks.”

    4.2 Context Management: Providing Only Task-Relevant Information

    More context is not always better. Feeding the entire codebase to the model introduces irrelevant content, increasing costs and interfering with its judgment. A better practice is to filter context by task, including:

    • Interface definitions and invocation methods of related modules;
    • Project coding standards and conventions, such as naming rules and error handling;
    • Test output from the previous failed round, used to guide corrections.

    Context should be organized structurally. For instance, separating “task description, allowed files to modify, forbidden actions, acceptance criteria” into distinct sections is easier for the model to follow than mixing all information into a single paragraph of natural language.

    4.3 Tool Invocation: Limiting Capabilities and Permissions

    Agents can invoke tools like compilers, test frameworks, code retrievers, and documentation queries, but each tool should have a clearly defined permission scope. Common principles include:

    • Only open tools essential for completing the task, following the principle of least privilege;
    • Set up approvals or whitelists for write and delete operations;
    • Treat tool output as data to be processed, not directly executed as instructions. This last point is crucial because logs, web content, or file comments returned by tools may contain misleading text.

    4.4 Test Design: Turning “Looks Right” into “Confirmed Right”

    The reliability of agentic coding largely depends on the acceptance mechanism. Tests should cover the following categories:

    • Functional tests: Verify if the input/output of new logic meets expectations;
    • Regression tests: Confirm existing functionality is not broken;
    • Boundary tests: Cover exceptions like null values, oversized inputs, and concurrency;
    • Static checks: Include type checking, formatting, and security scanning.

    Test cases are best written or determined before the task starts. This ensures the agent’s goal is to pass established acceptance, rather than modifying tests to accommodate its own implementation.

    4.5 Rollback and Change Isolation: Controlling the Cost of Failure

    Agents inevitably make mistakes, so every change should be reversible. Common practices include:

    • Recording a code snapshot before starting the task;
    • Executing changes in an independent branch or isolated workspace;
    • Setting a maximum number of attempts; exceeding this stops the process and escalates to manual handling;
    • Requiring backups and manual confirmation prior to execution for hard-to-reverse operations like database migrations or configuration changes.

    5. Illustration: A Verifiable Agent Work Loop

    The pseudo-code below illustrates a typical work loop. It emphasizes boundary checks, acceptance-driven progression, and failure rollback. The specific implementation can be adjusted according to the team’s tech stack.

    1. function run_task(task):
    2. boundary = load_boundary(task) # Modifiable files, available tools, forbidden operations
    3. snapshot = create_snapshot() # Record current state for rollback
    4. for attempt in 1 .. MAX_ATTEMPTS:
    5. context = build_context(task, boundary) # Only include task-relevant content
    6. patch = agent.propose_change(context)
    7. if not within_boundary(patch, boundary):
    8. reject(patch) # Reject out-of-bounds changes directly
    9. continue
    10. apply(patch)
    11. result = run_checks(task.acceptance_tests)
    12. if result.passed:
    13. return report_success(task, patch)
    14. feedback = summarize_failures(result)
    15. context.add(feedback) # Feed failure info as input for the next round
    16. rollback(snapshot)
    17. return escalate_to_human(task) # Escalate to manual handling after multiple failures

    This loop has three key points. First, boundary checks are completed before applying changes; out-of-bounds modifications never enter the codebase. Second, acceptance results determine task completion; the agent’s self-evaluation is not used as a basis. Third, failure information is structurally fed back to the next round, rather than simply asking the model to “try again.”

    6. How to Determine Your Current Stage

    You can do a self-check using the following questions:

    1. Do you need to describe implementation details from scratch every time you ask AI to write code?
    2. Do you rely on visual inspection of changes rather than automated tests?
    3. Can you quickly undo a change if an error occurs?
    4. Do your task descriptions include explicit acceptance criteria?
    5. Can you let AI independently complete a small task spanning multiple files?

    If the answers to the first two questions are “yes,” you are still mainly in the command-style collaboration. If the answers to the last three are mostly “no,” it means your acceptance and rollback mechanisms need supplementing. Developers should prioritize bridging these gaps rather than rushing to collect more prompts or try new models.

    7. Priority of Learning Focus

    For developers hoping to transition from prompt users to agentic engineering practitioners, it is recommended to organize knowledge in the following order:

    • First, master task decomposition and writing acceptance criteria, which is the foundation for all subsequent work;
    • Next, learn context organization methods to understand the relationship between information volume and model performance;
    • Then, practice tool permission design to establish security boundaries;
    • Finally, improve the testing system and rollback processes so that the agent’s work can be trusted long-term.

    By advancing in this order, developers can more clearly identify their weak points and more effectively evaluate how different models perform on real tasks.