SSyncropel Docs

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:dev

This rule says: when an INTEND record about the code domain arrives, route it to the dev agent.

Viewing Rules

spl config list-rules

Match Criteria

Rules match on combinations of fields:

CriterionDescriptionExample
--domainThe domain of the workcode, ops, data
--actThe act typeINTEND, 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:

  1. Explicit target: If the record has a body.to field, route directly (no rules checked)
  2. Pattern match: Check if a proven pattern matches (cheapest)
  3. Routing rules: Check configured rules (first match wins)
  4. Trust-based: Route to the actor with the highest trust in the relevant domain
  5. 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

On this page