Skip to content

previous-draft/store.py

Comment 1, line 1

previous-draft/store.py:1

# -*- coding: utf-8 -*-

Comment 2, line 2

previous-draft/store.py:2

"""LLM usage storage: raw events and daily aggregate cache; prefer cached history, retain one year."""

Comment 3, line 37

previous-draft/store.py:37

"""Date string in the running machine's local timezone."""

Comment 4, line 51

previous-draft/store.py:51

# ---- Collection state: incremental cursors/file offsets ----

Comment 5, line 64

previous-draft/store.py:64

# ---- Idempotent event writes ----

Comment 6, line 66

previous-draft/store.py:66

"""Insert events and return deduplicated days with newly inserted events."""

Comment 7, line 82

previous-draft/store.py:82

# ---- Daily aggregate cache ----

Comment 8, line 84

previous-draft/store.py:84

"""Recompute selected dates; historical reads use the cache without revisiting sources."""

Comment 9, line 106

previous-draft/store.py:106

# ---- Queries ----

Comment 10, line 113

previous-draft/store.py:113

"""Aggregate a date by local hour, tool and model for today's live charts."""