liveBook · Manning

Plan-act-observe loop

As explained in Vibe Engineering

A plan-act-observe loop is an iterative agent workflow that plans an action, executes it through tools, observes the result, and uses the observation to determine subsequent actions.

A plan-act-observe loop makes an AI coding agent iterative and interruptible: it forms a plan, takes an explicit tool action, observes the result, and adjusts the next action. In a payment-validation migration, the plan may cover library discovery, repository inspection, and proposed changes; execution then requests permission to read files or search the codebase. The human remains responsible for approving each operation. section 5.2.1

Use the loop as an operational control rather than treating an agent as an unrestricted code generator:

  • Separate planning from implementation when the task needs review; Plan Mode establishes what should happen before execution begins. section 5.2.1
  • Treat permissions as part of the workflow: Architect mode can inspect and propose, Code mode can edit within boundaries, and Ask mode answers questions. section 5.2.1
  • Expect exploration to consume substantial time and tokens; live search follows references more flexibly than indexed retrieval but costs more latency and may still miss coverage. section 3.5.1

Repository migration with explicit approvals

An agent first proposes migrating payment validation, then asks to read PaymentService.py, search for currency validation, and inspect currency.py. Each approval advances the loop while preserving a human checkpoint. The same pattern can assign planning, implementation, and testing to agents with different permissions. section 5.2.1

Figure 3.7 Context-aware assistance flow. The developer's query is converted into an embedding, matched against the indexed codebase, and the most relevant chunks are injected into the prompt before the model generates its response.

Contrast the loop's live, reasoning-driven repository exploration with embedding-based retrieval, which injects indexed chunks before generation. section 3.5.1

How Vibe Engineering covers it

How deep it goes
Details approvals, permission modes, specialized agents, and retrieval tradeoffs without formalizing the loop mathematically.
Examples
Uses payment-validation migration, approval prompts, repository search, and specialized planning, implementation, and testing agents.
What you can do after
Operate an AI coding agent through staged plans, explicit permissions, live repository exploration, and reviewable execution.
How it connects
Connects AI coding agents with tool use, access control, agentic search, and retrieval-augmented generation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.