babylon.engine.systems.faction_influence

Spec-070 FactionInfluenceSystem (T054, FR-021, FR-022, FR-026, FR-029a/b/c, FR-034).

Reads INFLUENCES + ADJACENCY edges, computes per-Territory winning Faction (FR-021), emits TERRITORY_TRANSITION on flips (FR-022), FACTION_VICTORY on supermajority (FR-026), RED_SETTLER_TRAP_DETECTED diagnostic (FR-034), and queues secession-eligible (faction, sovereign) pairs after a hysteresis window (FR-029a/b/c).

Pipeline position: ~14.5 (between OODASystem at 14 and SurvivalSystem at 15). Belongs to CONSEQUENCE_SYSTEMS per spec-056 + spec-070 research.md R-003.

Determinism notes (III.7):

  • Winning-Faction argmax uses incumbent-priority tiebreaker first, then seed-deterministic RNG over sorted-ID tied set.

  • Hysteresis counters keyed by (faction_id, sovereign_id).

  • Iteration is in lex-sorted Territory ID order.

Classes

FactionInfluenceSystem()

Resolve per-Territory winning Faction + secession eligibility.

class babylon.engine.systems.faction_influence.FactionInfluenceSystem[source]

Bases: SystemBase

Resolve per-Territory winning Faction + secession eligibility.

name: ClassVar[str] = 'FactionInfluence'
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: