SOLVED: Lua: Is the WoD bodyguard active or standing by at the barracks?

I’ve done /etrace and looked at the Lua APIs, and cannot determine if or when the player has an active bodyguard as a combat ally. I have learned that summoning a combat ally is with a successful spellcast, and if the ally dies, the player gets a hidden debuff, but none of those tell me if a combat ally is by the player’s side, ready to fight.

The game obviously knows, and I have figured out if a follower is assigned to the barracks, but that is only part of the answer.

I have not found a single event or API that fires or provides information that yes, Vivianne or Delvar or whomever is good to go, or if they (and the others) are milling about.

How does the game know?

Edit: C_Garrison.GetFollowerInfo(guid or garrFollowerID) does return info.status, yet that only says “working” because the follower is assigned a building. When I dismiss the bodyguard, it still says “working” unless I also remove the follower from the building, so that isn’t the answer.

I finally got this figured out. Your active bodyguard has a hidden quest that is flagged true. Register the event QUEST_LOG_UPDATED, then…

    function MyAddOn:QUEST_LOG_UPDATED()
        local questIDs = {
            [36877]     -- Tormmok
            [36898]     -- Delvar Ironfist
            [36899]     -- Defender Illona
            [36900]     -- Talonpriest Ishaal
            [36901]     -- Vivianne
            [36902]     -- Aeda Brightdawn
            [36936]     -- Leorajh
    }

        for i, #questIDs do
             if C_QuestLog.IsQuestFlaggedCompleted(i) then
                  -- it's true, that bodyguard is active
             end
        end
    end