Judge
A ? Judge node reads inbound text and emits it on exactly one labeled out-port: pass, fail, or unsure.
It is routing, not a fuse. A circuit breaker aborts, skips, or parks. A Judge chooses a branch.
Why it exists
Section titled “Why it exists”Without a multi-out branch, recipes stay linear plus stop conditions. Judge completes a small closed language with merge, parallelism, and park/splice gates: route by match, not evaluate an expression language.
How it works
Section titled “How it works”- Inbound texts are joined (same as other single-in transforms).
- Matchers run in order. first hit wins.
- Only the winning out-port carries the text. Losing ports stay empty, so unwired or losing arms starve downstream.
- If nothing matches:
- unsure (default): emit on
out:unsure - park: pause like an approval / breaker park. After approve, emit on
out:unsure
Matchers (v1)
Section titled “Matchers (v1)”| Kind | Meaning |
|---|---|
| contains | Substring match (case-insensitive by default) |
| regex | JavaScript RegExp (multiline, case-insensitive by default) |
Invalid regex patterns are skipped (non-hit), so a bad pattern does not abort the run.
There is no expression language and no LLM rubric in v1. Agent-free graphs still run.
| Handle | Role |
|---|---|
out:pass | Matcher routed to pass |
out:fail | Matcher routed to fail |
out:unsure | No matcher hit (or park resolved) |
Port display labels are editable on the card. The handle ids stay stable in graph JSON (type: "judge").
Cycles
Section titled “Cycles”fail → fix → back to Judge as a raw cycle is still refused. For stage retry, drop a ↻ Until after Judge fail: counted re-entry (default max 3, hard cap 8), then out:exhausted. Reenter edges are ignored by topo. Not a free cycle. Pair with a spend ceiling or circuit breaker (graph lint will hint if neither is present).
threadle run until-reenterAgent error port
Section titled “Agent error port”Agent nodes expose a lower red error connector (out:err). After retries are exhausted, failure text emits there instead of aborting the run (when the handle is wired). Composes with Judge / fallback arms. Unwired err keeps the old halt / continueOnError starve behavior. See Agents and Errors.
threadle run agent-err-fallbackPatterns
Section titled “Patterns”Tests → review / fix / human. Agent or prompt emits a report. Judge routes PASS to review, FAIL/ERROR to fix, anything else to unsure (or park).
Quality gate vs branch. Prefer a ‡ circuit breaker when the answer is “stop or continue on this wire.” Prefer Judge when the answer is “which of these three paths?”
Stage retry. Judge fail → Until → reenter implement → review again → Until exhausted → human / abort.
Examples
Section titled “Examples”▶ Judge branch. Agent-free. Change the prompt to FAIL or shrug to see the other arms.
▶ Until re-entry. Agent-free convert loop, then exhausted.
▶ Agent err fallback. Happy-path out vs out:err (needs agent CLI. Fail to see the err arm).
threadle run judge-branchthreadle run until-reenterthreadle run agent-err-fallbackRelated
Section titled “Related”- Until. Counted re-entry for stage retry
- Circuit breakers. Fuse semantics on one wire
- Stdlib · diff. Unified diff of two ports into Judge
- Merging. Fan-in counterpart
- Gates. Park / splice
- Examples