babylon.engine.systems.contradiction

Contradiction system — Lawverian opposition registry (Phase C1.3).

Position 18 in the pipeline. This is the rewrite that retires the saturating, add-only edge-tension accumulator (the “Formula” + “Consumption” inertness bugs of project/06-lawverian-dialectics.md §2). Each tick the system:

  1. writes per-edge tension as the fresh wealth-asymmetry gap of that edge (EXPLOITATION / WAGES / TENANCY) — scale-free, recomputed from current wealth, never accumulated;

  2. steps the OppositionRegistry (wired by ServicesProtocol.create()) over a GraphInputs snapshot built from the live graph, deriving each opposition’s gap, rate, and the Maoist principal contradiction;

  3. derives contradiction_frames from the registry states (intensity ← gap, aspect_balance ← rate, principal_aspect ← leading_pole; frame principal/secondary = registry principal + runner-up);

  4. fires RUPTURE on the principal opposition’s gap exceeding the defines threshold AND rising (rate > 0) — Mao’s “condition AND level”, never on hitting a ceiling.

Cross-tick + handoff channel.

The registry snapshot is stashed on the graph attribute opposition_states (not context.persistent_data). The bridged headless runner recreates a fresh TickContext every tick (engine/headless_runner/runner.py _advance_tick), so persistent_data is not a cross-tick channel there; the graph, by contrast, persists in-place across ticks in both the bridged runner and the in-memory Simulation facade. The graph attribute is therefore the reliable place to (a) recover the previous tick’s gaps for rate/inertia, (b) hand the capital_labor gap to the pre-position-18 consumers (ImperialRent @9, Struggle @16, Consciousness @17 read last tick’s snapshot), and (c) let the bridge’s persist_tick read the snapshot. This is the same channel contradiction_frames already uses.

Module Attributes

OPPOSITION_STATES_ATTR

Graph attribute holding {key: OppositionState.model_dump()} for the tick.

DIALECTICAL_REGIME_ATTR

Graph attribute holding this tick's fixed-point regime (Phase E2): {"regime": <reproduction|crisis|sublation>, "principal": key, "rate": float}.

OPPOSITION_INTERVENTIONS_ATTR

Graph attribute holding a list of StanceIntervention dumps to apply this tick.

Classes

ContradictionSystem()

Phase 18: fresh-gap tension + opposition-registry contradiction frames.

babylon.engine.systems.contradiction.OPPOSITION_STATES_ATTR = 'opposition_states'

Graph attribute holding {key: OppositionState.model_dump()} for the tick.

babylon.engine.systems.contradiction.DIALECTICAL_REGIME_ATTR = 'dialectical_regime'

Graph attribute holding this tick’s fixed-point regime (Phase E2): {"regime": <reproduction|crisis|sublation>, "principal": key, "rate": float}.

babylon.engine.systems.contradiction.OPPOSITION_INTERVENTIONS_ATTR = 'opposition_interventions'

Graph attribute holding a list of StanceIntervention dumps to apply this tick. Written by verb/OODA systems (spec-071), read + CLEARED here (consumed-once). No producer writes it yet; unit tests set it directly.

class babylon.engine.systems.contradiction.ContradictionSystem[source]

Bases: SystemBase

Phase 18: fresh-gap tension + opposition-registry contradiction frames.

name: ClassVar[str] = 'Contradiction Tension'
creates_value: ClassVar[bool] = False
step(graph, services, context)[source]

Write fresh per-edge tension, then step the opposition registry.

Return type:

None

Parameters: