fix diagnostics for internally used Sections.keySection
add rotateIfChanged (and add rotate-smart to deploy example)