AI Coding Harness Engineering: A One-Week Plan Toward 90% Task Coverage

    A practical guide to building a controlled AI coding workflow through clear task contracts, project knowledge, reproducible environments, layered verification, and bounded feedback loops. The seven-day plan explains how to measure agent-led task coverage, manage risk, and evaluate delivery quality without treating 90% coverage as a guarantee or confusing it with full autonomy.

    1. From Generating Code to Delivering Changes

    AI coding has evolved beyond local code completion. Agents can now interpret requirements, analyze repositories, modify multiple files, and run checks. Yet developers still encounter a familiar problem: code that looks reasonable does not work reliably within an existing project.

    An agent may introduce an implementation pattern the project does not use. It may fix one issue while breaking a neighboring module. Or every test may pass even though important business edge cases remain untested.

    These failures highlight a fundamental distinction: code generation capability is not the same as engineering delivery capability.

    Reliable delivery requires answers to at least five questions:

    1. What problem must be solved, and what is outside the scope?
    2. Which constraints in the existing system must remain intact?
    3. Which resources may the agent read, modify, and execute?
    4. How will the team prove that the change meets requirements rather than merely looks correct?
    5. If something goes wrong, how can execution be stopped, the cause identified, and the previous state restored?

    When these answers exist only in developers’ heads, agents have to guess. More guessing means more manual correction, which can erase the benefits of automation.

    Harness engineering means building engineering constraints, execution environments, and feedback mechanisms around an agent. It is not a single tool or simply a longer prompt. It turns engineering conditions that developers normally supply implicitly into a system the agent can read, execute within, and verify against.

    The goal is not to expect the model to become reliable on its own. It is to make correct behavior easier and expose incorrect behavior sooner.

    2. Define “90%”: High Coverage Is Not High Autonomy

    Before discussing a “90% AI coding rate,” define what the metric measures. The share of generated code, time spent using AI, task participation, and independent delivery are different measures.

    One practical definition is:

    Agent execution coverage = eligible tasks accepted after the agent performs the primary implementation work ÷ all eligible tasks included in the measurement.

    “Primary implementation work” needs an agreed definition. For example, the agent might develop the initial approach, modify the code, and run verification, while a developer confirms the requirements and reviews the result. If a developer must rewrite the core implementation, the task should not count as agent-led delivery.

    Eligibility must also be explicit. A reasonable task set might include:

    • Routine development tasks with clear requirements and executable acceptance criteria.
    • Bug fixes with identifiable change boundaries.
    • Feature extensions with existing reference implementations.
    • Lower-risk additions to tests, documentation maintenance, and localized refactoring.

    Major architectural changes, production incident response, and complex authorization design may require different workflows. However, teams must not exclude tasks retroactively just to improve the reported percentage. Reports should disclose the total task count, eligibility criteria, and reasons for exclusions.

    The 90% figure is therefore best treated as an engineering target for a defined task set, not a universal claim about all development work. The source material provides no auditable project logs, task samples, or acceptance records establishing that an application achieved this result within one week.

    A realistic one-week objective is to establish a measurable, reusable execution loop, then use real tasks to assess whether coverage can approach the target.

    3. Five Components of an Engineering Harness

    3.1 Task Contracts: Turn Requirements into Acceptable Inputs

    Ambiguity is often a greater obstacle than complexity.

    “Optimize the list page” could mean improving load time, changing interactions, adding filters, or fixing a display issue. Without clarification, faster implementation may simply accelerate work in the wrong direction.

    Each task should include at least:

    1. Objective: The problem to solve
    2. Context: Current behavior and its impact
    3. Change scope: Modules that may be modified
    4. Non-goals: Items explicitly excluded from this task
    5. Acceptance criteria: Observable or executable checks
    6. Risk constraints: Prohibited resources and actions
    7. Delivery requirements: Change summary, verification results, known limitations

    For example, “fix pagination” is too vague. “Reset the current page to page one when filters change, and ensure the empty-results view displays correctly” is specific enough to guide implementation and acceptance.

    Not every acceptance criterion needs to be automated, but criteria should be as objective as possible. Visual changes and complex interactions may still require manual acceptance, with the relevant states and interaction paths clearly specified.

    3.2 Project Knowledge: Provide a Map, Not a Document Dump

    Giving an agent the entire project does not necessarily provide useful context. Repeated, outdated, or irrelevant information can obscure the constraints that matter.

    Organize knowledge in layers:

    • Project level: Directory structure, module responsibilities, dependency direction, and shared development rules.
    • Module level: Key entry points, data flows, interface contracts, and relevant test locations.
    • Task level: Files directly related to the requirement, observed failures, and relevant historical decisions.

    Project-level guidance should be concise and stable. Module guidance should live near the corresponding code. Task context should change with the work.

    The most valuable knowledge often explains not where code lives, but why a constraint exists. A module may be prohibited from accessing another module’s internal storage to preserve an authorization boundary. A field name may need to remain unchanged for compatibility with historical data.

    Without explicit documentation, an agent can produce a locally attractive solution that damages the broader design.

    3.3 Execution Environment: Make Problems Reproducible and Actions Bounded

    Agents need a repeatable development environment, not one that depends on incidental state on a particular machine.

    The basics include:

    • Clear dependency setup and startup instructions.
    • Independent, resettable test data.
    • Separation between development verification and production resources.
    • Restrictions on writable directories and executable operations.
    • Prohibition on reading sensitive configuration unrelated to the task.
    • Human approval for irreversible actions.

    Repository files, error logs, and external text may contain untrusted content. An agent must not change its execution boundaries because a piece of text tells it to “ignore restrictions.” Authorization should come from explicit control rules, not from business materials the agent happens to read.

    The value of environment governance is consistent reproducibility for both humans and agents. If developers cannot reliably repeat a verification run, agents are unlikely to deliver reliable changes either.

    3.4 Verification: Require Evidence of Correctness

    Automated verification is central to the engineering loop, but “tests were run” does not mean “requirements were proven.”

    Use layered verification:

    1. Low-cost checks: Syntax, types, formatting, and static rules to catch obvious problems quickly.
    2. Module tests: Local logic and boundary conditions.
    3. Integration checks: Data transfer, error handling, and compatibility across interfaces and modules.
    4. Critical business-flow checks: Outcomes that users actually depend on.
    5. Human review: Business semantics, security risks, architectural impact, and maintainability.

    A particular risk arises when the agent modifies both implementation and tests: the tests may reproduce the same mistaken assumption as the code. Important behavior should have an independent acceptance basis. Where necessary, add a failing test before implementing the fix.

    Verification reports must also state what was not checked. A check that was not run must be marked as not run, not presented as passing.

    3.5 Feedback and Stop Conditions: Allow Repair, Not Unlimited Trial and Error

    Agents can iterate on failures, but repair loops need limits.

    Useful feedback includes:

    • The failed check.
    • Relevant inputs and expected results.
    • Actual results.
    • Error details that help locate the problem.
    • Changes already made during the current iteration.

    Avoid feeding large volumes of unrelated logs back into the context. Classify the failure first, then provide evidence relevant to the current problem.

    Define stop conditions for repeated failures, expanding change scope, suspected sensitive operations, and conflicting requirements. Stopping is not necessarily an automation failure; it can be evidence that risk controls are working.

    4. A Practical Seven-Day Implementation Plan

    The following sequence is intended for projects that already have basic tests and development workflows. It is a suggested implementation order, not a guarantee of completion time or task coverage. Projects without stable builds, test data, or module boundaries may need a longer foundation-building phase.

    Day 1: Establish a Baseline and Identify Why Humans Intervene

    Select representative recent development tasks and record where developers intervened:

    • Clarifying requirements.
    • Finding relevant code.
    • Correcting implementations.
    • Preparing the environment.
    • Adding missing verification.

    Do not merely count agent failures. Classify their causes:

    • Missing context.
    • Ambiguous acceptance criteria.
    • An environment that cannot run.
    • Model reasoning or implementation errors.
    • Permission and resource restrictions.
    • Tasks unsuitable for automation.

    This determines the improvement priorities. If unstable environments cause most failures, further prompt optimization is unlikely to help much.

    Day 2: Build a Minimal Project Map

    Document directory responsibilities, development entry points, verification steps, and key constraints. Start with modules that change frequently.

    Avoid creating a large documentation system immediately. More complex documentation costs more to maintain and is more likely to become outdated. Start with a concise navigation file, then place detailed rules near the relevant modules.

    Update the guidance when code structure changes. The project map is an engineering asset, not a one-time document.

    Day 3: Standardize Task Templates and Risk Levels

    Convert everyday requests into a consistent task contract, and use risk levels to determine the agent’s permitted actions.

    • Low risk: Allow automated changes and submission of verification results.
    • Medium risk: Require confirmation of the implementation plan before changes begin.
    • High risk: Limit the agent to analysis, recommendations, or drafts awaiting review.

    Risk is not determined by line count alone. A small authorization change may be more dangerous than a large interface update. Assess business impact, data sensitivity, external dependencies, and rollback difficulty together.

    Day 4: Make Automated Verification Reliable

    First ensure existing checks run consistently. Then add the most important missing tests.

    Prioritize failure-prone scenarios with meaningful impact, such as empty input, duplicate requests, insufficient permissions, timeouts, and compatibility with historical data. Do not spend the entire week chasing test coverage percentages while neglecting actual business risk.

    Make test execution as deterministic as possible. Time, random inputs, and external dependencies should have controllable substitutes so that the same code does not produce contradictory results across runs.

    Day 5: Connect the Controlled Execution Loop

    Link task intake, plan approval, code changes, verification, repair, and reporting.

    The basic workflow can be expressed as pseudocode:

    1. Read the task contract
    2. Check scope, permissions, and acceptance criteria
    3. If information is insufficient:
    4. Request clarification and pause
    5. Generate an implementation plan
    6. Determine whether human confirmation is required by the risk level
    7. Apply changes in an isolated environment
    8. Run the required verification
    9. If verification fails and repair conditions still hold:
    10. Perform bounded repairs based on failure evidence
    11. Otherwise:
    12. Stop and report the reason for failure
    13. Submit the change summary, verification records, and unresolved issues
    14. Await any required human review

    The key is not how automated the workflow looks. Every step needs defined inputs, outputs, and stop conditions.

    Day 6: Validate with Real Tasks, Not Curated Demos

    Draw tasks from a predefined pool, covering feature development, bug fixes, and test maintenance.

    Record failures and human takeovers as well as successes. Successful samples show that certain task types can be completed. Failed samples expose weaknesses in the system.

    For recurring problems, improve task templates, project knowledge, or verification rules rather than adding a one-off prompt for every task.

    Day 7: Consolidate the Rules and Define the Next Improvements

    Review coverage, human intervention time, rework, review burden, and defect feedback.

    Turn effective rules into reusable assets. Remove or revise ineffective ones. Identify which tasks still require human leadership and which engineering foundations need further work.

    The value of the week is not a polished automation demonstration. It is learning which conditions enable agents to perform the primary implementation work reliably.

    5. Measure Benefits Beyond Code Generation Speed

    A healthy measurement framework should include at least four groups of metrics.

    Task metrics: Task participation rate, agent-led completion rate, first-pass acceptance rate, and human takeover rate.

    Quality metrics: Reasons for rework, issues found during review, and post-delivery defects and their severity.

    Cost metrics: Time and resources spent preparing requirements, organizing context, waiting for execution, reviewing results, and maintaining the harness.

    Safety metrics: Out-of-scope changes, attempts to access sensitive resources, unauthorized operations, and triggered stop conditions.

    Efficiency comparisons should use tasks with similar complexity and risk. Comparing automated results from simple tasks with human effort on complex tasks can produce misleading conclusions.

    The meaningful objective is lower total effort per accepted delivery without reducing quality or safety—not faster code generation or more modified files.

    6. Higher Coverage Comes from Reducing Uncertainty

    Engineering AI coding workflows does not simply remove developers from the process. It redistributes responsibilities.

    Agents are well suited to work with explicit rules, timely feedback, and repeatable execution. Developers can focus more on interpreting requirements, designing systems, evaluating risk, and defining acceptance criteria.

    Clear tasks, trustworthy context, stable environments, independent verification, and controlled permissions make it more feasible for agents to lead routine implementation. Weak engineering foundations can have the opposite effect: a more capable model may simply produce larger incorrect changes faster.

    A 90% coverage target should never conceal quality problems. One week can launch the system, but sustainable gains require continued rule maintenance, failure analysis, stronger verification, and honest accounting of the work humans still perform.

    The ultimate value of an engineering harness is turning occasionally successful code generation into a development capability with traceable processes, verifiable results, and controlled risk.