AST JSON Schema
The formal JSON Schema for AST nodes lives in the repository at:
schemas/signalql-ast-v0.4.schema.json(current)schemas/signalql-ast-v0.3.schema.jsonschemas/signalql-ast-v0.2.schema.jsonschemas/signalql-ast-v0.1.schema.json(historical)
Current schema ID: https://signalql.org/schemas/signalql-ast-v0.4.schema.json
Language version: v0.4 (schema version tracks spec version, not npm package semver). Each schema embeds compatibility refs for earlier kinds, so v0.1–v0.3 ASTs validate against the current schema.
Examples
Valid retrieve AST (v0.2)
json
{
"kind": "retrieve",
"source": { "kind": "entity", "name": "work_item" },
"where": [{ "field": "signal(risk_score)", "op": ">", "value": 0.7 }],
"traverse": { "relationship": "depends_on", "depthLte": 2 },
"trend": null,
"return": ["entity_id", "signal(risk_score)"]
}Valid sequence AST (v0.2)
json
{
"kind": "sequence",
"steps": ["pr_opened", "no_activity", "stale"],
"within": "3d"
}Valid trace lineage AST (v0.4)
json
{
"kind": "trace",
"target": {
"entity": "ticket",
"where": { "kind": "cmp", "field": { "kind": "path", "path": "id" }, "op": "=", "value": "123" }
},
"via": "derived_from",
"depthLte": 6,
"asOf": null
}Invalid example (domain-specific interpretation in core)
json
{
"kind": "retrieve",
"source": { "kind": "entity", "name": "work_item" },
"where": [{ "field": "blocked", "op": "=", "value": true }],
"traverse": null,
"trend": null,
"return": ["entity_id"]
}blocked is a business interpretation label and should not be hardcoded in SignalQL core semantics. Use external derived signals instead.