Your first pattern
Do the same kind of work three times, see Syncropel recognize the pattern, watch your trust score grow, and see how the next similar piece of work is handled.
What you'll see
In about 30 minutes, you'll create three similar threads, see Syncropel record their pattern signatures, and see how the next similar piece of work is matched to the pattern so its outcome can be reused instead of triggering a fresh model call.
After this, you'll understand how repeated work gets cheaper: work that matches a proven pattern is reused, not reasoned out again.
Before you start
splinstalled (spl --version)- Your workspace running, with
spl statushealthy. - Completed Your first decision gate, because patterns build on approved rules.
- A little patience: patterns are picked up on a timer that runs about every 60 seconds.
This tutorial uses spl thread records, spl trust and the HTTP API. There is no spl pattern command (see Patterns).
1. Create three similar threads
Three similar threads, each with the same kind of INTEND, DO and closing KNOW. A small example: counting lines in three files.
# Thread 1
THREAD1=th_count_lines_a
spl intend "Count the lines in src/main.rs" --thread $THREAD1
spl do "Read file and count newlines" --thread $THREAD1
spl know "src/main.rs has 142 lines" --thread $THREAD1 --fulfills
# Thread 2
THREAD2=th_count_lines_b
spl intend "Count the lines in src/lib.rs" --thread $THREAD2
spl do "Read file and count newlines" --thread $THREAD2
spl know "src/lib.rs has 89 lines" --thread $THREAD2 --fulfills
# Thread 3
THREAD3=th_count_lines_c
spl intend "Count the lines in src/main.rs" --thread $THREAD3
spl do "Read file and count newlines" --thread $THREAD3
spl know "src/main.rs has 142 lines" --thread $THREAD3 --fulfillsThe --fulfills on each closing KNOW marks the thread as successfully closed. That is what makes Syncropel record the pattern.
2. Look at the pattern signatures
Each closed thread now has a pattern signature at four levels of detail, L0 to L3. L0 is the most exact and L3 the most general:
spl thread show $THREAD1You'll see the usual output plus a pattern_hashes block (the values are long fingerprints):
Thread: th_count_lines_a (closed, fulfilled)
Records: 3 (INTEND → DO → KNOW)
Pattern hashes:
L0: 7f3a4c2e9b1d8a6f5c4b3a2e1d0c9b8a7f6e5d4c3b2a1908f7e6d5c4b3a2918
L1: 8c9d0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f
L2: a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456
L3: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3Now compare it with thread 2:
spl thread show $THREAD2Threads 1 and 2 should match at L1, L2 and L3: same shape and same flow. They differ at L0 because the file names and line counts differ. The more general levels describe the shape of the work without its content, which is what lets patterns be shared without sharing what the work was about. The exact L0 level never leaves a namespace without consent.
Threads 1 and 3 should match at L0: the same exact INTEND, DO and KNOW result.
3. Read the pattern records
Patterns are ordinary records, so you can query them through the HTTP API. Threads 1 and 3 are identical at L0, and all three threads match at L1:
curl -s -H "Authorization: Bearer $(cat ~/.syncro/token)" \
"http://localhost:9100/v1/records?body.kind=core.pattern.observation.v1&limit=10" \
| jq '.records[] | {hash_l1: .body.hash_l1, observations: .body.observation_count}'You should see one entry whose hash_l1 matches all three threads, with observation_count: 3. Each successful --fulfills adds one observation.
4. Watch the trust score grow
Each closed thread is also evidence about your trust in an area of work (general if you didn't pass --domain). Look at your trust:
spl trustACTOR DOMAIN SUCCESS TOTAL TRUST
did:sync:user:you general 3 3 0.439Three out of three successes. A small number of results is never fully trusted, so 3 out of 3 scores about 0.44, not 1.0. The score climbs as more work is reviewed.
Trust is one of the conditions for a pattern to become permanent. The others are many more observations, a real regularity in the work and more than one source.
This tutorial covers the early stage only. Three observations from one member don't make a pattern permanent. But the pattern is already on record, and the next similar piece of work can match it. See Patterns for when a pattern is reused.
5. Add a fourth thread and watch for a match
Start one more line-count thread:
THREAD4=th_count_lines_d
spl intend "Count the lines in src/test.rs" --thread $THREAD4See what Syncropel did with the new INTEND:
spl thread records $THREAD4If a routing rule covers this shape of work, you should see follow-on records from Syncropel, for example a DO with body.dispatch_handled: true and body.replay_source: <pattern_id>. These show the outcome was reused from the pattern, not reasoned out again.
If no rule covers this shape yet, Syncropel treats the new INTEND like the unrouted record in the decision-gate tutorial and proposes a routing rule for you to approve. The pattern is on record, but nothing is routed automatically until a rule covers the shape.
6. Inspect the routing rules
The rules that will fire next are the records on the th_engine_config thread:
spl thread records th_engine_config | jq '.[] | select(.body.kind == "core.routing_rule.v1") | {name: .body.name, match: .body.match}'Each entry is a LEARN record describing one rule. The records are the routing table; there is no separate config file.
What just happened
- Closed threads become pattern observations. Every
--fulfillsKNOW closes a thread and records its signatures at four levels of detail. This happens automatically. - Levels separate shape from content. L0 includes the content, so it stays inside its namespace. L1 to L3 describe only the shape and are safe to share with paired workspaces with consent.
- Cheaper matches come first. New work is matched from the most exact level to the most general, and then reasoned out fresh only if nothing matches.
- Trust and repetition gate permanence. Three observations don't make a pattern permanent. That needs a trusted producer, many observations and more than one source.
- Patterns can lapse. If trust in the producer falls (see Trust), the pattern is no longer reused, so the workspace doesn't keep reusing something that stopped working.
Where to next
- Patterns concept: how patterns are matched, reused, made permanent and shared.
- Trust concept: how trust is earned, how it fades and why it decides which patterns become permanent.
- Engine concept: what keeps your workspace running, including routing and scheduled work.
- Your first federation pair: permanent patterns can be shared with paired workspaces, with consent.
- Cookbook: Trust-gated auto-approval: combining trust and the decision gate so high-trust members' work is approved automatically.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Hash signatures don't appear in spl thread show | The thread isn't closed. A pattern is recorded only when a closing KNOW carries --fulfills against a prior INTEND. | Re-emit the closing KNOW with --fulfills (or --fulfills <intend_record_id> if you want to be explicit). Without it, the thread stays open and no pattern is recorded. |
| Threads 1 and 2 also match at L0 | The bodies are identical. L0 matches only on identical content. | This is fine, just less interesting. Vary the INTEND text between threads (different filename, different parameter) to see L0 differ while L1 still matches. |
| Pattern observation count stuck at 1 | Each thread closed but they differ at every level (different body kinds, actors or acts). | Verify all three threads use the same act sequence (INTEND → DO → KNOW), the same actor, and structurally similar body shapes. Use spl thread show <id> to compare the signatures side by side. |
Trust score flat at 0.0 after --fulfills | The closing KNOW didn't include a --domain, so observations land in general, and your spl trust view may be filtered. | Run spl trust with no flags to see all domains. Or pass --domain code (or whatever fits) to spl know to attribute observations to a specific domain. |
| Fourth record didn't auto-route | No routing rule covers the pattern's L1 signature yet. Patterns make routing possible; rules make it happen. | Either approve a routing proposal (per the decision-gate tutorial) or hand-author a rule with spl config add-rule. Patterns and rules are separate: patterns are matched, rules route. |
Your first decision gate
Write a record that has no routing rule yet, see Syncropel propose one as a decision request, approve it, and watch the next similar record route automatically.
Build a multi-user code review flow
Pair two workspaces with one command and exchange code-review records in both directions, with consent controlling what is shared.