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:
compute_agitation_delta() — Converts changes in the value tensor (Δ(s/v), Δ(Φ), Δ(g₃₃)) into raw political energy (agitation).
compute_exploitation_visibility() — Determines how visible exploitation is, dampened by imperial rent (commodity fetishism).
compute_reification_buffer() — Measures how much commodity fetishism obscures class relations.
route_agitation_to_ternary() — Routes accumulated agitation into (Δr, Δl, Δf) ternary consciousness shifts based on solidarity and education pressure.
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
|
Gate a fascist→revolutionary ( |
|
Fascist share of the non-revolutionary tendency (spec-071, §9.4). |
|
Convert value tensor changes into agitation increment. |
|
Determine how visible exploitation is to a population. |
|
Measure commodity fetishism from imperial rent. |
|
Normalized ternary entropy of |
|
Project (r, l, f) onto the probability simplex (r + l + f = 1). |
|
Route accumulated agitation into ternary consciousness shifts. |
- babylon.formulas.consciousness_routing.apply_fr_gate(delta_fr, *, proletarianizing, adjacent_r, has_solidarity, epsilon=0.0)[source]
Gate a fascist→revolutionary (
f → r) flow (spec-071, §9.4).The
f → rtransition is FORBIDDEN unless all three material preconditions hold simultaneously: the node is proletarianizing (losing its stake), it is adjacent to a revolutionary pole, AND a solidarity edge is present. This asymmetry (fascism is easy to enter, hard to leave) breaks detailed balance (Kolmogorov), so NO potential-function / free-energy formulation exists — the gate is a directed flow constraint, not a gradient.- Parameters:
delta_fr (
float) – The proposedf → rflow magnitude (>= 0).proletarianizing (
bool) – Whether the node is losing its material stake.adjacent_r (
bool) – Whether the node is adjacent to a revolutionary pole.has_solidarity (
bool) – Whether a solidarity edge is incident.epsilon (
float) – The flow permitted when the gate is CLOSED (default 0.0 = fully forbidden).
- Return type:
- Returns:
delta_frwhen all three preconditions hold, elseepsilon.
Example
>>> apply_fr_gate(0.3, proletarianizing=True, adjacent_r=True, has_solidarity=True) 0.3 >>> apply_fr_gate(0.3, proletarianizing=True, adjacent_r=True, has_solidarity=False) 0.0
- babylon.formulas.consciousness_routing.assimilation_ratio(lib, f)[source]
Fascist share of the non-revolutionary tendency (spec-071, §9.4).
assimilation_ratio = f / (l + f)— how much of the passive (non-revolutionary) mass has been absorbed into the fascist pole rather than remaining liberal-hegemonic. Zero when there is no non-revolutionary mass.- Parameters:
- Return type:
- Returns:
Fascist share of
l + fin [0, 1]; 0.0 whenl + f == 0.
Example
>>> assimilation_ratio(0.3, 0.1) 0.25 >>> assimilation_ratio(0.0, 0.0) 0.0
- 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:
Rising exploitation rate (Δ(s/v) > 0): Workers produce more surplus relative to wages.
Declining imperial rent (ΔΦ < 0): Core workers losing their bribe from unequal exchange.
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:
- 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:
- 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 + ε)
- babylon.formulas.consciousness_routing.ideological_contestation(r, lib, f)[source]
Normalized ternary entropy of
(r, l, f)— a DIAGNOSTIC only.H(r, l, f) / log 3∈ [0, 1]. 0 = one pole holds the whole mass (settled consciousness); 1 = maximal contestation (equal thirds).IMPORTANT (§9.4): entropy is permutation-symmetric, so it CANNOT carry the George Jackson asymmetry (r and f are not interchangeable). This is a read-only diagnostic; the asymmetry lives in the directed
f → rgate (apply_fr_gate()), never in a potential/free-energy function.- Parameters:
- Return type:
- Returns:
Normalized entropy in [0, 1].
Example
>>> round(ideological_contestation(1.0, 0.0, 0.0), 6) 0.0 >>> round(ideological_contestation(1/3, 1/3, 1/3), 6) 1.0
- 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.
- 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:
Solidarity determines the revolutionary vs fascist split. With solidarity, agitation routes to r (class consciousness). Without solidarity, agitation routes to f (fascism).
Education pressure biases the split toward revolutionary. This is the mechanized effect of the EDUCATE verb.
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:
- Returns:
Tuple of (Δr, Δl, Δf) — directional shifts in ternary space. Δl is typically negative (agitation drains liberal tendency).