Expand description
The recovery-verification cadence scheduler and the prompt state machine the client UX renders (SSoT: Backup — Recovery Verification Cadence).
This half of the recovery verification is deliberately pure and network-free: every method
takes the current wall-clock instant as an argument, so the whole ladder — the 7 d → 90 d → 180
d back-off, the re-arm triggers, the snooze caps, and the repeated-failure escalation to a
guided re-wrap — is driven by a mocked clock in tests with no sleeps and no I/O. The scheduler
is serde-serializable so a client persists it across launches.
Advisory by construction. The scheduler exposes exactly one read surface —
RecoveryCadence::state — returning a VerificationState the UX renders. There
is no method anywhere that gates sync, unlock, or any critical flow;
VerificationState::blocks_critical_flow is const false for every variant, so the
“never blocks” rule is a compile-time property, not a convention.
Structs§
- Recovery
Cadence - The persistent recovery-verification scheduler for one account on one device.
Enums§
- Rearm
Trigger - A reason to reset the ladder back to the 7-day step (SSoT § Schedule and Triggers).
- Snooze
Duration - How long a user may defer a due prompt. The check is advisory, so a snooze only moves the next reminder — it never suppresses anything critical.
- Verification
State - The state the client UX renders. This is the entire consumer contract of the scheduler — pure data, never a localized string, and never a gate.
Constants§
- BACKOFF_
INTERVAL_ SECS - After the first success the interval steps to 90 days.
- CAP_
INTERVAL_ SECS - After two consecutive successes the interval caps at 180 days and stays there.
- INITIAL_
INTERVAL_ SECS - First prompt lands 7 days after setup: catches the lost-napkin case while re-setup is still cheap.
- MAX_
CONSECUTIVE_ SNOOZES - At most this many consecutive snoozes before the prompt degrades to a persistent,
non-blocking
VerificationState::Badge. - REWRAP_
FAILURE_ THRESHOLD - Failures required before the guided re-wrap is offered — and they must span at
least
REWRAP_MIN_SESSIONSdistinct app sessions, so a single fat-fingered session never triggers a rotation. - REWRAP_
MIN_ SESSIONS - The re-wrap escalation requires failures across at least this many app sessions.