Decides what a rotation does to one stored envelope at a moment: date a
bare value, publish a next value, promote it, or drop an expired
previous one. Pure, so a test can walk every step.
Parameters
envelope: SecretEnvelope
the stored envelope
nowMs: number
the moment
rotationMs: number
the interval between rotations; 0 never rotates
overlapMs: number
how long the previous value is still accepted
fresh: ()=>string
makes a new value
Returns {envelope:SecretEnvelope;step:string}
{ envelope, step }, step '' when nothing is to change
Decides what a rotation does to one stored envelope at a moment: date a bare value, publish a next value, promote it, or drop an expired previous one. Pure, so a test can walk every step.