Phase 14 · Lesson 44 of 54

Build an Evidence-Backed Execution Plan

A plan is not a prettier to-do list. It is a dependency graph in which every change has a reason and every terminal node has proof.

Lesson 44 of 54Learn + Build~65 minutesPython (stdlib)

Before this: Lesson 43 of Phase 14

On this page

Learning Objectives

  • Convert a task frame into work items with evidence and proof.
  • Model ordering as dependencies instead of prose sequence.
  • Detect missing facts, unknown dependencies, and cycles before editing.
  • Separate steps that can run together from steps that must wait.

Why Agent Plans Fail

Weak plans repeat the request in future tense:

  1. Update the API.
  2. Add tests.
  3. Update documentation.

Nothing in that list says what was found, why those files are correct, which contract changes first, or what can happen concurrently. An agent can follow every step and still create rework.

A strong plan makes five commitments for each work item:

Commitment Purpose
Identifier Stable reference for dependencies and handoff
Change The smallest behavior or contract change
Evidence Repository facts that justify the change
Dependencies Work that must be true first
Proof The exact check that closes the item

Plan the Contract Before Its Implementations

When multiple surfaces depend on the same behavior, define the behavior first. Tests, implementation, documentation, and integration can then share one contract instead of inventing four versions.

Diagram (opens full size)

The graph exposes safe concurrency. Implementation and documentation can proceed together after the contract is fixed. Integration waits for both.

Evidence Changes the Plan

Repository evidence is not decoration. It should be capable of changing the work:

  • An existing helper removes a planned new abstraction.
  • A compatibility test forces a migration step.
  • A deployment constraint moves a schema change into another task.
  • A public response type changes the order of implementation and documentation.

If the evidence cannot change the plan, it is probably not evidence for that decision.

Design for Interruption

Coding-agent sessions end unexpectedly. A resumable plan has work items small enough that another session can determine:

  • which item is complete;
  • which proof ran;
  • which artifacts changed;
  • which dependencies are now unblocked;
  • what the next safe item is.

Do not encode state only in checked boxes inside a chat. Store the plan next to the work.

Plan Validation

Reject the plan before execution when:

  • an identifier is duplicated;
  • a work item has no evidence;
  • a work item has no proof;
  • a dependency names an unknown item;
  • the graph contains a cycle;
  • the first irreversible action occurs before the relevant uncertainty is resolved.

The first five checks are mechanical. The last requires judgment and should be called out explicitly.

Build It

code/main.py models work items, validates their receipts, computes execution waves with a topological sort, and writes outputs/evidence-plan.json.

Run:

python3 code/main.py
python3 -m unittest discover code/tests -v

The example produces three waves. Contract definition runs first. Implementation and documentation run together. The integration gate runs last.

Use It with a Coding Agent

Ask the agent to produce the plan before it changes files. Review the plan for three things:

  1. Every path and behavior claim has a repository receipt.
  2. Every item has one clear completion proof.
  3. The graph delays expensive or irreversible work until the uncertainty it depends on is resolved.

Approve the plan, not a vague promise to be careful.

Exercises

  1. Add a migration item that requires explicit human approval.
  2. Create a cycle and explain the hidden product disagreement behind it.
  3. Split one item that has two proof commands.
  4. Add a work item that can run in the second wave without touching either existing branch.
  5. Render the plan as Markdown while keeping JSON as the source of truth.

Further Reading

What You Keep

Keep outputs/evidence-plan.json. It becomes the delegation contract in the next lesson.

Check yourself

Quick quiz

  1. What distinguishes an execution plan from a to-do list?

    1. A model recommendation
    2. A fixed number of steps
    3. More prose
    4. A dependency graph with evidence and proof
    Show the answer

    D. A dependency graph with evidence and proof Dependencies, receipts, and completion proof make the plan executable and resumable.

  2. Why define a shared contract before its implementations?

    1. To avoid documentation
    2. To delay all work
    3. So dependent surfaces do not invent conflicting behavior
    4. So only one agent can work
    Show the answer

    C. So dependent surfaces do not invent conflicting behavior A fixed contract unblocks safe parallel work on dependent surfaces.

  3. What does a dependency cycle usually reveal?

    1. Good parallelism
    2. A hidden unresolved decision or bad decomposition
    3. Fast execution
    4. Strong evidence
    Show the answer

    B. A hidden unresolved decision or bad decomposition Cyclic work items cannot establish a valid starting point.

  4. When can two work items share an execution wave?

    1. When their dependencies are complete and they are otherwise independent
    2. When they touch the same files
    3. When neither has proof
    4. When both are important
    Show the answer

    A. When their dependencies are complete and they are otherwise independent A wave contains all currently unblocked independent work.

  5. Why attach evidence to each work item?

    1. To show why the change belongs and let new evidence revise it
    2. To replace tests
    3. To decorate the plan
    4. To satisfy a token target
    Show the answer

    A. To show why the change belongs and let new evidence revise it Evidence must justify and be capable of changing the plan.

  6. What makes a plan resumable?

    1. One worker for everything
    2. A long initial prompt
    3. Small items with status, artifacts, dependencies, and proof
    4. Chat history
    Show the answer

    C. Small items with status, artifacts, dependencies, and proof Durable item state lets another session continue without rediscovery.

Questions people ask

What makes a good project plan for AI agent work?

Each item should name the change, the evidence that it is needed, what it depends on, and the check that proves it is finished. Ordering by dependencies, not by a list, shows what can run in parallel.

How do you spot a weak plan?

It repeats the request in future tense, like update the API then add tests, without saying what was found, why those changes, what comes first or how each step will be confirmed.

Next lessonDelegate Agent Work with Isolation and Merge ContractsPrevious: Frame the Task Before the Agent Writes Code

Lessons from AI Engineering from Scratch by Rohit Ghumare and contributors, MIT license. Notes for owners by Lozo. License

Next step

Rather have it built for you?

Reading is optional. Tell me what's stuck and I'll build it into the business you already run.

  • A real conversation, not a pitch
  • You keep your accounts
  • Nothing sends without your yes