chapter ten

10 Composing patterns: From map to terrain

 

This chapter covers

  • Diagnosing a task failure and comparing a small set of pattern candidates
  • Following task, state, authority, and evidence across pattern seams
  • Reusing pattern interfaces while supplying domain-specific adapters
  • Testing a general-agent baseline before adding patterns
  • Recording a composition as a testable, removable architecture decision
"The map is not the territory."

— Alfred Korzybski, Science and Sanity [1]

In an enterprise SaaS system, a salary-configuration task required the agent to find a template and pass its identifier to a later import call. Bo Liang, an architect and ADPS co-founder, found that the model could choose the right tools in the right order and still regenerate the long identifier incorrectly from the conversation. The call passed its format checks but carried the wrong value [2].

A language model generates a likely token sequence; it does not guarantee that a regenerated identifier equals the tool's original value. Liang's team moved that responsibility to program logic, passing the original value and its source directly from the upstream tool receipt to the downstream consumer [2]. Figure 10.1 contrasts the two paths. The composition problem is to preserve that continuity as control moves between model calls, tools, approvals, and external systems.

10.1 The evidence-driven six-step method

10.1.1 Step 1: Bound completion

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

10.1.3 Step 3: Diagnose the binding deficit

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

10.1.5 Step 5: Specify consequential seams and define the experiment

10.1.6 Step 6: Compare, decide, and reopen

10.2 From pattern map to task terrain

10.2.1 What the map can suggest

10.2.2 What the terrain adds

10.3 Model the complete task before selecting patterns

10.3.1 The Task Completion Contract

10.3.2 Draw the task spine and four continuity lines

10.3.3 Locate the first deviation

10.4 Make consequential interfaces explicit

10.5 Do general-purpose agents make composition obsolete?

10.6 The pattern selection card and evaluation receipt

10.7 Selecting and connecting patterns for a salary-template task

10.7.1 From observed failure to a candidate composition

10.7.2 Reuse the mechanisms and supply the adapters

10.7.3 Compare on the same workload before accepting

10.8 Three field pressure tests

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

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

10.8.3 DeerFlow guardrails: Authorize tool visibility and execution