babylon.engine.systems.collapse_transition

Spec-070 CollapseTransitionSystem (T067 + T084-T087, FR-023, FR-024, FR-027, FR-028).

Handles two distinct collapse / fracture paths:

  1. Collapse-driven (FR-023, FR-024): Sovereign legitimacy ≤ 0.0 or external trigger via context.persistent_data["balkanization. collapse_triggers"]. Emits SOVEREIGN_COLLAPSE, partitions claimed Territories among winning Factions (creates new Sovereigns at control_level = initial_post_collapse_control_level), emits TERRITORY_TRANSITION per claimed Territory, deletes the collapsed Sovereign node + outbound edges.

  2. Active-secession (FR-027, FR-028, FR-029a): Reads persistent_data["balkanization.secession_eligible"] (populated by FactionInfluenceSystem when the hysteresis window elapses), emits CIVIL_WAR_DECLARED, rewires the contiguous sub-region’s CLAIMS from the parent Sovereign to a new secessionist Sovereign via the bulk_partition_claims O(K) protocol method (FR-018 / SC-004).

Pipeline position: 20.5 (between FieldDerivativeSystem at 20 and EdgeTransitionSystem at 21). Belongs to CONSEQUENCE_SYSTEMS.

Determinism notes:

  • Collapse predicate evaluation in lex-sorted Sovereign ID order.

  • TERRITORY_TRANSITION emission per claimed Territory in sorted-ID order.

  • New Sovereign IDs follow SOV_AUTO_T{tick}_F{faction_id}_{counter}.

  • Orphaned Sovereign nodes (zero CLAIMS) are deleted at the END of every tick.

Classes

CollapseTransitionSystem()

Detects collapsing Sovereigns + emits transition events.

class babylon.engine.systems.collapse_transition.CollapseTransitionSystem[source]

Bases: SystemBase

Detects collapsing Sovereigns + emits transition events.

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

Apply system logic to the world graph (in-place mutation).

The signature matches babylon.kernel.system_protocol.System exactly. The engine (and all test fixtures) pass a BabylonGraph, which satisfies GraphProtocol.

Return type:

None

Parameters: