History: read-only open and last_activity_ms #16

closed cmc opened this on 2026-09-04 17:15 UTC

cmc 2026-09-04 17:15 UTC

pet-life needs to know when activity last happened, which means reading signald's SQLite. Duplicating the schema in a second crate would be a coupling that breaks silently.

Read-only matters: the normal open prunes and migrates, and a menu-bar app polling every five seconds must not mutate the daemon's store.

Done when:

  • History::open_read_only opens without pruning, migrating or creating.
  • History::last_activity_ms returns the most recent KeysPerMin or CommitsToday row with a value above zero, or None.
  • SessionSeconds and the hardware signals are excluded: a shell sitting open is not attention, and a sleeping machine still reports a battery percentage.

Part of the menubar-pet stack (docs/superpowers/specs/2026-09-04-menubar-pet-design.md).

closed by commit 146b67f808 by cmc: History: read-only open and last_activity_ms

2026-09-04 17:17 UTC