Success Criteria
Success criteria are deterministic validators that determine whether a workflow outcome is considered successful. They gate payment under success-fee and hybrid pricing models, and their evaluation trace is recorded in the settlement attestation.
How evaluation works
When a workflow completes, WeaveOS evaluates the outcome object against the criteria defined in the quote. The evaluation engine uses RFC 6901 JSON Pointer paths to resolve field references within the outcome. Every step produces a trace entry — a record of which criterion was evaluated, what value was found, and whether it matched.
The full evaluation trace is included in the settlement attestation blob stored on Walrus, providing an immutable audit record.
Criterion types
exact
Strict equality check. The field at path must equal value. Supports strings, numbers, and booleans.
{ "type": "exact", "path": "/status", "value": "resolved" }numeric_threshold
Compares a numeric field against a threshold using one of six operators.
// Supported ops: "<" | "<=" | ">" | ">=" | "==" | "!="
{ "type": "numeric_threshold", "path": "/confidence", "op": ">=", "value": 0.85 }regex
Tests a string field against a regular expression. The pattern uses the host regex engine. Avoid patterns with catastrophic backtracking in production criteria.
{
"type": "regex",
"path": "/summary",
"pattern": "(?i)(resolved|fixed|closed|completed)"
}json_schema
Validates the outcome (or a sub-path of it) against a JSON Schema (Draft 7). Uses AJV internally. Schema errors are included in the evaluation trace.
{
"type": "json_schema",
"schema": {
"type": "object",
"required": ["resolved", "summary", "confidence"],
"properties": {
"resolved": { "type": "boolean" },
"summary": { "type": "string", "minLength": 10 },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 }
},
"additionalProperties": false
}
}Boolean composition
Criteria can be composed into logical trees using all_of, any_of, and not.
all_of
All child criteria must match.
{
"type": "all_of",
"criteria": [
{ "type": "exact", "path": "/resolved", "value": true },
{ "type": "numeric_threshold", "path": "/confidence", "op": ">=", "value": 0.9 }
]
}any_of
At least one child criterion must match.
{
"type": "any_of",
"criteria": [
{ "type": "exact", "path": "/tier", "value": "gold" },
{ "type": "numeric_threshold", "path": "/lifetimeValue", "op": ">", "value": 10000 }
]
}not
Inverts a criterion. Matches if the child criterion does not match.
{
"type": "not",
"criterion": { "type": "exact", "path": "/escalated", "value": true }
}Evaluation trace
Every evaluation produces a structured trace. This is returned in the workflow response under settlement.criteriaTrace and stored in the Walrus attestation blob.
{
"matched": true,
"trace": [
{
"criterion": { "type": "exact", "path": "/resolved", "value": true },
"resolved": true,
"matched": true,
"reason": "Field /resolved equals true"
},
{
"criterion": { "type": "numeric_threshold", "path": "/confidence", "op": ">=", "value": 0.9 },
"resolved": 0.94,
"matched": true,
"reason": "0.94 >= 0.9"
}
]
}path does not exist in the outcome object, the criterion evaluates as false with reason "Path not found". Always validate your outcome schema against your criteria during development.Testing criteria
Use the Criteria Tester in Dashboard → Developer to evaluate a criteria tree against a sample outcome JSON without creating a workflow. This is the fastest way to validate complex compositions before deploying them to a product configuration.