babylon.engine.systems.sovereignty
Spec-070 SovereigntySystem (T042, FR-019, FR-020, FR-035, FR-043).
Reads Sovereign nodes + their CLAIMS edges, computes per-Territory
metabolic_impact (FR-019) and effective_controller (FR-020),
publishes them via context.persistent_data for the MetabolismSystem
extension to consume (FR-043), and emits DUAL_POWER_ACTIVE when
multiple Sovereigns hold non-zero CLAIMS on the same Territory
(FR-035).
Pipeline position: ~17.5 (between ConsciousnessSystem at 17 and
ContradictionSystem at 18). Belongs to CONSEQUENCE_SYSTEMS per
spec-056 partition + spec-070 FR-042.
Determinism notes (III.7):
Effective-controller tiebreak (when two CLAIMS edges have identical
control_level) uses Sovereign ID lexicographic ordering (handled byGraphProtocol.query_territory_claims()which sorts by(-control_level, sovereign_id)).DUAL_POWER_ACTIVE event emission is per-Territory in sorted-ID order.
Classes
Crystallizes Sovereign extraction policy into per-Territory metabolic impact (FR-019, FR-043) + diagnoses dual-power configurations (FR-035). |
- class babylon.engine.systems.sovereignty.SovereigntySystem[source]
Bases:
SystemBaseCrystallizes Sovereign extraction policy into per-Territory metabolic impact (FR-019, FR-043) + diagnoses dual-power configurations (FR-035).
- Reads:
Sovereign nodes (
_node_type == "sovereign").CLAIMS edges incident to each Sovereign.
- Writes (via
context.persistent_data): balkanization.metabolic_impact_by_territory:{territory_id -> float}of the effective metabolic_impact to apply (sum across CLAIMS edges weighted by control_level — but per FR-020 + the data-model.md effective-controller resolution, only the highest-control_level Sovereign’s impact applies, not double-counted).balkanization.effective_controller_by_territory:{territory_id -> sovereign_id}mapping for downstream systems.
- Emits:
DUAL_POWER_ACTIVEper Territory where ≥2 CLAIMS edges havecontrol_level > 0.0(FR-035).
- step(graph, services, context)[source]
Apply system logic to the world graph (in-place mutation).
The signature matches
babylon.kernel.system_protocol.Systemexactly. The engine (and all test fixtures) pass aBabylonGraph, which satisfiesGraphProtocol.- Return type:
None
- Parameters:
graph (GraphProtocol)
services (ServicesProtocol)
context (ContextType)