Here are some links from when I was reading this stuff:
http://www.askcodeman.com/index.php?sid=a9d7a2c59b03b369e73eeb627fd0646a
https://law.resource.org/pub/us/code/safety.html
Fire codes:
https://www.nfpa.org/Codes-and-Standards/All-Codes-and-Standards/Codes-and-Standards
One important thing to always remember is that for almost every building code, the AHJ is the law, NOT the text of the code. Their word is IT - a completely judgment based system. The explicit declaration is usually found in the first chapter, first paragraph of any of the code texts.
This cuts both ways. The AHJ (in the person of the inspector) rules, and they can rule any way they see fit w/in a wide lattitude. Most that I have dealt with made every effort to be reasonable, but I have worked in large cities with more or less professional bureaucrats. However, they _are_ god in this little arena and need to be respected that way. It pays to understand this and work with it. Cultivate as good a relationship as possible. Understand that they have seen a _lot_ of buildings and good inspectors potentially have forgotten more about what you're doing with your job than you will ever imagine much less know. Given a modicum of reason, they can help you immensely. Try asking, politely, for their opinion and knowledge. And then, of course, there are the newbies with something to prove who need kid gloves. But most I know were decent people.
In larger departments, there is hierarchy in the AHJ and one can take their case upstairs if done courteously and competently. I have twice appealed decisions and had the field inspector's call reversed, unequivocally. But you have to be sensible and know your stuff. The first time was after five years in the trade and many respectful dealings with the department - I knew the chief and all the inspectors by name and I knew the code backwards and forwards; and they knew me and the kind of work I did. Going upstairs is not something to do lightly, but it's sometimes an option. A good friend in Port Townsend WA built much of his house himself and had some questionable experiences with the AHJ, but he sucked it up. At the end of the job "his" inspector was sick and the chief came by. The chief looked over the job and passed him no question, immediately. They talked about his experiences and the chief asked why he hadn't called in on some of the many issues he'd suffered. Turned out that the inspector he dealt with was known to his department for being unreasonable. It's a judgment call.
The AHJ as a profession just wants to see things done decently and and safely I find it hard to really argue with that. They usually have significant
experience and are in a position of serious responsibility. Life is a "do your best, give and take" group effort. None of us know everything.
Rufus