zara-timers: reject coercible numeric values in persisted state #63

Closed
opened 2026-09-08 02:02:54 +00:00 by nsaspy · 0 comments
Owner

Problem

TimerDomain._load() currently coerces persisted numeric fields with int() / float(). Corrupt or externally edited state can therefore turn booleans and numeric strings into trusted sequence/countdown data.

Required behavior

  • persisted sequence must be an exact non-negative integer, excluding booleans
  • persisted running/paused timer remaining must be an exact finite int/float, excluding booleans, within the normal timer duration bound
  • persisted reminder cadence must satisfy the same exact integer/range contract as newly-created reminders
  • malformed persisted numeric state fails closed as TimerError
  • deterministic restart regressions
  • full registry/install/Nix gate remains green

No Zara Core changes.

## Problem `TimerDomain._load()` currently coerces persisted numeric fields with `int()` / `float()`. Corrupt or externally edited state can therefore turn booleans and numeric strings into trusted sequence/countdown data. ## Required behavior - persisted `sequence` must be an exact non-negative integer, excluding booleans - persisted running/paused timer `remaining` must be an exact finite int/float, excluding booleans, within the normal timer duration bound - persisted reminder cadence must satisfy the same exact integer/range contract as newly-created reminders - malformed persisted numeric state fails closed as `TimerError` - deterministic restart regressions - full registry/install/Nix gate remains green No Zara Core changes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara-plugins#63
No description provided.