The refresh family — rotation, the race, and the alarm

The refresh family — rotation, the race, and the alarm A lifecycle diagram generated by Archify. 01 / The family, while it lives 02 / What a lost claim means 03 / Ends Login · family minted · The family, while it lives 01 Login family minted Active · access valid ≤ 15 min · The family, while it lives 02 Active access valid ≤ 15 min Claim · WHERE used_at IS NULL · The family, while it lives · one statement 03 Claim WHERE used_at IS NULL one statement Rotated · R2 is the tip · The family, while it lives 04 Rotated R2 is the tip Same-token race · successor is fresh · What a lost claim means · not theft Same-token race successor is fresh not theft Replay · used_at already set · What a lost claim means · family dies Replay used_at already set family dies Family revoked · marked, never deleted · Ends · terminal Family revoked marked, never deleted terminal refresh presented won lost · fresh tip lost · stale tip Legend start active state decision failure / exit

Why the claim is one statement

  • • The single-use guarantee IS the WHERE used_at IS NULL inside the UPDATE
  • • Split into SELECT-then-UPDATE, two callers both see an unspent token
  • • That is exactly the case reuse detection exists to catch

Why the whole family dies

  • • Victim and thief both hold descendants of one root
  • • Nothing distinguishes them, so revoking one leaves the wrong half live
  • • Both re-authenticate; only the one who knows the password returns

The two ends not drawn here

  • • Logout and admin revoke mark the family dead from Active
  • • A family lapses 30 days after LOGIN — absolute, never sliding
  • • A sliding window would make a family immortal while anyone rotates it