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
ConditionFiredobject (withconditionType,previousState,newState,note) ornullif 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_callcouncil_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 !== stanceagreement_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 > thresholdconviction_below
Parameter: threshold: number (0–100)
Fires when the conviction score falls below the threshold.
curr.conviction_score < thresholdagent_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 !== stancedivergence_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_callmarket_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 !== nullCondition Fired Payload
When a condition fires, it returns:
| Field | Description |
|---|---|
conditionType | String key (e.g. consensus_change, agent_stance) |
previousState | JSON string of the relevant prior state |
newState | JSON string of the new state |
note | Human-readable sentence describing what changed |