roboto.domain.triggers.validation
Module Contents
TriggerValidator
Save-time validation for triggers.
Enforces the cross-field rules that need the event catalog: a condition may only reference namespace roots exposed by every event the source fires for, once_per must be legal for every subscribed event, an action target’s file patterns need a dataset to match against and are themselves required when the firing event’s own file is the action’s input, and every target template placeholder must resolve to a shared exposed root (or a reserved envelope./trigger. context). A schedule fires for exactly one occurrence type, so the same rules apply to it with that occurrence’s roots.
Run before persistence so a trigger that could never fire — or could never resolve its templates — fails loudly with an actionable message instead of silently misbehaving at evaluation time.
Parameters
TriggerValidator.validate()
Validate the cross-field rules for one trigger’s parts.
Parameters
The trigger’s firing source.
condition Optional[roboto.Optional predicate over the firing’s namespace.
targets collections.The trigger’s target specs.
managed_by Optional[roboto.The trigger’s owner, if it is managed. An ingestion rule’s trigger accepts only the files the rule’s path patterns match, so its per-file targets need no required_inputs.
Raises
ValueErrorThe first rule that fails, with a message naming the offending field, root, or event.
Return type
TriggerValidator.validate_record()
Validate a full trigger record.