Insert the task if absent. If it exists with the same kind and spec, keep it
untouched (that is how a restart keeps its nextRunAt); if either differs, overwrite
kind, spec and nextRunAt with the given ones (the fencing token is kept). Returns
the stored record.
Atomic claim: succeeds only when nextRunAt !== null && nextRunAt <= now and the
record has no live lease (leaseUntil absent or <= now). Then it sets
leaseOwner = owner, leaseUntil = now + leaseMs and increments fencingToken.
Returns null otherwise (not due, leased elsewhere, or unknown id).
Set leaseUntil only if fencingToken still matches; false means the lease was lost.
Commit an occurrence only if fencingToken still matches: write the patch, clear the
lease and set updatedAt = now. false when stale (claimed again since) or deleted.
Remove the record. The id's fencing token is kept as a high-water mark: a later
register() of the same id starts from it, so tokens never go backwards per id.
Every stored record (orphans included), in no particular order.
Reference, in-process ScheduleStore. Nothing survives the process.