--[[
	Cerebro - Communication V2 Module (Decomposed)
	Hash-based state synchronization with 4 message types:
	  STATE_HEARTBEAT  — Periodic hash broadcast for divergence detection
	  STATE_FETCH      — Request full state snapshot from officer
	  STATE_SNAPSHOT   — Full state payload (players + config + purge ledger)
	  RPC_CONTROL      — Non-persistent action commands (bids, session, etc.)

	This module has been split into 3 focused files (Phase 2a decomposition):
	  Modules/Sync/HashEngine.lua   — ComputeRosterHash, ComputeConfigHash, SimpleHash, InvalidateHashCache
	  Modules/Sync/V2Protocol.lua   — Lifecycle, heartbeat, fetch/snapshot, merge logic
	  Modules/Sync/RPCDispatch.lua  — SendRPC, HandleRPC, all Broadcast*, convergence, repair

	These files are loaded via TOC after this file. They attach to this module
	via Cerebro:GetModule("CommunicationV2").

	@module Modules.CommunicationV2
	@version 0.12.0
	@invariant ComputeRosterHash excludes lastUpdate recursively (prevents hash ping-pong)
	@invariant Roster hash includes only participants (status=Core OR ep>0 OR gp>baseGP)
	@invariant All RPC handlers require IsOfficer(sender) + epoch check + quarantine guard
	@invariant Heartbeat gated to Sync Leader during active raids; event-driven ungated
	@see docs/decisions/ADR-002-kill-v1-protocol.md (V1 retirement plan)
]]--

local AddonName = "Cerebro"
local Cerebro = LibStub("AceAddon-3.0"):GetAddon(AddonName)

-- Create the module — split files attach functions to it via GetModule
local CommunicationV2 = Cerebro:NewModule("CommunicationV2", "AceEvent-3.0", "AceTimer-3.0")
Cerebro.modules.CommunicationV2 = CommunicationV2
