Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cerulion.com/llms.txt

Use this file to discover all available pages before exploring further.

A trigger policy decides when a node fires. It can be set on the CLI via --policy SPEC (on node create and node modify) or in source via a #[cerulion_node(...)] attribute. Trigger policy lives only on the macro side — graph YAML carries no policy block.

--policy SPEC grammar

SPEC is parsed by parse_policy_spec. Accepted forms:
SPECMaps to MacroPolicyRules
period_ms=NPeriod { period_ms: N }N must be a positive integer > 0. Bare period_ms (no =N) → error “requires a value”. period_ms=0 → error “must be > 0”.
deadline_ms=NDeadline { deadline_ms: N }Same N rules.
sync_window_ms=NSync { window_ms: N }Same N rules.
externalExternalCase-insensitive keyword.
data_trigger=NAME or trigger=NAMEDataTrigger { input_name: NAME }NAME must be non-empty and match a declared input.
anything elseerror”unknown policy spec X” listing the accepted forms.
--policy default was removed. It used to alias period_ms=100; it now errors with “unknown policy spec”. A 100 ms period must be written --policy period_ms=100.

Macro-attribute equivalents

Each --policy SPEC has an equivalent #[cerulion_node(...)] attribute. See Node macro reference for full attribute semantics.
--policy SPECMacro attribute
period_ms=N#[cerulion_node(period_ms = N)]
deadline_ms=N#[cerulion_node(deadline_ms = N)]
sync_window_ms=N#[cerulion_node(sync_window_ms = N)]
external#[cerulion_node(external)]
data_trigger=NAME / trigger=NAMEfield marked #[input(trigger)] named NAME
The unbounded_sync and tick_deadline_ms = N attributes have no --policy SPEC equivalent; they are macro-only.

Defaulting matrix

When --policy is omitted, node create resolves the policy from the declared inputs (resolve_create_policy):
Inputs declaredResult
0 inputs (no -i, no -T)Error: source-only nodes must declare a non-data policy explicitly (--policy period_ms=N or --policy external).
1+ inputs via -i onlyNo node-level policy attr is written (bare #[cerulion_node]). The runtime fires on any input arrival and emits a graph-build warning. No silent auto-promotion to data_trigger.
-T setDataTrigger { input_name: <T's name> }, regardless of the -i count.
Non-data --policy + -TError (conflict).
The engine convenience wrapper node_cmd::node_create (used by tests/TUI scaffolding) supplies Period { period_ms: 100 } when called with policy = None. The CLI path uses the strict node_create_with_options, which enforces the 0-inputs-error rule. The “100 ms default” is a convenience-API behavior, not the CLI default.

Policy short labels

node list and node info print a short policy label via format_policy_short:
LabelPolicy
period <N>msPeriod
deadline <N>msDeadline
sync <N>msBounded sync
sync ∞Unbounded sync
externalExternal
trigger:<input>Data trigger
-None