Corners and connections are where insulation and air barriers can have trouble. Compressed or insufficient insulation can cause cold spots, which lead to condensation, mold, and rot. Air leaks at this connection can cut the effectiveness of the insulation substantially. In cold climates, this is where ice dams begin.
To keep the air barrier continuous, span the wall sheathing over the framing connection and use adhesive or sealants at framing connections as shown.
Roofs and walls need to dry
Moisture from both outside and inside a house can thwart your best efforts at keeping the building dry. Moisture in roof and wall assemblies is inevitable, so it's a good idea to design them so that they can dry. Roofs and walls that can dry to either the outside or inside are good, but those that can dry both directions are even better.
You can eliminate cold spots at this connection by using more insulation. Use a raised heel truss or set the rafters atop the ceiling joists (called raised plate) to make extra room.
Vented attics can keep a roof dry
Outdoor air that enters soffit vents and is exhausted through a ridge vent can help roof sheathing to dry if it ever gets damp.
Ventilation may help keep roofs cool
Although roof ventilation is often perceived as an effective way to cool off attics during the summer, studies show that it's hard to lower attic temperatures very much by ventilation alone. However, most building scientists agree that attic ventilation can lower the chance of ice damming in snowy climates. For more information on preventing ice dams, see Prevent Ice Dams With Air Sealing and Insulation.