liveBook · Manning

Chapter 10: Composing patterns: From map to terrain

What you will learn in chapter 10 of Designing AI Agents

Introduces pattern composition through an identifier handoff failure and the need to preserve continuity across consequential interfaces.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces pattern composition through an identifier handoff failure and the need to preserve continuity across consequential interfaces.

Key terms: identifier, tool receipt, runtime binding, program-enforced contracts, shared state, delegated authority, external effect, pattern matrix, task model, Task

10.1 The evidence-driven six-step method

This section introduces a baseline-first method for selecting patterns and defines task contracts and seams.

Key terms: task contract, permitted effects, observable completion conditions, baseline, catalog, deficit, seam, handoff, state, result

10.1.1 Step 1: Bound completion

10.1.2 Step 2: Run the smallest end-to-end baseline

Establish and test the simplest plausible end-to-end baseline, and revisit it as capabilities improve.

Key terms: baseline, contract, real acceptance point, first deviation, required gate, deficit, composition, native harness

10.1.3 Step 3: Diagnose the binding deficit

This section diagnoses observed agent failures using cognitive functions and matches the failing work’s dependency shape to a possible execution topology.

Key terms: cognitive functions, diagnostic questions, observed failure, dependency shape, Chain, Route, Parallel, topology, Loop, Hierarchy

10.1.4 Step 4: Generate a small candidate set from the map

Generate a small set of pattern candidates from the diagnosed task and express each as a testable architecture hypothesis.

Key terms: cognitive function, dependency shape, canonical matrix, candidate, architecture hypothesis, preconditions, expected effect, workload-specific parameters, credible alternative, claimed mechanism

10.1.5 Step 5: Specify consequential seams and define the experiment

This section explains how to specify consequential handoffs and design a comparable, controlled test of a proposed pattern composition.

Key terms: seam, handoff, authority, permitted effects, recovery, acceptance, task-pattern fit, pattern-pattern fit, architecture-workload fit, failure injection

10.1.6 Step 6: Compare, decide, and reopen

Compare a proposal against the baseline, revise failures at the responsible layer, and reopen provisional acceptance when tested conditions change.

Key terms: baseline, required gate, proposal, regression, task-contract error, stale-state seam, handoff, latency, completion gate, acceptance

10.2 From pattern map to task terrain

This section explains how the pattern map suggests candidates while task-specific context and evidence guide their selection and composition.

Key terms: pattern map, task terrain, cognitive functions, execution topologies, pattern language, forces and tradeoffs, preconditions, task workflow, composition

10.2.1 What the map can suggest

This section shows how pattern-map coordinates suggest candidates for a specific task need, which become architecture hypotheses to test.

Key terms: pattern coordinate, architecture hypothesis, mechanism, preconditions

10.2.2 What the terrain adds

This section explains how a task’s operating terrain shapes pattern interfaces and why evidence must remain available across seams.

Key terms: task terrain, user story, interfaces, task spine, seam, Task, State, Authority, Evidence, Semantic Compaction

10.3 Model the complete task before selecting patterns

This section explains how to model a complete task and its current outcome before choosing patterns.

Key terms: pattern shopping, starting state, intended effect, forbidden effects, acceptance evidence

10.3.1 The Task Completion Contract

This section defines a Task Completion Contract and shows why completion must be judged against the bounded task and its observable effects, not merely a well-formed output or a ready application.

Key terms: task, goal, Task Completion Contract, permitted effects, observable completion conditions, output schema, authoritative business readback, tool receipt, completion contracts, source evidence

10.3.2 Draw the task spine and four continuity lines

This section shows how to map an existing task and trace four distinct continuity lines through it.

Key terms: task spine, Task, State, Authority, Evidence, acceptance point, Task continuity, State continuity, run identity, permitted mutation

10.3.3 Locate the first deviation

This section explains how to locate the first observable deviation from a task completion contract rather than treating a downstream error as the root problem.

Key terms: first deviation, observable state, Task Completion Contract, broken handoff

10.4 Make consequential interfaces explicit

This section explains where consequential handoffs need explicit contracts and where agents can retain flexibility within bounded workspaces.

Key terms: shared or durable state, authority, principal, mutation rule, external side effect, normalized intent, preconditions, idempotency, recovery boundary, acceptance owner

10.5 Do general-purpose agents make composition obsolete?

This section explains when general-purpose agents can replace custom pattern compositions and why executable interfaces and environmental controls remain necessary.

Key terms: general-purpose agents, baseline, native primitive, explicit pattern, reproducible deficit, Skills, command line, graphical controls, platform, bounded results

10.6 The pattern selection card and evaluation receipt

This section separates architecture proposals from evaluation results and explains how evidence determines whether a pattern composition is accepted or simplified.

Key terms: pattern selection card, ASSESS, ROUTE, SELECT, evaluation receipt, candidate generation, admission, comparison, composition, seams

10.7 Selecting and connecting patterns for a salary-template task

The section frames a salary-import design exercise around an identifier failure and a workflow with fixed stages but flexible tool choices.

Key terms: matching, import, readback, tools

10.7.1 From observed failure to a candidate composition

This section diagnoses a salary-template task’s observed failure and selects a proportionate candidate composition for testing.

Key terms: business query, active principal, import permission, template_id, matching receipt, runtime state binding, Tool Dispatch, Guardrail Sandwich, direct binding, admission

10.7.2 Reuse the mechanisms and supply the adapters

This section adapts reusable action-control mechanisms to a salary-template import and traces their admission, verification, and recovery boundaries.

Key terms: control logic, domain adapter, DispatchContext, matching service, tenant policy, match receipt, ToolIntent, ArgusAction.execute(), dispatch(), admit()

10.7.3 Compare on the same workload before accepting

This section defines a controlled comparison and evidence-based acceptance decision for the salary-import composition.

Key terms: versioned cases, test tenant, run-to-run variation, externally accepted completions, business readback, quality and latency budgets, direct-binding-only ablation, local fakes, admission and execution checks, failing gate

10.8 Three field pressure tests

Introduces three field cases and their evidence for pressure-testing the composition method.

10.8.1 GIS publication: An internal receipt is not the delivered result

This section uses GIS publication failures to show why acceptance must verify the client-facing result rather than rely on an internal success receipt.

Key terms: acceptance boundary, GetMap, GetTile, task receipt, client-facing path

10.8.2 Learned routing: A valid training set can still misrepresent the workload

This case shows why a learned router needs evaluation on representative user requests despite valid synthetic training data and converged loss.

Key terms: structural uniformity, positional shortcuts, class balance, distribution problems, route accuracy, entity-parameter fidelity, clarification and rejection calibration, held-out evidence, Evaluation Receipt, held-out workload boundary

10.8.3 DeerFlow guardrails: Authorize tool visibility and execution

The DeerFlow case shows why tool visibility and execution must be authorized at separate seams using the same policy source.

Key terms: authorization provider, tool assembly, deferred discovery, runtime guard

10.9 The composition record

The section describes the linked artifacts in a composition record and how they keep architecture decisions connected to operating evidence.

Key terms: Task Completion Contract, Task Terrain Graph, Task, State, Authority, Evidence, Pattern Selection Card, Evaluation Receipt, baseline deficit, consequential seams

10.10 Argus as a composition self-test

This section uses Argus to test whether composed modules respect authority, require evidence for completion, and write durable memory only after external acceptance.

Key terms: authority, authorized_reader(), plan version, write set, completion gate, reflection evidence, external acceptance, durable memory, memory-write decision, boundary tests

10.11 Summary

10.12 References

This section lists sources referenced in the chapter, including case reports, research, and technical materials.

Where this is used later

Concepts explained in this chapter

← Chapter 9: Governance: Constraints that enable freedom Chapter 11: Patterns in the wild: Three end-to-end case studies →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.