The Stability Equation (S)
The kairos-core engine uses a single deterministic pairwise scoring function known internally as the Stability Equation (). It is evaluated whenever the engine scores an interaction between two agents, including cumulative pairwise stability accumulation and paradox checks for same-node collisions.
The Formula
Section titled “The Formula”Here, is the engine constant PARADOX_EPSILON = 10^{-6}. It exists only to prevent division by zero when both lambda values are zero.
This page reflects the current engine implementation in kairos-core, which uses additive gamma, additive lambda, and an epsilon-adjusted denominator.
Variables
Section titled “Variables”— Stability Contribution
Section titled “\Gamma — Stability Contribution”and are the effective gamma values for agents and .
Because gamma appears in the numerator, higher gamma increases and therefore increases stability.
— Stability Cost
Section titled “\Lambda — Stability Cost”and are the effective lambda values for agents and .
Because lambda appears in the denominator, higher lambda decreases and therefore decreases stability.
Engine Threshold
Section titled “Engine Threshold”The engine uses one hard-coded paradox boundary:
PARADOX_THRESHOLD = 0.15- A same-node collision becomes a paradox only when
- is not a paradox because the comparison is strictly less-than
In the actual implementation, larger values of are more stable, and smaller values are less stable.
Where It Is Used
Section titled “Where It Is Used”- In the Paradox Engine, same-node collisions are checked with this equation. If the score is below threshold, the tick is rolled back and retried under a decree.
- In multi-agent runs, the engine computes the same score for every unordered agent pair each tick and adds it to each agent’s cumulative stability total.
Intuition
Section titled “Intuition”Because the equation is additive in both gamma and lambda:
- Increasing either agent’s gamma increases stability.
- Increasing either agent’s lambda decreases stability.
- Setting both lambda values to zero does not crash the calculation because keeps the denominator non-zero.
For example, if agent has , , and agent has , , then:
That value is well above 0.15, so it is stable and does not trigger a paradox.
Source of Truth
Section titled “Source of Truth”The implementation lives in kairos-core/src/engine/modules/ParadoxEngine.ts:
computeStability(gammaA, gammaB, lambdaA, lambdaB)return (gammaA + gammaB) / (lambdaA + lambdaB + PARADOX_EPSILON)