"Name both ends of a window; “recent” is not a boundary."
What actually persists
A label such as “7 days” is ambiguous until the boundary is written. Inkwell means the selected local date plus the six preceding local dates. The 30-day view follows the same inclusive rule.
Views are queries
Compute the start date in calendar arithmetic and query start <= entry_date <= end. Store dates in canonical ISO form so lexical ordering matches calendar ordering.
What ambiguity costs
Using the previous seven dates excludes today. Using 168 hours makes daylight-saving transitions and time of day leak into a calendar view. Counting entries instead of dates answers a different question entirely.
See one entry through four windows
Test “Rolling Windows Are Inclusive” by viewing one entry through Today, 7 days, 30 days, and calendar. State whether each view copies data or applies another predicate, and separate the questions answered by device-local date and absolute timestamp. Creating fake rows for blank days means the model has begun storing obligation.
Query it
Test 7-day and 30-day windows across a month boundary and a year boundary. Include month end, year end, near-midnight creation, multiple entries on one day, and status = 'live'. Explain the predicates and indexes that produce the answer, not only the final count.
Memory should lead back
Dates and keywords make return paths without judging the writing. When search reads the same original and transcribed state and tags retain prompt provenance, one collection truly owns its history.