Skip to main content

Module cadence

Module cadence 

Source
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§

RecoveryCadence
The persistent recovery-verification scheduler for one account on one device.

Enums§

RearmTrigger
A reason to reset the ladder back to the 7-day step (SSoT § Schedule and Triggers).
SnoozeDuration
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.
VerificationState
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_SESSIONS distinct 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.