If the game log said a player got Harbor Master, then you are playing the Harbor Master scenario.
Harbor Master works kind of like Largest Army. Whoever gets three harbor points first takes the card and gets two additional points added to their score. You get one harbor point for each settlement you have on a port, two harbor points for each city on a port.
Another thing to remember is that you can only win on your turn. So, if you get the point you need to win while it is someone else's turn you will have to wait until it is your turn again before you can actually win. If one of the other people get to the reqired points during their turn before it gets back to you - they get the win.
Plus one on all of these points! The AI is luggable terrible, even when using “Master” players.
In addition to all the ridiculous behavior noted above, my wife and I have noticed a few occasions where once the AI decides who they are going to “pick on” with the robber, etc, they rarely change their minds, even after significant lead changes, and will continue to rob from the same player for the whole game.