mud_server.services.policy.utils ================================ .. py:module:: mud_server.services.policy.utils .. autoapi-nested-parse:: Shared utility helpers for policy services. These helpers are intentionally storage-agnostic primitives used across multiple policy modules. They hold common parsing and guard-rail behavior that should remain consistent across validation, activation, and publish. Functions --------- .. autoapisummary:: mud_server.services.policy.utils.now_iso mud_server.services.policy.utils.ensure_world_exists mud_server.services.policy.utils.parse_scope mud_server.services.policy.utils.resolve_positive_int_version mud_server.services.policy.utils.activation_map_from_rows Module Contents --------------- .. py:function:: now_iso() Return canonical UTC ISO-8601 timestamp string with ``Z`` suffix. .. py:function:: ensure_world_exists(world_id) Raise a typed 404 when the target world id does not exist. .. py:function:: parse_scope(scope_text) Parse ``world_id[:client_profile]`` text into ``ActivationScope``. Empty ``client_profile`` always maps to world-level scope. .. py:function:: resolve_positive_int_version(*, value, default, context) Resolve a positive integer value with strict type and range checks. .. py:function:: activation_map_from_rows(rows) Return ``policy_id -> variant`` map from activation row payloads.