How to read this page: one screen, one Save. Every input is a dropdown, text, number, or date/time field — no JSON anywhere.
Blue pills predicate = named boolean rules composed from primitives. (Value-kind defined terms are shown without a pill — the Kind dropdown labels them.)
Datatypes (datetime, list[int], etc.) drive the operator dropdown — only the operators valid for the chosen subject's type appear.
Two date windows: start → frozen (inviting allowed) and start → end (rewards apply).
Named typed constants (value-kind) and named boolean rules (predicate-kind) used by the clauses below. Predicate-kind terms expand to show their OR-branches.
#
Name
Kind
Datatype
Value (for value-kind) / Branches (for predicate-kind)
Evaluated at referral link creation. ALL conditions must match for this program to apply to a new referral. Lesson-specific metrics (e.g. lesson.usd_amount) are not available here — referencing them is a save-time error.
Evaluated at each lesson completion. First rule whose conditions all match wins; its reward is paid. If none match, no reward for that lesson (but the program stays applied to the referral).