# Cerebro

## [v0.10.27](https://github.com/Shezzannn/Cerebro/tree/v0.10.27) (2026-03-17)
[Full Changelog](https://github.com/Shezzannn/Cerebro/compare/v0.10.26...v0.10.27) 

- chore: Bump version to 0.10.27  
    Fix season reset double-fire and single-person standings on concurrent officer login. Prevent duplicate EP/GP wipe when multiple officers log in after a new season starts.  
- Merge pull request #34 from Shezzannn/fix/season-reset-double-fire  
    fix: prevent season reset double-fire and empty-roster sync on concurrent officer logins  
- ci: add Data/ to Package Guard ALLOWED list (runtime directory)  
- fix: resolve all 7 pre-existing luacheck warnings (0 warnings / 0 errors)  
    Communication.lua: remove unused local `lastQuarantineLog` (declared, never read)  
    CommunicationV2.lua: make coreAdmittedAt elseif branch non-empty (Debug call;  
      same behavior — still does not assign local\_[k] = v when incoming is nil)  
    Preparation.lua: remove unused local `failCount` and dead `failingSlots` table  
      (failingSlots was populated but never queried; allPass check uses arrays directly)  
    Session.lua: rename shadowed `roster` → `rosterSnapshot` at L508 (pure rename)  
    Utilities.lua: add Debug calls to intentional skip branches in  
      GetFilteredPlayersForSync (same filter behavior, now luacheck-clean)  
- fix: prevent season reset double-fire and empty-roster sync  
    Fixes a race condition where multiple officers logging in simultaneously  
    each independently fire CheckSeasonChange(), causing epoch divergence and  
    triggering HandleEpochMismatch's players={} wipe+FETCH path. The auto-FETCH  
    then delivers an empty or single-person roster, collapsing standings.  
    Fix 1 (Core.lua): Move CheckSeasonChange from 10s to 60s fallback timer.  
    Stores ref as Cerebro.\_seasonCheckTimer for early cancellation.  
    Fix 2 (CommunicationV2.lua): BuildSnapshot now carries lastKnownSeasonID.  
    HandleSnapshot adopts it (monotonic, officer-only) then cancels the 60s  
    timer and fires CheckSeasonChange() immediately. The currentID==storedID  
    guard now fires correctly, suppressing the duplicate reset.  
    Fix 3 (Utilities.lua): Local lastSeasonReset sentinel guard blocks re-entry  
    on /reload and any login where snapshot propagation took longer than expected.  
    Type-guarded for corrupt SavedVar safety.  
    Fix 4 (CommunicationV2.lua + Utilities.lua): HandleHeartbeat now stores  
    epoch in peerHashes[sender]. CheckSeasonChange() reads peerHashes before  
    bumping the epoch: if any officer peer is already at localEpoch+1, the  
    reset is skipped entirely, preventing the duplicate wipe and empty-roster FETCH.  
    Also includes Utilities.lua season ID correction: 16->17 for Midnight S1.  
    luacheck: 0 new warnings (3 pre-existing unrelated empty-branch warnings)  
- fix: bump\_version.py reuses pre-bumped version if not yet tagged\n\nPreviously the script always bumped the patch version unconditionally,\ncausing a version skip when a PR pre-bumped (e.g. PR named v0.10.25\nbumps Core.lua to 0.10.25, then the deploy script bumps again to 0.10.26).\n\nFix: check git tags. If the current version has no tag yet (unreleased),\nreuse it as-is. Only bump when the current version is already tagged.  
