Composition Patterns
Everything is a holon - whole and part. Composition is how the parts assemble into larger wholes without losing what they are.
The holonic hierarchy
Steward (root)
├── Operations (strategy)
├── Capabilities (behavioral)
├── Agents (behavioral)
├── Workflows (behavioral)
└── Governance (the Steward's own)
The Steward is the container. Operations are the mutable strategy layer. Capabilities, Agents, and Workflows are the behavioral holons they compose.
Vertical vs horizontal
- Vertical (parent → child): an Operation composes Capabilities and Agents; a Steward composes Operations. The standard nesting.
- Horizontal (peer → peer):
.Merge()folds another Steward's registries into this one. Operations, Capabilities, Agents, services andOnInithooks merge; direct registrations override merged entries with the same name. Governance is NOT merged - the merged Steward's guardrails are ignored, per the no-aggregation rule.
const AdminPlane = Steward('AdminPlane', 'Auth, users and audit')
.Merge(AuthPlane)
.Merge(UserPlane)
.Merge(AuditPlane);
The governance cascade
When a Steward runs an Operation, every guardrail on the way must accept:
- The Steward's own guardrail, checked before the Operation starts, with the
Operation's name as the
Action. - Each Capability, Agent and Workflow's own guardrail, checked when the Operation calls it.
Operations don't carry guardrails of their own; to restrict one Operation, the
Steward's guardrail matches on its name (for example ActionAllowlistPolicy). Each
level governs itself, and nothing is inherited: a nested Steward doesn't take its
parent's guardrail.
Which entity do I use?
| Use... | When |
|---|---|
| Agent | The work needs an AI/LLM, or spawns an external tool |
| Capability | A reusable, deterministic tool or cross-cutting concern |
| Operation | A strategy composing capabilities / agents / sub-operations |
| Workflow | Multi-step work with state, approval gates, or persistence |
| Governance | Access control, validation, a policy you attach |
| Steward | The root container that hosts and runs them all |
A quick decision tree: needs AI? → Agent. Otherwise a reusable tool? → Capability (with output hooks if callers need to interact with a resource). Otherwise a strategy composing others? → Operation (→ Workflow if it's multi-step with durable state). The container around all of it is always the Steward.
- Back to Patterns · or move on to the Guides → to build your own
On fathym.com: Holonic →