The Composition Grammar

The pattern network is reusable; a composed solution is one team’s selection from it. The grammar below says when a selection is valid. A composition that breaks a rule is not a weaker solution; it is not a solution, and its boundary must be redesigned.

The rules

Rule 0. Name the whole and its boundary. Before selecting a pattern, state the intended outcome and stopping point, the governed content boundary, external systems, authority owners, risk class, success measures, consequence of release, total resource budget, and time horizon. Select a pattern because its context and forces match this statement, not because its technology is familiar.

Rule 1. A root pattern anchors the solution. Select the scale-1 pattern whose context matches the situation, beginning from THE QUESTIONS PEOPLE ASK (1) and GOVERNED CONTENT SUBSTRATE (2). Declare whether the outcome is a full realization or a named intermediate result. A partial realization remains a scoped realization of its root and must not claim the full root’s release outcome. A system may have several roots when it does several kinds of work, provided their boundaries are explicit.

Rule 2. Close the obligations. Every unguarded “Requires” edge of a selected pattern is mandatory. A guarded requirement is mandatory when its guard holds; record why the guard is true or false. A “Requires one of” set is satisfied by at least one member, with a rationale. A substitute pattern may discharge an obligation only if its contract, authority, evidence, and quality invariants are demonstrably equivalent, and the substitution is recorded. An omitted requirement cannot be relabeled optional.

Rule 3. Techniques resolve local decisions. A scale-2 operation selects the scale-3 techniques it needs. A control that spans operations, such as a runtime plan or an evaluation loop, may instead be coordinated by the root. A technique does not become a root because several operations use it.

Rule 4. Every handoff has an invariant and a gate. Adjacent operations exchange a named, versioned artifact or service contract. The receiver checks identity, provenance, validity, owner, and freshness before use. A gate prevents invalid state from propagating. Operations may run in parallel only when they read compatible immutable inputs, have disjoint outputs or a declared resolver, stay within a shared budget, and rejoin under a complete membership rule.

Rule 5. Variation and authority are recorded. For every optional pattern, choice, guard, substitution, or partial realization, record the context, rationale, owner, equivalent obligation, and review trigger. The authority matrix distinguishes capability, permission, responsibility, delegation, approval, and accountability. If two selected patterns assign one decision to incompatible authorities or impose contradictory invariants, the composition is invalid.

Rule 6. Runtime composition preserves invariants. A router or planner may select, construct, or revise a path only from capabilities the composition permits. Before each new or changed action, apply the temporal admission test. Persist the proposed path and its admission decision. A failed admission goes to replanning, human review, or stop; a model cannot authorize its own exception.

Rule 7. Failures have destinations, and behavior is evaluated. Every material failure has a typed destination: retry, repair, reobserve, reconcile, authorized substitute, human review, quarantine, or stop. Recovery cannot weaken the invariant that detected the failure. Evaluate both the artifact and the trajectory. A release comparison names its case set, rubric, rater, environment, baseline, uncertainty, and hard-constraint versions. Evaluation findings can change run state under policy; persistent behavior changes and changes to the language follow their own review.

Rule 8. The language must be complete before it is used. The Timeless Way of Building names two tests of a language, and both apply to a composed solution. It is morphologically complete when you can picture the system it will generate as a whole, with no region where you would have to stop and start thinking from the beginning. It is functionally complete when the patterns, as a system, generate only problems they themselves resolve: a pattern that creates a review queue is accompanied by a pattern that keeps the queue small; a pattern that creates projections is accompanied by a pattern that keeps them current. Where either test fails, invent or add a pattern; where a pattern contributes nothing, remove it. And keep each pattern’s direct components few: Alexander found that a pattern with more than about five parts directly beneath it cannot be imagined coherently, so the rest must be reached through those parts. The validation tool enforces a limit of six.

Composition modes

Mode Runtime choice Constraint
Static None after design The complete execution network is approved before the run.
Conditional Select among predefined branches Every branch has a contract, a guard, and a failure destination.
Dynamic Construct a path from permitted capabilities Admit the proposed plan against current dependencies and authority before execution.
Adaptive Revise an admitted path from new evidence Readmit changed steps, invalidate stale approvals, keep the audit trail.
Evolutionary Propose changes to capabilities or behavior Runtime proposals never change governing policy; change goes through review and regression evaluation.

Variation vocabulary

Variation What the manifest must record
Implementation substitution The alternate implementation, the same pattern contract, and the owner
Pattern substitution Evidence that another pattern satisfies the same obligation and boundary
Conditional requirement The guard, its observed value, and the trigger for rechecking it
Partial realization The named intermediate outcome, the obligations closed for it, and the release claims excluded
Optional extension The context and forces that justify adding the pattern
Substrate choice The substrate selected, how it meets the six substrate conditions, and any condition it meets only partially