babylon.formulas.consciousness_routing

Consciousness routing formulas (Spec 043 — Consciousness as Value Transparency).

This module implements the tensor-to-consciousness pipeline that replaces the legacy ideological_routing.py. Consciousness is NOT directly incremented — it is the degree to which the value form becomes transparent to those organized by it.

Pipeline Stages:
  1. compute_agitation_delta() — Converts changes in the value tensor (Δ(s/v), Δ(Φ), Δ(g₃₃)) into raw political energy (agitation).

  2. compute_exploitation_visibility() — Determines how visible exploitation is, dampened by imperial rent (commodity fetishism).

  3. compute_reification_buffer() — Measures how much commodity fetishism obscures class relations.

  4. route_agitation_to_ternary() — Routes accumulated agitation into (Δr, Δl, Δf) ternary consciousness shifts based on solidarity and education pressure.

  5. normalize_to_simplex() — Projects (r, l, f) onto the probability simplex (r + l + f = 1).

See also

babylon.models.components.material_conditions.MaterialConditionsBuffer:

Stores the intermediate buffers on population nodes.

babylon.models.entities.consciousness.TernaryConsciousness:

The canonical consciousness state on community hyperedges.

babylon.config.defines: Tuning coefficients (ConsciousnessDefines).

Functions

compute_agitation_delta(...[, defines])

Convert value tensor changes into agitation increment.

compute_exploitation_visibility(...[, defines])

Determine how visible exploitation is to a population.

compute_reification_buffer(imperial_rent, ...)

Measure commodity fetishism from imperial rent.

normalize_to_simplex(r, lib, f)

Project (r, l, f) onto the probability simplex (r + l + f = 1).

route_agitation_to_ternary(agitation, ...[, ...])

Route accumulated agitation into ternary consciousness shifts.

babylon.formulas.consciousness_routing.compute_agitation_delta(exploitation_rate_delta, imperial_rent_delta, visibility_delta, defines=None)[source]

Convert value tensor changes into agitation increment.

Agitation is generated by three sources of material crisis:

  1. Rising exploitation rate (Δ(s/v) > 0): Workers produce more surplus relative to wages.

  2. Declining imperial rent (ΔΦ < 0): Core workers losing their bribe from unequal exchange.

  3. Increasing reproductive visibility (Δg₃₃ > 0): Previously invisible care work becoming monetized/contested.

Formula:

Δagitation = max(0, Δ(s/v)) × α_e
           + max(0, -ΔΦ) × α_r
           + max(0, Δg₃₃) × α_v
Parameters:
  • exploitation_rate_delta (float) – Change in s/v since last tick.

  • imperial_rent_delta (float) – Change in Φ since last tick (negative = crisis).

  • visibility_delta (float) – Change in g₃₃ since last tick.

  • defines (ConsciousnessDefines | None) – Optional custom coefficients.

Return type:

float

Returns:

Non-negative agitation increment.

babylon.formulas.consciousness_routing.compute_exploitation_visibility(exploitation_rate, imperial_rent, defines=None)[source]

Determine how visible exploitation is to a population.

Imperial rent acts as an opacity filter on exploitation: when workers receive a “bribe” via unequal exchange with the periphery, the exploitation that does exist becomes obscured by material comfort.

Formula:

visibility = s/v / (s/v + Φ × opacity + ε)

When Φ = 0 (periphery), visibility approaches 1.0 for high s/v. When Φ > 0 (core), visibility is dampened.

Parameters:
  • exploitation_rate (float) – Current s/v ratio for this population.

  • imperial_rent (float) – Current Φ (positive = core, negative = periphery).

  • defines (ConsciousnessDefines | None) – Optional custom coefficients.

Return type:

float

Returns:

Exploitation visibility in [0, 1].

babylon.formulas.consciousness_routing.compute_reification_buffer(imperial_rent, total_v)[source]

Measure commodity fetishism from imperial rent.

The reification buffer represents how much the commodity form obscures underlying class relations. Higher imperial rent means core workers experience class relations as “natural” rather than exploitative — the bribe makes the system appear to work.

Formula:

reification = |Φ| / (|Φ| + v + ε)
Parameters:
  • imperial_rent (float) – Current Φ (positive or negative).

  • total_v (float) – Total variable capital in the local economy.

  • defines – Optional custom coefficients.

Return type:

float

Returns:

Reification buffer in [0, 1].

babylon.formulas.consciousness_routing.route_agitation_to_ternary(agitation, solidarity_factor, education_pressure, defines=None)[source]

Route accumulated agitation into ternary consciousness shifts.

Agitation is consumed and routed to (Δr, Δl, Δf) based on:

  1. Solidarity determines the revolutionary vs fascist split. With solidarity, agitation routes to r (class consciousness). Without solidarity, agitation routes to f (fascism).

  2. Education pressure biases the split toward revolutionary. This is the mechanized effect of the EDUCATE verb.

  3. Liberal drain absorbs a fraction as liberal drift.

Formula:

consumed = agitation × consumption_rate
effective_solidarity = min(1.0, solidarity + education_pressure)
Δr = consumed × effective_solidarity × routing_scale
Δf = consumed × (1 - effective_solidarity) × routing_scale
Δl = -(Δr + Δf) × liberal_backpressure
Parameters:
  • agitation (float) – Accumulated agitation on this node [0, ∞).

  • solidarity_factor (float) – Incoming SOLIDARITY edge strength [0, 1].

  • education_pressure (float) – Education pressure on community [0, 1].

  • defines (ConsciousnessDefines | None) – Optional custom coefficients.

Return type:

tuple[float, float, float]

Returns:

Tuple of (Δr, Δl, Δf) — directional shifts in ternary space. Δl is typically negative (agitation drains liberal tendency).

babylon.formulas.consciousness_routing.normalize_to_simplex(r, lib, f)[source]

Project (r, l, f) onto the probability simplex (r + l + f = 1).

The simplex constraint ensures consciousness is a valid probability distribution. Values below zero are clamped. If the sum is below 1, the remainder is assigned to liberal (hegemonic default). If above 1, values are scaled proportionally.

Parameters:
  • r (float) – Revolutionary tendency [may be any float].

  • lib (float) – Liberal tendency [may be any float].

  • f (float) – Fascist tendency [may be any float].

Return type:

tuple[float, float, float]

Returns:

Tuple of (r, lib, f) satisfying r + lib + f ≈ 1.0, all >= 0.