Skip to content

digest_store

diapason.agents.digest_store

DigestStore — SQLite-backed storage for pre-computed digest artifacts.

DigestArtifact dataclass

A pre-computed morning digest ready for delivery.

DigestStore

SQLite store for digest artifacts.

get_latest()

Return the most recent digest, or None.

get_today(timezone_name='')

Return today's digest if it exists, or None.

timezone_name must be the timezone the digest was generated in — digest.timezone in the config. The stored generated_at carries that zone, so its date prefix is the reader's calendar day, and comparing it against today in the same zone is like for like.

This defaulted to "UTC" while generated_at was written with a naive datetime.now(), i.e. machine-local. West of Greenwich the two dates diverge every evening: at 21:00 in Toronto it is already tomorrow in UTC, so the morning's digest stopped matching and the API answered "No digest for today" about a digest sitting in the table. The window was four hours a day, every day. East of Greenwich it fails the other way round, in the early morning.

The fallback is the machine's own zone rather than UTC: rows written before this fix are naive local, and local is what they mean.

history(limit=10)

Return the N most recent digests.

save(artifact)

Save a digest artifact.