Skip to content

Lesson 01 · Foundations

What Compositionality Demands

State the compositionality problem and distinguish compositional interfaces from ad-hoc glue.

~12 min The Compositionality Problem
compositionalityopen-systeminterface-boundaryemergent-failure

The problem in one sentence

You can understand every component and still misunderstand the whole — unless the meaning of the whole is determined by the meanings of the parts and the law by which they are joined. That requirement is compositionality.

Closed boxes vs open systems

Open system · wiring diagram

Wiring diagram with ports and optional nestingouter system Xin₀in₁outAB (nested)B₁B₂

Outer ports are the interface of X. Filling boxes is operadic composition: B itself is a diagram of B₁ and B₂.

Open systems and boundaries

A closed system has no exposed interface: you can only replace it wholesale. An open system publishes a typed boundary — ports, wires, message shapes, resource accounts — so neighbors can plug in. Composition glues boundaries. Without an explicit boundary, engineers invent implicit ones; those are where emergent failure lives.

How compositionality is earned

Name the whole

State the system whose meaning you care about.

Failure modes when composition is informal

ModeSymptomRepair
Implicit interfaceWorks only if teams share unwritten lorePromote lore to typed ports
Hidden channelGlobals/caches couple boxes invisiblySurface channels as wires
Arity blindnessBinary glue forced onto multi-party joinsUse n-ary operations / wiring ops
Semantic forkSame diagram, conflicting meaningsFix one algebra; version others explicitly

Diagnose a non-compositional join

  1. 01List the parts you claim to compose and the whole you claim to get.
  2. 02Write the interface of each part: what enters, what leaves, what is invariant.
  3. 03Write the glue: which ports connect, which types must match, which resources are shared.
  4. 04Ask: if I replace one part by another with the same interface, does the whole’s meaning update only through that interface?
  5. 05If the answer needs “tribal knowledge” beyond the interface, the design is not compositional yet.

Check yourself

Retrieval practice — feedback explains why.

Q1Compositionality means:
Q2An open system is one that:
Q3A classic symptom of non-compositional design is:

Explain it back

Name a system you know that failed because two parts were correct alone but wrong when joined. What interface was missing?

Sources · claim ledger