RYO ARENA DOCS
Developer Reference

Condition Types

All alert condition types, their parameters, and the exact logic used to evaluate them.

Conditions are defined in src/server/triggers/conditions.ts and evaluated inside alertTriggerCheck after each re-analysis.

How Evaluation Works

evaluateConditions(conditions[], logic, previous, current) iterates all conditions:

  • Each condition returns a ConditionFired object (with conditionType, previousState, newState, note) or null if not triggered.
  • OR logic — returns all fired conditions (any one is enough)
  • AND logic — returns all conditions only if every condition fired; otherwise returns []

Condition Reference

consensus_change

No parameters.

Fires when the final_call changed between the previous and current consensus.

prev.final_call !== curr.final_call

council_stance

Parameter: stance: "long" | "short" | "neutral"

Fires when the council newly reaches the target stance (transition into it, not already there).

curr.final_call === stance AND prev.final_call !== stance

agreement_below

Parameter: threshold: "unanimous" | "majority" | "split"

Fires when the current agreement level is below the threshold.

Agreement levels are mapped to integers: unanimous=3, majority=2, split=1.

AGREEMENT_LEVEL[curr.agreement] < AGREEMENT_LEVEL[threshold]

conviction_above

Parameter: threshold: number (0–100)

Fires when the conviction score exceeds the threshold.

curr.conviction_score > threshold

conviction_below

Parameter: threshold: number (0–100)

Fires when the conviction score falls below the threshold.

curr.conviction_score < threshold

agent_stance

Parameters: persona: string, stance: "long" | "short" | "neutral"

Fires when a specific agent newly switches to the target stance.

curr.verdicts[persona].stance === stance
AND prev.verdicts[persona].stance !== stance

divergence_detected

No parameters.

Fires when there is any meaningful divergence: either the agreement level dropped or the final call flipped.

AGREEMENT_LEVEL[curr.agreement] < AGREEMENT_LEVEL[prev.agreement]
OR prev.final_call !== curr.final_call

market_regime_change

No parameters.

Fires when the market_regime_context string changed to a new non-null value.

prev.market_regime_context !== curr.market_regime_context
AND curr.market_regime_context !== null

Condition Fired Payload

When a condition fires, it returns:

FieldDescription
conditionTypeString key (e.g. consensus_change, agent_stance)
previousStateJSON string of the relevant prior state
newStateJSON string of the new state
noteHuman-readable sentence describing what changed

On this page