Skip to content

The Stability Equation (S)

The kairos-core engine uses a single deterministic pairwise scoring function known internally as the Stability Equation (S\mathcal{S}). It is evaluated whenever the engine scores an interaction between two agents, including cumulative pairwise stability accumulation and paradox checks for same-node collisions.

S=ΓA+ΓBΛA+ΛB+ε\mathcal{S} = \frac{\Gamma_A + \Gamma_B}{\Lambda_A + \Lambda_B + \varepsilon}

Here, ε\varepsilon 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.

Γ\Gamma — Stability Contribution

Section titled “\Gamma — Stability Contribution”

ΓA\Gamma_A and ΓB\Gamma_B are the effective gamma values for agents AA and BB.

Because gamma appears in the numerator, higher gamma increases S\mathcal{S} and therefore increases stability.

ΛA\Lambda_A and ΛB\Lambda_B are the effective lambda values for agents AA and BB.

Because lambda appears in the denominator, higher lambda decreases S\mathcal{S} and therefore decreases stability.

The engine uses one hard-coded paradox boundary:

  • PARADOX_THRESHOLD = 0.15
  • A same-node collision becomes a paradox only when S<0.15\mathcal{S} < 0.15
  • S=0.15\mathcal{S} = 0.15 is not a paradox because the comparison is strictly less-than

In the actual implementation, larger values of S\mathcal{S} are more stable, and smaller values are less stable.

  • 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.

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 ε\varepsilon keeps the denominator non-zero.

For example, if agent AA has γ=0.3\gamma = 0.3, λ=0.5\lambda = 0.5, and agent BB has γ=0.7\gamma = 0.7, λ=0.2\lambda = 0.2, then:

S=0.3+0.70.5+0.2+0.0000011.42857\mathcal{S} = \frac{0.3 + 0.7}{0.5 + 0.2 + 0.000001} \approx 1.42857

That value is well above 0.15, so it is stable and does not trigger a paradox.

The implementation lives in kairos-core/src/engine/modules/ParadoxEngine.ts:

  • computeStability(gammaA, gammaB, lambdaA, lambdaB)
  • return (gammaA + gammaB) / (lambdaA + lambdaB + PARADOX_EPSILON)