Skip to main content

Module predicate

Module predicate 

Source
Expand description

Predicates over grains, and boolean gates over triggers.

Both reuse areev_cal::ast::Condition rather than introducing a language. That AST already has And/Or/Not with parenthesised grouping and the right OR < AND < NOT precedence, it already serializes as internally tagged JSON, and areev_cal::executor::grain_matches_condition_tree is a total evaluator for it — a missing field is false, never an error.

Two constraints made this the only workable shape:

  • areev_run_core::cond is frozen. Its module doc states “No expression language beyond this in v1: that is a spec-shaped surface and a standing exclusion”, repeated as a hard exclusion in the governed-agents proposal. So Argo Events’ conditions: "(a && b) || c" — the best syntax in the survey — is the one thing that cannot be copied.
  • New CAL syntax is an OMS conformance decision. Adding &&/|| tokens to the lexer is a spec-level change against an external standard.

Kestra’s shape is the compatible alternative: a data structure with explicit combinator nodes rather than an infix string. A serialized Condition tree is exactly that. Knative reached the same conclusion independently, shipping its structural all/any/not filters ahead of its SQL dialect because the structural form was “much more stable”.

Functions§

from_value
Read a predicate back off a Trigger grain.
gate_satisfied
Evaluate a gate over member triggers that have fired.
grain_matches
Does this grain satisfy the predicate?
parse_predicate
Parse a predicate written as CAL WHERE syntax into a Condition tree.
referenced_members
Every field name a gate expression references.
to_value
Serialize a predicate for storage on a Trigger grain.