Routing Rules
Control how records are routed to actors — match patterns, set targets, and let the system learn.
Overview
Routing rules tell the engine how to handle incoming records. When a record arrives, the engine checks rules in order and dispatches to the first matching target. Rules are configuration — no code changes needed.
Creating a Rule
spl config add-rule \
--name "code-to-dev" \
--domain code \
--act INTEND \
--target did:sync:agent:devThis rule says: when an INTEND record about the code domain arrives, route it to the dev agent.
Viewing Rules
spl config list-rulesMatch Criteria
Rules match on combinations of fields:
| Criterion | Description | Example |
|---|---|---|
--domain | The domain of the work | code, ops, data |
--act | The act type | INTEND, KNOW, DO |
All specified criteria must match (AND logic). Unspecified criteria are wildcards.
How Routing Works
The engine checks rules in order, top to bottom:
- Explicit target: If the record has a
body.tofield, route directly (no rules checked) - Pattern match: Check if a proven pattern matches (cheapest)
- Routing rules: Check configured rules (first match wins)
- Trust-based: Route to the actor with the highest trust in the relevant domain
- Default: Propose a routing decision for human approval
Most records are handled by patterns and rules. Only genuinely novel situations require manual decisions — and those decisions become new rules for the future.
Rules Evolve
When the engine proposes a routing decision and you approve it, a routing rule is automatically created. The next identical situation routes instantly without asking.
Over time, the rule set grows from evidence. You don't need to configure rules upfront — the system learns them from your decisions.
What's Next
- Actors and adapters — configure the targets that rules route to
- The engine — the routing cascade in detail
- Configuration reference — full rule syntax