Skip to main content

Module context

Module context 

Source
Expand description

The --context-query declaration spelling (#92).

A trigger’s declared context is a saved query, and since 1.5.1 the declaration may bind the query’s parameters from the FIRING ITEM using the same JSON pointers --dedup-key already understands:

triage_ctx                                   # parameterless (1.5.0 form)
triage_ctx($session = /session)              # one binding
triage_ctx($session = /session, $from = /email/from)

The whole spelling is stored verbatim in the Trigger grain’s context_query field, so what a fired run gets to see stays on the declaration — auditable and replicating — rather than in host config. At fire time the evaluator resolves each pointer against the item’s payload and runs the saved query with those bindings. Resolution is fail-closed like --dedup-key’s unidentifiable path: an unresolvable pointer, or a pointer landing on a non-scalar, refuses the firing rather than running the query with a hole in it.

Structs§

ContextQuerySpec
A parsed --context-query spelling.

Functions§

parse_context_query
Parse a --context-query spelling: name or name($p = /ptr, $q = /ptr).